/* =============================================================
   The Match — Editorial design system
   -------------------------------------------------------------
   Design intent:
     • A printed-magazine feel, not a SaaS dashboard.
     • Warm paper background (#F4EFE6) rather than cold #FFFFFF —
       reduces eye strain and signals "thoughtful" instead of
       "form to fill".
     • Fraunces (display) is doing the heavy lifting. Its
       optical-size axis lets the masthead lean hard into
       editorial drama while body-set Fraunces (when used)
       stays readable.
     • Spacing scale is 4px-based. All values reach the page
       through tokens so the rhythm stays consistent.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Paper — warm cream backgrounds */
  --paper:        #F4EFE6;
  --paper-soft:   #FAF6EE;
  --paper-deep:   #ECE5D6;
  --paper-card:   #FFFDF8;

  /* Ink — never pure black; we tint it warm so it sits on cream */
  --ink:          #1C1A16;
  --ink-soft:     #524E45;
  --ink-mute:     #8C8579;
  --ink-faint:    #B5AE9F;

  /* Editorial accents */
  --moss:         #3F5D3A;     /* strengths */
  --moss-deep:    #2A3F26;
  --moss-tint:    #DCE5D2;
  --moss-paper:   #EAEFE0;

  --rust:         #A8423A;     /* gaps */
  --rust-deep:    #7A2A24;
  --rust-tint:    #F1D9D3;
  --rust-paper:   #F5E2DC;

  --gold:         #A8843A;     /* emphasis */
  --gold-deep:    #6F541F;
  --gold-tint:    #F1E5C8;

  --rule:         #C7BDA8;
  --rule-soft:    #DDD3BD;
  --rule-strong:  #8C8579;

  /* Type */
  --font-display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing — 4px base */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;
  --s-32: 128px;

  /* Layout */
  --page-max: 1280px;
  --gutter:   clamp(20px, 5vw, 64px);

  /* Motion */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- RESET-LITE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/*
  HTML 的 `hidden` 屬性預設是 `display: none`，但會被任何顯式
  CSS display 規則（display: flex / grid 等）蓋掉。加上 !important
  確保 hidden 元素永遠是隱藏的。沒這條，verify-banner 和 topbar__auth
  就算 JS 設 hidden 還是會顯示出來。
*/
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  /*
    Subtle paper grain — two layered radial-gradients give the
    background some life without resorting to images. Browsers
    rasterise this once; cost is essentially free.
  */
  background:
    radial-gradient(circle at 18% 12%, rgba(168, 132, 58, 0.06), transparent 40%),
    radial-gradient(circle at 82% 78%, rgba(63, 93, 58, 0.05), transparent 45%),
    var(--paper);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
}
h1, h2, h3, h4, h5, h6, p, blockquote, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}
::selection {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- TOP BAR (auth state) ---------- */
.topbar {
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper-deep);
  padding: var(--s-3) var(--gutter);
  /*
    Sits above the masthead like a subscriber strip on a print
    paper — small but always visible, reminds you who you are.
  */
}
.topbar__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 14;
}
.brand-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--moss);
}
.topbar__auth {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 6px var(--s-3);
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-soft);
}
.user-chip__quota {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}
.user-chip__sep { color: var(--ink-faint); }
.user-chip__email {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip__plan {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold-deep);
  background: var(--gold-tint);
  padding: 2px 6px;
  border-radius: 2px;
}
.user-chip__plan[data-plan="pro"] {
  color: var(--paper);
  background: var(--moss);
}
.user-chip__plan[data-plan="admin"] {
  color: var(--paper);
  background: var(--ink);
}

/* ---------- JD LEGITIMACY CONCERNS BANNER ----------
   When Claude flags JD legitimacy issues (MLM / spam / 八大 etc.),
   we display this prominently and hide the regular score/strengths/
   gaps panels. Designed to feel like an editorial pull-quote
   ("note from the editor") rather than a system error. */
