:root {
  --paper: #f4ecdc;
  --paper-deep: #e9ddc7;
  --card: #fffdf8;
  --ink: #1d2f44;
  --navy: #173a63;
  --gold: #c9a45e;
  --gold-deep: #8a682e;
  --terracotta: #c76555;
  --sage: #739269;
  --muted: #6f746f;
  --line: rgba(29, 47, 68, .16);
  --shadow: 0 18px 60px rgba(54, 42, 25, .10);
  --serif: ui-serif, Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.65;
}
button, textarea { font: inherit; }
button { color: inherit; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 78px 24px 54px;
  background:
    radial-gradient(circle at 82% 22%, rgba(201, 164, 94, .32), transparent 28%),
    linear-gradient(135deg, #fffaf0 0%, #efe2ca 64%, #e2d1b2 100%);
  border-bottom: 1px solid rgba(23, 58, 99, .12);
}
.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -110px;
  bottom: -210px;
  border: 1px solid rgba(23, 58, 99, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(23, 58, 99, .035), 0 0 0 76px rgba(23, 58, 99, .025);
}
.hero__inner, .tabs__inner, main { width: min(1160px, 100%); margin: 0 auto; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font: 700 .75rem/1.2 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 650; letter-spacing: -.025em; }
h1 { max-width: 820px; margin: 0; font-size: clamp(2.35rem, 6vw, 4.85rem); line-height: 1.08; }
.hero__lead { max-width: 820px; margin: 24px 0 0; color: #4d5660; font-size: 1.05rem; }
.audit-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  max-width: 820px;
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid rgba(23, 58, 99, .12);
  border-radius: 18px;
  background: rgba(23, 58, 99, .12);
}
.audit-strip div { padding: 15px 18px; background: rgba(255, 253, 248, .74); backdrop-filter: blur(10px); }
.audit-strip strong { display: block; font: 650 1.55rem/1 var(--serif); color: var(--navy); }
.audit-strip span { display: block; margin-top: 5px; color: var(--muted); font-size: .78rem; }

.tabs { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(244, 236, 220, .9); backdrop-filter: blur(18px); }
.tabs__inner { display: flex; gap: 8px; padding: 10px 18px; }
.tabs a { padding: 8px 13px; border-radius: 999px; color: var(--navy); font-size: .86rem; font-weight: 650; text-decoration: none; }
.tabs a:hover { background: rgba(255, 255, 255, .66); }

.round-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, calc(100% - 36px));
  margin: 24px auto -34px;
  padding: 14px 17px;
  border: 1px solid rgba(115, 146, 105, .38);
  border-radius: 15px;
  background: rgba(255, 253, 248, .85);
}
.round-banner strong { display: block; font-family: var(--serif); }
.round-banner span { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; }
.round-banner a { flex: none; padding: 8px 12px; border-radius: 999px; color: white; background: var(--sage); font-size: .78rem; font-weight: 750; text-decoration: none; }

.section { padding: 72px 24px; scroll-margin-top: 62px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.16; }
.section-heading p:not(.eyebrow) { max-width: 710px; margin: 12px 0 0; color: var(--muted); }
.section-heading--compact { align-items: start; }

.progress-card { flex: 0 0 230px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 253, 248, .76); }
.progress-card__numbers { display: flex; align-items: baseline; gap: 6px; }
.progress-card strong { font: 650 1.8rem/1 var(--serif); color: var(--navy); }
.progress-card span { color: var(--muted); font-size: .82rem; }
.progress-track { height: 6px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: rgba(23, 58, 99, .1); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--terracotta)); transition: width .25s ease; }

