/* The "Questions by topic" list and the topic overview that kit/build_topic_pages.py adds
   below the practice tool on each subject page and its topic pages
   (/<subject>/topics/<slug>/). Uses the subject page's own colour variables, so it follows
   the light/dark switch. */
.topic-overview, .topic-index{max-width:980px}
.topic-overview{margin-top:46px; padding-top:22px; border-top:1px dashed var(--rule); line-height:1.6}
.topic-overview h2, .topic-index h2{font-family:"Fraunces",Georgia,serif; font-weight:600; font-size:24px;
  letter-spacing:-.01em; margin:0 0 8px}
.topic-overview h2.sub{font-size:21px; margin-top:38px; padding-top:18px; border-top:1px dashed var(--rule)}
.topic-overview h3{font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted);
  font-weight:600; margin:26px 0 10px}
.topic-overview .lede{font-size:15.5px; margin:0 0 10px; max-width:75ch}
.topic-overview .note{color:var(--muted); font-size:13.5px; margin:0 0 14px; max-width:75ch}

.topic-overview .freq{border-collapse:collapse; font-size:13.5px; margin:6px 0 4px; font-variant-numeric:tabular-nums}
.topic-overview .freq th, .topic-overview .freq td{padding:6px 14px 6px 0; text-align:right; border-bottom:1px dashed var(--rule-soft)}
.topic-overview .freq th:first-child, .topic-overview .freq td:first-child{text-align:left}
.topic-overview .freq thead th{color:var(--muted); font-weight:600; font-size:12px}
.topic-overview .freq td:last-child{text-align:left; padding-left:6px}
.topic-overview .freq .bar{display:inline-block; height:8px; border-radius:4px; background:var(--accent); vertical-align:middle; opacity:.8}

.topic-overview .q{border:1px solid var(--rule); border-radius:6px; background:var(--surface); margin:0 0 12px; overflow:hidden}
.topic-overview .qhead{display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; padding:10px 16px;
  background:var(--raised); border-bottom:1px dashed var(--rule)}
