/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --ink: #1c2030;
  --masthead: #192139;
  --paper: #f7f2e8;
  --surface: #fffdf8;
  --rule: #d8cfbf;
  --muted: #625f59;
  --ochre: #8a5a18;
  --teal: #286a67;
  --danger: #a33a32;
  --sans: "Source Sans 3", Inter, system-ui, sans-serif;
  --display: Newsreader, "Playfair Display", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  /* ── Legacy compatibility aliases ──────────────────────────────────────── */
  /* Preserved verbatim from the pre-Enscript palette (commit 1d785ba) so    */
  /* authenticated pages and legacy public body styles keep their exact      */
  /* visual values. New CSS should use the canonical Editorial Archive       */
  /* tokens above; these aliases exist only to avoid an out-of-scope visual  */
  /* redesign of pages Task 3 did not touch.                                 */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --radius: 6px;
  --indigo: #1F2A44;
  --indigo-dim: #2D3E5E;
  --gold: #D4AF37;
  --gold-light: #F5EFC0;
  --parchment: #F2E9D8;
  --white: #FDFAF5;
  --gray: #6B7280;
  --teal-light: #E8F4F5;
  --shadow-sm: 0 1px 3px rgba(31,42,68,.08);
  --shadow-md: 0 4px 20px rgba(31,42,68,.12);
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
/* Class rules such as .btn/.nav-link set display and would otherwise override
   the user-agent [hidden] rule; templates rely on the hidden attribute so that
   no inline style attributes are needed under a strict style-src. */
[hidden] { display: none !important; }
html { background: var(--paper); color: var(--ink); scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--rule) var(--paper); }
body { margin: 0; min-width: 0; background: var(--paper); font-family: var(--sans); line-height: 1.55; font-variant-ligatures: common-ligatures; }
::selection { background: rgba(138, 90, 24, 0.22); color: var(--ink); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 99px; border: 2px solid var(--paper); }
textarea, input, [contenteditable] { caret-color: var(--ochre); }
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; }
img { display: block; max-width: 100%; }
.pricing-price, .entry-offer-price, .pricing-pages, .pricing-unit, .pricing-savings,
.job-row-meta, .credits-display, .selected-file-meta,
.top-up-pages-selection, .checkout-status,
.job-transcript th, .job-transcript td { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
/* ── Layout Helpers ────────────────────────────────────────────────────────── */
.container        { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.container.narrow { max-width: 720px; }


/* ── NavBar ────────────────────────────────────────────────────────────────── */
.navbar { min-height: 64px; padding: 0 20px; color: var(--surface); background: var(--masthead); }
.navbar, .navbar-links, #site-menu { display: flex; align-items: center; }
.navbar { justify-content: space-between; }
.navbar-brand, .footer-wordmark { font-family: var(--display); font-size: 26px; font-weight: 600; text-decoration: none; }
.navbar-links, #site-menu { gap: 8px; }
.nav-link, .navbar .btn { display: inline-flex; min-height: 44px; align-items: center; padding-inline: 14px; }
.site-menu-button { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid currentColor; border-radius: 6px; color: var(--surface); background: transparent; }
.site-footer { color: var(--surface); background: var(--masthead); border-top: 1px solid rgb(255 255 255 / 20%); }
.footer-inner { display: grid; grid-template-columns: 1.2fr 0.8fr 1.5fr; gap: 32px; width: min(100% - 40px, 1200px); margin-inline: auto; padding: 48px 0 28px; }
.footer-brand p, .footer-policy, .footer-copyright { color: #ddd8cf; }
.footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
.footer-copyright { grid-column: 1 / -1; margin: 0; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / 20%); }
@media (max-width: 639px) {
  .navbar { position: relative; flex-wrap: wrap; }
  .site-menu-button { display: inline-flex; }
  #site-menu { display: none; width: 100%; flex-direction: column; align-items: stretch; padding: 12px 0 16px; }
  #site-menu.is-open { display: flex; }
  #site-menu .nav-link, #site-menu .btn { width: 100%; justify-content: center; }
  .footer-inner { grid-template-columns: 1fr; width: min(100% - 32px, 1200px); }
  .footer-copyright { grid-column: 1; }
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 9px 20px; border-radius: var(--radius); min-height: 44px;
  border: none; cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--gold); color: var(--indigo);
  box-shadow: 0 4px 18px rgba(212,175,55,.4);
}
.btn-primary:hover { background: #c9a430; }
.btn-outline {
  background: transparent; color: var(--parchment);
  border: 1px solid rgba(242,233,216,.25);
}
.btn-outline:hover { border-color: rgba(242,233,216,.6); }
.btn-lg { font-size: 15px; padding: 13px 30px; }

.hero { padding: 72px 0 48px; border-bottom: 1px solid var(--rule); }


/* ── Dashboard ──────────────────────────────────────────────────────────────── */
.dashboard-page { padding: 60px 0; }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 40px; }
.dashboard-header h1 { font-family: var(--display); font-size: 36px; text-wrap: balance; }
.account-status,
.checkout-confirmation,
.account-gate { min-height: 24px; color: var(--gray); }
.account-status.is-error,
.checkout-confirmation.is-error,
.account-gate.is-error { color: var(--danger); }
.account-status { display: grid; gap: 10px; margin-top: 10px; }
.account-status-message,
.checkout-confirmation-message,
.account-gate-message,
.account-gate-detail { margin: 0; }
.checkout-confirmation { display: grid; gap: 10px; margin-top: 10px; }
.credits-display { font-size: 14px; color: var(--gray); margin-top: 4px; }

.upload-page { padding: 60px 0; }
.upload-page h1 { font-family: var(--display); font-size: 36px; margin-bottom: 8px; text-wrap: balance; }
.upload-sub { color: var(--gray); font-size: 14px; margin-bottom: 36px; }
.account-gate { display: grid; gap: 10px; margin-bottom: 24px; }

.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed rgba(31,42,68,.2); border-radius: var(--radius);
  background: rgba(242,233,216,.3); padding: 60px 40px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .18s cubic-bezier(.34,1.4,.64,1), box-shadow .2s;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--teal); background: var(--teal-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(40,106,103,.12); }
