/* ==========================================================
   Proportionality Meter · Ashes of Alexandria
   Ash ground, ink text. Verdigris = holds / Justified.
   Ember = fails / Unlawful. Bronze = the instrument itself.
   ========================================================== */
@font-face { font-family: 'Marcellus'; src: url('../fonts/marcellus-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('../fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('../fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('../fonts/atkinson-hyperlegible-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ash: #E3E1DC;
  --vellum: #F6F5F2;
  --ink: #24212B;
  --smoke: #615D67;
  --rule: #C9C5BD;
  --stone: #B8B3AA;
  --verdigris: #2C6E61;
  --verdigris-wash: #D8E7E2;
  --ember: #A0352A;
  --ember-wash: #F2DEDA;
  --bronze: #85632A;
  --bronze-wash: #EDE3CF;

  --display: 'Marcellus', 'Trajan Pro', Georgia, serif;
  --text: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --s-xs: 0.8125rem;
  --s-sm: 0.9375rem;
  --s-md: 1rem;
  --s-lg: 1.25rem;
  --s-xl: 1.625rem;
  --s-2xl: 2.125rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ash);
  color: var(--ink);
  font: var(--s-md)/1.5 var(--text);
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.2; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }
code { font-size: 0.9em; background: var(--vellum); padding: 0.1em 0.35em; border-radius: 3px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
.booting { padding: 3rem; text-align: center; color: var(--smoke); }

/* ---------- Buttons & form controls ---------- */
.btn {
  font: inherit; font-size: var(--s-sm);
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.5em 0.95em;
  border: 1px solid var(--rule); border-radius: 5px;
  background: var(--vellum); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--smoke); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--vellum); }
.btn-primary:hover { background: #3a3542; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--smoke); }
.btn-quiet:hover { color: var(--ink); border-color: var(--rule); }
.btn-danger { background: transparent; border-color: var(--ember); color: var(--ember); }
.btn-danger:hover { background: var(--ember-wash); }
.link-btn { font: inherit; font-size: var(--s-xs); background: none; border: 0; padding: 0; color: var(--smoke); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--ember); }