.concerns-banner {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--s-6);
  padding: var(--s-8) var(--s-10);
  background:
    repeating-linear-gradient(135deg,
      var(--rust-tint) 0 10px,
      var(--rust-paper) 10px 20px);
  border: 1.5px solid var(--rust);
  border-radius: 4px;
  margin-bottom: var(--s-16);
  position: relative;
  animation: fadeUp 600ms var(--ease-out) both;
}
.concerns-banner__icon {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  color: var(--rust-deep);
  align-self: start;
}
.concerns-banner__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--rust-deep);
  font-variation-settings: "opsz" 24;
  margin-bottom: var(--s-4);
}
.concerns-banner__comment {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: var(--s-5);
  font-variation-settings: "opsz" 14;
}
.concerns-banner__list {
  display: grid;
  gap: var(--s-2);
  padding-left: var(--s-5);
  margin-bottom: var(--s-5);
}
.concerns-banner__list li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  list-style: disc;
}
.concerns-banner__note {
  padding-top: var(--s-4);
  border-top: 1px dashed var(--rust);
  font-size: 13px;
  font-style: italic;
  color: var(--rust-deep);
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14;
}

/* ---------- VERIFY BANNER ---------- */
.verify-banner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-6);
  background: var(--gold-tint);
  border: 1px solid var(--gold);
  border-radius: 3px;
  margin-bottom: var(--s-10);
}
.verify-banner__icon {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold-deep);
  line-height: 1;
}
.verify-banner__text {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.verify-banner__text strong {
  color: var(--gold-deep);
  font-weight: 600;
}

/* ---------- MASTHEAD ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  padding: var(--s-10) var(--gutter) var(--s-12);
  position: relative;
}
.masthead::after {
  /* Hairline below the heavy rule — a double-rule effect from
     the printed-page tradition. */
  content: '';
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: -4px;
  height: 1px;
  background: var(--rule);
}
.masthead__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  text-align: center;
}
.masthead__strap {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-8);
}
.strap-rule {
  width: 32px;
  height: 1px;
  background: var(--rule-strong);
  display: inline-block;
}
.masthead__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(72px, 14vw, 200px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  font-variation-settings: "opsz" 144;
  color: var(--ink);
  margin: 0;
}
.title-line { display: inline-block; }
.title-line--ital {
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  color: var(--moss);
  /* The Match — italic word floats slightly higher, classic editorial display */
  position: relative;
  top: -0.04em;
}
.masthead__tag {
  max-width: 540px;
  margin: var(--s-8) auto 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.55;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 14;
}
/*
  Editorial 雜誌風的雙句結構：setup（痛點）/ payoff（解法）之間
  留一小口氣。直接用 HTML 的 <br><br> 處理 — 試過用 span block +
  CSS padding，但 <span> 在 <p> 內的 anonymous block formatting
  會把 padding/margin 全吃掉，不值得跟瀏覽器較勁。<br><br> 簡單、可靠、跨瀏覽器一致。
*/

/* ---------- PAGE WRAP ---------- */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--s-16) var(--gutter) var(--s-20);
}

/* ---------- SECTION HEADS — shared editorial pattern ---------- */
.section-head {
  margin-bottom: var(--s-10);
  border-top: 1px solid var(--rule);
  padding-top: var(--s-6);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--s-6);
  row-gap: var(--s-2);
  align-items: baseline;
}

/* ---- Collapsible section heads (findings--* sections) ---- */
.section-head--toggle {
  grid-template-columns: auto 1fr auto;   /* num · title/dek · chevron */
  cursor: pointer;
  transition: background 200ms var(--ease-out);
  margin-bottom: 0;                       /* body provides bottom space */
  padding-bottom: var(--s-4);
  user-select: none;
}
.section-head--toggle:hover {
  background: linear-gradient(to bottom, transparent, var(--paper-deep) 30%);
}
.section-head--toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}
.section-chevron {
  grid-row: 1 / span 2;
  grid-column: 3;
  align-self: center;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  color: var(--ink-mute);
  transition: transform 350ms var(--ease-out), color 200ms var(--ease-out);
  font-variation-settings: "opsz" 24;
}
.section-head--toggle:hover .section-chevron {
  color: var(--ink);
}
/* When expanded — chevron points up */
.findings:not([data-collapsed="true"]) .section-chevron {
  transform: rotate(180deg);
}