.drop-zone.is-dropped { animation: dropReceived .42s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes dropReceived { 0% { transform: scale(1); } 45% { transform: scale(1.015); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .drop-zone:hover, .drop-zone.drag-over { transform: none; box-shadow: none; } .drop-zone.is-dropped { animation: none; } }
.drop-icon { font-size: 36px; margin-bottom: 12px; color: var(--teal); }
.drop-text { font-size: 15px; color: var(--indigo); margin-bottom: 6px; }
.drop-link { color: var(--teal); text-decoration: underline; }
.drop-note { font-size: 12px; color: var(--gray); }

.upload-options { margin-top: 24px; }
.selected-file { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--indigo); margin-bottom: 16px; padding: 10px 14px; background: var(--parchment); border-radius: var(--radius); animation: selectedFileIn .38s cubic-bezier(.16,1,.3,1) both; }
.selected-file-icon { flex-shrink: 0; font-size: 20px; }
.selected-file-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.selected-file-meta { flex-shrink: 0; color: var(--gray); font-size: 12px; }
.upload-preview { margin-bottom: 16px; border: 1px solid rgba(31,42,68,.1); border-radius: var(--radius); overflow: hidden; background: var(--parchment); animation: selectedFileIn .38s cubic-bezier(.16,1,.3,1) .06s both; }
.upload-preview img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
@keyframes selectedFileIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .selected-file, .upload-preview { animation: none; } }
.upload-paste-hint { margin-top: 8px; font-size: 12px; color: var(--gray); text-align: center; }
.upload-paste-hint kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); font-size: 11px; font-weight: 600; }
.upload-progress { height: 3px; margin-top: 12px; border-radius: 99px; background: rgba(31,42,68,.08); overflow: hidden; }
.upload-progress-bar { height: 100%; width: 0; border-radius: inherit; background: var(--teal); transition: width .2s ease; }
.upload-progress[hidden] { display: none; }
.upload-context { margin-bottom: 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--parchment); }
.upload-context-summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--gray); user-select: none; min-height: 44px; }
.upload-context-summary::-webkit-details-marker { display: none; }
.upload-context-summary::before { content: "\203A"; display: inline-block; font-size: 16px; line-height: 1; transition: transform .15s ease; }
.upload-context[open] .upload-context-summary::before { transform: rotate(90deg); }
.upload-context-body { padding: 0 14px 12px; }
.upload-context-body .option-row--context { margin-bottom: 6px; }
.upload-context-body input[type="text"] { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 14px; }
.upload-context-optional { color: var(--muted); font-weight: 400; }
.upload-context-help { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.upload-actions { margin-top: 24px; display: flex; align-items: center; gap: 16px; }
.upload-result { min-height: 24px; margin-top: 16px; color: var(--gray); }
.upload-result.is-error { color: var(--danger); }
.upload-actions button[disabled] { cursor: wait; opacity: .7; }

/* ── Job page ───────────────────────────────────────────────────────────────── */
.job-page { padding: 60px 0; }
.back-link { font-size: 13px; color: var(--gray); display: inline-block; margin-bottom: 20px; }
.back-link:hover { color: var(--teal); }
.job-page h1 { font-family: var(--display); font-size: 32px; margin-bottom: 32px; text-wrap: balance; }
.job-progress[hidden] { display: none; }
.job-progress-bar { height: 100%; width: 0; border-radius: inherit; background: var(--teal); transition: width .35s ease; }
.job-complete-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 24px; border: 1px solid rgba(138,90,24,.18); border-radius: var(--radius); background: linear-gradient(135deg, var(--surface) 0%, #fdf6e3 100%); animation: jobReveal .45s cubic-bezier(.16,1,.3,1) both; }
.job-complete-mark { flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: var(--surface); font-size: 18px; line-height: 1; }
.job-complete-text { min-width: 0; }
.job-complete-title { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--ink); }
.job-complete-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
@keyframes jobReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes jobMarkPop { 0% { transform: scale(.72); } 55% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: no-preference) { .job-complete-mark { animation: jobMarkPop .42s cubic-bezier(.34,1.56,.64,1) .12s both; } }

/* ── Destructive actions ────────────────────────────────────────────────────── */
/* A quiet trash icon-button: subdued until intent, danger-tinted on hover/focus.
   A 44px box meets the minimum accessible touch target and keeps it aligned in
   job actions and dashboard rows. */
.job-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.job-actions-primary,
.job-action-group { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.job-recovery { display: grid; gap: 10px; margin-bottom: 24px; }
.job-recovery-message,
.job-recovery-balance,
.job-feedback,
.job-attribution { margin: 0; }
.job-recovery-message,
.job-recovery-balance,
.job-attribution,
#job-feedback { color: var(--gray); }
.job-recovery-message.is-error,
#job-feedback.is-error { color: var(--danger); }
.job-recovery-list { margin: 0; padding-left: 22px; color: var(--indigo); }
.job-recovery-list li { margin-bottom: 6px; }
.job-attribution { font-size: 14px; max-width: 42rem; }
.btn-copy { position: relative; }
.copy-key-hint { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; margin-left: 8px; padding: 1px 5px; border: 1px solid rgba(31,42,68,.18); border-radius: 4px; background: var(--surface); font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.btn-copy.is-copied { border-color: var(--teal); background: var(--teal-light); color: var(--teal); }
.btn-copy.is-copied .copy-key-hint { border-color: var(--teal); background: var(--surface); color: var(--teal); }
@media (prefers-reduced-motion: no-preference) { .btn-copy.is-copied { animation: copyPop .32s cubic-bezier(.34,1.56,.64,1) both; } }
@keyframes copyPop { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
.btn-icon-danger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; flex: 0 0 auto;
  font-size: 16px; line-height: 1;
  background: transparent; color: var(--gray);
  border: 1px solid rgba(31,42,68,.14); border-radius: var(--radius);
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.btn-icon-danger:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }
.btn-icon-danger[disabled], .btn-icon-danger[aria-busy="true"] { opacity: .5; cursor: default; }

/* Account deletion: a visually subordinate, clearly destructive section set
   apart from the primary dashboard content. */
.account-danger {
  margin-top: 48px; padding: 20px;
  border: 1px solid rgba(162,59,59,.3); border-radius: var(--radius);
  background: rgba(162,59,59,.04);
}
.account-danger-title { font-size: 15px; font-weight: 600; color: var(--danger); margin: 0 0 6px; }
.account-danger-desc { font-size: 13px; color: var(--gray); max-width: 60ch; margin: 0 0 14px; }
.btn-account-delete {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  font-size: 14px; font-weight: 600; line-height: 1;
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger); border-radius: var(--radius);
  cursor: pointer; transition: color .15s, background .15s;
}
.btn-account-delete:hover { color: var(--white); background: var(--danger); }
.btn-account-delete:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }
.btn-account-delete[disabled], .btn-account-delete[aria-busy="true"] { opacity: .5; cursor: default; }

/* Dashboard page top-up dialog. */
.top-up-pages-trigger { margin-top: 10px; color: var(--ink); border: 1px solid var(--rule); background: transparent; }
.top-up-pages-dialog {
  width: min(calc(100% - 32px), 520px);
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 20px 60px rgb(28 32 48 / 22%);
}
.top-up-pages-dialog::backdrop { background: rgb(28 32 48 / 52%); }
.top-up-pages-surface { position: relative; display: grid; gap: 12px; padding: 32px; }
.top-up-pages-close {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--rule); border-radius: 6px;
  color: var(--muted); background: transparent; cursor: pointer;
}
.top-up-pages-kicker { margin: 0; color: var(--ochre); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.top-up-pages-dialog h2 { margin: 0; padding-right: 32px; font-family: var(--display); font-size: 36px; line-height: 1.05; }
.top-up-pages-dialog p { margin: 0; }
.top-up-pages-label { margin-top: 8px; font-size: 14px; font-weight: 600; }
.top-up-pages-select { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); background: var(--surface); }
.top-up-pages-selection { color: var(--muted); font-size: 14px; }
.top-up-pages-dialog .checkout-status { min-height: 24px; margin-top: 0; }
.top-up-pages-dialog .checkout-status.is-error { color: var(--danger); }
#top-up-pages-checkout { width: 100%; }
.top-up-pages-link, .top-up-pages-cancel { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--teal); background: transparent; border: 0; cursor: pointer; font-size: 14px; }
.top-up-pages-link { text-decoration: underline; }
.top-up-pages-cancel { color: var(--muted); }

