/* Kamarai Tudástár — institutional records tool.
   Palette: deep ink blue accent on warm paper; semantic red/amber/green
   reserved exclusively for the coverage band. No external assets. */

:root {
  --sans: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, ui-sans-serif, sans-serif;
  --serif: "Source Serif 4", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Times New Roman", ui-serif, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --paper:      #f7f5f0;
  --surface:    #fffefb;
  --surface-2:  #f1eee7;
  --ink:        #191c20;
  --ink-2:      #3d434b;
  --muted:      #666d76;
  --rule:       #d9d4c9;
  --rule-strong:#bdb6a8;
  --accent:     #123a5e;
  --accent-ink: #0d2a45;
  --accent-weak:#e6eef5;
  --accent-on:  #ffffff;

  --ok-fg:   #1c5f36;  --ok-bg:   #e6f0e7;  --ok-rule:  #2f7a49;
  --warn-fg: #7a4c00;  --warn-bg: #f8eed6;  --warn-rule:#a86a10;
  --none-fg: #8d2019;  --none-bg: #f7e6e3;  --none-rule:#a63a30;

  --focus: #0f6ea8;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(24,26,30,.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14171b;
    --surface:    #1a1e23;
    --surface-2:  #21262c;
    --ink:        #e9e6e0;
    --ink-2:      #c3c8ce;
    --muted:      #969da6;
    --rule:       #2f353c;
    --rule-strong:#454d56;
    --accent:     #8ab8e0;
    --accent-ink: #b6d4ee;
    --accent-weak:#1c2a37;
    --accent-on:  #0e1216;

    --ok-fg:   #96d3a6;  --ok-bg:   #16281c;  --ok-rule:  #3f8f58;
    --warn-fg: #e6bf7a;  --warn-bg: #2a2113;  --warn-rule:#9a7328;
    --none-fg: #f0a49b;  --none-bg: #2e1815;  --none-rule:#a8493d;

    --focus: #7cc0ee;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "kern" 1;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }

a { color: var(--accent); text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.skiplink {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--accent); color: var(--accent-on);
  padding: 10px 16px; text-decoration: none;
}
.skiplink:focus { left: 8px; top: 8px; }

/* ── Masthead ───────────────────────────────────────────────── */

.masthead { background: var(--surface); border-bottom: 1px solid var(--rule-strong); }
.masthead__rule { height: 4px; background: var(--accent); }
.masthead__inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; padding-top: 18px; padding-bottom: 18px;
}
.brand { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.brand__mark { width: 34px; height: 34px; flex: none; margin-top: 2px; }
.mark-bg { fill: var(--accent); stroke: none; }
.mark-fg { stroke: var(--surface); }
@media (prefers-color-scheme: dark) { .mark-fg { stroke: #0e1216; } }

.brand__text h1 {
  font-size: 20px; font-weight: 640; letter-spacing: .01em; line-height: 1.2;
}
.brand__sub {
  margin-top: 4px; max-width: 62ch;
  font-size: 13.5px; color: var(--muted);
}
.demo-badge {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--surface-2);
  padding: 5px 10px; font-size: 12px; color: var(--ink-2);
  letter-spacing: .01em;
}
.demo-badge__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn-rule); flex: none;
}

/* ── Layout ─────────────────────────────────────────────────── */

.layout { padding-top: 26px; padding-bottom: 40px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel__title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 640; color: var(--muted);
  padding: 12px 20px; border-bottom: 1px solid var(--rule);
  background: var(--surface-2);
}

.ask form { padding: 18px 20px 4px; }

/* Roles */
.roles { border: 0; padding: 0; margin: 0 0 18px; }
.roles__legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 620; }
.roles__hint { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.roles__group {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  overflow: hidden; width: fit-content; max-width: 100%;
}
.role {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 14px; cursor: pointer; background: var(--surface);
  border-right: 1px solid var(--rule);
  min-width: 108px;
}
.role:last-child { border-right: 0; }
.role span { font-size: 13.5px; font-weight: 560; }
.role small { font-size: 11px; color: var(--muted); }
.role input { position: absolute; opacity: 0; width: 0; height: 0; }
.role:hover { background: var(--surface-2); }
.role:has(input:checked), .role.is-checked { background: var(--accent); }
.role:has(input:checked) span, .role.is-checked span { color: var(--accent-on); }
.role:has(input:checked) small, .role.is-checked small { color: var(--accent-on); opacity: .82; }
.role:has(input:focus-visible), .role.is-focus { outline: 2px solid var(--focus); outline-offset: -2px; }

/* Question field */
.ask__field { display: block; }
.ask__label { display: block; font-size: 13px; font-weight: 620; margin-bottom: 6px; }
#kerdes {
  width: 100%; resize: vertical; min-height: 62px;
  padding: 11px 13px;
  background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  font-size: 17px; line-height: 1.4;
}
#kerdes::placeholder { color: var(--muted); opacity: 1; }
#kerdes:focus-visible { border-color: var(--focus); background: var(--surface); }
.ask__help { font-size: 12px; color: var(--muted); margin-top: 6px; }