/* Count badge inside title */
.section-count {
  display: inline-block;
  margin-left: var(--s-3);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  vertical-align: middle;
  /* Subtle pill background */
  background: var(--paper-deep);
  padding: 3px 10px;
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
}
.section-count:empty {
  display: none;
}

/* Collapsible body —
   max-height transition for smooth open/close. 5000px is big enough
   for any realistic content; transition stays at ~400ms regardless. */
.findings__body {
  overflow: hidden;
  max-height: 5000px;
  opacity: 1;
  transition: max-height 450ms var(--ease-out), opacity 250ms var(--ease-out), margin 350ms var(--ease-out);
  margin-top: var(--s-6);
}
.findings[data-collapsed="true"] .findings__body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}
/* Reduce findings article margin when collapsed (tighter scan view) */
.findings[data-collapsed="true"] {
  margin-bottom: var(--s-3) !important;
}
.section-num {
  grid-row: 1 / span 2;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--gold-deep);
  font-variation-settings: "opsz" 14;
  padding-top: 6px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variation-settings: "opsz" 36;
}
.section-dek {
  grid-column: 2;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 14;
  max-width: 60ch;
}

/* ---------- INTAKE ---------- */
.intake { margin-bottom: var(--s-20); }

.intake__grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: var(--s-10);
  align-items: stretch;
}
.intake__spine {
  background: var(--rule);
  width: 1px;
}

.column__head {
  margin-bottom: var(--s-5);
}
.column__eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid currentColor;
  margin-bottom: var(--s-3);
}
.column__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-variation-settings: "opsz" 24;
}

.column__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.char-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.file-btn,
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border-radius: 2px;
  transition: background 200ms var(--ease-out), border-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.file-btn:hover,
.text-btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
/* Parsing in-progress state — shimmery to signal "wait" without
   stealing user focus. The file button is the only thing using
   this for now but it's a generic utility. */
.file-btn.is-busy {
  pointer-events: none;
  color: var(--ink-mute);
  border-color: var(--rule);
  background:
    linear-gradient(90deg, transparent 0%, var(--paper-deep) 40%, transparent 80%)
    var(--paper-soft);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.text-btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.text-btn--primary:hover {
  background: var(--moss-deep);
  border-color: var(--moss-deep);
}

.url-fetch {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1 1 320px;
  min-width: 0;
}
.url-fetch input {
  flex: 1;
  min-width: 0;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--rule-strong);
  border-right: none;
  background: var(--paper-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: 2px 0 0 2px;
  height: 32px;
}
.url-fetch input::placeholder { color: var(--ink-mute); font-family: var(--font-body); }
.url-fetch button {
  border-radius: 0 2px 2px 0;
  height: 32px;
}

/* URL hint — shows when user pastes a CloudFlare-blocked URL (104/1111).
   設計目的：把「抓取失敗」這個 negative outcome 改成「我們刻意不做」
   這個有觀點的設計選擇。Editorial 風的 framing 比 error toast 強。 */
.url-hint {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--s-3);
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--gold-tint);
  border-left: 3px solid var(--gold);
  border-radius: 0 3px 3px 0;
  animation: fadeUp 250ms var(--ease-out);
}
.url-hint__icon {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--gold-deep);
  line-height: 1.3;
}
.url-hint__text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  font-variation-settings: "opsz" 14;
}
.url-hint__text strong {
  font-style: normal;
  font-weight: 600;
  color: var(--gold-deep);
}

/* Manuscript — the textarea styled like a yellowed page */
.manuscript {
  width: 100%;
  min-height: 360px;
  padding: var(--s-6);
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  resize: vertical;
  font-variation-settings: "opsz" 14;
  box-shadow: 0 1px 0 var(--rule-soft);
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.manuscript:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 3px var(--moss-tint);
}
.manuscript::placeholder {
  color: var(--ink-mute);
  font-style: italic;
}

