@charset "UTF-8";

:root {
  --bg: #f7f6f2;
  --paper: #fbfcff;
  --ink: #1d2a40;
  --muted: #53627a;
  --line: #dde3ef;
  --pale: #edf1f8;
  --navy: #111827;
  --inverse: #f7f8fc;
  --coral: #ff937e;
  --accent: #c45d3c;
  --accent-dark: #973d31;
  --dark-surface: radial-gradient(ellipse at 76% 42%, #343246 0%, transparent 51%),
    linear-gradient(146deg, var(--navy) 26%, #1c283f 100%);
  --sans: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 12px 38px #11182713;
}

/* Base and accessibility */
* { box-sizing: border-box }
html { scroll-behavior: smooth }
[id] { scroll-margin-top: 12px }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

body > main, .home-view {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}

h1, h2, h3, p { margin: 0 }
button, input, textarea, select { font: inherit }
a, button, input, textarea, select {
  -webkit-tap-highlight-color: transparent;
  outline-offset: 5px;
}
a { color: inherit; text-decoration: none }
button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
button:disabled { cursor: not-allowed }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
}
[hidden] { display: none !important }

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  z-index: 99;
  top: -70px;
  left: 15px;
  padding: 10px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { top: 10px }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(1140px, calc(100% - 80px));
  margin-inline: auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 1.65px;
  line-height: 1.7;
}
.eyebrow:lang(zh-CN) { letter-spacing: 1.7px }

.character-count {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.input-error {
  padding: 0 0 14px;
  color: var(--accent-dark);
  font-size: 12px;
}

textarea {
  display: block;
  width: 100%;
  max-height: 300px;
  resize: vertical;
}

/* Header and navigation */
.site-header {
  border-bottom: 1px solid #30394c;
  background: var(--navy);
  color: var(--inverse);
}

.nav-shell {
  display: flex;
  align-items: center;
  gap: 64px;
  width: min(1140px, calc(100% - 80px));
  height: 64px;
  margin: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1;
}
.brand-dot { color: var(--coral) }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--coral);
  color: var(--navy);
}
.brand-mark svg {
  width: 27px;
  height: 27px;
  stroke-width: 1.6;
}
.brand-mark .play-fill { fill: currentColor; stroke: none }

.main-nav {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: 32px;
  height: 100%;
}
.nav-link {
  position: relative;
  padding: 8px 0;
  color: #bec8da;
  font-size: 13px;
}
.nav-link.active { color: var(--inverse) }
.nav-link:hover { color: var(--coral) }
.nav-link.active::after {
  position: absolute;
  right: 0;
  bottom: -17px;
  left: 0;
  height: 2px;
  background: var(--coral);
  content: "";
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 23px;
  margin-left: auto;
  font-size: 13px;
}