.ask__actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  padding: 8px 15px; font-size: 14px; font-weight: 560;
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-on);
}
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn--quiet { background: transparent; font-weight: 500; }
.btn--icon { padding: 6px; border-color: transparent; background: transparent; }
.btn--icon:hover { background: var(--surface-2); }
.icon { width: 18px; height: 18px; flex: none; }

/* Samples */
.samples { padding: 16px 20px 18px; border-top: 1px solid var(--rule); margin-top: 14px; }
.samples__label {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 620; margin-bottom: 9px;
}
.samples__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  text-align: left; cursor: pointer;
  border: 1px solid var(--rule-strong); border-radius: 100px;
  background: var(--surface); padding: 6px 14px; font-size: 13.5px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.chip--control { border-style: dashed; }
.chip__tag {
  display: inline-block; margin-left: 8px; padding-left: 8px;
  border-left: 1px solid var(--rule-strong);
  font-size: 11.5px; color: var(--muted); letter-spacing: .01em;
}

/* ── Results grid ───────────────────────────────────────────── */

.results { display: grid; grid-template-columns: 1fr; gap: 22px; margin-top: 22px; }
@media (min-width: 1040px) {
  .results { grid-template-columns: minmax(0, 1fr) 306px; align-items: start; }
  .results.is-single, .results:has(.col-rail:empty) { grid-template-columns: minmax(0, 1fr); }
  .col-rail { position: sticky; top: 20px; }
}
.col-main:empty, .col-rail:empty { display: none; }

/* Intro / empty state */
.intro {
  border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: var(--radius);
  padding: 18px 22px;
}
.intro h3 { font-size: 15px; font-weight: 620; margin-bottom: 8px; }
.intro ul { margin-top: 10px; }
.intro li {
  position: relative; padding-left: 20px; margin-bottom: 6px;
  font-size: 14px; color: var(--ink-2);
}
.intro li::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 6px; height: 6px; background: var(--accent);
}

/* Status / loading */
.status {
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: var(--radius); padding: 18px 20px;
}
.status__bar {
  height: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px;
  border-radius: 2px;
}
.status__bar i {
  display: block; height: 100%; width: 34%; background: var(--accent);
  animation: slide 1.5s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}
@media (prefers-reduced-motion: reduce) {
  .status__bar i { animation: none; width: 100%; opacity: .4; }
}
.status__line { font-size: 14.5px; font-weight: 560; }
.status__steps { margin-top: 10px; font-size: 13px; color: var(--muted); }
.status__steps li { padding: 2px 0 2px 22px; position: relative; }
.status__steps li::before {
  content: ""; position: absolute; left: 6px; top: 9px;
  width: 7px; height: 7px; border: 1px solid var(--rule-strong); border-radius: 50%;
}
.status__steps li.is-done { color: var(--ink-2); }
.status__steps li.is-done::before { background: var(--accent); border-color: var(--accent); }

/* Error */
.errorbox {
  border: 1px solid var(--none-rule); border-left: 4px solid var(--none-rule);
  background: var(--none-bg); color: var(--none-fg);
  border-radius: var(--radius); padding: 18px 20px;
}
.errorbox h3 { font-size: 15.5px; font-weight: 640; display: flex; gap: 8px; align-items: center; }
.errorbox p { color: var(--ink-2); font-size: 14px; margin-top: 8px; max-width: 68ch; }
.errorbox code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--rule);
  padding: 1px 5px; border-radius: 2px; color: var(--ink-2);
}
.errorbox .btn { margin-top: 14px; background: var(--surface); }

/* ── Answer ─────────────────────────────────────────────────── */

.answer {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}

