/* ------------------------------------------------------------------
   Website editor for abditabari.com. Plain CSS, self-hosted fonts.
   Tokens follow the public site (src/styles/global.css).
   ------------------------------------------------------------------ */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 100 900; font-display: swap; src: url('fonts/inter-latin-wght-italic.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 100 900; font-display: swap; src: url('fonts/inter-latin-ext-wght-italic.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('fonts/source-serif-4-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('fonts/source-serif-4-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #faf9f6;
  --ink: #192d39;
  --muted: #5a6368;
  --hairline: #dddeda;
  --line-strong: #7a8288;
  --accent: #234d59;
  --accent-strong: #1a3a44;
  --accent-tint: #e7eeee;
  --rust: #7c4636;
  --rust-tint: #f6eee8;
  --error: #9e2b1f;
  --error-tint: #f8ebe8;
  --panel: #f0f0ea;
  --panel-alt: #eeeee7;
  --field: #fffefc;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius: 6px;
  --header: 64px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
  background: var(--paper);
}
@media (min-width: 900px) { html { scroll-padding-top: calc(var(--header) + 1.5rem); } }
@media (max-width: 760px) { html { font-size: 16px; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 0.6rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--accent); text-underline-offset: 0.15em; }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.9em; background: var(--panel-alt); padding: 0.05em 0.3em; border-radius: 4px; overflow-wrap: anywhere; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Headings and regions that receive focus programmatically are not controls. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 30; background: var(--accent); color: #fff; padding: 0.75rem 1rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 0.75rem; color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 0.94rem; }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
.app-header { background: var(--paper); border-bottom: 1px solid var(--hairline); z-index: 20; }
@media (min-width: 900px) { .app-header { position: sticky; top: 0; } }
.app-header__inner { display: flex; align-items: center; gap: 0.75rem 1.25rem; flex-wrap: wrap; min-height: var(--header); padding: 0.5rem 1.5rem; max-width: 1480px; margin: 0 auto; }
.brand { margin: 0; display: flex; flex-direction: column; line-height: 1.2; margin-right: auto; }
.brand__name { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.brand__site { font-size: 0.9rem; color: var(--muted); }
.save-status { margin: 0; display: flex; align-items: center; gap: 0.5rem; font-size: 0.94rem; padding: 0.35rem 0.75rem; border-radius: var(--radius); background: var(--accent-tint); color: var(--accent-strong); transition: background-color 160ms ease, color 160ms ease; }
.save-status[data-tone="busy"] { background: var(--panel); color: var(--ink); }
.save-status[data-tone="warn"] { background: var(--rust-tint); color: var(--rust); }
.save-status[data-tone="error"] { background: var(--error-tint); color: var(--error); font-weight: 600; }
.save-status[data-tone="muted"] { background: var(--panel); color: var(--muted); }
.account { display: flex; align-items: center; gap: 0.5rem; }
.account__name { font-size: 0.94rem; color: var(--muted); }
.app-header .nav-toggle { display: none; }
.banner-slot { max-width: 1480px; margin: 0 auto; padding: 0 1.5rem; }
.banner-slot:empty { display: none; }
.banner-slot > .notice { margin-top: 1rem; }

/* ---------- Layout ---------- */
.app-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.5rem; max-width: 1480px; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }
.app-layout:has(.app-nav:empty) { grid-template-columns: minmax(0, 1fr); }
.app-nav:empty { display: none; }
.app-main { min-width: 0; outline: none; }
.app-nav { align-self: start; }
@media (min-width: 900px) { .app-nav { position: sticky; top: calc(var(--header) + 1rem); max-height: calc(100vh - var(--header) - 2rem); overflow-y: auto; padding-right: 0.25rem; } }
.nav__list { list-style: none; margin: 0 0 1rem; padding: 0; }
.nav__heading { font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rust); margin: 0.75rem 0 0.25rem; font-weight: 600; }
.nav__link { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 3px solid transparent; padding: 0.45rem 0.75rem; font: inherit; font-size: 0.97rem; color: var(--ink); cursor: pointer; border-radius: 0 var(--radius) var(--radius) 0; min-height: 40px; }
.nav__link[aria-current="page"] { border-left-color: var(--accent); background: var(--accent-tint); font-weight: 600; color: var(--accent-strong); }

