:root {
  color-scheme: light;
  --bg: #f4f7f4;
  --surface: #ffffff;
  --surface-2: #edf3ef;
  --surface-3: #e3ece7;
  --ink: #1d2b26;
  --muted: #60716a;
  --line: #d5e0da;
  --brand: #173e32;
  --brand-2: #285f4b;
  --accent: #b38a35;
  --accent-soft: #f5edd9;
  --danger: #a33c39;
  --danger-soft: #f7e8e6;
  --warning: #8a641a;
  --warning-soft: #faf1d5;
  --success: #2f6b4b;
  --success-soft: #e3f1e8;
  --info: #365f7c;
  --info-soft: #e7f0f6;
  --shadow: 0 14px 36px rgba(28, 57, 45, 0.10);
  --shadow-small: 0 7px 18px rgba(28, 57, 45, 0.08);
  --radius: 18px;
  --radius-small: 11px;
  --content: 1240px;
  --header-offset: 154px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111a17;
  --surface: #18241f;
  --surface-2: #202f29;
  --surface-3: #293a33;
  --ink: #eef5f1;
  --muted: #a9bbb2;
  --line: #34483f;
  --brand: #dcecdf;
  --brand-2: #8fc3a6;
  --accent: #dfba63;
  --accent-soft: #3d3523;
  --danger: #f19590;
  --danger-soft: #412825;
  --warning: #e9c36b;
  --warning-soft: #40371f;
  --success: #8bd0a7;
  --success-soft: #20382b;
  --info: #8fc7e5;
  --info-soft: #213645;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.30);
  --shadow-small: 0 8px 20px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -12%, rgba(78, 133, 104, 0.18), transparent 31rem),
    radial-gradient(circle at 100% 10%, rgba(183, 143, 56, 0.11), transparent 26rem),
    var(--bg);
  color: var(--ink);
  line-height: 1.72;
  min-height: 100vh;
}

a { color: var(--brand-2); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: .65rem 1rem;
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-small);
  transition: top .2s;
}
.skip-link:focus { top: .75rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.header-inner,
.search-band,
#main-content,
.site-footer {
  width: min(calc(100% - 2rem), var(--content));
  margin-inline: auto;
}

.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 47px;
  height: 47px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #f4ead0;
  background: linear-gradient(145deg, #173e32, #2f6b4e);
  box-shadow: 0 8px 20px rgba(20, 61, 47, .24);
  flex: 0 0 auto;
}
.brand-mark svg { width: 33px; height: 33px; fill: #b6d29e; }
.brand strong { display: block; font-size: 1.18rem; letter-spacing: .015em; }
.brand small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.3; }

.header-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.header-nav a,
.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  padding: .55rem .82rem;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.header-nav a:hover,
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); }
.theme-toggle { min-width: 40px; }