/* Dashboard job rows (rendered by app.js). */
.job-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--white); border: 1px solid rgba(31,42,68,.1);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.job-row-link { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.job-row-name { font-weight: 600; color: var(--indigo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row-meta { font-size: 13px; color: var(--gray); text-transform: capitalize; overflow-wrap: anywhere; }
.job-status-line { padding: 8px 0; color: var(--gray); text-transform: capitalize; }
.job-status-note { margin: 4px 0; color: var(--gray); }
.job-status-note.is-error { color: var(--danger); }
.job-failed-pages { margin: 4px 0 0; padding-left: 20px; color: var(--danger); }
.list-message.is-error { color: var(--danger); }
.dashboard-empty-actions { margin-top: 12px; }
.job-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.job-result-pane { min-width: 0; }
.job-result-pane h2 { font-size: 16px; margin-bottom: 12px; }
.job-original-frame { display: grid; min-height: 280px; place-items: center; padding: 12px; border: 1px solid rgba(31,42,68,.1); background: var(--parchment); }
.job-original-image { display: block; width: 100%; max-height: 560px; object-fit: contain; }
.job-transcript { max-height: 560px; margin: 0; overflow: auto; padding: 20px 18px; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); line-height: 1.65; }
.job-transcript p { margin: 0 0 10px; line-height: 1.65; }
.job-transcript p:last-child { margin-bottom: 0; }
.job-transcript h1, .job-transcript h2, .job-transcript h3 { margin: 16px 0 8px; font-family: var(--display); line-height: 1.3; }
.job-transcript h1 { font-size: 20px; }
.job-transcript h2 { font-size: 17px; }
.job-transcript h3 { font-size: 15px; }
.job-transcript h1:first-child, .job-transcript h2:first-child, .job-transcript h3:first-child { margin-top: 0; }
.job-transcript ul, .job-transcript ol { margin: 0 0 10px 20px; padding: 0; }
.job-transcript li { margin-bottom: 4px; line-height: 1.5; }
.job-transcript table { width: 100%; margin-bottom: 10px; border-collapse: collapse; font-size: 14px; }
.job-transcript th, .job-transcript td { padding: 6px 8px; border: 1px solid var(--rule); text-align: left; }
.job-transcript th { background: var(--parchment); font-weight: 600; }
.job-transcript hr { margin: 14px 0; border: 0; border-top: 1px solid var(--rule); }
.job-transcript-toc { margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--parchment); }
.job-transcript-toc-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.job-transcript-toc-item a { color: var(--teal); font-size: 13px; text-decoration: none; }
.job-transcript-toc-item a:hover { text-decoration: underline; }
.job-transcript-toc-item.toc-level-2 { padding-left: 14px; }
.job-transcript-toc-item.toc-level-3 { padding-left: 28px; }
.job-transcript-empty { color: var(--muted); font-style: italic; }
.job-transcript:focus-visible { outline: 2px solid var(--ochre); outline-offset: -2px; }
.verified-page { margin-top: 20px; padding: 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.verified-page:first-child { margin-top: 0; }
.verified-page-label { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.verified-page-frame { display: grid; place-items: center; padding: 8px; margin-bottom: 12px; border: 1px solid var(--rule); background: var(--parchment); border-radius: var(--radius); }
.verified-page-image { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.verified-page .job-transcript { max-height: none; }
.job-result-message { color: var(--gray); }
/* Screen-reader-only utilities keep native controls keyboard-accessible. */
.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Transient deletion feedback. role is set per message (status vs alert). */
.delete-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: 90vw; padding: 12px 18px; border-radius: var(--radius);
  background: var(--indigo); color: var(--parchment);
  box-shadow: var(--shadow-md); font-size: 14px; z-index: 200;
}
.delete-toast.is-error { background: var(--danger); color: var(--white); }

/* ── Auth / Sign-in prompt ──────────────────────────────────────────────────── */
.signin-prompt { padding: 100px 0; text-align: center; }
.signin-prompt h2 { font-family: var(--display); font-size: 32px; margin-bottom: 12px; text-wrap: balance; }
.signin-prompt p { color: var(--gray); margin-bottom: 28px; }
.signin-prompt .auth-error { color: var(--danger); }

@media (max-width: 639px) {
  .top-up-pages-dialog { width: calc(100% - 24px); max-height: calc(100vh - 24px); }
  .top-up-pages-surface { padding: 28px 20px 20px; }
  .top-up-pages-dialog h2 { font-size: 30px; }
}

/* ── Spinner ────────────────────────────────────────────────────────────────── */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(15,111,122,.2); border-top-color: var(--teal); border-radius: 50%; animation: spin .6s linear infinite; }
.spinner[hidden] { display: none; }
.spinner-wrap { padding: 40px; text-align: center; color: var(--gray); }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Policy pages (Terms / Privacy) ─────────────────────────────────────────── */
.policy-page { padding: 56px 0 24px; }
.policy-prose h1 { font-family: var(--display); font-size: 34px; margin-bottom: 8px; text-wrap: balance; }
.policy-prose h2 { font-family: var(--display); font-size: 22px; margin: 32px 0 10px; text-wrap: balance; }
.policy-prose p { color: var(--indigo); margin-bottom: 14px; }
.policy-prose ul { margin: 0 0 14px; padding-left: 22px; list-style: disc; }
.policy-prose li { margin-bottom: 8px; }
.policy-meta { color: var(--gray); font-size: 15px; margin-bottom: 8px; }
.policy-footnote { color: var(--gray); font-size: 14px; margin-top: 32px; }
.policy-prose a { color: var(--teal); text-decoration: underline; }

/* ── Pricing ─────────────────────────────────────────────────────────────── */
.pricing-page { padding: 72px 0; }
.pricing-header { max-width: 680px; margin-bottom: 40px; }
.pricing-header h1 { margin: 0; font-family: var(--display); font-size: 56px; line-height: 1.05; text-wrap: balance; }
.pricing-trust { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.pricing-package { position: relative; display: grid; grid-template-rows: auto auto auto auto auto auto auto auto 1fr auto; min-width: 0; padding: 24px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.pricing-package--entry { border-width: 2px; }
.pricing-package--featured { border: 2px solid var(--ochre); box-shadow: 0 4px 24px rgba(138, 90, 24, .12); }
.pricing-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 999px; background: var(--ochre); color: var(--surface); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.pricing-price { margin: 16px 0 0; font-family: var(--display); font-size: 38px; }
.pricing-pages, .pricing-unit { color: var(--muted); }
.pricing-savings { display: inline-block; margin: 6px 0 0; padding: 2px 8px; border-radius: 999px; background: var(--teal-light); color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.pricing-starter-kicker { display: inline-block; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: var(--parchment); color: var(--ochre); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.pricing-starter-assurance { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pricing-guarantee { margin: 10px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.45; letter-spacing: .015em; }
.pricing-package .btn { align-self: end; width: 100%; }
.checkout-status { min-height: 28px; margin-top: 16px; color: var(--muted); }
.checkout-status.is-error { color: var(--danger); }
.pricing-checkout-trust { margin: 20px 0 0; color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.pricing-faq { max-width: 740px; margin-top: 48px; padding: 24px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.pricing-faq h2 { margin: 0 0 20px; font-family: var(--display); font-size: 24px; text-wrap: balance; }
.pricing-faq dl { margin: 0; display: grid; gap: 20px; }
.pricing-faq dl div { min-width: 0; }
.pricing-faq dt { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.pricing-faq dd { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.waitlist-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; max-width: 920px; margin-top: 28px; padding: 24px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.waitlist-copy h2 { margin: 0 0 8px; font-family: var(--display); font-size: 30px; text-wrap: balance; }
.waitlist-copy p { margin: 0; color: var(--muted); }
.waitlist-form { min-width: 0; }
.waitlist-form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.waitlist-field { min-width: 0; }
.waitlist-field label { display: inline-block; margin-bottom: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.waitlist-field input { width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); background: var(--surface); }
.waitlist-privacy { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.waitlist-status { min-height: 24px; margin-top: 10px; }
.waitlist-status-message { margin: 0; font-size: 14px; }
.waitlist-status-message--success { color: var(--teal); }
.waitlist-status-message--error { color: var(--danger); }
@media (max-width: 959px) { .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .pricing-page { padding: 48px 0; }
  .pricing-header h1 { font-size: 42px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .waitlist-panel { grid-template-columns: 1fr; }
  .waitlist-form-row { grid-template-columns: 1fr; }
  .waitlist-form-row .btn { width: 100%; }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container, .container.narrow { padding: 0 20px; }
}

/* ── Public landing: Task 4 evidence-led narrative ───────────────────────── */
.public-container { width: min(100% - 40px, 1200px); margin-inline: auto; }
.hero { padding: 72px 0 48px; border-bottom: 1px solid var(--rule); background: none; }
.hero-copy { max-width: 760px; }
.eyebrow { margin: 0 0 12px; color: var(--ochre); font-weight: 700; text-transform: uppercase; }
.hero h1, .public-section h2, .final-cta h2 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: 0; text-wrap: balance; }
.hero h1 { max-width: 720px; font-size: 64px; line-height: 1.02; color: var(--ink); }
.hero-summary { max-width: 660px; margin: 24px 0; font-size: 21px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .btn-outline { color: var(--ink); border-color: var(--rule); }
.hero-trust { max-width: 660px; margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.hero-trust a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.public-section { padding: 72px 0; border-bottom: 1px solid var(--rule); }
.public-section h3 { margin: 0 0 8px; font-family: var(--display); font-size: 24px; }
.public-section p { margin: 0 0 16px; color: var(--muted); }

.proof-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--rule); background: var(--surface); }
.proof-source, .proof-output { min-width: 0; padding: 24px; }
.proof-source { border-right: 1px solid var(--rule); }
.proof-source img { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background: #eee8dc; }
.proof-transcription { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--display); font-size: 18px; color: var(--ink); }
.proof-engine { max-width: 760px; margin: 0 0 32px; }
.proof-engine-label { margin-bottom: 10px; color: var(--ochre); font-weight: 700; text-transform: uppercase; }

.testimonial-grid, .workflow-list, .best-fit-grid, .capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.testimonial { margin: 0; padding-left: 20px; border-left: 3px solid var(--ochre); }
.testimonial p { margin: 0 0 8px; color: var(--ink); }
.testimonial cite { color: var(--muted); font-style: normal; }

.workflow-list { list-style: none; padding: 0; margin: 0; }
.workflow-list li { padding: 18px; border: 1px solid var(--rule); background: var(--surface); }
.workflow-icon { display: inline-block; width: 24px; height: 24px; margin-bottom: 10px; color: var(--ochre); }
.workflow-list p { margin: 0; color: var(--ink); }

.best-fit-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.best-fit-grid article, .capability-grid article { padding: 18px; border: 1px solid var(--rule); background: var(--surface); }

.entry-offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
.entry-offer-copy p, .trust-copy p { max-width: 620px; }
.entry-offer-action { display: grid; gap: 12px; justify-items: start; }
.entry-offer-price { margin: 0; font-family: var(--display); font-size: 40px; line-height: 1.05; color: var(--ink); }
.trust-copy { display: grid; gap: 0; }
.trust-testimonials { margin-top: 24px; }

.final-cta { padding: 64px 0 48px; color: var(--surface); background: var(--masthead); }
.final-cta p { max-width: 620px; color: rgba(255, 253, 248, 0.88); }
.final-cta-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 20px; }
.final-cta-price { margin: 0; font-size: 15px; font-weight: 600; color: var(--surface); }
.final-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.final-cta-trust { max-width: 620px; margin: 14px 0 0; color: rgba(255, 253, 248, 0.62); font-size: 12px; line-height: 1.45; }

@media (max-width: 959px) {
  .hero h1 { font-size: 50px; }
  .testimonial-grid, .workflow-list, .capability-grid, .best-fit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .public-container { width: min(100% - 32px, 1200px); }
  .hero { padding-top: 48px; }
  .hero h1 { font-size: 42px; line-height: 1.05; }
  .hero-summary { font-size: 18px; }
  .hero-actions > * { width: 100%; }
  .public-section { padding: 48px 0; }
  .entry-offer { grid-template-columns: 1fr; }
  .proof-grid, .testimonial-grid, .workflow-list, .capability-grid, .best-fit-grid { grid-template-columns: 1fr; }
  .proof-source { border-right: 0; border-bottom: 1px solid var(--rule); }
  .job-result-grid { grid-template-columns: 1fr; }
  .dashboard-header { flex-direction: column; gap: 16px; }
  .dashboard-header .btn { width: 100%; }
  .job-row { grid-template-columns: minmax(0, 1fr); }
  .btn-icon-danger { justify-self: start; }
}