.icon-text {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.icon-text svg { width: 17px; height: 17px }
.nav-divider {
  width: 1px;
  height: 17px;
  background: #4d5970;
}
.history-count {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #333e55;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}
.site-feedback-trigger {
  flex: none;
  justify-content: center;
  white-space: nowrap;
}
.site-feedback-trigger:hover { color: var(--coral) }
.site-feedback-trigger:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

.language-control { position: relative; z-index: 5 }
.language-control summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.language-control summary::-webkit-details-marker { display: none }
.language-control summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.language-control :is(summary, a):hover { color: var(--coral) }
.language-control summary > span > svg { width: 17px; height: 17px }
.language-control .language-chevron { width: 12px; height: 12px; transition: transform .15s }
.language-control[open] .language-chevron { transform: rotate(180deg) }
.language-control nav {
  position: absolute;
  z-index: 3;
  inset-inline-end: 0;
  min-width: 152px;
  padding: 7px 13px;
  border: 1px solid #4d5970;
  border-radius: 8px;
  background: #222c40;
  box-shadow: var(--shadow);
  color: var(--inverse);
}
.language-control nav a { display: block; padding: 7px 0 }
.language-control [aria-current] { font-weight: 700 }
.language-control nav a[aria-current=page]::after { content: "✓"; float: right; color: var(--coral) }

/* Homepage */
.home-hero {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  background: var(--dark-surface);
  color: var(--inverse);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(34px, 6vw, 90px);
  padding: 35px 0 38px;
}
.hero-content { min-width: 0 }
.hero-content h1 {
  margin-bottom: 15px;
  font: 750 clamp(38px, 4.05vw, 60px)/1.12 var(--sans);
  letter-spacing: -.042em;
}
.hero-content h1:lang(zh-CN) {
  line-height: 1.25;
  letter-spacing: -.035em;
}
.hero-content h1 span, .hero-content h1 em { display: block }
.hero-content h1 em { color: var(--coral); font: inherit }
.hero-copy {
  max-width: 56ch;
  color: #cfd7e6;
  font-size: 15px;
  line-height: 1.65;
}

.composer {
  margin-top: 22px;
  padding: 16px 16px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 32px #080c1745;
  transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within {
  border-color: #a4b8e0;
  box-shadow: 0 0 0 3px #9bb3eb40, 0 12px 32px #080c1745;
}
.composer-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}
.composer textarea {
  min-height: 86px;
  padding: 10px 12px;
  border: 1px solid #dfe5f1;
  border-radius: 8px;
  background: var(--pale);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
.composer textarea:focus { border-color: #566f9f }
.composer textarea:focus-visible { outline: 0 }
.composer textarea[aria-invalid=true] { border-color: var(--accent-dark) }
.composer textarea::placeholder { color: var(--muted) }

.name-field {
  margin: 8px 0 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.name-field label { color: var(--muted); font-size: 11px }
.name-field input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f5ef;
  font-size: 13px;
}

.composer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  padding-bottom: 8px;
}
.quiet-button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 12px;
}
.quiet-button svg { width: 14px; height: 14px }

.clue-exclusions {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}
.exclusion-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.exclusion-heading p { font-weight: 650 }
.exclusion-heading .text-button { min-height: 28px; font-size: inherit }
.exclusion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.exclusion-list li { min-width: 0; max-width: 100% }
.exclusion-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--pale);
  color: var(--ink);
  text-align: start;
  overflow-wrap: anywhere;
}
.exclusion-chip:hover { color: var(--accent-dark) }
.exclusion-chip [aria-hidden] { font-size: 16px; line-height: 1 }
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid #e1e6f0;
}
.composer-bottom p {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.composer-bottom p svg { width: 15px; height: 15px }
#query-privacy-note {
  padding-bottom: 12px;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.5;
}
.composer-footnote {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: #bfc9db;
  font-size: 10px;
}
.small-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b3c5e0;
}