.search-band { position: relative; padding-bottom: .82rem; }
.global-search {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: .55rem;
  align-items: center;
  min-height: 52px;
  padding: .35rem .45rem .35rem 1rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-small);
}
.search-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.global-search input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  min-width: 0;
}
.global-search input::placeholder { color: color-mix(in srgb, var(--muted) 76%, transparent); }
.global-search button {
  border: 0;
  border-radius: 11px;
  background: var(--brand);
  color: var(--bg);
  padding: .58rem 1rem;
  cursor: pointer;
  font-weight: 700;
}
html[data-theme="dark"] .global-search button { color: #15382e; }
.shortcut-hint {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 6px;
  padding: .05rem .43rem;
  font-size: .72rem;
  box-shadow: none;
}
.search-suggestions {
  position: absolute;
  top: calc(100% - .55rem);
  left: 0;
  right: 0;
  z-index: 200;
  max-height: min(62vh, 520px);
  overflow: auto;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.suggestion-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .75rem;
  align-items: start;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  border-radius: 11px;
  padding: .72rem;
  cursor: pointer;
}
.suggestion-item:hover,
.suggestion-item[aria-selected="true"] { background: var(--surface-2); }
.suggestion-code { font-size: .74rem; font-weight: 800; color: var(--brand-2); }
.suggestion-title { font-size: .9rem; line-height: 1.45; }
.suggestion-category { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.suggestion-empty { padding: 1.1rem; text-align: center; color: var(--muted); }

#main-content { min-height: calc(100vh - 235px); padding-block: 2.3rem 4rem; }
#main-content:focus { outline: none; }
.loading-state {
  min-height: 260px;
  display: flex;
  gap: .7rem;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-shell { animation: page-in .25s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 3.3rem);
  border-radius: 27px;
  color: #f6fbf8;
  background:
    radial-gradient(circle at 95% 15%, rgba(207, 227, 187, .25), transparent 14rem),
    linear-gradient(128deg, #173e32 0%, #275b48 58%, #526c45 100%);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -90px;
  width: 310px;
  height: 310px;
  border: 2px solid rgba(255,255,255,.08);
  border-radius: 46% 54% 58% 42%;
  transform: rotate(18deg);
}
.hero-copy { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: #d6e8d9;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  font-weight: 800;
}
.hero h1 { margin: .55rem 0 .7rem; max-width: none; white-space: nowrap; font-size: clamp(1.1rem, 3.6vw, 2.85rem); line-height: 1.16; }
.hero p { max-width: 66ch; margin: 0; color: rgba(246, 251, 248, .82); }
.hero-actions { margin-top: 1.35rem; display: flex; flex-wrap: wrap; gap: .65rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: .62rem .9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: #f3ead2; color: #173e32; }
.btn-secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.btn-quiet { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn:hover { filter: brightness(1.03); transform: translateY(-1px); }

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  align-content: center;
}
.stat-card {
  padding: 1rem;
  border-radius: 15px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(8px);
}
.stat-card strong { display: block; font-size: 1.65rem; line-height: 1; }
.stat-card span { display: block; margin-top: .4rem; color: rgba(255,255,255,.72); font-size: .78rem; }

.section { margin-top: 2.7rem; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}
.section-head h2 { margin: 0; font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
.section-head p { margin: .25rem 0 0; color: var(--muted); }
.section-head a { font-size: .88rem; font-weight: 700; text-decoration: none; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.category-card {
  --category-color: var(--brand-2);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: start;
  padding: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-small);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.category-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--category-color);
}
.category-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--category-color) 42%, var(--line)); box-shadow: var(--shadow); }
.category-code {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--category-color);
  font-weight: 900;
}
.category-card h3 { margin: 0; font-size: 1.05rem; }
.category-card p { margin: .4rem 0 0; color: var(--muted); font-size: .88rem; }
.category-count { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.category-arrow { align-self: center; color: var(--category-color); font-size: 1.1rem; }

.update-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
}
.update-strip .update-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}
.update-strip h3 { margin: 0; font-size: 1rem; }
.update-strip p { margin: .2rem 0 0; color: var(--muted); font-size: .84rem; }
.update-strip a { text-decoration: none; font-weight: 800; white-space: nowrap; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: .8rem;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-2); }
.breadcrumbs span[aria-current="page"] { color: var(--ink); }

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
.page-header h1 { margin: .25rem 0 .5rem; font-size: clamp(1.55rem, 3.3vw, 2.25rem); line-height: 1.34; }
.page-header p { margin: 0; color: var(--muted); }
.page-header .header-actions { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: flex-end; }

.category-banner {
  --category-color: var(--brand-2);
  border-left: 7px solid var(--category-color);
}
.category-banner .category-label { color: var(--category-color); font-weight: 900; letter-spacing: .08em; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, auto));
  gap: .65rem;
  margin: 1rem 0;
}
.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
  padding: .55rem .72rem;
  outline: 0;
}
.toolbar input:focus,
.toolbar select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent); }