.field { display: grid; gap: 0.3rem; margin: 0 0 1rem; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend, .seg > legend { font-size: var(--s-sm); font-weight: 700; padding: 0; }
textarea, input[type=text], input:not([type]), input[type=password], select {
  font: inherit; color: inherit; width: 100%;
  padding: 0.55rem 0.7rem;
  background: #fff; border: 1px solid var(--rule); border-radius: 4px;
}
textarea { resize: vertical; min-height: 2.8em; line-height: 1.45; }
textarea:disabled, input:disabled, select:disabled { background: transparent; color: var(--smoke); border-style: dashed; }
.check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: var(--s-sm); cursor: pointer; }
.check input { margin-top: 0.25em; accent-color: var(--ink); width: 1rem; height: 1rem; }
.checks { display: grid; gap: 0.35rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.row > .field { flex: 1 1 200px; }
.hint { color: var(--smoke); font-size: var(--s-sm); margin-bottom: 1rem; max-width: 68ch; }
.empty { color: var(--smoke); font-style: italic; }
.form-error { color: var(--ember); font-size: var(--s-sm); font-weight: 700; min-height: 1.2em; }

.seg { display: inline-flex; border: 0; padding: 0; margin: 0 0 1rem; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.seg > legend { width: 100%; margin-bottom: 0.3rem; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 0.35em 0.9em; border: 1px solid var(--rule); border-radius: 999px; font-size: var(--s-sm); background: #fff; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--vellum); }
.seg input:focus-visible + span { outline: 2px solid var(--bronze); outline-offset: 2px; }

/* ---------- Top bar & tabs ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand-mark { width: 30px; height: 30px; fill: var(--bronze); flex: none; }
.brand-name { font-family: var(--display); font-size: var(--s-lg); line-height: 1.1; }
.brand-seat { font-size: var(--s-xs); color: var(--smoke); }
.topbar-tools { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.conn { font-size: var(--s-xs); color: var(--smoke); padding: 0 0.5rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.conn::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--stone); }
.conn-on::before { background: var(--verdigris); }
.conn-off { color: var(--ember); font-weight: 700; }
.conn-off::before { background: var(--ember); }
.save-state { font-size: var(--s-xs); color: var(--smoke); padding: 0 0.5rem; }
.ss-error { color: var(--ember); font-weight: 700; }
.ss-pending, .ss-saving { color: var(--bronze); }

.charge-tabs {
  display: flex; gap: 0.25rem; overflow-x: auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--rule);
}
.charge-tab {
  font: inherit; background: none; border: 0; cursor: pointer; color: var(--smoke);
  padding: 0.85rem 1rem 0.7rem; border-bottom: 3px solid transparent; margin-bottom: -1px;
  display: grid; justify-items: start; gap: 0.1rem; text-align: left;
}
.charge-tab[aria-current=true] { color: var(--ink); border-bottom-color: var(--bronze); }
.tab-name { font-family: var(--display); font-size: var(--s-lg); }
.tab-status { font-size: var(--s-xs); }
.tab-status.st-open { color: var(--verdigris); font-weight: 700; }
.tab-status.st-locked { color: var(--ink); }

/* ---------- Juror workspace ---------- */
.juror { max-width: 1200px; margin: 0 auto; padding: 1.75rem clamp(1rem, 3vw, 2rem) 5rem; }
.charge-head { max-width: 70ch; margin-bottom: 1.5rem; }
.charge-head h1 { font-size: var(--s-2xl); }
.articles { color: var(--bronze); font-size: var(--s-sm); margin: 0.35rem 0 0.6rem; }
.summary { color: var(--smoke); }
.status-line { margin-top: 0.75rem; font-size: var(--s-sm); font-weight: 700; }
.status-line.st-open { color: var(--verdigris); }
.status-line.st-locked { color: var(--ink); }
.status-line.st-not_raised { color: var(--smoke); font-weight: 400; }
.waiting { display: grid; justify-items: center; gap: 1rem; padding: 3rem 1rem; text-align: center; color: var(--smoke); }
.waiting .temple { width: 160px; }

.page-alert { background: var(--ember); color: #fff; border-radius: 8px; padding: 0.85rem 1.1rem; margin: -0.5rem 0 1.5rem; max-width: 70ch; }
.page-alert-soft { background: var(--bronze-wash); color: var(--ink); border: 1px solid #D8C9A8; }
@media (prefers-reduced-motion: no-preference) {
  .page-alert[role=alert] { animation: pulse 1.6s ease-in-out 2; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(160, 53, 42, 0.25); } }
}
.incident-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.4rem; }
.incident-tab {
  font: inherit; font-size: var(--s-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.9rem; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--ink);
}
.incident-tab[aria-current=true] { background: var(--ink); border-color: var(--ink); color: var(--vellum); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.v-justified { background: var(--verdigris); }
.dot.v-unlawful { background: var(--ember); }
.incident-note { font-size: var(--s-xs); color: var(--smoke); margin-bottom: 1.5rem; }

.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.meter-col { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.record-col { max-width: 760px; }

/* The meter */
.meter-card { background: var(--vellum); border: 1px solid var(--rule); border-radius: 10px; padding: 1.1rem 1.25rem 1.25rem; text-align: center; }
.meter-incident { font-size: var(--s-sm); color: var(--smoke); }
.meter-card .temple { width: 100%; max-width: 240px; margin: 0.25rem auto 0; display: block; }
.verdict { font-family: var(--display); font-size: var(--s-2xl); line-height: 1.1; margin-top: 0.25rem; }
.v-justified .verdict { color: var(--verdigris); }
.v-unlawful .verdict { color: var(--ember); }
.verdict-sub { font-size: var(--s-xs); color: var(--smoke); margin-top: 0.3rem; }

.temple { display: block; overflow: visible; }
.temple .roof path, .temple .roof rect { stroke-width: 1.5; }
.temple .roof-up path, .temple .roof-up rect { fill: var(--verdigris); stroke: var(--verdigris); }
.temple .roof-open path, .temple .roof-open rect { fill: none; stroke: var(--stone); stroke-dasharray: 5 4; }
.temple .roof-down path, .temple .roof-down rect { fill: none; stroke: var(--ember); stroke-dasharray: 5 4; }
.temple .roof-down .crack { stroke-dasharray: none; stroke-width: 2; }
.temple .col-up rect { fill: var(--verdigris); }
.temple .col-up .flute { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.5; }
.temple .flute { stroke: none; }
.temple .col-open rect { fill: none; stroke: var(--stone); stroke-width: 1.5; stroke-dasharray: 5 4; }
.temple .col-ghost rect { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; }
.temple .col-down path, .temple .col-down rect { fill: var(--ember); }
.temple .steps rect { fill: var(--stone); }
.temple .col-letter { font-family: var(--display); font-size: 17px; fill: var(--smoke); text-anchor: middle; }
@media (prefers-reduced-motion: no-preference) {
  .meter-card .roof-up { animation: settle 0.5s cubic-bezier(.2, .8, .3, 1); }
  @keyframes settle { from { transform: translateY(-10px); opacity: 0.2; } to { transform: none; opacity: 1; } }
}

.rollup { background: var(--vellum); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem 1.25rem; }
.rollup h2 { font-size: var(--s-lg); margin-bottom: 0.5rem; }
.rollup ul { list-style: none; margin: 0; padding: 0; }
.rollup li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-top: 1px solid var(--rule); font-size: var(--s-sm); }
.rollup li:first-child { border-top: 0; }
.rollup-total { font-size: var(--s-sm); margin-top: 0.5rem; color: var(--smoke); }
.v-word { font-weight: 700; }
.v-word.v-justified { color: var(--verdigris); }
.v-word.v-unlawful { color: var(--ember); }
.v-word.v-split { color: var(--bronze); }

.notice { border-radius: 10px; padding: 1rem 1.25rem; background: var(--bronze-wash); border: 1px solid #D8C9A8; font-size: var(--s-sm); }
.notice h3 { font-size: var(--s-lg); margin-bottom: 0.35rem; }
.notice p + p, .notice p + form { margin-top: 0.6rem; }
.notice-soft { background: transparent; border-style: dashed; color: var(--smoke); }
.notice-alert { background: var(--ember-wash); border-color: var(--ember); }
.notice-alert h3 { color: var(--ember); }
.resolution-form { margin-top: 0.75rem; }
.resolution-form textarea { background: #fff; }
.saved-note { font-size: var(--s-xs); color: var(--verdigris); font-weight: 700; margin-top: 0.5rem; }
.reopen { font-size: var(--s-sm); color: var(--smoke); display: grid; gap: 0.6rem; justify-items: start; }
.reopen .field { width: 100%; }

/* Record sections */
.block { padding: 1.75rem 0 0.5rem; border-top: 1px solid var(--rule); }
.record-col > .block:first-child { border-top: 0; padding-top: 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.block-head h2 { font-size: var(--s-xl); }
.ref { font-size: var(--s-xs); color: var(--smoke); white-space: nowrap; }

.pillar-slot + .pillar-slot { margin-top: 1rem; }
.pillar { background: var(--vellum); border: 1px solid var(--rule); border-left: 5px solid var(--stone); border-radius: 6px; padding: 1rem 1.25rem 1.1rem; }
.pillar.s-established { border-left-color: var(--verdigris); }
.pillar.s-not_established { border-left-color: var(--ember); }
.pillar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.pillar-head h3 { font-size: var(--s-lg); }
.status-tag { font-family: var(--text); font-size: var(--s-xs); font-weight: 700; color: var(--smoke); white-space: nowrap; }
.status-tag.s-established { color: var(--verdigris); }
.status-tag.s-not_established { color: var(--ember); }
.test { font-style: italic; color: var(--smoke); margin: 0.25rem 0 0.9rem; }
.rebutted { font-size: var(--s-sm); font-weight: 700; color: var(--ember); margin: -0.4rem 0 0.9rem; }

.metric-chips { border: 0; padding: 0; margin: 0 0 0.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.metric-chips legend { font-size: var(--s-sm); font-weight: 700; margin-bottom: 0.35rem; padding: 0; }
.chip { font: inherit; font-size: var(--s-sm); cursor: pointer; padding: 0.3em 0.85em; border-radius: 999px; border: 1px solid var(--rule); background: #fff; color: var(--ink); }
.chip[aria-pressed=true] { background: var(--bronze-wash); border-color: var(--bronze); color: #5b421a; font-weight: 700; }
.chip:disabled { cursor: default; opacity: 0.7; }
.prompts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.4rem 1.25rem; margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: 6px; background: #fff; border: 1px dashed var(--rule); font-size: var(--s-sm); }
.prompt-name { font-weight: 700; color: var(--bronze); }
.prompts ul { margin: 0.2rem 0 0; padding-left: 1.1rem; color: var(--smoke); }

.decide { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: #fff; }
.decide-btn { font: inherit; font-size: var(--s-sm); padding: 0.45em 1em; border: 0; border-left: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; }
.decide-btn:first-child { border-left: 0; }
.decide-btn:disabled { cursor: not-allowed; color: var(--stone); }
.decide-btn[aria-pressed=true].d-unresolved { background: var(--rule); color: var(--ink); }
.decide-btn[aria-pressed=true].d-established { background: var(--verdigris); color: #fff; }
.decide-btn[aria-pressed=true].d-not_established { background: var(--ember); color: #fff; }
.decide-hint { font-size: var(--s-xs); color: var(--smoke); margin-top: 0.45rem; }

.trigger { padding: 1rem 0; border-top: 1px dashed var(--rule); }
.trigger:first-of-type { border-top: 0; padding-top: 0.25rem; }
.trigger-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.5rem; }
.trigger-head h3 { font-size: var(--s-lg); }
.defeats { font-size: var(--s-xs); color: var(--smoke); white-space: nowrap; }
.trigger.is-on .trigger-head h3 { color: var(--ember); }
.trigger .field { margin-bottom: 0.5rem; }

.log-form { background: var(--vellum); border: 1px solid var(--rule); border-radius: 6px; padding: 1rem 1.25rem 0.5rem; margin-bottom: 1.25rem; }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-item { padding: 0.8rem 0 0.8rem 1rem; border-left: 3px solid var(--stone); margin-bottom: 0.6rem; }
.log-item.stance-defence { border-left-color: var(--verdigris); }
.log-item.stance-prosecution { border-left-color: var(--ember); }
.log-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; font-size: var(--s-xs); color: var(--smoke); }
.stance { font-weight: 700; color: var(--ink); }
.log-evidence { font-weight: 700; margin-top: 0.15rem; }
.log-expl { color: var(--smoke); font-size: var(--s-sm); }

/* ---------- Login ---------- */
.login { max-width: 400px; margin: 0 auto; padding: 12vh 1.25rem 3rem; }
.login-art { width: 140px; margin-bottom: 1.25rem; }
.login h1 { font-size: var(--s-2xl); }
.login-sub { color: var(--smoke); margin: 0.4rem 0 2rem; }
.login-form .btn { width: 100%; justify-content: center; padding: 0.7em; font-size: var(--s-md); }
.login-form .form-error { margin-top: 0.75rem; }

/* ---------- Dais ---------- */
.dais {
  max-width: 1280px; margin: 0 auto; padding: 1.75rem clamp(1rem, 3vw, 2rem) 4rem;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.5rem 2.5rem; align-items: start;
}
.dais > section > h2 { font-size: var(--s-xl); margin-bottom: 0.75rem; }
.dais-notices { grid-column: 1; }
.dais-charges { grid-column: 1; }
.dais-progress, .dais-reveal, .dais-reset { grid-column: 2; }
.dais-progress { grid-row: 1 / span 2; }
.dais-reset p, .dais-reveal p { color: var(--smoke); font-size: var(--s-sm); margin-bottom: 0.75rem; }
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.notice-item { background: var(--vellum); border: 1px solid var(--rule); border-left: 5px solid var(--stone); border-radius: 6px; padding: 0.85rem 1rem; display: grid; gap: 0.5rem; }
.notice-item.is-new { border-left-color: var(--ember); background: var(--ember-wash); }
.notice-meta { font-size: var(--s-xs); color: var(--smoke); }
.dais-charge { background: var(--vellum); border: 1px solid var(--rule); border-radius: 6px; padding: 1rem 1.25rem; margin-bottom: 0.75rem; display: grid; gap: 0.6rem; }
.dais-charge.st-open { border-color: var(--verdigris); box-shadow: inset 4px 0 0 var(--verdigris); }
.dais-charge-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.dais-charge-head h3 { font-size: var(--s-lg); }
.dais-charge-head .tab-status { white-space: nowrap; }
.scope { border: 1px dashed var(--rule); border-radius: 6px; padding: 0.6rem 0.9rem; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.scope legend { font-size: var(--s-sm); font-weight: 700; padding: 0 0.3rem; }
.scope .hint { width: 100%; margin: 0; font-size: var(--s-xs); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.progress th, .progress td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); font-size: var(--s-sm); vertical-align: top; }
.progress thead th { font-weight: 700; font-size: var(--s-xs); color: var(--smoke); }
.th-charge { display: block; font-weight: 400; }
.progress tbody th { font-weight: 700; min-width: 8rem; }
.prog { display: block; }
.prog-sub { display: block; font-size: var(--s-xs); color: var(--smoke); }
.progress td.untouched { color: var(--stone); }

/* ---------- Reveal screen ---------- */
.reveal { max-width: 1500px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 4rem; font-size: 1.125rem; }
.reveal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.5rem; }
.reveal-head h1 { font-size: clamp(2rem, 3.5vw, 3rem); }
.reveal-head p { color: var(--smoke); }
.sealed { display: grid; justify-items: center; gap: 1.25rem; padding: 12vh 1rem; text-align: center; color: var(--smoke); font-size: var(--s-lg); }
.sealed .temple { width: 200px; }
.reveal-charge { margin-bottom: 2.5rem; }
.reveal-charge h2 { font-size: var(--s-xl); margin-bottom: 0.75rem; }
.reveal-table { table-layout: fixed; }
.reveal-table th:first-child { width: 13rem; }
.reveal-table th, .reveal-table td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--rule); text-align: center; }
.reveal-table thead th { font-family: var(--display); font-weight: 400; font-size: var(--s-lg); padding-bottom: 0.5rem; }
.reveal-table tbody th, .reveal-table tfoot th { text-align: left; font-weight: 700; overflow-wrap: anywhere; }
.reveal-table tfoot td, .reveal-table tfoot th { font-size: var(--s-sm); color: var(--smoke); border-bottom: 0; padding-top: 0.6rem; }
.cell { font: inherit; font-size: var(--s-sm); font-weight: 700; display: inline-flex; align-items: center; gap: 0.6rem; background: none; border: 1px solid transparent; border-radius: 6px; padding: 0.25rem 0.6rem; cursor: pointer; }
.cell:hover { border-color: var(--rule); background: var(--vellum); }
.cell .temple.mini { width: 72px; }
.cell.v-justified { color: var(--verdigris); }
.cell.v-unlawful { color: var(--ember); }
.overall { display: table-cell; }
.overall .v-word { display: block; }
.split-note { display: block; font-size: var(--s-xs); color: var(--smoke); font-weight: 400; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 10px; padding: 0; max-width: min(860px, 94vw); width: 100%; background: var(--vellum); color: var(--ink); box-shadow: 0 20px 60px rgba(36, 33, 43, 0.35); }
dialog::backdrop { background: rgba(36, 33, 43, 0.45); }
.dlg-body { padding: 1.5rem 1.75rem 1.75rem; max-height: 85vh; overflow-y: auto; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.dlg-head h2 { font-size: var(--s-xl); }
.dlg-body h3 { font-size: var(--s-lg); margin: 1.25rem 0 0.4rem; }
.dlg-body ul, .dlg-body ol { padding-left: 1.2rem; margin: 0.4rem 0; }
.guide-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.5rem 1.5rem; }
.guide-metrics h4 { font-family: var(--text); font-weight: 700; margin-top: 0.75rem; color: var(--bronze); }
.guide-metrics ul { color: var(--smoke); font-size: var(--s-sm); }
.guide-note { margin-top: 1rem; padding: 0.75rem 1rem; background: #fff; border-left: 4px solid var(--bronze); border-radius: 4px; font-size: var(--s-sm); }
.detail-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.detail-pillar { padding: 0.6rem 0 0.6rem 0.9rem; border-left: 4px solid var(--stone); margin-bottom: 0.6rem; }
.detail-pillar.s-established { border-left-color: var(--verdigris); }
.detail-pillar.s-not_established { border-left-color: var(--ember); }
.detail-pillar h3 { margin: 0 0 0.2rem; display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.detail-metrics { font-size: var(--s-xs); color: var(--bronze); font-weight: 700; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .meter-col { position: static; }
  .meter-card .temple { max-width: 200px; }
  .dais { grid-template-columns: 1fr; }
  .dais > section { grid-column: 1 !important; grid-row: auto !important; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > .temple { max-width: 160px; }
}

/* ---------- Printed final record ---------- */
#print-record { display: none; }
@media print {
  @page { margin: 16mm; }
  body { background: #fff; font-size: 11pt; }
  #app, dialog { display: none !important; }
  #print-record { display: block; }
  #print-record h1 { font-size: 20pt; margin-bottom: 4pt; }
  #print-record h2 { font-size: 15pt; margin-top: 18pt; border-bottom: 1px solid #999; padding-bottom: 3pt; }
  #print-record h3 { font-size: 12pt; margin-top: 12pt; }
  #print-record dl { display: grid; grid-template-columns: 34mm 1fr; gap: 2pt 8pt; margin: 6pt 0; }
  #print-record dt { font-weight: 700; }
  #print-record dd { margin: 0; }
  #print-record table { margin: 6pt 0; font-size: 10pt; }
  #print-record th, #print-record td { border: 1px solid #999; padding: 3pt 5pt; text-align: left; vertical-align: top; }
  #print-record p { margin: 4pt 0; }
  .pr-inc { break-inside: avoid; }
  .pr-meta { color: #555; }
}
