.math-subject-menu { position: relative; z-index: 40; font-size: 12px; }
.math-subject-menu summary { cursor: pointer; padding: 9px 12px; border-radius: 9px; background: #eef3ff; color: #4266ec; list-style: none; white-space: nowrap; }
.math-subject-menu>div { display: none; position: absolute; right: 0; top: 100%; padding: 10px; min-width: 210px; background: #fff; border: 1px solid #e3e8f3; border-radius: 12px; box-shadow: 0 12px 35px #25345520; }
.math-subject-menu[open]>div,.math-subject-menu:hover>div,.math-subject-menu:focus-within>div { display: grid; }
.math-subject-menu strong { padding: 9px 10px 5px; color: #7b879f; font-size: 11px; }
.math-subject-menu a { padding: 9px 10px; border-radius: 6px; color: #294477; text-decoration: none; }
.math-subject-menu a:hover { background: #eef3ff; }
.math-board-link,.math-account-link { color: #4266ec; font-size: 11px; text-decoration: none; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar { height: auto; min-height: 74px; gap: 12px; }
.top-right { flex-wrap: wrap; justify-content: flex-end; }
@media(max-width:760px) { .topbar{padding:10px 14px;flex-wrap:wrap;}.top-right{gap:9px;width:100%;justify-content:space-between;}.math-subject-menu summary{padding:7px 9px;}.math-account-link{max-width:100px;} }

/* Keep narrow tablet columns from expanding the entire page. */
.two-columns > *, .topbar > * { min-width: 0; }
.topic { min-width:0; overflow-wrap:anywhere; }
@media(min-width:761px) and (max-width:1100px) { .topic-list { grid-template-columns:repeat(3,minmax(0,1fr)); } }