.style-guide {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  margin: 0 0 18px;
  padding: 22px 24px;
  border: 1px solid rgba(23, 58, 99, .13);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,253,248,.92), rgba(232,219,193,.72));
}
.style-guide h3 { margin: 0; font-size: 1.35rem; }
.style-guide p:not(.eyebrow) { max-width: 700px; margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.family-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.family-actions button, .filter-bar button, .export-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  padding: 9px 14px;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.family-actions button:hover, .filter-bar button:hover, .export-actions button:hover { transform: translateY(-1px); border-color: var(--gold); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter-bar button { padding: 8px 13px; color: var(--muted); font-size: .82rem; }
.filter-bar button.is-active { border-color: var(--navy); color: white; background: var(--navy); }

.review-list { display: grid; gap: 22px; }
.review-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 12px 42px rgba(54, 42, 25, .065);
}
.review-card.is-complete { border-color: rgba(115, 146, 105, .62); }
.review-card.is-rejected { border-color: rgba(199, 101, 85, .68); }
.review-card__header { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.review-card__header h3 { margin: 3px 0 0; font-size: 1.45rem; }
.review-card__header p { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: .88rem; }
.scene-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.scene-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 99px; background: rgba(201,164,94,.17); color: var(--gold-deep); font-size: .69rem; font-weight: 700; letter-spacing: .05em; }
.scene-source { align-self: start; max-width: 290px; color: #81857f; font: .68rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }

.current-scene { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; padding: 18px 24px; background: #f8f3e9; }
.current-label { color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.current-preview { min-width: 0; }
.current-tool-card, .candidate-tool-card {
  width: 190px;
  min-height: 104px;
  padding: 13px 14px;
  border: 1px solid rgba(29,47,68,.15);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbf5e9, #fffdf8);
  box-shadow: 0 4px 12px rgba(54,42,25,.08);
}
.tool-card-icon { width: 34px; height: 34px; margin-bottom: 7px; font-size: 28px; line-height: 34px; }
.tool-card-name { font: 650 .95rem/1.25 var(--serif); }
.tool-card-tagline { margin-top: 3px; color: var(--muted); font-size: .67rem; }
.current-ui { display: inline-flex; align-items: center; min-height: 48px; padding: 9px 14px; border: 1px solid rgba(29,47,68,.13); border-radius: 12px; background: white; font-family: var(--serif); }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 22px 24px 14px; }
.choice { position: relative; display: block; min-width: 0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__surface { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; cursor: pointer; transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease; }
.choice__surface:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 10px 28px rgba(54,42,25,.10); }
.choice input:focus-visible + .choice__surface { outline: 3px solid rgba(23,58,99,.28); outline-offset: 2px; }
.choice input:checked + .choice__surface { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy), 0 12px 32px rgba(23,58,99,.12); }
.choice__art { display: grid; place-items: center; min-height: 202px; padding: 14px; overflow: hidden; background: #efe5d4; }
.choice__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.choice__footer strong { font-family: var(--serif); font-size: .94rem; }
.choice-letter { display: grid; flex: 0 0 auto; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--navy); background: rgba(23,58,99,.08); font-weight: 800; }
.choice input:checked + .choice__surface .choice-letter { color: white; background: var(--navy); }

.sheet-crop { width: 172px; height: 172px; border-radius: 18px; background-repeat: no-repeat; background-size: 500% auto; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.candidate-tool-card { width: 196px; background: rgba(255,253,248,.94); }
.candidate-tool-card .tool-card-icon { border-radius: 8px; background-repeat: no-repeat; background-size: 500% auto; }
.toolbox-art { display: grid; place-items: center; gap: 12px; }

.ui-stage { width: 100%; min-height: 150px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #fffaf0, #eee1ca); }
.ui-demo { display: inline-flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid rgba(29,47,68,.13); border-radius: 12px; color: var(--navy); background: #fffdf8; font: 650 .92rem/1 var(--serif); box-shadow: 0 5px 16px rgba(54,42,25,.08); }
.zi { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ui-demo--badge { border-color: rgba(201,164,94,.55); border-radius: 999px; color: #745623; background: #f7edd5; }
.ui-demo--rule { position: relative; padding-left: 38px; border: 0; box-shadow: none; background: transparent; }
.ui-demo--rule::before { content: ""; position: absolute; left: 3px; width: 26px; height: 2px; background: var(--gold); }
.dual-icons { gap: 4px; border-radius: 999px; }
.dual-icons .zi { padding: 5px; width: 30px; height: 30px; border-radius: 50%; background: rgba(23,58,99,.08); }
.theme-dial { position: relative; width: 44px; height: 44px; overflow: hidden; border: 2px solid var(--navy); border-radius: 50%; background: white; }
.theme-dial::before { content: ""; position: absolute; inset: 0 0 0 50%; background: var(--navy); }
.theme-dial::after { content: ""; position: absolute; inset: 8px; border: 1px solid var(--gold); border-radius: 50%; }
.moon-ring { width: 44px; height: 44px; border: 2px solid var(--navy); border-radius: 50%; box-shadow: inset 10px -2px 0 0 var(--gold); }
.route-node { display: inline-flex; align-items: center; gap: 0; }
.route-node i { width: 7px; height: 7px; border: 2px solid var(--navy); border-radius: 50%; }
.route-node b { width: 20px; height: 1px; background: var(--gold); }
.date-range { display: inline-flex; align-items: center; gap: 3px; }
.date-range i { width: 13px; height: 15px; border: 1.5px solid currentColor; border-radius: 3px; }
.date-range b { width: 16px; height: 1.5px; background: var(--gold); }

.calendar-demo { display: grid; grid-template-columns: repeat(3, 42px); gap: 7px; }
.cal-cell { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(29,47,68,.13); border-radius: 9px; background: white; font-size: .78rem; }
.cal-cell::before, .cal-cell::after { content: ""; position: absolute; width: 7px; height: 7px; }
.calendar-dots .cal-cell:nth-child(2)::before { top: 4px; left: 4px; border-radius: 50%; background: var(--gold); }
.calendar-dots .cal-cell:nth-child(3)::after { right: 4px; bottom: 4px; border-radius: 50%; background: var(--sage); }
.calendar-dots .cal-cell:nth-child(3)::before { top: 4px; left: 4px; border: 2px solid var(--gold); border-radius: 50%; }
.calendar-flags .cal-cell:nth-child(2)::before, .calendar-flags .cal-cell:nth-child(3)::before { top: 3px; left: 5px; border-left: 2px solid var(--gold); border-top: 6px solid var(--gold); border-right: 5px solid transparent; }
.calendar-flags .cal-cell:nth-child(3)::after { right: 4px; bottom: 4px; border-right: 2px solid var(--sage); border-bottom: 6px solid var(--sage); border-left: 5px solid transparent; }
.calendar-borders .cal-cell:nth-child(2) { border: 2px solid var(--gold); }
.calendar-borders .cal-cell:nth-child(3) { border: 3px double var(--sage); background: linear-gradient(135deg, rgba(201,164,94,.18) 50%, rgba(115,146,105,.18) 50%); }
.sort-demo { display: flex; align-items: center; gap: 7px; }
.sort-demo button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: white; }
.sort-demo svg { width: 17px; height: 17px; }
.sort-segmented { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.sort-segmented button { border: 0; border-radius: 0; }
.sort-segmented button + button { border-left: 1px solid var(--line); }
.drag-handle { display: grid; grid-template-columns: repeat(2, 3px); gap: 3px; padding: 6px; }
.drag-handle i { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

.review-card__footer { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: start; padding: 6px 24px 24px; }
.reject-choice { position: relative; }
.reject-choice input { position: absolute; opacity: 0; }
.reject-choice span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 9px 12px; border: 1px solid rgba(199,101,85,.38); border-radius: 12px; color: #88453a; background: #fff8f5; cursor: pointer; font-size: .82rem; font-weight: 700; }
.reject-choice input:checked + span { color: white; border-color: var(--terracotta); background: var(--terracotta); }
.scene-note { width: 100%; min-height: 76px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; color: var(--ink); background: white; }
.scene-note:focus { outline: 2px solid rgba(23,58,99,.2); border-color: var(--navy); }
.empty-filter { padding: 40px; color: var(--muted); text-align: center; }

.section--audit { background: #e9ddc8; }
.audit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.audit-card { padding: 20px; border: 1px solid rgba(29,47,68,.13); border-radius: 18px; background: rgba(255,253,248,.72); }
.audit-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.audit-card__status { padding: 4px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; }
.audit-card__count { font: 650 1.7rem/1 var(--serif); color: var(--navy); }
.audit-card h3 { margin: 18px 0 7px; font-size: 1.08rem; }
.audit-card p { margin: 0; color: var(--muted); font-size: .84rem; }
.audit-card--review .audit-card__status { color: #704f17; background: rgba(201,164,94,.25); }
.audit-card--keep .audit-card__status { color: #49633f; background: rgba(115,146,105,.2); }
.audit-card--future .audit-card__status { color: #7d493f; background: rgba(199,101,85,.17); }
.audit-card--exclude .audit-card__status { color: #61655f; background: rgba(111,116,111,.14); }
.scan-details { margin-top: 18px; border: 1px solid rgba(29,47,68,.13); border-radius: 16px; background: rgba(255,253,248,.6); }
.scan-details summary { padding: 15px 18px; cursor: pointer; font-weight: 700; }
.scan-details__body { padding: 0 18px 16px; color: var(--muted); font-size: .86rem; }
code { padding: .1em .35em; border-radius: 5px; background: rgba(23,58,99,.07); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }

.section--export { padding-bottom: 92px; }
.export-panel { display: grid; grid-template-columns: 1fr 320px; gap: 48px; padding: 34px; border-radius: 24px; color: #f9f4e9; background: var(--navy); box-shadow: var(--shadow); }
.export-panel h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.export-panel p { color: rgba(249,244,233,.74); }
.export-panel .eyebrow { color: #e2c98d; }
.export-panel code { background: rgba(255,255,255,.1); }
.global-note { display: block; margin-top: 24px; }
.global-note span { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 700; }
.global-note textarea { width: 100%; resize: vertical; border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 12px; color: white; background: rgba(255,255,255,.08); }
.global-note textarea::placeholder { color: rgba(255,255,255,.42); }
.export-actions { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.export-actions button { width: 100%; border-color: rgba(255,255,255,.2); color: white; background: rgba(255,255,255,.08); }
.export-actions button.primary { border-color: var(--gold); color: var(--navy); background: #efd9a6; font-weight: 800; }
.export-actions button.quiet { border-color: transparent; color: rgba(255,255,255,.68); background: transparent; }
#export-status { min-height: 1.5em; margin: 4px 0 0; font-size: .8rem; text-align: center; }
.export-preview { max-height: 460px; margin: 18px 0 0; overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 16px; white-space: pre-wrap; background: #fffdf8; font-size: .76rem; }

footer { padding: 26px 24px 42px; color: var(--muted); font-size: .78rem; text-align: center; }

@media (max-width: 900px) {
  .audit-grid { grid-template-columns: repeat(2, 1fr); }
  .choice-grid { grid-template-columns: 1fr; }
  .choice__surface { display: grid; grid-template-columns: minmax(220px, .9fr) 1.1fr; }
  .choice__footer { border-top: 0; border-left: 1px solid var(--line); }
  .style-guide, .export-panel { grid-template-columns: 1fr; }
  .family-actions { justify-content: start; }
  .export-actions { max-width: 420px; }
}

@media (max-width: 660px) {
  .hero { padding: 54px 18px 38px; }
  .audit-strip { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 54px 16px; }
  .section-heading { display: block; }
  .progress-card { margin-top: 20px; }
  .review-card__header { grid-template-columns: 1fr; padding: 19px 18px 15px; }
  .scene-source { max-width: none; text-align: left; }
  .current-scene { grid-template-columns: 1fr; padding: 16px 18px; }
  .choice-grid { padding: 18px 18px 12px; }
  .choice__surface { display: flex; }
  .choice__footer { border-top: 1px solid var(--line); border-left: 0; }
  .review-card__footer { grid-template-columns: 1fr; padding: 4px 18px 20px; }
  .audit-grid { grid-template-columns: 1fr; }
  .export-panel { padding: 24px 20px; }
  .round-banner { display: block; margin-bottom: -24px; }
  .round-banner a { display: inline-block; margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