.examples-section, .example-grid, .scene-tags, .case-flow, .platform-wall {
  display:flex; align-items:center; flex-wrap:wrap; gap:7px;
}
.examples-section { margin-top:16px }
.examples-section h2 { color:#d0d7e5; font-size:12px; font-weight:500 }
.example-card {
  padding:5px 11px; border:1px solid #526079; border-radius:20px; color:var(--inverse);
  background:#ffffff08; font-size:12px; line-height:1.4; white-space:nowrap;
}
.example-card:hover, .example-card[aria-pressed=true] { background:#344159; border-color:var(--coral) }
.section-heading { display:flex; align-items:baseline; gap:12px }
.scene-card {
  position:relative; justify-self:end; width:min(100%,420px); margin:0; overflow:hidden;
  background:var(--paper); color:var(--ink); border:1px solid #ffffff2b; border-radius:17px; box-shadow:0 20px 60px #070d1b55;
}
.scene-image { display:block; width:100%; height:clamp(112px,11vw,160px); object-fit:cover; object-position:center 16% }
.scene-badge { position:absolute; top:12px; left:14px; background:#111827e8; color:white; padding:3px 9px; border-radius:20px; font-size:11px }
.scene-caption { padding:16px 18px 14px }
.scene-clue { border-left:3px solid var(--coral); padding-left:11px }
.scene-clue small, .guide-next small { display:block; font-size:11px; font-weight:650; letter-spacing:.04em }
.scene-clue small { color:var(--muted) }
.scene-quote { margin-top:2px; font-size:14px; line-height:1.45 }
.scene-result { margin:15px 0 12px; padding-top:12px; border-top:1px solid var(--line) }
.scene-status { color:#365b52; font-size:11px; font-weight:700 }
.scene-result h2 { margin:4px 0 9px; font-size:clamp(19px,2vw,26px); line-height:1.13; letter-spacing:-.028em; text-wrap:balance }
.scene-tags span, .case-flow span { padding:3px 8px; border-radius:5px; background:var(--pale); color:var(--muted); font-size:11px; font-weight:600 }
.scene-match { display:flex; align-items:center; justify-content:space-between; padding:8px 11px; border-radius:7px; background:var(--navy); color:white; font-size:12px; font-weight:650 }
.scene-match:hover { background:#2c3d59 }
.scene-match svg { width:15px; height:15px; color:var(--coral) }
.home-resources { display:grid; gap:32px; padding-block:30px 42px }
.step-strip,.visual-grid,.check-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px }
.step-strip { list-style:none; padding:0; margin:0 }
.step-strip li { display:flex; align-items:center; gap:13px; padding:5px 12px 5px 0 }
.step-strip li+li { border-left:1px solid var(--line); padding-left:18px }
.step-strip b,.numbered>div::before { color:var(--accent-dark); font-size:12px; font-weight:750; font-variant-numeric:tabular-nums }
.step-strip h2,.visual-card h3 { font-size:16px; line-height:1.35 }
.step-strip p,.platform-band header p { margin-top:3px; color:var(--muted); font-size:13px }
.visual-card,.platform-band,.guide-section,.guide-toc { border:1px solid var(--line); border-radius:13px; background:var(--paper) }
.visual-card { padding:10px }
.visual-card h3 { padding:11px 6px 3px }
.miniature { min-height:88px; padding:12px; border-radius:8px; display:flex; justify-content:center; align-items:center; gap:8px; font-size:12px }
.title-diagram { background:#f6eae3; flex-direction:column }
.title-diagram s { color:#7c5a50 }
.title-diagram strong,.version-diagram>div { padding:4px 10px; border:1px solid #d8ded9; border-radius:6px; background:white }
.version-diagram { background:#e9edf7 }
.version-diagram>div { min-width:72px; transform:rotate(-4deg) }
.version-diagram>div+div { transform:rotate(4deg) }
.version-diagram :is(small,strong),.verify-diagram div>span { display:block }
.verify-diagram { background:#e6f1ea }
.verify-diagram div>span { color:#426455 }
.verify-seal { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:#d2e7dc; color:#226344 }
.platform-band { display:grid; grid-template-columns:minmax(145px,1fr) 3.8fr; align-items:center; gap:20px; padding:19px 22px }
.platform-band h2,.home-guides h2,.home-faq h2,.guide-toc h2 { font-size:19px; line-height:1.3; letter-spacing:-.022em }
.platform-wall { list-style:none; padding:0; margin:0 }
.platform-wall li { border-radius:6px; background:#eff5f1; padding:4px 8px; color:#294d3c; font-size:12px; font-weight:600 }
.platform-wall li:has(a) { padding:0; border:1px solid #c5ddd0 }
.platform-wall a { display:block; padding:4px 8px; border-radius:inherit }
.platform-wall a::after { content:" ↗"; font-size:10px; opacity:.65 }
.platform-wall a:is(:hover,:focus-visible), .all-guides:hover, .crumb a:hover { text-decoration:underline; text-underline-offset:3px }
.resources-pair { display:grid; grid-template-columns:1fr 1.16fr; gap:clamp(24px,5vw,70px) }
.home-faq h2 { margin-bottom:8px }
.home-faq details,.guide-question { padding:8px 0; border-bottom:1px solid var(--line); font-size:14px }
.home-faq summary,.guide-question summary { display:flex; align-items:center; justify-content:space-between; gap:12px; list-style:none; cursor:pointer; font-weight:600 }
.home-faq summary::after,.guide-question summary::after { content:"+"; color:var(--muted) }
.home-faq details[open] summary::after,.guide-question[open] summary::after { content:"−" }
.home-faq details p,.guide-question p { padding:7px 16px 0 0; color:var(--muted) }

.home-guides .section-heading { justify-content:space-between; flex-wrap:wrap; gap:4px 12px; margin-bottom:11px }
.all-guides { color:var(--accent-dark); font-size:13px; font-weight:600 }
.home-guides h2 { color: #17223a; font-size: 19px }
.home-guide-grid {
  display: grid;
  gap: 12px;
}
.home-guide-card {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #e0e3eb;
  border-radius: 9px;
  background: #fdfdff;
  transition: border-color .2s, background .2s;
}
.home-guide-card:hover { border-color: #8291af; background: #fff }
.home-guide-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 7px;
  background: #e9eef8;
  color: #3e537c;
}
.home-guide-icon svg, .home-guide-arrow svg { width: 16px; height: 16px }
.home-guide-arrow { color: #3e537c }
.home-guide-card strong {
  display: block;
  color: #1d2a40;
  font-size: 14px;
  line-height: 1.35;
}
.home-guide-card strong + span {
  display: block;
  margin-top: 3px;
  color: #53627a;
  font-size: 12px;
  line-height: 1.45;
}

/* Buttons */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 19px;
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid var(--coral);
  border-radius: 9px;
  background: var(--coral);
  color: #211a26;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  transition: background .2s, transform .2s;
}
.primary-button:hover { transform: translateY(-1px) }
.primary-button:hover:not(:disabled) { background: #ffad9f; border-color: #ffad9f }
.primary-button:disabled {
  color: #596476;
  background: #e5e9f0;
  border-color: #e5e9f0;
}
.primary-button svg { width: 17px; height: 17px }
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  transition: border-color .2s, background .2s;
}
.secondary-button:hover { border-color: #9faec8; background: var(--pale) }
.secondary-button svg, .text-button svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
}
.text-button:hover:not(:disabled) { text-decoration: underline }
.text-button:disabled { color: var(--muted); opacity: .7 }

/* Footer and privacy */
.guide-link, .footer-languages a, .footer-links button {
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.guide-link:hover, .footer-languages a:hover, .footer-links button:hover { color: var(--accent-dark) }
.site-footer {
  display: grid;
  gap: 8px;
  padding-block: 16px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer-links, .footer-languages {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
}
.footer-brand {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.025em;
}
.footer-languages [aria-current=page] { display: none }
.footer-coverage { margin-left: auto; color: var(--muted); font-size: 12px }
.privacy-section { font-size: .85rem }
.privacy-section summary {
  width: fit-content;
  font-size: 12px;
  cursor: pointer;
}
.privacy-section p { max-width: 72ch; line-height: 1.5 }
.privacy-section details[open] p { margin-block: .6em }
.privacy-section details > a {
  color: var(--accent-dark);
  text-decoration: underline;
  display: inline-block;
  margin-inline-end: .65rem;
}

/* Results and shared page headings */
.results-view, .searching-view { flex: 1 0 auto }
.results-hero, .guide-hero {
  background: var(--dark-surface);
  color: var(--inverse);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0;
  color: #d4def0;
  font-size: 13px;
  font-weight: 600;
}
.back-link:hover { color: var(--coral) }
.back-link svg { width: 16px; height: 16px }
.results-hero { padding-block: 20px 53px }
.result-heading {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-top: 12px;
}
.result-heading h1, .searching-content h1, .guide-hero h1 {
  font: 750 clamp(32px, 4vw, 54px)/1.16 var(--sans);
  letter-spacing: -.04em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.result-heading h1:focus, .searching-content h1:focus { outline: none }
.result-heading p, .reading-intro { color: #cfd7e6 }
.result-heading p {
  margin-top: 10px;
  font-size: 15px;
  max-width: 65ch;
  text-wrap: pretty;
}
.result-heading p:lang(zh) { max-width: 46em }
.result-heading p:empty { display: none }
.result-count {
  flex: none;
  margin: 0 0 2px auto;
  padding: 5px 10px;
  border: 1px solid #f3a99066;
  border-radius: 6px;
  background: #ff937e14;
  color: #ffb7aa;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.results-body {
  position: relative;
  margin-top: -24px;
  padding-bottom: 38px;
}
.results-layout {
  display: grid;
  grid-template-columns: minmax(215px, 275px) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}
.results-layout:has(.query-panel[hidden]) { grid-template-columns:minmax(0,860px); justify-content:center }
.query-panel, .candidate-card, .empty-state, .feedback-panel, .help-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 9px 24px #11182709;
}
.query-panel {
  position: sticky;
  top: 16px;
  padding: 17px;
  min-width: 0;
}
.query-panel-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.query-panel-top svg {
  width: 17px;
  height: 17px;
  color: #546990;
}
.query-panel h2, .candidate-detail h3 { font-size: 14px; font-weight: 700 }
#query-summary {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.query-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block: 11px;
}
.query-tags:empty { margin-block: 6px }
.query-tags span, .match-badge {
  padding: 3px 7px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.query-tags span {
  border-radius: 5px;
  background: var(--pale);
  color: #3e5279;
}
.query-panel .text-button { min-height: 40px }
#rail-excluded { margin-top: 12px; color: var(--muted); font-size: 12px }
#rail-excluded li { background: var(--pale); padding: 2px 6px; border-radius: 4px }
.result-content { min-width: 0 }
.candidate-card {
  --candidate-padding: clamp(15px, 2.2vw, 24px);
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.candidate-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 17px var(--candidate-padding) 0;
}
.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 650;
  background: #e1f2e7;
  color: #235c3a;
  border-radius: 20px;
}
.match-badge svg { width: 14px; height: 14px }
.match-badge.related { background: #ebedf2; color: #4e5970 }
.platform-pill { background: var(--ink); color: white; border-radius: 20px; padding: 2px 9px; font-size: 12px }
.candidate-main { padding: 18px var(--candidate-padding) }
.candidate-main:has(.candidate-poster) {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.candidate-poster {
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--pale);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px #11182714;
}
.candidate-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .2s;
}
a.candidate-poster:hover img { transform: scale(1.03) }
.candidate-top + .candidate-main { padding-top: 8px }
.candidate-main h2 {
  font-size: clamp(21px, 2.35vw, 30px);
  line-height: 1.2;
  letter-spacing: -.022em;
}
.candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.candidate-meta:empty { display: none }
.candidate-meta span + span::before { content: "·"; margin-right: 7px }
.original-title-note, .alias-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.candidate-detail { padding: 0 var(--candidate-padding) 16px }
.candidate-detail h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}
.candidate-detail h3 svg, .match-points svg, .uncertainty-note svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.match-points {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.match-points li, .uncertainty-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.match-points li svg, .uncertainty-note svg { margin-top: 3px; color: #546990 }
.uncertainty-note {
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--pale);
  color: #465674;
  font-size: 13px;
}
.match-points + .uncertainty-note { margin-top: 14px }
.candidate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px var(--candidate-padding);
  border-top: 1px solid var(--line);
}
.candidate-actions .primary-button { gap: 9px }
.source-details {
  padding: 10px var(--candidate-padding);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.source-details summary {
  width: fit-content;
  padding: 3px 0;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.source-details ul { padding-left: 1.25em; margin-block: 5px 10px }
.source-links {
  display: grid;
  gap: 4px;
  margin-block: 7px 5px;
}
.source-links > div { background: var(--pale); padding: 10px 12px; border-radius: 6px }
.source-links p { margin-top: 5px }
.source-links a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.candidate-reports {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-left: auto;
}
.candidate-reports .text-button { min-height: 32px; font-size: 11px; color: var(--muted) }
.feedback-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.feedback-panel p { font-size: 14px; font-weight: 650 }
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.feedback-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-size: 13px;
}
.feedback-button svg { width: 15px; height: 15px }
.feedback-button:hover, .feedback-button.selected { border-color: #a2afc7; background: var(--pale) }
.help-panel { margin-top: 12px; padding: 16px 20px; background: var(--navy); color: white }
.help-panel h3 { font-size: 15px }
.help-panel p, .result-bottom-note {
  margin-block: 6px 10px;
  font-size: 13px;
}
.help-panel p { color: #d5ddeb }
.result-bottom-note { color: var(--muted) }
.help-panel .secondary-button { background: var(--coral); border-color: var(--coral) }
.empty-state { padding: clamp(18px, 3.5vw, 38px); text-align: center }
.error-state { border-color: #edc4bb; background: #fffaf8 }
.empty-state h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25 }
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 13px;
  border-radius: 12px;
  background: var(--pale);
  color: #475d8a;
}
.empty-icon svg { width: 25px; height: 25px }
.empty-state > p {
  max-width: 53ch;
  margin: 10px auto 16px;
  color: var(--muted);
  font-size: 14px;
}
.empty-state :is(.primary-button, .secondary-button) { margin: 4px }
.detail-prompts {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 9px;
  margin: 14px auto;
  text-align: start;
}
.detail-prompt {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border-radius: 8px;
  background: var(--pale);
  color: var(--muted);
  font-size: 13px;
}
.detail-prompt > span { color: #546990; font-variant-numeric: tabular-nums }
.detail-prompt strong { display: block; color: var(--ink) }

/* Search progress */
.searching-view { background: var(--bg); color: var(--ink) }
.search-bar { background: var(--navy); color: var(--inverse) }
.search-bar .shell { display: flex; justify-content: space-between; align-items: center; gap: 12px }
.search-bar .shell > span { color: #ccd6e8; font-size: 12px }
.searching-shell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-block: 28px 40px;
}
.searching-content {
  width: min(100%, 540px);
  margin: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}
.searching-content h1 { font-size: clamp(24px, 2.55vw, 34px) }
.searching-content .eyebrow {
  justify-content: center;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 12px;
}
.search-clue {
  margin: 12px 0;
  padding: 8px 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--pale);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}
.search-animation {
  width: 48px;
  height: 48px;
  position: relative;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  color: var(--accent-dark);
  background: #fff0eb;
  border-radius: 50%;
}
.search-animation svg { width: 25px; height: 25px }
.search-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #ecc4b9;
  animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring { 75%, 100% { transform: scale(1.2); opacity: 0 } }
.progress-list {
  display: grid;
  width: 100%;
  list-style: none;
  margin: 15px auto;
  padding: 0;
  text-align: start;
  font-size: 14px;
  color: var(--muted);
}
.progress-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.progress-symbol {
  width: 16px;
  height: 16px;
  flex: none;
  border: 1px solid #647692;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
}
.progress-list .done .progress-symbol {
  color: #246440;
  background: #d9eee1;
  border-color: #a4ceb3;
}
.progress-list .done .progress-symbol::after { content: "✓" }
.progress-list .current .progress-symbol {
  border: 2px solid var(--coral);
  border-right-color: transparent;
  animation: orbit 1.4s linear infinite;
}
.progress-list .current { color: var(--ink); font-weight: 600 }
@keyframes orbit { to { transform: rotate(360deg) } }
.searching-content .secondary-button {
  color: var(--ink);
  border-color: var(--line);
  background: white;
}
.searching-content .secondary-button:hover { background: var(--pale) }
#verification:not(:empty), #result-verification:not(:empty) {
  background: var(--navy);
  padding: 8px;
  border-radius: 8px;
  width: min(100%, 340px);
  margin: 12px auto;
}
#verification { text-align: center }
#verification:empty { display: none }
#verification p {
  margin-bottom: 9px;
  color: var(--inverse);
  font-size: 13px;
}

/* Guides */
.guide-hero { padding:30px 0 36px }
.crumb { margin-bottom:12px; color:#d5deee; font-size:12px }
.crumb a { color:var(--coral) }
.guide-hero h1 { max-width:25ch; font-size:clamp(31px,3.3vw,45px) }
.reading-intro { max-width:74ch; margin-top:10px; font-size:16px }
.guide-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(190px,260px); gap:26px; padding-block:26px 40px; align-items:start }
.guide-section { margin-bottom:16px; padding:clamp(18px,2.2vw,30px); overflow-wrap:anywhere }
.guide-section h2 { margin:0 0 12px; font-size:clamp(19px,2vw,25px); letter-spacing:-.022em; line-height:1.3 }
.guide-section p { margin:8px 0; color:var(--muted); font-size:14px }
.guide-section a { color:var(--accent-dark); text-decoration:underline; text-underline-offset:3px }
.guide-article { min-width:0 }
.guide-table-wrap { max-width:100%; overflow-x:auto; margin:16px 0; border:1px solid var(--line); border-radius:8px }
.guide-table { width:100%; min-width:32rem; border-collapse:collapse; text-align:start; font-size:14px; line-height:1.55 }
.guide-table caption { padding:10px 14px; text-align:start; font-weight:650 }
.guide-table :is(th,td) { padding:10px 14px; border-bottom:1px solid var(--line); text-align:start; vertical-align:top }
.guide-table thead, .guide-table th[scope="row"] { background:var(--pale) }
.guide-table tbody tr:last-child > * { border-bottom:0 }
.guide-list, .guide-checklist { margin:12px 0; padding-inline-start:1.5em; font-size:14px; line-height:1.65; color:var(--muted) }
.guide-list strong, .guide-checklist strong { color:var(--ink) }
.guide-list li, .guide-checklist li { margin-block:6px; padding-inline-start:.2em }
ul.guide-checklist { list-style-type:square }
.guide-checklist li::marker { color:var(--accent-dark); font-weight:700 }
.guide-callout { margin:16px 0; padding:12px 16px; border-inline-start:4px solid var(--accent-dark); border-radius:4px; background:var(--pale) }
.guide-callout.caution { border-color:#9a5420; background:#fff0df }
.guide-callout > :first-child { margin-top:0 }
.guide-callout > :last-child { margin-bottom:0 }
.comparison,.guide-next { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px }
.comparison { margin:14px 0 }
.comparison>div,.check-grid>div { padding:13px 16px; border-radius:8px; background:#f9eee9 }
.comparison>div+div { background:#e9f3ed }
.comparison small { font-size:11px; font-weight:700 }
.comparison p,.check-grid p { margin:5px 0 0; line-height:1.55 }
.check-grid { gap:9px; counter-reset:guide-step }
.check-grid>div,.editions>div:first-child { background:var(--pale) }
.check-grid h3,.editions h3 { font-size:14px }
.numbered>div { counter-increment:guide-step }
.numbered>div::before { display:block; margin-bottom:5px; content:counter(guide-step,decimal-leading-zero) }
.case-flow { margin-bottom:12px }
.case-flow span { font-size:12px }
.case-flow span+span::before { content:"→"; margin-right:6px }
.case-title { font-size:20px }
.case-note,.keyword-line { display:block; padding:10px 13px; border-radius:7px; background:#fff0df }
.keyword-line { margin:12px 0; background:var(--navy); color:var(--inverse); white-space:normal }
.guide-toc { position:sticky; top:20px; padding:20px }
.guide-toc ol { padding-left:1.3em; color:var(--muted); margin:12px 0 16px; font-size:13px }
.guide-toc li { padding-block:3px }
.guide-toc a:hover { text-decoration:underline }
.guide-next a { display:grid; gap:5px; align-content:center; padding:15px 18px; border:1px solid var(--line); border-radius:10px; background:var(--paper) }
.guide-next a:first-child { background:var(--navy); color:white }
.guide-next a:first-child small { color:var(--coral) }
.guide-question { margin-top:12px }
.guide-question summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px }
.guide-hub { padding-block:24px 36px }
.hub-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); gap:12px }
.hub-cards .home-guide-card { grid-template-columns:minmax(0,1fr) auto; align-items:start; text-decoration:none }
.hub-cards .home-guide-arrow { align-self:center }
.hub-cta { grid-template-columns:1fr }
.hub-cta a:hover { background:#2c3d59 }

/* Dialogs and notifications */
.info-dialog {
  width: min(510px, calc(100vw - 32px));
  max-height: 85vh;
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 25px 70px #11182745;
}
.info-dialog::backdrop { background: #11182786; backdrop-filter: blur(4px) }
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--navy);
  color: white;
}
.dialog-top .icon-button { flex: none; color: white }
.dialog-top .eyebrow { color: var(--coral); font-size: 12px }
.icon-button {
  display: grid;
  place-items: center;
  min-width: 36px;
  min-height: 36px;
  color: var(--muted);
}
.info-dialog h2 { line-height: 1.23 }
.info-dialog > h2 { margin: 4px 0 12px; font-size: clamp(24px, 3vw, 31px) }
.dialog-top h2 { font-size: 22px }
.dialog-note { color: var(--muted); font-size: 14px }
#dialog-body, #site-feedback-form { padding: 20px }
#manual-copy { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 6px }
#site-feedback-form { display: grid; gap: 14px }
#site-feedback-form label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}
#site-feedback-form select, #site-feedback-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
#site-feedback-form textarea { min-height: 106px }
#site-feedback-form :is(select, textarea):focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px }
.feedback-message { display: grid; gap: 6px }
#site-feedback-count { justify-self: end; font-size: 12px }
.site-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.recent-item {
  display: block;
  width: 100%;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  text-align: start;
  overflow-wrap: anywhere;
}
.recent-item strong { display: block; font-size: 14px }
.recent-item span { color: var(--muted); font-size: 12px }
.history-clear { margin-top: 12px }
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--navy);
  color: var(--inverse);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: .2s;
}
.toast.visible { opacity: 1; transform: translate(-50%,0) }

/* Preview controls stay in document flow. */
.preview-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0 auto 28px;
  padding: 8px 10px 8px 14px;
  border-radius: 11px;
  background: #28332ff2;
  color: #edf0e7;
  box-shadow: 0 5px 20px #1e282420;
  font-size: 10px;
  backdrop-filter: blur(12px);
}
.preview-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bccda0;
}
.preview-controls label { color: #d0d8cd; white-space: nowrap }
.preview-controls select {
  max-width: 170px;
  padding: 6px 23px 6px 8px;
  border: 1px solid #667168;
  border-radius: 6px;
  background: #3d4843;
  color: #f6f7f2;
  font-size: 10px;
  cursor: pointer;
}

/* Responsive layout */
@media (max-width: 1150px) {
  .shell, .nav-shell { width: calc(100% - 64px) }
  .nav-shell { gap: 20px }
  .main-nav { gap: 16px }
  .nav-actions { gap: 12px }
  .optional { display: none }
}

@media (850px <= width <= 950px) {
  .nav-shell { width: calc(100% - 32px); gap: 12px }
  .main-nav { gap: 12px }
  .nav-actions { gap: 8px }
}

@media (width < 850px) {
  .nav-shell { gap: 30px }
  .main-nav { display: none }
  .nav-actions { gap: 15px }
}
@media (max-width: 850px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 650px;
    margin: auto;
    padding: 31px 0;
  }
  .hero-content h1 { font-size: clamp(35px, 6.2vw, 51px) }
  .scene-card { justify-self:stretch; width:100% }
  .platform-band,.guide-layout { grid-template-columns:1fr }
  .guide-toc { position:static; grid-row:1 }
  .guide-toc ol { display:flex; flex-wrap:wrap; gap:6px 22px; margin:6px 0 }
  .guide-toc .primary-button { display:none }

  .results-layout { grid-template-columns: 1fr; gap: 12px }
  .query-panel { position:static }
}

/* The feedback button needs more room than the preview and prelaunch headers. */
@media (max-width: 760px) {
  .nav-shell:has(.site-feedback-trigger:not([hidden])) { gap: 14px }
  .nav-actions:has(.site-feedback-trigger:not([hidden])) { gap: 10px }
  .nav-actions:has(.site-feedback-trigger:not([hidden])) :is(.history-label, .nav-divider) { display: none }
}

@media (max-width: 640px) {
  .nav-shell { gap: 14px }
  .history-label, .nav-actions .nav-divider { display: none }
  .site-feedback-trigger { min-width: 44px; min-height: 44px }
}

@media (max-width: 570px) {
  .candidate-main:has(.candidate-poster) { grid-template-columns: 56px minmax(0, 1fr); gap: 12px }
  .shell, .nav-shell { width: calc(100% - 40px) }
  .nav-shell { height: 60px; gap: 15px }
  .brand { gap: 8px; font-size: 24px }
  .brand-mark {
    width: 29px;
    height: 29px;
    border-radius: 8px;
  }
  .brand-mark svg { width: 24px; height: 24px }
  .nav-actions { gap: 12px }
  .language-control { font-size: 12px }
  .language-control summary { gap: 6px }

  .hero-grid { padding: 25px 0 26px }
  .hero-content h1 {
    margin-bottom: 11px;
    font-size: clamp(27px, 7.65vw, 38px);
  }
  .hero-copy { font-size: 13px; line-height: 1.6 }
  .composer { margin-top: 16px; padding: 13px 12px 0 }
  .composer textarea { font-size: 16px }
  .character-count { font-size: 9px }
  .composer-bottom { gap: 7px }
  .composer-bottom p { font-size: 10px }
  .composer .primary-button {
    gap: 8px;
    padding-inline: 10px;
    white-space: nowrap;
  }
  .composer-footnote { font-size: 9px; line-height: 1.6 }
  .example-card { font-size:11px; padding-inline:8px }
  .scene-image { height:108px }
  .scene-caption { padding:13px }
  .step-strip,.visual-grid,.resources-pair,.check-grid,.guide-next,.comparison,.detail-prompts { grid-template-columns:1fr }
  .step-strip { gap:10px }
  .step-strip li+li { border:0; padding-left:0 }
  .home-resources { gap:20px; padding-block:22px }
  .visual-card { display:grid; grid-template-columns:135px 1fr; align-items:center; gap:8px }
  .miniature { min-height:72px; font-size:10px; padding:7px }
  .version-diagram>div { min-width:0; padding:4px }
  .platform-band,.guide-toc { padding:14px }
  .guide-layout { gap:14px }
  .footer-coverage { margin-left:0; flex-basis:100% }
  .detail-prompt { flex-direction:row }
  .searching-content { padding:20px 15px }

  .primary-button { gap: 14px; padding-inline: 13px }
  .results-hero { padding-block: 13px 44px }
  .result-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
  }
  .result-heading h1, .searching-content h1, .guide-hero h1 { font-size: clamp(27px, 7.8vw, 40px) }
  .result-heading p { font-size: 14px }
  .result-count { margin: 0 }
  .results-body { margin-top: -20px; padding-bottom: 22px }
  .query-panel { padding: 12px 15px }
  .feedback-panel { flex-direction: column; align-items: flex-start }

  .eyebrow { letter-spacing: 1.1px }
  .searching-shell { padding-block: 9px 20px }
  .guide-hero { padding-block: 26px 30px }

  .preview-controls {
    gap: 7px;
    padding: 7px 8px 7px 11px;
    font-size: 9px;
  }
  .preview-controls select { max-width: 146px; font-size: 9px }
}

@media (max-width: 480px) {
  .nav-shell:has(.site-feedback-trigger:not([hidden])) { width: calc(100% - 20px); gap: 6px }
  .nav-shell:has(.site-feedback-trigger:not([hidden])) .brand { gap: 5px; font-size: 21px }
  .nav-actions:has(.site-feedback-trigger:not([hidden])) { gap: 6px }
  .language-control summary { gap:4px }
  .site-feedback-trigger { font-size: 12px }
}

@media (max-width: 360px) {
  .nav-shell { width: calc(100% - 20px); gap: 6px }
  .brand { gap: 5px; font-size: 21px }
  .nav-actions { gap: 6px }
  .nav-actions:has(.site-feedback-trigger:not([hidden])) .language-control summary > [data-icon="globe"] { display: flex }
  .nav-actions:has(.site-feedback-trigger:not([hidden])) #language-current { display: none }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
