/* IndiaAuditLens Law Library, shared page styles (from the hand-built Section 16 page).
   Layout: an encyclopaedia article in three columns. Sticky contents on the left, the article in the
   centre at reading width, a sticky rail on the right with quick facts and CA tools. Below 1200px the
   contents becomes a drawer and the rail sits under the lead; below 768px the rail folds. */
:root {
  --bg: #ffffff;
  --fg: #202122;
  --muted: #54595d;
  --surface: #f8f9fa;
  --surface-head: #e2e8f3;
  --rule: #a2a9b1;
  --rule-soft: #c8ccd1;
  --link: #3366cc;
  --link-hover: #2a4b8d;
  --active-bg: #eaf0fb;
  --quote-rule: #c8ccd1;
  --ok-bg: #dbf3ec; --ok-fg: #0f5b45; --ok-row: #f2fbf8;
  --bad-bg: #fde6e4; --bad-fg: #8f1d14; --bad-row: #fff6f5;
  --open-bg: #fdf1d6; --open-fg: #6b4a00; --open-row: #fffbf1;
  --na-bg: #eaecf0; --na-fg: #44494d;
  --shadow: rgba(32, 33, 34, .18);
  --serif: "Libertinus Serif", "Linux Libertine", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --hdr: 50px;
  --stick: calc(var(--hdr) + env(safe-area-inset-top, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101418; --fg: #e3e6ea; --muted: #a2a9b1; --surface: #181d23; --surface-head: #243146;
    --rule: #4a535d; --rule-soft: #333b44; --link: #8eacef; --link-hover: #b5c9f5; --active-bg: #1f2a3b; --quote-rule: #46505b;
    --ok-bg: #143a30; --ok-fg: #8fe0c4; --ok-row: #12211d; --bad-bg: #44201d; --bad-fg: #f5aaa2; --bad-row: #241615;
    --open-bg: #3d3115; --open-fg: #f1d18a; --open-row: #221d10; --na-bg: #2a3038; --na-fg: #c3c8ce;
    --shadow: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101418; --fg: #e3e6ea; --muted: #a2a9b1; --surface: #181d23; --surface-head: #243146;
  --rule: #4a535d; --rule-soft: #333b44; --link: #8eacef; --link-hover: #b5c9f5; --active-bg: #1f2a3b; --quote-rule: #46505b;
  --ok-bg: #143a30; --ok-fg: #8fe0c4; --ok-row: #12211d; --bad-bg: #44201d; --bad-fg: #f5aaa2; --bad-row: #241615;
  --open-bg: #3d3115; --open-fg: #f1d18a; --open-row: #221d10; --na-bg: #2a3038; --na-fg: #c3c8ce;
  --shadow: rgba(0, 0, 0, .55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 15px; line-height: 1.6; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--link-hover); }
a:focus-visible, summary:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }
[id] { scroll-margin-top: calc(var(--stick) + 14px); }
button { font: inherit; color: inherit; }

/* Sticky top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); border-bottom: 1px solid var(--rule-soft); }
.topbar-in { max-width: 1440px; margin: 0 auto; height: var(--hdr); display: flex; align-items: center; gap: 14px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wordmark { font-family: var(--serif); font-size: 1.2rem; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wordmark span { color: var(--muted); font-size: .92rem; }
.tabs { display: flex; gap: 18px; font-size: .85rem; margin-left: auto; }
.tabs a { color: var(--link); padding-block: 4px; }
.tabs a[aria-current] { color: var(--fg); border-bottom: 2px solid var(--fg); }
.btn-toc { display: none; align-items: center; gap: 6px; border: 1px solid var(--rule); background: var(--surface); border-radius: 3px; padding: 4px 10px; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.btn-toc:hover { background: var(--surface-head); }
.btn-toc svg { width: 16px; height: 16px; flex: none; }

/* Three-column frame */
.layout { max-width: 1440px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 18px 40px;
  display: grid; grid-template-columns: 14.5rem minmax(0, 1fr) 19.5rem; grid-template-areas: "toc head rail" "toc body rail"; grid-template-rows: auto 1fr; column-gap: 28px; }
.art-head { grid-area: head; min-width: 0; }
.art-body { grid-area: body; min-width: 0; }
.art-head, .art-body { max-width: 50rem; }
.toc-side { grid-area: toc; align-self: start; position: sticky; top: calc(var(--stick) + 12px); max-height: calc(100vh - var(--stick) - 24px); overflow-y: auto; overscroll-behavior: contain; font-size: .88rem; padding-right: 4px; }
.rail { grid-area: rail; align-self: start; position: sticky; top: calc(var(--stick) + 12px); max-height: calc(100vh - var(--stick) - 24px); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 14px; min-width: 0; padding-bottom: 4px; }
body.toc-hidden .layout { grid-template-columns: 0 minmax(0, 1fr) 19.5rem; column-gap: 0; }
body.toc-hidden .art-head, body.toc-hidden .art-body { margin: 0 auto; width: 100%; padding-right: 28px; }
body.toc-hidden .toc-side { display: none; }

/* Contents sidebar */
.toc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0 8px; border-bottom: 1px solid var(--rule-soft); margin-bottom: 6px; }
.toc-head h2 { all: unset; font-weight: 700; font-size: .95rem; }
.toc-hide { border: 1px solid transparent; background: var(--na-bg); border-radius: 3px; padding: 1px 9px; font-size: .8rem; cursor: pointer; }
.toc-hide:hover { border-color: var(--rule); }
.toc-side ol { list-style: none; margin: 0; padding: 0; }
.toc-side ol ol { padding-left: 22px; }
.toc-side li { position: relative; }
.toc-side a { display: flex; gap: 6px; padding: 3px 6px 3px 22px; border-radius: 3px; line-height: 1.35; color: var(--link); }
.toc-side ol ol a { padding-left: 6px; }
.toc-side a .n { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.toc-side a[aria-current] { color: var(--fg); font-weight: 700; background: var(--active-bg); }
.toc-side a.top { font-weight: 700; color: var(--fg); }
.toc-side a.top[aria-current] { background: none; }
.chev { position: absolute; left: 0; top: 2px; width: 20px; height: 22px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.chev svg { width: 12px; height: 12px; transition: transform .15s; }
li.collapsed > .chev svg { transform: rotate(-90deg); }
li.collapsed > ol { display: none; }
.toc-backdrop { display: none; }

/* Title area */
.title-row { display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.25; margin: 0; text-wrap: balance; min-width: 0; }
.title-row .btn-toc { margin-bottom: 6px; }
body.toc-hidden .title-row .btn-toc { display: inline-flex; }
.tagline { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.hatnote { font-style: italic; font-size: .9rem; padding-left: 1.6em; margin: 8px 0 14px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 1.55rem; line-height: 1.3; margin: 1.6em 0 .5em; padding-bottom: 3px; border-bottom: 1px solid var(--rule); text-wrap: balance; }
h3 { font-family: var(--sans); font-weight: 700; font-size: 1.02rem; margin: 1.4em 0 .35em; }
p { margin: .5em 0 .7em; }
sup.ref { font-size: .72em; line-height: 0; white-space: nowrap; }
sup.ref a { padding: 0 1px; }

/* At a glance */
.glance { border: 1px solid var(--rule-soft); background: var(--surface); padding: 12px 16px 10px; margin: 4px 0 14px; }
.glance h2 { all: unset; display: block; font-family: var(--serif); font-size: 1.2rem; margin-bottom: 6px; }
.glance-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 6px 22px; }
.gl-k { font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 4px 0 4px; }
.glance ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.glance li a { display: grid; grid-template-columns: 5.4rem 1fr; gap: 8px; padding: 3px 4px; border-radius: 3px; color: var(--fg); font-size: .9rem; line-height: 1.4; }
.glance li a:hover { background: var(--active-bg); text-decoration: none; }
.glance li a:hover .gl-t { text-decoration: underline; color: var(--link); }
.cl { font-family: var(--mono); font-size: .76rem; color: var(--link); white-space: nowrap; padding-top: 2px; }
.gl-note { font-size: .84rem; color: var(--muted); margin: 8px 0 2px; }

/* Rail cards */
.card { border: 1px solid var(--rule-soft); background: var(--surface); font-size: .85rem; line-height: 1.45; min-width: 0; }
.card > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; background: var(--surface-head); font-weight: 700; }
.card > summary::-webkit-details-marker { display: none; }
.card > summary::after { content: "−"; font-weight: 400; color: var(--muted); }
.card:not([open]) > summary::after { content: "+"; }
.card-body { padding: 8px 10px 10px; display: grid; gap: 12px; }
.rail .infobox { border: 0; background: none; font-size: .8rem; line-height: 1.38; }
.rail .ib-title, .rail .ib-sub { display: none; }
#quick-facts .card-body { padding-top: 4px; }
.infobox table { width: 100%; border-collapse: collapse; }
.ib-title { font-family: var(--serif); font-size: 1.12rem; text-align: center; padding: 2px 4px 0; }
.ib-sub { text-align: center; color: var(--muted); font-size: .78rem; padding: 0 4px 6px; }
.ib-band { background: var(--na-bg); text-align: center; font-weight: 700; padding: 1px 6px; font-size: .76rem; }
.infobox th { text-align: left; vertical-align: top; padding: 3px 6px 3px 0; width: 34%; font-weight: 700; }
.infobox td { vertical-align: top; padding: 3px 0; }
.infobox tr + tr th, .infobox tr + tr td { border-top: 1px solid var(--rule-soft); }
.ib-structure { padding: 0 !important; }
.ib-structure summary { cursor: pointer; display: block; list-style: none; }
.ib-structure summary::-webkit-details-marker { display: none; }
.ib-structure summary::after { content: " [show]"; font-weight: 400; color: var(--link); }
.ib-structure details[open] summary::after { content: " [hide]"; }
.ib-structure details ol { padding: 6px 0 2px; }
.ib-structure ol { list-style: none; margin: 0; display: grid; gap: 3px; }
.ib-structure li { display: grid; grid-template-columns: 3rem 1fr; gap: 6px; align-items: baseline; }
.ib-structure .ss { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.ib-structure .bar { border-left: 3px solid var(--rule); padding-left: 6px; }
.ib-structure .bar.cond { border-left-color: var(--link); }

.tool h3 { font-size: .86rem; margin: 0 0 4px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.aid { font-weight: 400; font-size: .72rem; color: var(--open-fg); background: var(--open-bg); padding: 0 6px; border-radius: 3px; white-space: nowrap; }
.limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.limits li { display: grid; grid-template-columns: 6.2rem 1fr; gap: 8px; align-items: baseline; }
.limits .lim { white-space: nowrap; font-family: var(--serif); font-size: 1.02rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.limits a { color: var(--link); font-size: .78rem; }
.tool + .tool { border-top: 1px solid var(--rule-soft); padding-top: 10px; }
.field { display: grid; gap: 2px; margin: 6px 0; }
.field label { font-size: .78rem; color: var(--muted); }
.field input, .field select { font: inherit; font-size: .88rem; padding: 4px 6px; border: 1px solid var(--rule); border-radius: 3px; background: var(--bg); color: var(--fg); width: 100%; min-width: 0; }
.out { margin-top: 6px; padding: 6px 8px; background: var(--bg); border: 1px solid var(--rule-soft); border-radius: 3px; font-size: .84rem; }
.out .big { font-family: var(--serif); font-size: 1.15rem; font-variant-numeric: tabular-nums; display: block; }
.out .warn { color: var(--open-fg); background: var(--open-bg); display: block; padding: 4px 6px; border-radius: 3px; margin-top: 4px; }
.out p { margin: .25em 0; }
.prefill { font-size: .74rem; color: var(--muted); margin: 2px 0 0; }

/* Quotes and law text */
blockquote { margin: .8em 0 1em; padding: 2px 0 2px 16px; border-left: 3px solid var(--quote-rule); font-family: var(--serif); font-size: 1.06rem; line-height: 1.55; max-width: 44rem; }
blockquote cite { display: block; font-family: var(--sans); font-style: normal; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.lawtext { border: 1px solid var(--rule-soft); background: var(--surface); margin: .6em 0 1em; }
.lawtext > summary { cursor: pointer; padding: 8px 12px; font-weight: 700; font-size: .9rem; }
.lawtext > summary span { font-weight: 400; color: var(--muted); }
.lawtext-body { padding: 4px 16px 14px; border-top: 1px solid var(--rule-soft); font-family: var(--serif); font-size: 1rem; line-height: 1.55; }
.lawtext-body p { margin: .55em 0; }
.lawtext-body .lt-h { font-variant: small-caps; color: var(--muted); }
.lawtext-body .lt-t { font-weight: 600; }
.lawtext-body .lt-in { padding-left: 1.4em; }
.lawtext-body .lt-enf { margin-top: 1.2em; padding-top: .8em; border-top: 1px solid var(--rule-soft); font-family: var(--sans); font-size: .82rem; color: var(--muted); }
.lawtext-body .lt-fn { font-family: var(--sans); font-size: .82rem; color: var(--muted); margin: .3em 0; }
sup.sfn { font-family: var(--sans); font-size: .68em; color: var(--muted); }
.note { border: 1px solid var(--rule-soft); border-left: 4px solid var(--open-fg); background: var(--surface); padding: 8px 12px; font-size: .9rem; margin: .8em 0; }

/* Questions to answer on the file */
.qbox { border: 1px dashed var(--rule); margin: .6em 0 1.2em; font-size: .9rem; }
.qbox > summary { cursor: pointer; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.qbox > summary b { font-weight: 700; }
.qcount { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.qbox ol { margin: 0; padding: 2px 12px 4px 12px; list-style: none; counter-reset: q; }
.qbox li { counter-increment: q; }
.qbox label { display: grid; grid-template-columns: 18px 1.4rem 1fr; gap: 4px; align-items: start; padding: 4px 0; cursor: pointer; line-height: 1.45; }
.qbox label::before { content: counter(q) "."; grid-column: 2; grid-row: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.qbox input { grid-column: 1; grid-row: 1; margin: 3px 0 0; width: 15px; height: 15px; accent-color: var(--link); }
.qbox label span { grid-column: 3; grid-row: 1; }
.qbox input:checked ~ span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule); }
.qfoot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 2px 12px 8px; font-size: .76rem; color: var(--muted); }
.qreset { border: 0; background: none; color: var(--link); cursor: pointer; padding: 0; font-size: .76rem; }

/* Tables */
.tw { overflow-x: auto; margin: .6em 0 1.1em; max-width: 100%; }
table.wt { border-collapse: collapse; font-size: .86rem; line-height: 1.45; background: var(--surface); min-width: 34rem; width: 100%; }
table.wt caption { text-align: left; font-weight: 700; padding: 0 0 6px; font-size: .88rem; }
table.wt th, table.wt td { border: 1px solid var(--rule); padding: 5px 8px; vertical-align: top; text-align: left; }
table.wt th { background: var(--surface-head); }
table.wt td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.wt td:first-child { white-space: nowrap; }
table.wt tr:has(.chip.ok) td { background: var(--ok-row); }
table.wt tr:has(.chip.bad) td { background: var(--bad-row); }
table.wt tr:has(.chip.open) td { background: var(--open-row); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.chip::before { font-size: .85em; }
.chip.ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip.ok::before { content: "✓" / ""; }
.chip.bad { background: var(--bad-bg); color: var(--bad-fg); }
.chip.bad::before { content: "✕" / ""; }
.chip.open { background: var(--open-bg); color: var(--open-fg); }
.chip.open::before { content: "?" / ""; }
.chip.na { background: var(--na-bg); color: var(--na-fg); }
.chip.na::before { content: "–" / ""; }
.arith { font-variant-numeric: tabular-nums; border-left: 3px solid var(--rule-soft); padding-left: 12px; margin: .6em 0 .8em; }
.arith p { margin: .25em 0; }
ol.qs { padding-left: 1.4em; }
ol.qs li { margin: .35em 0; }
ul.plain { padding-left: 1.3em; }
ul.plain li { margin: .2em 0; }

/* References and navbox */
ol.refs { font-size: .86rem; padding-left: 2em; columns: 2 20rem; column-gap: 2.5em; }
ol.refs li { margin: 0 0 .45em; break-inside: avoid; }
ol.refs li:target { background: var(--surface-head); }
.unv { color: var(--muted); font-style: italic; }
.navbox { border: 1px solid var(--rule); margin-top: 2em; font-size: .86rem; background: var(--bg); }
.nb-title { background: var(--surface-head); text-align: center; font-weight: 700; padding: 5px 8px; }
.nb-row { display: grid; grid-template-columns: 11rem 1fr; border-top: 2px solid var(--bg); }
.nb-row > div:first-child { background: var(--surface-head); font-weight: 700; padding: 5px 10px; text-align: right; }
.nb-row > div:last-child { background: var(--surface); padding: 5px 10px; min-width: 0; }
.nb-row .sep { color: var(--muted); padding: 0 .35em; }
.nb-prevnext { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 10px; background: var(--surface); border-top: 2px solid var(--bg); }
.plain-name { color: var(--fg); }
.footer { margin-top: 2em; padding-top: 10px; border-top: 1px solid var(--rule-soft); font-size: .8rem; color: var(--muted); }

/* 768–1199: contents becomes a drawer, rail sits under the lead */
@media (max-width: 1199px) {
  .layout, body.toc-hidden .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "rail" "body"; grid-template-rows: auto; column-gap: 0; }
  .art-head, .art-body { max-width: 50rem; margin: 0 auto; width: 100%; }
  body.toc-hidden .art-head, body.toc-hidden .art-body { padding-right: 0; }
  .topbar .btn-toc { display: inline-flex; }
  body.toc-hidden .title-row .btn-toc { display: none; }
  .rail { position: static; max-height: none; overflow: visible; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; max-width: 50rem; margin: 6px auto 4px; width: 100%; }
  .toc-side, body.toc-hidden .toc-side { display: block; position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(20rem, 86vw); max-height: none; background: var(--bg); border-right: 1px solid var(--rule); box-shadow: 0 0 24px var(--shadow);
    padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
    transform: translateX(-105%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
  body.toc-open .toc-side { transform: none; visibility: visible; transition: transform .2s ease; }
  .toc-backdrop { position: fixed; inset: 0; z-index: 40; background: var(--shadow); }
  body.toc-open .toc-backdrop { display: block; }
}
@media (min-width: 1200px) {
  body.toc-hidden .topbar .btn-toc { display: inline-flex; }
}
/* Phones: rail folds into Quick facts and Tools */
@media (max-width: 767px) {
  .rail { grid-template-columns: minmax(0, 1fr); }
  .tabs { display: none; }
  .wordmark span { display: none; }
  .topbar .btn-toc { margin-left: auto; order: 2; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.32rem; }
  .hatnote { padding-left: .8em; }
  .glance-grid { grid-template-columns: minmax(0, 1fr); }
  .glance li a { grid-template-columns: 4.8rem 1fr; }
  table.wt.ex { min-width: 0; }
  table.wt.ex td:first-child { white-space: normal; }
  .nb-row { grid-template-columns: 1fr; }
  .nb-row > div:first-child { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toc-side, body.toc-open .toc-side, .chev svg { transition: none !important; }
}

/* ---- Additions for generated pages ---- */
body { margin: 0; }
.wordmark a { color: inherit; }
.wordmark a:hover { text-decoration: none; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.crumbs a { color: var(--link); }
.crumbs .sep { padding: 0 .35em; }
.glance-grid.n1 { grid-template-columns: minmax(0, 1fr); }
.glance-grid.n3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.glance li > a, .glance li > span.gl-row { display: grid; grid-template-columns: 6.6rem 1fr; gap: 8px; padding: 3px 4px; border-radius: 3px; color: var(--fg); font-size: .9rem; line-height: 1.4; }
.glance .cl { white-space: normal; overflow-wrap: anywhere; }
h2 .h-ref, h3 .h-ref { font-family: var(--mono); font-size: .72em; font-weight: 400; color: var(--muted); margin-right: .45em; white-space: nowrap; }
.qbox > summary .qtitle { font-weight: 400; color: var(--muted); font-size: .84rem; }
.limits li.wide { grid-template-columns: 1fr; gap: 0; }
.limits li.wide .lim { white-space: normal; font-size: .95rem; }
.faq-item { border-top: 1px solid var(--rule-soft); padding: 2px 0; }
.faq-item:last-of-type { border-bottom: 1px solid var(--rule-soft); }
.faq-item > summary { cursor: pointer; padding: 7px 0; font-weight: 700; }
.faq-item > p { margin: 0 0 .5em; }
.faq-item .faq-ref { font-size: .8rem; color: var(--muted); }
.ilist { margin: .6em 0 1.1em; }
.ilist > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
table.wt td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.wt.inst td:first-child { white-space: normal; min-width: 9rem; }
.st { font-size: .76rem; color: var(--open-fg); background: var(--open-bg); padding: 0 6px; border-radius: 3px; white-space: nowrap; }
.nb-row b { font-weight: 700; }
/* Index pages */
table.wt.idx td:first-child { white-space: nowrap; }
.tier { font-size: .74rem; font-weight: 700; padding: 0 7px; border-radius: 10px; white-space: nowrap; background: var(--na-bg); color: var(--na-fg); }
.tier.t-A { background: var(--ok-bg); color: var(--ok-fg); }
.tier.t-B { background: var(--surface-head); color: var(--fg); }
.hub-list { list-style: none; padding: 0; margin: .6em 0 1.2em; display: grid; gap: 8px; }
.hub-list li { border: 1px solid var(--rule-soft); background: var(--surface); padding: 8px 12px; }
.hub-list .meta { display: block; font-size: .82rem; color: var(--muted); }
.layout.index-layout .art-head, .layout.index-layout .art-body { max-width: 56rem; }
@media (max-width: 767px) {
  .glance li > a, .glance li > span.gl-row { grid-template-columns: 5.4rem 1fr; }
  table.wt.inst, table.wt.idx { min-width: 0; }
  table.wt.idx td:first-child, table.wt.inst td:first-child { white-space: normal; }
}
/* Phones: long labels wrap instead of pushing the page sideways (tables keep their own scroll box, .tw) */
.layout > *, .art-body, .art-head, .rail > * { min-width: 0; }
h1, h2, h3, h4, .toc-side a, .toc a, .infobox th, .infobox td, .navbox, .navbox a, .glance .cl { overflow-wrap: anywhere; }
h2 .h-ref, h3 .h-ref { white-space: normal; overflow-wrap: anywhere; }
