/*
  JournalFit design system ("proofreader's desk")
  - cool desk, white sheets, blue-black ink
  - green = inserted / done, yellow = highlighter (used on counts only), red = deleted / over limit
  - journal names are always italic serif, the way they appear in reference lists
*/

@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/spectral-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/spectral-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/spectral-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/spectral-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 500; font-display: swap; src: url("../fonts/spectral-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2"); }

:root {
  --ink: #1A2744;
  --muted: #56627A;
  --desk: #EDF1F4;
  --sheet: #FFFFFF;
  --rule: #CBD4DD;
  --rule-soft: #DCE3EA;
  --insert: #0A6F52;
  --insert-dark: #08583F;
  --insert-tint: #DDF1E8;
  --mark: #FFE066;
  --redline: #B3261E;
  --redline-tint: #FBE4E1;
  --warn: #7A4F00;
  --warn-tint: #FFF1CC;
  --pencil: #2457C5;
  --pencil-tint: #E4ECFB;

  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 6px;
  --radius-lg: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  --page-max: 1180px;
  --measure: 66ch;
  --shadow-sheet: 0 1px 0 rgba(26, 39, 68, .06), 0 14px 30px -14px rgba(26, 39, 68, .22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--desk);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
p { margin: 0 0 1em; text-wrap: pretty; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(2.4rem, 1.3rem + 3.8vw, 4.1rem); line-height: 1.04; letter-spacing: -.015em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.6rem); line-height: 1.14; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 650; }
h4 { font-size: 1rem; line-height: 1.35; font-weight: 650; }
a { color: var(--pencil); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.journal { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.06em; letter-spacing: .005em; }

:focus-visible { outline: 3px solid var(--pencil); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--mark); color: var(--ink); }

.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: 8px; top: -60px; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius); z-index: 100; }
.skip-link:focus { top: 8px; }