@media (max-width: 899px) {
  .app-header__inner { padding: 0.5rem 1rem; }
  .app-header .nav-toggle:not([hidden]) { display: inline-flex; }
  .app-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1rem 1rem 3rem; }
  .app-nav { display: none; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 0.5rem 0.75rem; background: var(--field); }
  .app-nav.is-open { display: block; }
  .account__name { display: none; }
  .banner-slot { padding: 0 1rem; }
}

/* ---------- Page structure ---------- */
.page { max-width: 1100px; }
.page--narrow { max-width: 40rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head__intro { color: var(--muted); max-width: 68ch; font-size: 1.05rem; }
.panel { border-top: 1px solid var(--hairline); padding: 1.5rem 0 1rem; }
.panel--quiet { background: var(--panel); border: 0; border-radius: var(--radius); padding: 1.25rem 1.25rem 0.75rem; margin: 1.5rem 0; }
.panel__title { font-size: 1.35rem; }
.subhead { font-size: 1.1rem; margin-top: 1.5rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.75rem 0; }
.loading { color: var(--muted); padding: 2rem 0; }
.plain-list { padding-left: 1.25rem; }
.plain-list li { margin-bottom: 0.35rem; }
.link-list { list-style: none; padding: 0; }
.link-list li { margin-bottom: 0.4rem; }
.steps { padding-left: 1.4rem; max-width: 68ch; }
.steps li { margin-bottom: 0.5rem; }
.steps--inline { background: var(--panel); border-radius: var(--radius); padding: 1rem 1rem 0.5rem 2.4rem; margin-bottom: 1.5rem; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1.5rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .facts { grid-template-columns: minmax(0, 1fr); } .facts dd { margin-bottom: 0.5rem; } }
.result-slot:empty { display: none; }
.result-slot > * + * { margin-top: 0.75rem; }
.badge { display: inline-block; margin-left: 0.5rem; font-size: 0.85rem; line-height: 1.4; padding: 0.05rem 0.45rem; border: 1px solid var(--accent); color: var(--accent); border-radius: var(--radius); font-weight: 600; vertical-align: middle; white-space: nowrap; }
.badge--warn { border-color: var(--rust); color: var(--rust); }

/* ---------- Notices ---------- */
.notice { border-left: 4px solid var(--accent); background: var(--accent-tint); padding: 0.85rem 1rem 0.35rem; border-radius: 0 var(--radius) var(--radius) 0; max-width: 72ch; }
.notice__title { font-weight: 650; margin-bottom: 0.35rem; }
.notice--warn { border-left-color: var(--rust); background: var(--rust-tint); }
.notice--error { border-left-color: var(--error); background: var(--error-tint); }
.notice--info { border-left-color: var(--line-strong); background: var(--panel); }
.notice--success { border-left-color: var(--accent); background: var(--accent-tint); }
.notice + .notice { margin-top: 0.75rem; }
.note { font-size: 0.94rem; color: var(--rust); margin: 0.5rem 0 0; }
.progress-note { background: var(--panel); border-radius: var(--radius); padding: 0.85rem 1rem 0.25rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 44px; padding: 0.55rem 1.05rem; border-radius: var(--radius); border: 1px solid var(--accent); font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.25; cursor: pointer; text-decoration: none; transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease; white-space: nowrap; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: #fffefc; }
.btn--secondary { background: var(--field); color: var(--accent); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; font-weight: 500; padding-inline: 0.6rem; }
.btn--link { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; font-weight: 500; white-space: normal; text-align: left; }
.btn--danger { background: #a0442c; border-color: #a0442c; color: #fffefc; }
.btn--tool { min-height: 40px; padding: 0.35rem 0.8rem; background: var(--field); color: var(--ink); border-color: var(--line-strong); font-weight: 600; }
.btn[aria-busy="true"] { cursor: progress; }
@media (max-width: 480px) { .btn { white-space: normal; text-align: center; } }

/* ---------- Fields ---------- */
.field { margin: 0 0 1.15rem; max-width: 46rem; }
.field--wide { max-width: 60rem; }
.field--group { border: 0; padding: 0; min-width: 0; }
.field__label { display: block; font-weight: 600; margin-bottom: 0.25rem; padding: 0; }
.field__required { font-weight: 400; color: var(--muted); }
.field__hint { color: var(--muted); font-size: 0.94rem; margin: 0 0 0.4rem; max-width: 68ch; }
.field__error { color: var(--error); font-weight: 600; font-size: 0.97rem; margin: 0.35rem 0 0; }
.field__status:empty { display: none; }
.field__status { color: var(--rust); font-size: 0.97rem; margin: 0.35rem 0 0; }
.input { display: block; width: 100%; font: inherit; font-size: 1rem; line-height: 1.5; color: var(--ink); background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0.55rem 0.7rem; min-height: 44px; }
.input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.input[readonly], .input:disabled { background: var(--panel); color: var(--muted); }
.input--area { min-height: 6rem; resize: vertical; field-sizing: content; max-height: 70vh; }
/* Editable text stays at 16px or more: phones zoom into smaller text on focus.
   Page zoom itself is never disabled. */
.input--citation { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: max(16px, 0.95rem); line-height: 1.55; min-height: 7.5rem; }
.input--markdown { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: max(16px, 0.95rem); min-height: 22rem; }
.input--mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: max(16px, 0.9rem); }
.input--select { appearance: auto; }
.input--year { width: 7.5rem; display: inline-block; }
.year-input { display: inline-flex; align-items: center; gap: 0.5rem; }
.choice-row, .date-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; margin-bottom: 0.4rem; }
.date-row .input { width: auto; min-width: 8rem; }
.date-row .input--year { width: 6.5rem; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.fieldset { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 0.75rem 1rem 0.25rem; margin: 0 0 1.25rem; min-width: 0; }
.fieldset legend { font-weight: 600; padding: 0 0.35rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.4rem; }
.link-panel { margin-top: 0.75rem; padding: 0.85rem 1rem; background: var(--panel); border-radius: var(--radius); }
.citation-preview { margin-top: 0.75rem; padding: 0.75rem 1rem; background: var(--panel); border-radius: var(--radius); }
.citation-preview__label { font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; font-weight: 600; }
.citation-preview__text { margin: 0; font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; overflow-wrap: anywhere; }
.cite-link { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
.guide { margin-top: 0.6rem; }
.guide summary, .disclosure summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.guide__list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 1rem; }
.guide__list dd { margin: 0; }
@media (max-width: 600px) { .guide__list { grid-template-columns: minmax(0, 1fr); } }
.disclosure { margin: 1rem 0; max-width: 68ch; }
.readonly-box { background: var(--panel); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 1rem 0; font-size: 0.94rem; }
.readonly-box__title { font-weight: 600; }
.readonly-box dd { margin: 0 0 0.5rem; color: var(--muted); }
.file-input { display: block; font: inherit; font-size: 1rem; max-width: 100%; min-height: 44px; }
.file-input::file-selector-button { font: inherit; font-weight: 600; margin-right: 0.75rem; padding: 0.5rem 0.9rem; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--field); color: var(--accent); cursor: pointer; min-height: 44px; }
.upload { padding: 0.25rem 0 0.5rem; }
.upload--compact { border-top: 1px dashed var(--hairline); padding-top: 0.75rem; margin-top: 0.5rem; }
.upload__chosen { margin: 0.4rem 0 0; color: var(--muted); }

/* ---------- Collections ---------- */
.collection { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (min-width: 1100px) { .collection__list { position: sticky; top: calc(var(--header) + 1rem); max-height: calc(100vh - var(--header) - 2rem); overflow-y: auto; padding-right: 0.5rem; } }
@media (max-width: 1099px) { .collection { grid-template-columns: minmax(0, 1fr); } }
.record-list__group { font-family: var(--sans); font-size: 0.9rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--rust); margin: 1.1rem 0 0.35rem; font-weight: 600; }
.record-list__items { list-style: none; margin: 0; padding: 0; }
.record { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 3px solid transparent; border-radius: 0 var(--radius) var(--radius) 0; padding: 0.55rem 0.75rem; margin: 0 0 0.2rem; font: inherit; color: var(--ink); cursor: pointer; }
.record.is-selected { background: var(--accent-tint); border-left-color: var(--accent); }
.record__title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.95rem; line-height: 1.45; }
.record__meta { display: block; font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; }
.editor__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; }
.editor__back { display: none; }
@media (max-width: 1099px) { .editor__back { display: inline-flex; } .collection__editor { border-top: 1px solid var(--hairline); padding-top: 1.25rem; } }
.editor-empty { background: var(--panel); border-radius: var(--radius); padding: 1.25rem 1.25rem 0.5rem; }
.string-list__items { padding-left: 0; list-style: none; }
.add-box { background: var(--panel); border-radius: var(--radius); padding: 0.75rem 1rem 0.25rem; margin: 0.5rem 0 1.25rem; max-width: 46rem; }
.add-box.disclosure { padding-top: 0.25rem; }
.record-stack .fieldset { max-width: 46rem; }