/* CTA bar */
.intake__cta {
  margin-top: var(--s-10);
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-6);
  justify-content: space-between;
}
.intake__hint {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  max-width: 40ch;
  font-variation-settings: "opsz" 14;
}

/* The primary CTA — designed to feel like a "next page" call in
   a magazine: heavy ink, generous padding, an arrow that nudges. */
.cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-10);
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 24;
  transition: transform 200ms var(--ease-out), background 200ms var(--ease-out);
}
.cta:hover {
  background: var(--moss-deep);
  transform: translateY(-1px);
}
.cta:active {
  transform: translateY(0);
}
.cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.cta__arrow {
  font-family: var(--font-display);
  transition: transform 250ms var(--ease-out);
}
.cta:hover .cta__arrow { transform: translateX(4px); }
.cta--secondary {
  background: var(--paper-card);
  color: var(--ink);
  border-color: var(--ink);
}
.cta--secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- LOADING ---------- */
.loading {
  padding: var(--s-20) 0;
  text-align: center;
}
.loading__mark {
  display: inline-flex;
  gap: 8px;
  margin-bottom: var(--s-6);
}
.loading__mark span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink);
  opacity: 0.2;
  animation: pulse 1.4s var(--ease-in-out) infinite;
}
.loading__mark span:nth-child(2) { animation-delay: 0.2s; }
.loading__mark span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
  0%, 60%, 100% { opacity: 0.2; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.25); }
}
.loading__text {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  color: var(--ink);
  font-variation-settings: "opsz" 24;
}
.loading__sub {
  margin-top: var(--s-2);
  font-size: 13px;
  color: var(--ink-mute);
  /* Tied to the JS subtitle rotation — smooth opacity swap */
  transition: opacity 200ms var(--ease-out);
}

/* ---------- REPORT ---------- */
.report > .cover { margin-bottom: var(--s-16); }
.report > .findings { margin-bottom: var(--s-16); }
.report { animation: fadeUp 600ms var(--ease-out) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* COVER — score spread */
.cover__spread {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1fr;
  gap: var(--s-12);
  align-items: center;
  padding: var(--s-10) 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.cover__score {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
}
.score-cap {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.score-num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(120px, 18vw, 240px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
  font-variant-numeric: tabular-nums;
}
/* Color-coded score band */
.score-band {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--moss);
  font-variation-settings: "opsz" 18;
  padding-top: var(--s-2);
}
.score-band[data-band="strong"]  { color: var(--moss); }
.score-band[data-band="good"]    { color: var(--moss); }
.score-band[data-band="partial"] { color: var(--gold-deep); }
.score-band[data-band="weak"]    { color: var(--rust); }

.cover__quote {
  position: relative;
  padding-left: var(--s-8);
}
.quote-mark {
  position: absolute;
  left: -6px;
  top: -24px;
  font-family: var(--font-display);
  font-size: 96px;
  line-height: 1;
  color: var(--gold);
  font-variation-settings: "opsz" 144;
}
.cover__quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.4;
  color: var(--ink);
  font-variation-settings: "opsz" 24;
  font-weight: 400;
}

/* FINDINGS — strengths / gaps lists */
.finding-list { display: grid; gap: var(--s-4); }

.finding-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--s-5);
  padding: var(--s-5) var(--s-6);
  border-radius: 3px;
  position: relative;
  border: 1px solid transparent;
}

.finding-item__num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  font-variation-settings: "opsz" 24;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.finding-item__body {
  display: grid;
  gap: var(--s-2);
}
.finding-item__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  font-variation-settings: "opsz" 18;
}
.finding-item__detail {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.finding-item__detail strong { color: var(--ink); font-weight: 600; }

.finding-item__meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-1);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.finding-item__meta strong {
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
}

/* Strength styling — moss green */
.findings--strengths .finding-item {
  background: var(--moss-paper);
  border-left: 3px solid var(--moss);
}
.findings--strengths .finding-item__num { color: var(--moss); }

/* Bonus strengths — gold accent. 用金色而非綠色，視覺上區分
   「JD 對應 = moss」與「JD 沒列但加分 = gold」兩種強項類型。 */