/* ---------- layout primitives ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--page-max)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gutter), 760px); margin-inline: auto; }
.section { padding-block: clamp(3.5rem, 7vw, 6.25rem); }
.section--sheet { background: var(--sheet); }
.section--ruled { border-top: 1px solid var(--rule); }
.stack > * + * { margin-top: var(--gap, 1rem); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, .75rem); }
.cluster--between { justify-content: space-between; }
.grid-2 { display: grid; gap: var(--gap, 1.25rem); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid-3 { display: grid; gap: var(--gap, 1.25rem); grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.2em; }

/* ---------- header / footer ---------- */
.site-header { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.site-header__bar { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; flex-wrap: wrap; padding-block: .5rem; }
.wordmark { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.6rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; line-height: 1; }
.wordmark:hover { text-decoration: none; }
.nav { display: flex; gap: .25rem; margin-right: auto; flex-wrap: wrap; }
.nav__link { color: var(--ink); text-decoration: none; padding: .45rem .75rem; border-radius: var(--radius); font-weight: 500; font-size: .98rem; }
.nav__link:hover { background: var(--desk); }
.nav__link[aria-current="page"] { background: var(--desk); font-weight: 650; }
.site-header__actions { display: flex; gap: .5rem; align-items: center; }
@media (max-width: 760px) {
  .site-header__bar { gap: .5rem 1rem; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; margin-right: 0; padding-bottom: .25rem; }
  .nav__link { white-space: nowrap; }
  .site-header__actions { margin-left: auto; }
}

.site-footer { border-top: 1px solid var(--rule); padding-block: 3rem 2.5rem; font-size: .95rem; }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; align-items: start; }
.site-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; align-content: start; }
.site-footer__list a { color: var(--ink); }
.site-footer__fine { margin-top: 2.5rem; color: var(--muted); font-size: .875rem; }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.2rem; min-height: 44px;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--insert); color: #fff; }
.btn--primary:hover { background: var(--insert-dark); }
.btn--secondary { border-color: var(--ink); color: var(--ink); }
.btn--secondary:hover { background: rgba(26, 39, 68, .07); }
.btn--quiet { color: var(--ink); }
.btn--quiet:hover { background: rgba(26, 39, 68, .07); }
.btn--danger { background: var(--redline); color: #fff; }
.btn--danger:hover { background: #8F1D17; }
.btn--sm { min-height: 36px; padding: .4rem .8rem; font-size: .92rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; color: var(--pencil); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- forms ---------- */
/* a field never stretches its label and input to fill a taller neighbour in the same row */
.field { display: grid; gap: .35rem; align-content: start; }
.field + .field { margin-top: 1rem; }
.form-row > .field + .field { margin-top: 0; }
.field__label { font-weight: 600; font-size: .95rem; }
.field__help { color: var(--muted); font-size: .875rem; }
/* file inputs: the browser button looks like our secondary button */
.input[type="file"] { padding: .45rem; cursor: pointer; }
.input[type="file"]::file-selector-button {
  margin-right: .85rem; padding: .45rem .9rem; min-height: 36px;
  font: 600 .92rem/1.2 var(--sans); color: var(--ink); background: var(--sheet);
  border: 1.5px solid var(--ink); border-radius: var(--radius); cursor: pointer;
}
.input[type="file"]::file-selector-button:hover { background: rgba(26, 39, 68, .07); }

.field__error { color: var(--redline); font-size: .875rem; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--sheet);
  border: 1.5px solid var(--rule); border-radius: var(--radius); padding: .65rem .8rem; min-height: 46px;
}
.textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: #9FB0C0; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pencil); box-shadow: 0 0 0 3px var(--pencil-tint); }
/* a value you can read but not change */
.input[readonly], .select:disabled, .input:disabled { background: #F4F6F8; color: var(--muted); cursor: default; }
.input[readonly]:hover, .input:disabled:hover { border-color: var(--rule); }
.input[readonly]:focus { box-shadow: none; border-color: var(--rule); }
.is-invalid { border-color: var(--redline); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; }
.check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--insert); }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.form-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .form-row--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .form-row, .form-row--3 { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* segmented radio control (index chooser) */
.segmented { display: flex; flex-wrap: wrap; gap: .4rem; border: 0; margin: 0; padding: 0; }
.segmented__item { position: relative; }
.segmented__item input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.segmented__label {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .35rem .9rem;
  border: 1.5px solid var(--rule); border-radius: 999px; font-weight: 600; font-size: .95rem; background: var(--sheet); cursor: pointer;
}
.segmented__item input:checked + .segmented__label { background: var(--ink); border-color: var(--ink); color: #fff; }
.segmented__item input:focus-visible + .segmented__label { outline: 3px solid var(--pencil); outline-offset: 2px; }
.segmented__item input:disabled + .segmented__label { opacity: .5; cursor: not-allowed; }

/* ---------- alerts, badges ---------- */
.alert { border-left: 4px solid var(--pencil); background: var(--pencil-tint); padding: .85rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; font-size: .97rem; }
.alert + .alert { margin-top: .75rem; }
.alert--success { border-color: var(--insert); background: var(--insert-tint); }
.alert--warn { border-color: #C98900; background: var(--warn-tint); }
.alert--error { border-color: var(--redline); background: var(--redline-tint); }
.alert__title { font-weight: 650; display: block; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; line-height: 1.5; border: 1px solid var(--rule); background: var(--sheet); color: var(--muted); white-space: nowrap; }
.badge--ok { background: var(--insert-tint); border-color: #B5DEC9; color: var(--insert-dark); }
.badge--warn { background: var(--warn-tint); border-color: #EBCB7A; color: var(--warn); }
.badge--bad { background: var(--redline-tint); border-color: #EDB6B1; color: #8F1D17; }
.badge--info { background: var(--pencil-tint); border-color: #BCCDF1; color: #1B438F; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--sheet); }
.table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.table th { text-align: left; font-weight: 650; color: var(--muted); font-size: .85rem; padding: .7rem .9rem; border-bottom: 1px solid var(--rule); background: #F7F9FB; white-space: nowrap; }
.table td { padding: .75rem .9rem; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table__actions { white-space: nowrap; text-align: right; }

/* ---------- panels (white sheets inside the app) ---------- */
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: clamp(1.1rem, 2.5vw, 1.75rem); }
.panel__title { font-size: 1.2rem; margin-bottom: .75rem; }
.panel--flush { padding: 0; overflow: hidden; }

/* ---------- ranking (journal list, used on the landing sample and in the app) ---------- */
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking__row {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; column-gap: .75rem; row-gap: .2rem;
  padding: .95rem 0; border-top: 1px solid var(--rule-soft); align-items: baseline;
}
.ranking__row:first-child { border-top: 0; }
.ranking__rank { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--muted); text-align: right; }
.ranking__name { font-size: 1.18rem; line-height: 1.3; }
.ranking__meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; color: var(--muted); font-size: .88rem; }
.ranking__count { grid-column: 3; grid-row: 1 / span 2; align-self: center; text-align: right; font-weight: 700; font-size: 1.35rem; font-variant-numeric: tabular-nums lining-nums; line-height: 1.1; }
.ranking__count small { display: block; font-weight: 500; font-size: .78rem; color: var(--muted); }
.ranking__bar { grid-column: 2 / -1; height: 6px; margin-top: .45rem; background: var(--rule-soft); border-radius: 3px; overflow: hidden; }
.ranking__bar > i { display: block; height: 100%; background: var(--insert); transform-origin: left center; transform: scaleX(var(--w, 0)); transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.ranking__actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; margin-top: .55rem; }
.mark { display: inline-block; line-height: 1; padding: 0 .15em; margin-inline: -.15em; background: linear-gradient(transparent 55%, var(--mark) 55%); }
.ranking__count small { margin-top: .2rem; }
.js .ranking:not(.is-ready) .ranking__bar > i { transform: scaleX(0); }

/* ---------- marginalia (proof-style notes beside content) ---------- */
.note { position: relative; font-size: .875rem; line-height: 1.5; color: var(--muted); padding-left: 1rem; border-left: 2px solid var(--rule); max-width: 34ch; }
.note p { margin: 0; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 6vw, 5.5rem); }
.hero__title { max-width: 22em; }
.hero__line { display: block; text-wrap: balance; }
.hero__lede { margin-top: 1.25rem; font-size: 1.2rem; max-width: 56ch; color: #33415E; }
.stage { margin-top: clamp(2rem, 4vw, 3.25rem); display: grid; grid-template-columns: minmax(0, 1fr) 270px; column-gap: 3rem; align-items: start; }
.stage__part { grid-column: 1; background: var(--sheet); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); padding: 1.1rem clamp(1rem, 3vw, 1.75rem); position: relative; box-shadow: var(--shadow-sheet); clip-path: inset(-40px -40px 0 -40px); }
.stage__part:first-of-type { border-top: 1px solid var(--rule); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-top: 1.4rem; }
.stage__part:last-of-type { border-bottom: 1px solid var(--rule); border-radius: 0 0 var(--radius-lg) var(--radius-lg); clip-path: none; padding-bottom: 1.5rem; }
.stage__part + .stage__part { border-top: 1px solid var(--rule-soft); }
.stage__note { grid-column: 2; padding-top: 1.1rem; }
.stage__note::before { content: ""; position: absolute; left: -3rem; top: 1.85rem; width: 2.6rem; border-top: 1px solid var(--rule); }
.stage__note { position: relative; }
.stage__note .note { position: static; }
@media (max-width: 960px) {
  .stage { grid-template-columns: 1fr; }
  .stage__part, .stage__note { grid-column: 1; }
  .stage__note { padding-top: .6rem; padding-bottom: .9rem; }
  .stage__note::before { display: none; }
  .stage__note .note { max-width: none; }
  /* notes sit between the parts here, so each part becomes its own sheet */
  .stage__part, .stage__part:first-of-type, .stage__part:last-of-type,
  .stage__part + .stage__part { border: 1px solid var(--rule); border-radius: var(--radius-lg); clip-path: none; padding-block: 1.25rem; }
}
.title-field { width: 100%; border: 0; border-bottom: 2px solid var(--ink); background: transparent; padding: .2rem 0 .5rem; font-family: var(--serif); font-size: clamp(1.35rem, 1rem + 1.6vw, 1.9rem); line-height: 1.25; font-weight: 500; color: var(--ink); resize: none; min-height: 3.4em; }
.title-field:focus { outline: none; border-bottom-color: var(--pencil); box-shadow: 0 2px 0 var(--pencil); }
.title-field::placeholder { color: #8A96AB; font-style: italic; }
.examples { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; margin-top: .75rem; font-size: .9rem; color: var(--muted); }
.chip { font: inherit; font-size: .88rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--desk); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.stage__cta { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }
.sample-flag { font-size: .85rem; color: var(--muted); }

/* ---------- how it works ---------- */
.steps { list-style: none; margin: 2.5rem 0 0; padding: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 270px; column-gap: 3rem; padding-block: 1.6rem; border-top: 1px solid var(--rule); align-items: start; }
.step:last-child { border-bottom: 1px solid var(--rule); }
.step::before { counter-increment: step; content: counter(step); font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 3.6rem; line-height: .9; color: #A9B6C6; }
.step__body h3 { font-family: var(--serif); font-weight: 500; font-size: 1.55rem; line-height: 1.2; margin-bottom: .4rem; }
.step__body p { margin: 0; color: #33415E; max-width: 58ch; }
@media (max-width: 960px) {
  .step { grid-template-columns: 3rem minmax(0, 1fr); column-gap: 1rem; }
  .step::before { font-size: 2.6rem; }
  .step .note { grid-column: 2; margin-top: .8rem; max-width: none; }
}

/* ---------- change report sample (redline) ---------- */
.report { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-sheet); overflow: hidden; }
.report__head { padding: 1rem 1.5rem; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: baseline; }
.report__title { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.report__group { padding: 1rem 1.5rem; display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .25rem 1.25rem; border-top: 1px solid var(--rule-soft); }
.report__group:first-of-type { border-top: 0; }
.report__area { font-weight: 650; }
.report__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.report__lines li { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; }
.report__what { min-width: 8rem; color: var(--muted); }
del, .del { color: var(--redline); text-decoration: line-through; text-decoration-thickness: 1.5px; background: var(--redline-tint); padding-inline: .25em; border-radius: 3px; }
ins, .ins { color: var(--insert-dark); text-decoration: none; font-weight: 650; background: var(--insert-tint); padding-inline: .25em; border-radius: 3px; }
@media (max-width: 640px) { .report__group { grid-template-columns: 1fr; } }

/* ---------- plans (rate card rows) ---------- */
.rates { list-style: none; margin: 2.25rem 0 0; padding: 0; border-top: 2px solid var(--ink); }
.rate { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) 9.5rem 11.5rem; gap: .5rem 2rem; align-items: center; padding-block: 1.5rem; border-bottom: 1px solid var(--rule); }
.rate > :last-child { justify-self: end; }
.rate__name { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; line-height: 1.15; }
.rate__tag { color: var(--muted); font-size: .92rem; margin-top: .15rem; }
.rate__list { margin: 0; padding-left: 1.1rem; color: #33415E; font-size: .98rem; }
.rate__list li + li { margin-top: .2rem; }
.rate__price { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums lining-nums; line-height: 1.1; }
.rate__price small { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); }
@media (max-width: 900px) {
  .rate { grid-template-columns: minmax(0, 1fr) auto; }
  .rate__list { grid-column: 1 / -1; order: 3; }
  .rate > :last-child { grid-column: 1 / -1; order: 4; justify-self: start; margin-top: .5rem; }
}
@media (max-width: 520px) { .rate { grid-template-columns: minmax(0, 1fr); } }

/* ---------- two-column split (text left, card right); stacks on narrow screens ---------- */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.split--faq { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
@media (max-width: 860px) { .split, .split--faq { grid-template-columns: minmax(0, 1fr); } }
.split--faq .faq { margin-top: 0; }
.split--faq .note { margin-top: 1.1rem; }
.note--action { max-width: 30ch; }
.note--action .btn { margin-top: .75rem; }

/* ---------- FAQ ---------- */
.faq { margin-top: 2rem; border-bottom: 1px solid var(--rule); max-width: 820px; }
.faq details { border-top: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem 2.5rem 1.1rem 0; font-weight: 650; font-size: 1.1rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); font-size: 1.6rem; font-weight: 400; color: var(--muted); line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq__answer { padding: 0 2.5rem 1.3rem 0; color: #33415E; max-width: 66ch; }
.faq__answer p:last-child { margin-bottom: 0; }

/* ---------- modal ---------- */
.modal { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(560px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); background: var(--sheet); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(26, 39, 68, .5); }
.modal::backdrop { background: rgba(26, 39, 68, .55); }
.modal__body { padding: clamp(1.25rem, 3vw, 2rem); overflow-y: auto; max-height: calc(100vh - 2rem); }
.modal__close { position: absolute; right: .6rem; top: .6rem; }
.modal h2 { font-size: 1.7rem; margin-bottom: .4rem; }

/* ---------- progress / job status ---------- */
.progress { height: 10px; background: var(--rule-soft); border-radius: 5px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--insert); transition: width .4s ease; }
.job { display: grid; gap: .75rem; }
.job__msg { font-weight: 500; }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.task-list li { display: flex; gap: .7rem; align-items: flex-start; color: var(--muted); }
.task-list li[data-state="active"] { color: var(--ink); font-weight: 650; }
.task-list li[data-state="done"] { color: var(--insert-dark); }
/* the marker is drawn, not typed, so it looks the same in every font */
.task-list li::before { content: ""; flex: none; box-sizing: border-box; width: 1.15rem; height: 1.15rem; margin-top: .2rem; border: 2px solid #B8C4CF; border-radius: 50%; }
.task-list li[data-state="active"]::before { border-color: #C98900; background: var(--warn-tint); }
.task-list li[data-state="done"]::before { content: "\2713"; display: grid; place-items: center; background: var(--insert); border-color: var(--insert); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; }
.task-list__tag { margin-left: .4rem; vertical-align: .08em; }

/* ---------- app shell (signed-in + admin) ---------- */
.app-body { background: var(--desk); }
.app-header { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.app-header__bar { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; flex-wrap: wrap; padding-block: .4rem; }
.app-main { padding-block: 2rem 4rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.9rem, 1.3rem + 1.8vw, 2.6rem); }
.credit-pill { display: inline-flex; gap: .4rem; align-items: baseline; padding: .25rem .75rem; border: 1px solid var(--rule); border-radius: 999px; font-size: .88rem; background: var(--desk); }
.credit-pill b { font-variant-numeric: tabular-nums; }
.stat-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { padding: 1rem 1.1rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.stat__value { font-family: var(--serif); font-size: 2.2rem; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.stat__label { color: var(--muted); font-size: .9rem; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth__card { width: min(440px, 100%); }
.auth__logo { display: block; text-align: center; margin-bottom: 1.5rem; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: .4rem; font-family: var(--serif); font-weight: 500; font-size: 1.4rem; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* a long status note inside a value may wrap instead of pushing the page wider */
.kv dd .badge { white-space: normal; }
@media (max-width: 520px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { margin-top: .7rem; font-size: .9rem; }
  .kv dt:first-child { margin-top: 0; }
}

.spec-group { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1.25rem; }
.spec-group h3 { margin-bottom: .75rem; font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.spec-grid { display: grid; gap: .9rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.spec-grid .field + .field { margin-top: 0; }

.status { display: inline-flex; align-items: center; gap: .35rem; font-weight: 650; font-size: .9rem; }
.status::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); }
.status--submitted::before, .status--under_review::before { background: var(--pencil); }
.status--revision::before { background: #C98900; }
.status--accepted::before, .status--published::before { background: var(--insert); }
.status--rejected::before { background: var(--redline); }

.toast-area { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 50; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  .site-header, .site-footer, .btn, .nav { display: none !important; }
  body { background: #fff; }
}