.question-list { display: grid; gap: .75rem; }
.question-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.question-card:hover { border-color: var(--brand-2); transform: translateX(3px); box-shadow: var(--shadow-small); }
.question-id {
  display: inline-flex;
  padding: .25rem .5rem;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--brand-2);
  font-size: .72rem;
  font-weight: 900;
  white-space: nowrap;
}
.question-card h3 { margin: 0; font-size: 1rem; line-height: 1.55; }
.question-card p { margin: .38rem 0 0; color: var(--muted); font-size: .84rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.question-chevron { align-self: center; color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .22rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  font-size: .71rem;
  line-height: 1.25;
  white-space: nowrap;
}
.chip-evidence { color: var(--info); background: var(--info-soft); border-color: transparent; font-weight: 800; }
.chip-high, .chip-conflict { color: var(--danger); background: var(--danger-soft); border-color: transparent; font-weight: 800; }
.chip-medium, .chip-conditional { color: var(--warning); background: var(--warning-soft); border-color: transparent; font-weight: 800; }
.chip-ok { color: var(--success); background: var(--success-soft); border-color: transparent; font-weight: 800; }

.empty-state {
  padding: 3rem 1.3rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}
.empty-state strong { display: block; color: var(--ink); font-size: 1.05rem; }
.empty-state p { margin: .35rem 0 0; }

.question-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 1.2rem;
  align-items: start;
  margin-top: 1rem;
}
.article-stack { min-width: 0; display: grid; gap: 1rem; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-small);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.05rem; }
.panel-body { padding: 1.2rem; }
.answer-summary {
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 1.55rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--success-soft), var(--surface));
  border: 1px solid color-mix(in srgb, var(--success) 24%, var(--line));
  font-size: 1.02rem;
}
.answer-summary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 14px 0 0 14px;
  background: var(--success);
}
.answer-summary p { margin: 0; }
.answer-note { margin-top: .8rem; color: var(--muted); font-size: .82rem; }

.scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.scope-item { padding: .85rem; border-radius: 12px; background: var(--surface-2); }
.scope-item dt { color: var(--muted); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.scope-item dd { margin: .25rem 0 0; font-size: .88rem; }
.inline-list { display: flex; flex-wrap: wrap; gap: .35rem; }

.source-accordion { display: grid; gap: .7rem; }
.source-block {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
}
.source-block > summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: center;
  padding: .9rem 1rem;
  background: var(--surface-2);
}
.source-block > summary::-webkit-details-marker { display: none; }
.source-index {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-2);
  font-size: .72rem;
  font-weight: 900;
}
.source-title { min-width: 0; }
.source-title strong { display: block; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-title small { color: var(--muted); font-size: .72rem; }
.source-open { color: var(--muted); font-size: .78rem; }
.source-content { padding: 1rem; }
.source-pages { display: grid; gap: 1rem; }
.source-page {
  border-left: 3px solid var(--line);
  padding-left: .9rem;
}
.source-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: .45rem;
}
.source-page-head strong { color: var(--brand-2); font-size: .8rem; }
.source-page-head a { font-size: .75rem; text-decoration: none; }
.source-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: color-mix(in srgb, var(--ink) 91%, var(--muted));
  font-size: .88rem;
  line-height: 1.78;
}
.source-disclaimer {
  margin: 0 0 .9rem;
  padding: .7rem .8rem;
  border-radius: 10px;
  color: var(--muted);
  background: var(--accent-soft);
  font-size: .78rem;
}

.side-stack { display: grid; gap: 1rem; position: sticky; top: calc(var(--header-offset) + .8rem); }
.meta-list { display: grid; gap: .7rem; }
.meta-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: .55rem; font-size: .82rem; }
.meta-row dt { color: var(--muted); }
.meta-row dd { margin: 0; overflow-wrap: anywhere; }
.related-list { display: grid; gap: .45rem; }
.related-link {
  display: block;
  padding: .65rem .7rem;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface-2);
  font-size: .78rem;
  line-height: 1.48;
}
.related-link:hover { background: var(--surface-3); }

.update-list { display: grid; gap: .8rem; }
.update-card {
  display: grid;
  gap: .45rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.update-card h3 { margin: 0; font-size: .95rem; line-height: 1.5; }
.update-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.update-card .update-meta { display: flex; flex-wrap: wrap; gap: .35rem; }
.update-card a { font-size: .8rem; font-weight: 800; text-decoration: none; }
.update-review-note {
  padding: 1rem;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--warning) 25%, var(--line));
  background: var(--warning-soft);
  color: var(--warning);
  font-size: .84rem;
}

.search-summary { margin: .75rem 0 1rem; color: var(--muted); }
.search-highlight { background: var(--accent-soft); color: inherit; padding: 0 .08em; border-radius: 3px; }

.site-footer {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem 2.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}
.site-footer strong { display: block; color: var(--ink); }
.site-footer p { max-width: 64ch; margin: 0; text-align: right; }

.toast {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 500;
  max-width: min(360px, calc(100% - 2.4rem));
  padding: .75rem 1rem;
  border-radius: 11px;
  color: #fff;
  background: #173e32;
  box-shadow: var(--shadow);
  font-size: .84rem;
}