.coverage {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 20px; border-bottom: 1px solid var(--rule);
  border-left: 5px solid var(--cov-rule);
  background: var(--cov-bg); color: var(--cov-fg);
}
.coverage--lefedett        { --cov-fg: var(--ok-fg);   --cov-bg: var(--ok-bg);   --cov-rule: var(--ok-rule); }
.coverage--reszben_lefedett{ --cov-fg: var(--warn-fg); --cov-bg: var(--warn-bg); --cov-rule: var(--warn-rule); }
.coverage--nincs_fedezet   { --cov-fg: var(--none-fg); --cov-bg: var(--none-bg); --cov-rule: var(--none-rule); }
.coverage__icon { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.coverage__label {
  font-size: 15px; font-weight: 660; letter-spacing: .01em;
}
.coverage__desc { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; max-width: 72ch; }

.question-echo {
  padding: 14px 20px 0;
  font-family: var(--serif); font-size: 18px; line-height: 1.35;
}
.question-echo::before {
  content: "Kérdés"; display: block;
  font-family: var(--sans); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 620; margin-bottom: 4px;
}

.answer__body {
  padding: 16px 20px 20px;
  font-family: var(--serif); font-size: 17.5px; line-height: 1.62; color: var(--ink);
}
.answer__body p + p { margin-top: 0.85em; }
.answer__body ul, .answer__body ol { margin: 0.7em 0 0.7em 0; }
.answer__body li { position: relative; padding-left: 22px; margin-bottom: 4px; }
.answer__body ul > li::before {
  content: ""; position: absolute; left: 6px; top: .68em;
  width: 6px; height: 6px; background: var(--rule-strong);
}
.answer__body ol { counter-reset: li; }
.answer__body ol > li { counter-increment: li; }
.answer__body ol > li::before {
  content: counter(li) "."; position: absolute; left: 0; top: 0;
  color: var(--muted); font-size: .85em;
}
.answer__body strong { font-weight: 680; }

/* Inline citation chips */
.answer__body sup { line-height: 0; }
.cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 5px; margin: 0 1px;
  vertical-align: baseline; line-height: 1;
  font-family: var(--sans); font-size: 11.5px; font-weight: 660;
  color: var(--accent); background: var(--accent-weak);
  border: 1px solid var(--rule-strong);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 2px; cursor: pointer;
}
.cite:hover, .cite.is-active { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }

/* Conflict notice */
.conflict {
  margin: 0 20px 18px; padding: 12px 14px;
  border: 1px solid var(--warn-rule); border-left: 4px solid var(--warn-rule);
  background: var(--warn-bg); border-radius: var(--radius);
}
.conflict h4 { font-size: 13px; font-weight: 660; color: var(--warn-fg); }
.conflict p { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }

/* ── Sources ────────────────────────────────────────────────── */

.sources { border-top: 1px solid var(--rule); background: var(--surface-2); }
.sources__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 20px 10px;
}
.sources__head h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 660; color: var(--muted);
}
.sources__hint { font-size: 12px; color: var(--muted); }
.sources__list { padding: 0 20px 20px; display: grid; gap: 12px; }

.source {
  display: grid; grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px; padding: 14px 15px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
}
.source__n {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border: 1px solid var(--accent); color: var(--accent); background: var(--accent-weak);
  font-size: 13px; font-weight: 680; border-radius: 2px;
}
.source__title { font-size: 14.5px; font-weight: 640; line-height: 1.3; }
.source__meta {
  display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px;
  font-size: 12.5px; color: var(--muted);
}
.source__meta b { font-weight: 620; color: var(--ink-2); }
.tagpill {
  border: 1px solid var(--rule-strong); border-radius: 2px;
  padding: 0 6px; font-size: 11.5px; color: var(--ink-2); background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}
.source__quote {
  margin-top: 10px; padding: 10px 14px;
  border-left: 3px solid var(--rule-strong); background: var(--surface-2);
  font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: var(--ink-2);
}
.source__actions { margin-top: 11px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.source__fallback { font-size: 12.5px; color: var(--muted); }

/* ── Considered / gap panel ─────────────────────────────────── */

.gapbox { border-top: 1px solid var(--rule); padding: 16px 20px 20px; }
.gapbox h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 660; color: var(--muted); margin-bottom: 4px;
}
.gapbox > p { font-size: 13.5px; color: var(--ink-2); max-width: 74ch; }

.considered { margin-top: 12px; display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.considered li {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto;
  gap: 12px; align-items: center;
  background: var(--surface); padding: 8px 12px; font-size: 13px;
}
.considered__doc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.considered__page { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.considered__score { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.scorebar { width: 54px; height: 5px; background: var(--surface-2); border: 1px solid var(--rule); }
.scorebar i { display: block; height: 100%; background: var(--rule-strong); }

.nextstep {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  background: var(--accent-weak); border-radius: var(--radius);
  font-size: 13.5px; color: var(--ink-2);
}
.nextstep b { color: var(--ink); font-weight: 640; }

/* ── Rail ───────────────────────────────────────────────────── */

.rail-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow);
}
.rail-card h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 660; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--rule); background: var(--surface-2);
}
.kv { padding: 6px 14px 12px; }
.kv div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px dotted var(--rule); font-size: 13px;
}
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 560; }
.kv dd.mono { font-family: var(--mono); font-size: 12px; font-weight: 400; }
.rail-note { padding: 0 14px 12px; font-size: 12px; color: var(--muted); }