/* ---------- Files ---------- */
.file-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.file-list__item { display: flex; gap: 1rem; align-items: flex-start; padding: 0.75rem 0; }
.file-list__item + .file-list__item { border-top: 1px solid var(--hairline); }
.file-list__thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); background: var(--panel); flex: none; }
.file-list__icon { width: 72px; height: 72px; flex: none; display: grid; place-items: center; background: var(--panel); border-radius: var(--radius); font-weight: 700; color: var(--muted); }
.file-list__body { min-width: 0; }
.file-list__body p { margin-bottom: 0.2rem; }
.file-list__name { font-weight: 600; }
.file-list__path { overflow-wrap: anywhere; }

/* ---------- Preview ---------- */
.route-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.route-tab { font: inherit; font-size: 0.97rem; min-height: 44px; padding: 0.4rem 0.9rem; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); cursor: pointer; }
.route-tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fffefc; font-weight: 600; }
.preview-frame { display: block; width: 100%; height: 75vh; min-height: 480px; border: 1px solid var(--hairline); border-radius: var(--radius); background: #fffefc; }

/* ---------- Lists of changes, status, history, drafts ---------- */
.checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.checklist li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; padding: 0.45rem 0; }
.checklist__state { font-size: 0.85rem; font-weight: 700; padding: 0.05rem 0.5rem; border-radius: var(--radius); background: var(--panel); color: var(--muted); min-width: 4.8rem; text-align: center; }
.checklist .is-done .checklist__state { background: var(--accent); color: #fffefc; }
.change-list { list-style: none; padding: 0; margin: 0; max-width: 72ch; }
.change-list li { padding: 0.6rem 0; }
.change-list li + li { border-top: 1px solid var(--hairline); }
.change-list__what { font-weight: 600; margin-bottom: 0.15rem; }
.change-list__value { margin-bottom: 0.15rem; overflow-wrap: anywhere; }
.status-list { list-style: none; padding: 0; margin: 0 0 1rem; max-width: 72ch; }
.status-list__item { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.6rem 0; }
.status-list__item + .status-list__item { border-top: 1px solid var(--hairline); }
.status-list__state { font-size: 0.85rem; font-weight: 700; text-align: center; padding: 0.15rem 0.4rem; border-radius: var(--radius); align-self: start; background: var(--panel); color: var(--muted); }
.status-list__item.is-done .status-list__state { background: var(--accent); color: #fffefc; }
.status-list__item.is-failed .status-list__state { background: var(--error); color: #fffefc; }
.status-list__item.is-waiting .status-list__state { background: var(--rust-tint); color: var(--rust); }
.status-list__title { font-weight: 600; margin-bottom: 0.1rem; }
.status-list__text { margin: 0; }
@media (max-width: 480px) { .status-list__item { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; } .status-list__state { justify-self: start; } }
.history { list-style: none; padding: 0; margin: 0; }
.history__item { padding: 1rem 0; }
.history__item + .history__item { border-top: 1px solid var(--hairline); }
.history__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; }
.history__summary { font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.history__meta { color: var(--muted); font-size: 0.94rem; margin: 0.2rem 0 0; }
.history__status:empty { display: none; }
.draft-list { list-style: none; padding: 0; margin: 0; }
.draft-list__item { padding: 0.75rem 0; }
.draft-list__item + .draft-list__item { border-top: 1px solid var(--hairline); }
.draft-list__title { font-weight: 600; margin: 0; }
.choice-list { list-style: none; padding: 0; }
.choice { padding: 0.75rem 0; }
.choice + .choice { border-top: 1px solid var(--hairline); }
.choice fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice__what { font-weight: 600; padding: 0; }
.choice__value { overflow-wrap: anywhere; margin-bottom: 0.25rem; }
.choice__options { display: flex; flex-direction: column; }
.choice__options .check { align-items: flex-start; padding: 0.55rem 0; min-height: 0; }
.choice__options .check input { margin-top: 0.3rem; flex: none; }
.choice__result { background: var(--panel); border-radius: var(--radius); padding: 0.6rem 1rem 0.4rem; overflow-wrap: anywhere; }
.choice__result p { margin: 0 0 0.4rem; }
.compare-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.5rem; margin: 0.5rem 0 0.75rem; }
@media (max-width: 760px) { .compare-values { grid-template-columns: minmax(0, 1fr); } }
.compare-values__side { min-width: 0; overflow-wrap: anywhere; }
.compare-values__label { font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 0.25rem; }
.value-fields { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
.value-fields dt { color: var(--muted); font-size: 0.94rem; margin-top: 0.35rem; }
.value-fields dd { margin: 0; }
.value-list { margin: 0.15rem 0 0; padding-left: 1.25rem; }
.value-list li + li { margin-top: 0.2rem; }
.diff-tag { font-size: 0.85rem; font-weight: 600; color: var(--rust); white-space: nowrap; }
.doi-panel { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 0.85rem 1rem 0.35rem; margin: 0 0 1.25rem; background: var(--paper); }
.doi-panel__title { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 0 0 0.35rem; }
.doi-panel__subtitle { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 0.25rem 0 0.25rem; }
.doi-panel__status { color: var(--accent-strong); font-weight: 600; margin: 0.5rem 0; }
.doi-panel__notes { margin: 0.25rem 0 0.75rem; padding-left: 1.25rem; color: var(--muted); font-size: 0.94rem; }
.doi-panel__replaces { background: var(--panel); border-radius: var(--radius); padding: 0.6rem 1rem; margin: 0 0 0.75rem; overflow-wrap: anywhere; }
.doi-panel__replaces p { margin: 0 0 0.3rem; }
.doi-panel__label { font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.doi-panel__current { margin: 0; }
.doi-panel__current dt { font-size: 0.94rem; font-weight: 600; margin: 0.35rem 0 0; }
.doi-panel__current dd { margin: 0; overflow-wrap: anywhere; }
.compare { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin: 0.75rem 0; }
.compare__item { margin: 0; max-width: 12rem; font-size: 0.94rem; overflow-wrap: anywhere; }
.compare__image { display: block; width: 160px; height: 160px; object-fit: contain; background: var(--panel); border-radius: var(--radius); margin-bottom: 0.35rem; }
.coverage { list-style: none; padding: 0; }
.coverage li { padding: 0.5rem 0; }
.coverage__title { font-weight: 600; margin-bottom: 0.1rem; }

/* ---------- Dialog ---------- */
.dialog { border: 0; border-radius: var(--radius); padding: 1.5rem 1.5rem 0.75rem; max-width: min(34rem, calc(100vw - 2rem)); width: 100%; color: var(--ink); background: var(--paper); box-shadow: 0 16px 48px rgb(25 45 57 / 0.22); opacity: 1; transform: scale(1); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
@starting-style { .dialog[open] { opacity: 0; transform: scale(0.98); } }
.dialog::backdrop { background: rgb(25 45 57 / 0.45); }
.dialog__title { font-size: 1.35rem; }
.dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; margin: 1.25rem 0 0.75rem; }

@media (prefers-reduced-motion: reduce) {
  .btn, .dialog, .save-status { transition: none; }
  .btn:active:not(:disabled) { transform: none; }
  @starting-style { .dialog[open] { transform: none; } }
}

/* Hover colours only for a real pointer; touch screens keep the resting style. */
@media (hover: hover) and (pointer: fine) {
  a:hover { color: #a0442c; }
  .nav__link:hover { background: var(--panel); }
  .btn--primary:hover:not(:disabled) { background: var(--accent-strong); color: #fffefc; }
  .btn--secondary:hover:not(:disabled) { background: var(--accent-tint); color: var(--accent-strong); }
  .btn--quiet:hover:not(:disabled) { background: var(--panel); color: var(--accent-strong); }
  .btn--link:hover:not(:disabled) { color: #a0442c; }
  .btn--danger:hover:not(:disabled) { background: #853722; }
  .btn--tool:hover:not(:disabled) { background: var(--panel); }
  .record:hover { background: var(--panel); }
}