@media (max-width: 980px) {
  :root { --header-offset: 148px; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
  .question-layout { grid-template-columns: 1fr; }
  .side-stack { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  :root { --header-offset: 178px; }
  .header-inner { min-height: 72px; align-items: center; }
  .brand small { display: none; }
  .brand strong { font-size: 1rem; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .header-nav a { display: none; }
  .global-search { grid-template-columns: auto 1fr auto; }
  .shortcut-hint { display: none; }
  .global-search button { padding-inline: .75rem; }
  #main-content { padding-top: 1.25rem; }
  .hero { padding: 1.4rem; border-radius: 20px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: 1fr; }
  .update-strip { grid-template-columns: auto minmax(0, 1fr); }
  .update-strip > a { grid-column: 2; }
  .page-header { grid-template-columns: 1fr; }
  .page-header .header-actions { justify-content: flex-start; }
  .toolbar { grid-template-columns: 1fr; }
  .scope-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr; }
  .source-block > summary { grid-template-columns: auto minmax(0, 1fr); }
  .source-open { display: none; }
  .question-card { grid-template-columns: auto minmax(0, 1fr); }
  .question-chevron { display: none; }
  .site-footer { display: block; }
  .site-footer p { margin-top: .7rem; text-align: left; }
}

@media (max-width: 480px) {
  .header-inner, .search-band, #main-content, .site-footer { width: min(calc(100% - 1rem), var(--content)); }
  .header-inner { gap: .5rem; }
  .brand { gap: .55rem; }
  .brand strong { font-size: .92rem; }
  .hero-stats { gap: .55rem; }
  .stat-card { padding: .78rem; }
  .stat-card strong { font-size: 1.3rem; }
  .category-card { grid-template-columns: auto minmax(0, 1fr); padding: 1rem; }
  .category-arrow { display: none; }
  .category-count { grid-column: 2; }
  .question-card { gap: .65rem; padding: .9rem; }
  .question-id { font-size: .65rem; }
  .panel-body, .panel-head { padding-inline: .9rem; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --muted: #444; --line: #ccc; }
  body { background: #fff; }
  .site-header, .site-footer, .header-actions, .side-stack, .source-disclaimer, .toast { display: none !important; }
  #main-content { width: 100%; padding: 0; }
  .page-header, .panel { box-shadow: none; break-inside: avoid; }
  .question-layout { display: block; }
  .source-block { break-inside: avoid; }
  .source-block[open] > summary { background: #eee; }
}


/* v2 source registry */
.text-link { color: var(--brand-2); font-weight: 700; text-decoration: none; }
.source-mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.source-mini-card, .source-doc-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-sm); padding: 1.1rem; min-width: 0;
}
.source-mini-card { display: flex; flex-direction: column; gap: .7rem; }
.source-mini-card h3 { margin: 0; font-size: 1rem; line-height: 1.45; }
.source-mini-card p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.65; flex: 1; }
.source-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.source-doc-card { display: flex; flex-direction: column; gap: .9rem; }
.source-doc-card h2 { margin: 0; font-size: 1.22rem; line-height: 1.45; }
.source-doc-card > p { margin: 0; color: var(--muted); line-height: 1.72; }
.source-doc-meta, .source-link-row { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.source-doc-meta { color: var(--muted); font-size: .8rem; }
.source-link-row { margin-top: auto; }
.source-link-row a:not(.btn) { color: var(--brand-2); font-weight: 700; text-decoration: none; }
.source-doc-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1rem; margin: 0; }
.source-doc-details div { border-top: 1px solid var(--border); padding-top: .55rem; }
.source-doc-details dt { color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.source-doc-details dd { margin: .18rem 0 0; overflow-wrap: anywhere; font-size: .86rem; }
.source-review-note { border-left: 4px solid var(--warning); background: var(--warning-soft); border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: .75rem .9rem; }
.source-review-note strong { font-size: .82rem; }
.source-review-note p { margin: .35rem 0 0; color: var(--text); font-size: .84rem; line-height: 1.65; }
@media (max-width: 1050px) { .source-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .source-mini-grid, .source-card-grid { grid-template-columns: 1fr; }
  .source-doc-details { grid-template-columns: 1fr; }
}

.confidential-note{border-color:var(--danger);background:var(--danger-soft)}
.source-confidential{border-left:4px solid var(--danger);padding:.75rem 1rem;background:var(--danger-soft);border-radius:10px}