.findings--bonus .finding-item {
  background: var(--gold-tint);
  border-left: 3px solid var(--gold);
}
.findings--bonus .finding-item__num { color: var(--gold-deep); }
.findings--bonus .finding-item__title { color: var(--gold-deep); }

/* Gap styling — rust red, with severity pill */
.findings--gaps .finding-item {
  background: var(--rust-paper);
  border-left: 3px solid var(--rust);
}
.findings--gaps .finding-item__num { color: var(--rust); }

.severity-pill {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: var(--s-2);
}
.severity-pill[data-sev="critical"]    { background: var(--rust-deep); color: var(--paper); }
.severity-pill[data-sev="important"]   { background: var(--rust); color: var(--paper); }
.severity-pill[data-sev="nice-to-have"]{ background: var(--rust-tint); color: var(--rust-deep); }

/* REWRITE LIST — keyword / quantification */
.rewrite-list { display: grid; gap: var(--s-5); }

.rewrite-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s-5);
  align-items: stretch;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: var(--s-5) var(--s-6);
}
.rewrite-item__arrow {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--gold-deep);
  display: flex;
  align-items: center;
}
.rewrite-item__col {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.rewrite-item__label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.rewrite-item__col--before .rewrite-item__label { color: var(--rust); }
.rewrite-item__col--after  .rewrite-item__label { color: var(--moss); }

.rewrite-item__text {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
}
.rewrite-item__col--before .rewrite-item__text { color: var(--ink-soft); }
.rewrite-item__col--after  .rewrite-item__text { color: var(--ink); font-weight: 500; }

.rewrite-item__reason {
  grid-column: 1 / -1;
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--rule);
  font-size: 13px;
  font-style: italic;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14;
}

/* SELF-INTRO — pull-quote treatment */
.self-intro {
  background: var(--paper-card);
  border-left: 4px solid var(--gold);
  padding: var(--s-8) var(--s-10);
  border-radius: 0 4px 4px 0;
  position: relative;
}
.self-intro p {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
  font-variation-settings: "opsz" 18;
}
/* Drop cap on the intro — adds magazine drama */
.self-intro p::first-letter {
  font-family: var(--font-display);
  font-size: 4em;
  font-weight: 500;
  float: left;
  line-height: 0.9;
  padding-right: 0.12em;
  padding-top: 0.05em;
  color: var(--gold-deep);
  font-variation-settings: "opsz" 144;
}
#copyIntro { margin-top: var(--s-4); }

/* Report footer */
.report-foot {
  margin-top: var(--s-16);
  padding-top: var(--s-8);
  border-top: 2px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
}
.report-foot__note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
}

/* ---------- COLOPHON ---------- */
.colophon {
  border-top: 1px solid var(--rule);
  padding: var(--s-6) var(--gutter);
  background: var(--paper-deep);
}
.colophon__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.colophon__rule {
  width: 24px;
  height: 1px;
  background: var(--rule-strong);
}