/* ── Modal ──────────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(16,18,22,.62); }
.modal__box {
  position: relative; z-index: 1;
  width: min(1080px, 100%); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.modal__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--rule);
}
.modal__eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 620;
}
.modal__title { font-size: 16.5px; font-weight: 640; line-height: 1.25; }
.modal__body {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
  gap: 0; overflow: hidden; min-height: 0;
}
.pageview {
  background: var(--surface-2); border-right: 1px solid var(--rule);
  padding: 16px; overflow: auto; display: flex; align-items: flex-start; justify-content: center;
  min-height: 240px;
}
.pagewrap { position: relative; display: inline-block; max-width: 100%; overflow: hidden; background: #fff; }
.pagewrap img { display: block; max-width: 100%; height: auto; }
.hl {
  position: absolute; pointer-events: none;
  border: 2px solid var(--warn-rule);
  background: rgba(230, 170, 40, .18);
  box-shadow: 0 0 0 9999px rgba(20, 22, 26, .42);
}
.pagewrap.no-dim .hl { box-shadow: none; }
.pagewrap.no-hl .hl { display: none; }
.hl__tag {
  position: absolute; top: -1px; left: -1px; transform: translateY(-100%);
  background: var(--warn-rule); color: #fff;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 640; padding: 2px 6px; white-space: nowrap;
}
.pagefallback {
  align-self: stretch; display: flex; flex-direction: column; justify-content: center;
  gap: 10px; padding: 22px; text-align: left;
  border: 1px dashed var(--rule-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2); font-size: 13.5px; width: 100%;
}
.pagefallback strong { font-size: 14px; color: var(--ink); }
.pagefallback .q { font-family: var(--serif); font-size: 16px; border-left: 3px solid var(--rule-strong); padding-left: 12px; }

.modal__side { padding: 16px 20px; overflow: auto; }
.modal__side h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 660; margin-bottom: 6px;
}
.modal__quote {
  font-family: var(--serif); font-size: 16.5px; line-height: 1.55;
  border-left: 3px solid var(--warn-rule); padding: 4px 0 4px 14px; color: var(--ink);
}
.modal__facts { margin-top: 16px; }
.modal__facts div {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 6px 0; border-bottom: 1px dotted var(--rule);
}
.modal__facts dt { color: var(--muted); }
.modal__facts dd { margin: 0; text-align: right; font-weight: 560; }
.modal__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; border-top: 1px solid var(--rule); background: var(--surface-2);
  flex-wrap: wrap;
}
.modal__nav { display: flex; align-items: center; gap: 10px; }
.modal__count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Footer ─────────────────────────────────────────────────── */

.footer { padding-bottom: 34px; }
.footer p {
  border-top: 1px solid var(--rule); padding-top: 14px;
  font-size: 12.5px; color: var(--muted); max-width: 86ch;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 860px) {
  .masthead__inner { flex-direction: column; gap: 12px; }
  .roles__group { width: 100%; }
  .role { flex: 1 1 auto; min-width: 0; }
  .modal { padding: 0; }
  .modal__box { max-height: 100vh; height: 100%; width: 100%; border-radius: 0; border: 0; }
  .modal__body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .pageview { border-right: 0; border-bottom: 1px solid var(--rule); }
  .modal__side { max-height: 40vh; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .brand__mark { width: 28px; height: 28px; }
  .source { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .answer__body { font-size: 16.5px; }
  .chip__tag { display: block; margin: 3px 0 0; padding: 0; border-left: 0; }
}


/* Cross-page navigation and the conflict source list (added after the
   integration review: the admin and gap-report pages were unreachable from
   the ask page, and the conflict block showed no sources to compare). */
.masthead__nav { display: flex; gap: .75rem; align-items: center; }
.masthead__nav a {
  font-size: .85rem; text-decoration: none; padding: .25rem .6rem;
  border: 1px solid var(--rule, #d8d2c6); border-radius: 4px;
  color: inherit; opacity: .85;
}
.masthead__nav a:hover, .masthead__nav a:focus-visible { opacity: 1; text-decoration: underline; }
.conflict__sources { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .9rem; line-height: 1.5; }
.conflict__sources li { margin: .2rem 0; }