.topic-overview .qno{font-weight:600}
.topic-overview .session{color:var(--accent-ink); font-weight:600; font-size:14px}
.topic-overview .code{font-family:"IBM Plex Mono",monospace; font-size:11.5px; color:var(--muted)}
.topic-overview .marks{margin-left:auto; font-size:12.5px; color:var(--muted)}
.topic-overview .qbody{padding:12px 16px}
.topic-overview .qbody p{margin:0 0 10px}
.topic-overview .qbody p:last-child{margin-bottom:0}
.topic-overview .options{list-style:none; margin:10px 0 0; padding:0}
.topic-overview .options li{display:flex; gap:10px; padding:6px 0; border-top:1px dashed var(--rule-soft); font-size:14.5px}
.topic-overview .options li:first-child{border-top:0}
.topic-overview .opt-letter{flex:none; font-family:"IBM Plex Mono",monospace; font-weight:600; color:var(--accent-ink)}
.topic-overview .fig{margin:12px 0; padding:10px; background:#fff; border:1px solid var(--rule); border-radius:4px}
.topic-overview .fig img{display:block; max-width:100%; height:auto; margin:0 auto; cursor:zoom-in}
.topic-overview .fig figcaption{margin-top:8px; font-size:12px; color:#555; text-align:center}
.topic-overview details{border-top:1px dashed var(--rule)}
.topic-overview details > summary{cursor:pointer; padding:9px 16px; font-size:13.5px; font-weight:600;
  color:var(--accent-ink); list-style:none}
.topic-overview details > summary::-webkit-details-marker{display:none}
.topic-overview details > summary::before{content:"+"; display:inline-block; width:1.2em; font-family:"IBM Plex Mono",monospace}
.topic-overview details[open] > summary::before{content:"\2212"}
.topic-overview details > .inner{padding:0 16px 12px; color:var(--ink-2); font-size:14px}
.topic-overview details > .inner p{margin:0 0 10px}
.topic-overview details.case{border-top:0}
.topic-overview details.case > .inner{color:var(--ink)}
/* Signed-in list of older questions: one collapsible section per year */
.topic-overview details.arc-year{margin:10px 0; border:1px solid var(--rule); border-radius:6px; background:var(--surface)}
.topic-overview details.arc-year > summary{display:flex; align-items:baseline; gap:12px; padding:13px 18px;
  font-size:16px; color:var(--ink)}
.topic-overview details.arc-year > summary::before{color:var(--accent-ink)}
.topic-overview details.arc-year > summary:hover{background:var(--accent-soft)}
.topic-overview details.arc-year .yr{font-family:"Fraunces",Georgia,serif; font-weight:600; font-size:19px}
.topic-overview details.arc-year .ct{color:var(--muted); font-size:13px; font-weight:500}
.topic-overview details.arc-year > .arc-body{padding:4px 16px 16px}
.topic-overview details.arc-year > .arc-body > h3{margin-top:14px}
.topic-overview .answer{display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px;
  margin-right:10px; border-radius:50%; background:var(--accent); color:#fff; font-weight:700;
  font-family:"IBM Plex Mono",monospace}
.topic-overview .ms-list{margin:8px 0 0; padding-left:20px}
.topic-overview .ms-list li{margin-bottom:6px}

.topic-overview .locked{background:var(--raised); border:1px solid var(--rule); border-radius:6px; padding:14px 16px; margin:10px 0 4px}
.topic-overview .locked p{margin:0}
.topic-overview a, .topic-index a{color:var(--accent-ink)}
.topic-overview .teaser{list-style:none; margin:0; padding:0}
.topic-overview .teaser li{padding:8px 0; border-bottom:1px dashed var(--rule-soft); font-size:14px; color:var(--ink-2)}
.topic-overview .teaser .code{display:block; margin-bottom:2px}
.topic-overview .teaser .lock{color:var(--muted); font-size:12.5px; white-space:nowrap}

.topic-index{margin-top:46px; padding-top:22px; border-top:1px dashed var(--rule)}
.topic-index p{color:var(--muted); font-size:13.5px; margin:0 0 14px}
.topic-index ol{margin:0; padding:0; list-style:none; columns:3 250px; column-gap:28px}
.topic-index li{break-inside:avoid; padding:4px 0; font-size:14px}
.topic-index a{color:var(--ink-2); text-decoration:none}
.topic-index a:hover{color:var(--accent-ink); text-decoration:underline}
.topic-index .n{display:inline-block; min-width:3.9em; color:var(--muted); font-family:"IBM Plex Mono",monospace; font-size:12px}
.topic-index .is-current a{color:var(--accent-ink); font-weight:600}
/* Economics: each unit's own page heads the list of its chapters */
.topic-index li.unit{break-after:avoid; padding-top:12px; font-weight:600}
.topic-index li.unit:first-child{padding-top:4px}
.topic-index li.unit a{color:var(--ink)}
.topic-index li.unit .n{color:var(--accent-ink)}
.topic-overview :focus-visible, .topic-index :focus-visible{outline:3px solid var(--accent); outline-offset:2px}

/* Printing a topic page prints the whole topic, not the one-question tool above it. */
@media print{
  body.has-overview .main > :not(.topic-overview){display:none!important}
  body.has-overview .topbar, body.has-overview .paper-tray{display:none!important}
  .topic-overview{border-top:0; margin-top:0}
  .topic-overview details > .inner{display:block}
}
.topic-overview .sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
.topic-overview .locked .lk-title{font-weight:600; font-size:16px; margin-bottom:6px}
.topic-overview .locked p + p{margin-top:6px; color:var(--ink-2); font-size:14px}
.topic-overview .lk-actions{display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:12px!important}
.topic-overview .lk-btn{display:inline-flex; padding:9px 18px; border-radius:999px; background:var(--accent);
  color:#fff!important; font-weight:600; text-decoration:none}
.topic-overview .lk-btn:hover{background:var(--accent-ink)}
.topic-overview .teaser .more{color:var(--muted); font-style:italic}
.topic-overview.is-loading{min-height:180px}
.topic-overview.is-loading .note::after{content:""; display:inline-block; width:12px; height:12px; margin-left:8px; border:2px solid var(--accent); border-right-color:transparent; border-radius:50%; vertical-align:-1px; animation:tv-spin .8s linear infinite}
@keyframes tv-spin{to{transform:rotate(360deg)}}