/* ---------- AUTH MODAL ---------- */
/*
  Design rationale for the modal:
    • Backdrop is warm cream + paper noise, not the typical
      "black with 50% opacity" SaaS look. Keeps the editorial
      feel even when the modal is up.
    • Card has the same paper texture as everything else, plus
      a subtle drop shadow so it floats.
    • The eyebrow "VIP Subscriber" leans into the magazine
      metaphor — signing up is becoming a subscriber.
*/
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
}
.auth-modal[hidden] { display: none; }

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(168, 132, 58, 0.15), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(63, 93, 58, 0.12), transparent 50%),
    rgba(244, 239, 230, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: backdropIn 250ms var(--ease-out);
}
@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-modal__card {
  position: relative;
  width: min(100%, 460px);
  max-height: calc(100vh - var(--s-10));
  overflow-y: auto;
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: var(--s-10) var(--s-10) var(--s-8);
  box-shadow: 0 20px 60px rgba(28, 26, 22, 0.18), 0 4px 12px rgba(28, 26, 22, 0.08);
  animation: cardIn 350ms var(--ease-out);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal__close {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--ink-mute);
  border-radius: 50%;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.auth-modal__close:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.auth-modal__head {
  text-align: center;
  margin-bottom: var(--s-6);
}
.auth-modal__eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid currentColor;
}
.auth-modal__title {
  margin-top: var(--s-4);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variation-settings: "opsz" 36;
}
.auth-modal__dek {
  margin-top: var(--s-3);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 14;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s-6);
}
.auth-tabs button {
  flex: 1;
  background: transparent;
  border: none;
  padding: var(--s-3) 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.auth-tabs button.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.auth-form {
  display: grid;
  gap: var(--s-5);
}
.auth-form[hidden] { display: none; }

.auth-form__intro {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 14;
  margin-bottom: var(--s-1);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.auth-field > span {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.auth-field input {
  padding: var(--s-3) var(--s-4);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 3px var(--moss-tint);
}
.auth-field__hint {
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: 2px;
}

.cta--full {
  width: 100%;
  justify-content: center;
  margin-top: var(--s-2);
}

.auth-form__alt {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.auth-form__sep { color: var(--ink-faint); margin: 0 var(--s-2); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--moss-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }

.auth-sent {
  text-align: center;
  padding: var(--s-4) 0;
}
.auth-sent[hidden] { display: none; }
.auth-sent__icon {
  font-size: 48px;
  color: var(--gold);
  margin-bottom: var(--s-3);
}
.auth-sent__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  font-variation-settings: "opsz" 24;
  margin-bottom: var(--s-3);
}
.auth-sent__body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: var(--s-6);
  max-width: 30ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: var(--s-8);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: var(--s-3) var(--s-6);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
  z-index: 100;
  box-shadow: 0 6px 24px rgba(28, 26, 22, 0.18);
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast--success { background: var(--moss-deep); }
.toast--error   { background: var(--rust-deep); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 880px) {
  .intake__grid {
    grid-template-columns: 1fr;
  }
  .intake__spine { display: none; }
  .cover__spread {
    grid-template-columns: 1fr;
    gap: var(--s-8);
  }
  .rewrite-item {
    grid-template-columns: 1fr;
    gap: var(--s-3);
  }
  .rewrite-item__arrow {
    transform: rotate(90deg);
    justify-content: flex-start;
    font-size: 22px;
  }
  .self-intro { padding: var(--s-6); }
}

@media (max-width: 600px) {
  .topbar__inner { flex-wrap: wrap; gap: var(--s-2); }
  .user-chip__email { max-width: 110px; font-size: 11px; }
  .user-chip__quota { font-size: 11px; }
}

@media (max-width: 480px) {
  .masthead { padding: var(--s-8) var(--s-5) var(--s-10); }
  .page { padding: var(--s-10) var(--s-5) var(--s-16); }
  .masthead__strap { font-size: 10px; gap: var(--s-2); flex-wrap: wrap; justify-content: center; }
  .strap-rule { width: 16px; }
  .cta { font-size: 17px; padding: var(--s-4) var(--s-6); }
  .manuscript { min-height: 280px; padding: var(--s-4); }
  .finding-item { padding: var(--s-4); grid-template-columns: 28px 1fr; gap: var(--s-3); }
  .finding-item__num { font-size: 22px; }
  .intake__cta { flex-direction: column; align-items: stretch; }
  .intake__cta .cta { justify-content: center; }
  .auth-modal__card { padding: var(--s-8) var(--s-5) var(--s-6); }
  .auth-modal__title { font-size: 28px; }
  .verify-banner { flex-direction: column; align-items: flex-start; padding: var(--s-4); }
  .concerns-banner { grid-template-columns: 1fr; padding: var(--s-5); gap: var(--s-3); }
  .concerns-banner__icon { font-size: 40px; }
}

/* ---------- PRINT ---------- */
@media print {
  body { background: white; }
  .intake, .colophon, .loading, .report-foot button { display: none !important; }
  .masthead { padding: var(--s-6); }
  .report { display: block !important; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
