:root {
  --paper: #f6f5f1;
  --surface: #fffefa;
  --ink: #232321;
  --muted: #797974;
  --line: #deded6;
  --soft: #eeeee7;
  --accent: #426652;
  --error: #9c402c;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; width: 100%; height: auto; }
svg { flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid #849c88; outline-offset: 5px; }
button:disabled { opacity: .52; }
[hidden] { display: none !important; }
.app-shell { min-height: 100svh; display: flex; flex-direction: column; }
.site-header { width: min(1120px, 100%); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(28px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) 24px max(32px, env(safe-area-inset-left)); }
.wordmark { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-size: 16px; font-weight: 650; letter-spacing: -.4px; }
.wordmark span { overflow-wrap: anywhere; }
#header-nav { flex-shrink: 0; }
#app { width: 100%; min-width: 0; flex: 1 0 auto; }
#app:focus, h1:focus, h2:focus { outline: none; }
.site-footer { padding: 34px 24px max(26px, env(safe-area-inset-bottom)); color: #92928b; text-align: center; font-size: 11px; letter-spacing: .08em; }
.text-button { background: none; border: 0; padding: 12px 0; min-height: 44px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.text-button:hover { color: var(--ink); }
.back-link { display: inline-flex; align-items: center; gap: 5px; }
.button { border: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 17px 30px; font-size: 16px; font-weight: 550; line-height: 1.45; text-align: center; transition: background .18s ease, transform .18s ease, opacity .18s ease; overflow-wrap: anywhere; }
.button-primary { background: var(--ink); color: #fff; }
.button-primary:hover { background: #40403c; }
.button-primary:active, .button-secondary:active { transform: scale(.98); }
.button-secondary { background: #e8e8e1; color: var(--ink); }
.button-secondary:hover { background: #deded6; }
.button-full { width: 100%; }
.home { max-width: 900px; margin: 0 auto; padding: 48px 32px 4px; text-align: center; }
.home h1 { font-size: clamp(40px, 6.2vw, 66px); font-weight: 680; line-height: 1.14; letter-spacing: -.065em; padding-right: .065em; }
.home-subtitle { margin-top: 21px; font-size: 15px; color: var(--muted); letter-spacing: .02em; line-height: 1.65; }
.hero-characters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 18px; max-width: 660px; margin: 30px auto 28px; }
.hero-character { min-width: 0; }
.hero-character img { border-radius: 25%; }
.hero-character:first-child { padding-top: 18px; }
.hero-character:last-child { padding-top: 18px; }
.home-actions { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.home-actions .button { min-width: 230px; max-width: 100%; }
.home-secondary { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0 22px; }
.pane { width: min(100%, 560px); padding: 58px 28px 24px; margin: 0 auto; }
.pane h1 { font-size: 32px; font-weight: 620; letter-spacing: -.04em; line-height: 1.35; }
.pane-subtitle { margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.auth-form { margin-top: 36px; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.code-input { width: 100%; min-width: 0; height: auto; min-height: 64px; border: 1px solid #d7d7cf; background: var(--surface); border-radius: 16px; padding: 17px 19px; font-size: 20px; letter-spacing: .05em; color: var(--ink); }
.code-input::placeholder { color: #aaa9a0; font-size: 15px; letter-spacing: 0; }
.code-input:focus { border-color: var(--ink); outline-offset: 3px; }
.auth-form .button { margin-top: 24px; }
.inline-message { color: var(--error); font-size: 13px; line-height: 1.7; margin-top: 13px; overflow-wrap: anywhere; }
.inline-message:empty { display: none; }
.quiz { width: min(100%, 620px); padding: 32px 28px 24px; margin-inline: auto; }
.quiz-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.quiz-counter { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .045em; }
.quiz-counter strong { color: var(--ink); font-weight: 550; }
.quiz-progress { height: 3px; border-radius: 10px; overflow: hidden; background: #e2e2da; }
.quiz-progress-fill { display: block; height: 100%; background: var(--ink); border-radius: inherit; transition: width .25s ease; }
.question-heading { font-size: 28px; font-weight: 590; line-height: 1.5; letter-spacing: -.025em; margin: 36px 0 28px; overflow-wrap: anywhere; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option { display: flex; width: 100%; min-width: 0; align-items: center; justify-content: space-between; gap: 16px; text-align: left; padding: 19px 21px; min-height: 70px; border: 1px solid var(--line); border-radius: 18px; background: transparent; line-height: 1.65; font-size: 16px; font-weight: 400; transition: border-color .18s, background .18s; }
.option span { min-width: 0; overflow-wrap: anywhere; }
.option:hover { border-color: #adada4; background: #f0f0e9; }
.option.selected { background: #e8ece4; border-color: #77917c; }
.option:disabled { opacity: 1; }
.option-indicator { width: 19px; height: 19px; border: 1px solid #c7c7bc; border-radius: 50%; flex-shrink: 0; }
.option.selected .option-indicator { background: var(--accent); border-color: var(--accent); position: relative; }
.option.selected .option-indicator::after { content: ""; position: absolute; width: 7px; height: 4px; border-left: 1.5px solid white; border-bottom: 1.5px solid white; transform: rotate(-45deg); top: 5px; left: 5px; }
.quiz-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; }
.quiz-bottom .text-button { font-size: 14px; }
.quiz-note { color: #92928b; font-size: 12px; line-height: 1.7; }
.loading-pane { text-align: center; padding-top: 98px; }
.loading-pane h1 { font-size: 24px; margin-top: 27px; }
.loading-pane .button { margin-top: 25px; }
.loading-pane .text-button { display: block; margin: 7px auto 0; }
.loading-symbol { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #d8d8cf; border-top-color: var(--ink); margin: 0 auto; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result { width: min(100%, 580px); padding: 22px 28px 10px; margin: 0 auto; }
.result-intro { color: var(--muted); text-align: center; font-size: 13px; letter-spacing: .03em; margin-bottom: 2px; }
.result-art { width: min(100%, 350px); margin: 0 auto 12px; border-radius: 28%; }
.result h1 { text-align: center; font-size: clamp(32px, 6vw, 43px); font-weight: 650; line-height: 1.25; letter-spacing: -.045em; overflow-wrap: anywhere; }
.result-line { color: #62635d; font-size: 16px; line-height: 1.8; text-align: center; max-width: 29em; margin: 17px auto 0; text-wrap: pretty; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 27px; }
.result-actions .button { min-width: 0; max-width: 100%; min-height: 52px; padding: 15px 25px; font-size: 14px; }
.result-message { text-align: center; }
.result-folds { margin-top: 38px; }
.fold { border-top: 1px solid var(--line); }
.fold:last-child { border-bottom: 1px solid var(--line); }
.fold summary { overflow-wrap: anywhere; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; cursor: pointer; font-size: 14px; font-weight: 500; line-height: 1.6; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "+"; flex-shrink: 0; color: var(--muted); font-size: 21px; font-weight: 300; line-height: 1; }
.fold[open] summary::after { content: "−"; }
.fold-content { padding: 0 0 24px; }
.insight + .insight { margin-top: 23px; }
.insight h3 { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.insight p { font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
.insight p + p { margin-top: 12px; }
.secondary-type { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 16px; align-items: center; }
.secondary-type + .secondary-type { margin-top: 22px; }
.secondary-type img { border-radius: 20px; }
.secondary-type h3 { font-size: 16px; font-weight: 550; line-height: 1.5; margin-bottom: 5px; }
.secondary-type p { font-size: 13px; color: var(--muted); line-height: 1.75; overflow-wrap: anywhere; }
/* Long-form results stay in normal document flow; the saved card remains concise. */
.auth-cached { display: block; margin: 14px auto 0; }
.result-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 17px 0 0; }
.result-tags li { min-width: 0; max-width: 100%; padding: 5px 11px; border-radius: 999px; background: #e9ece5; color: #53644e; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.content-update { margin-top: 25px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; text-align: center; }
.content-update p { font-size: 13px; line-height: 1.8; color: var(--muted); overflow-wrap: anywhere; }
.content-update .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; max-width: 100%; padding-bottom: 0; color: var(--accent); overflow-wrap: anywhere; }
.result-profile { margin-top: 38px; }
.result-profile .section-eyebrow { margin-bottom: 14px; font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.result-profile p { font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
.result-profile p + p { margin-top: 12px; }
.result-profile + .result-folds { margin-top: 28px; }
.scene-list { list-style: none; margin: 0; padding: 0; }
.scene-list li { padding-left: 15px; border-left: 2px solid #d6dece; }
.scene-list li + li { margin-top: 19px; }
.scene-list p, .action-list p { font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
.scene-list p + p, .action-list p + p { margin-top: 10px; }
.campus-insight { margin-top: 26px; padding-top: 22px; border-top: 1px solid #e5e5de; }
.action-list { font-size: 15px; list-style: none; counter-reset: action; margin: 0; padding: 0; }
.action-list li { counter-increment: action; display: grid; grid-template-columns: 2em minmax(0, 1fr); gap: 12px; align-items: start; }
.action-list li::before { content: counter(action, decimal-leading-zero); font-size: 12px; color: var(--accent); line-height: 2.4; font-variant-numeric: tabular-nums; }
.action-list li + li { margin-top: 21px; }
.action-list li p { grid-column: 2; }
.script-insight { margin-top: 27px; }
.script-insight blockquote { margin: 0; padding: 18px 20px; background: #eceedf; border-radius: 15px; }
.script-insight blockquote p { font-size: 15px; line-height: 1.85; color: #38442f; }
.result-closing { margin: 28px 0 4px; color: var(--muted); font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.share-dialog { width: min(92vw, 520px); max-height: 90svh; max-height: 90dvh; border: 0; border-radius: 24px; padding: 18px; background: var(--paper); color: var(--ink); overflow-y: auto; box-shadow: 0 24px 100px #0003; }
.share-dialog::backdrop { background: #24251f85; backdrop-filter: blur(5px); }
.share-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 0 15px 6px; }
.share-head h2 { font-size: 17px; font-weight: 600; line-height: 1.5; }
.share-head p { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.icon-button { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; flex-shrink: 0; }
.icon-button:hover { background: #e6e6de; }
#share-image { border-radius: 12px; }
.share-download { width: 100%; margin-top: 17px; min-height: 50px; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.noscript { text-align: center; padding: 40px 24px; font-size: 16px; }

@media (min-width: 900px) and (min-height: 800px) {
  .home { padding-top: 62px; }
  .hero-characters { margin-top: 35px; margin-bottom: 32px; }
}

@media (max-width: 600px) {
  .site-header { padding: max(19px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 16px max(22px, env(safe-area-inset-left)); }
  .wordmark { font-size: 15px; gap: 8px; }
  .wordmark svg { width: 22px; height: 22px; }
  .home { padding: 43px max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left)); }
  .home h1 { font-size: clamp(34px, 10.4vw, 54px); letter-spacing: -.065em; line-height: 1.18; }
  .home-subtitle { font-size: 13px; margin-top: 18px; }
  .hero-characters { gap: 4px; margin: 28px -6px 27px; }
  .hero-character:first-child, .hero-character:last-child { padding-top: 14px; }
  .home-actions .button { width: min(100%, 300px); min-width: 0; }
  .home-secondary { gap: 0 24px; }
  .site-footer { padding-top: 30px; font-size: 10px; }
  .pane { padding: 45px max(24px, env(safe-area-inset-right)) 24px max(24px, env(safe-area-inset-left)); }
  .pane h1 { font-size: 28px; }
  .pane-subtitle { font-size: 14px; }
  .quiz { padding: 25px max(22px, env(safe-area-inset-right)) 16px max(22px, env(safe-area-inset-left)); }
  .question-heading { margin-top: 31px; margin-bottom: 24px; font-size: 24px; }
  .option { padding: 17px 18px; min-height: 68px; font-size: 15px; border-radius: 16px; }
  .options { gap: 11px; }
  .quiz-bottom { margin-top: 16px; }
  .result { padding: 19px max(24px, env(safe-area-inset-right)) 10px max(24px, env(safe-area-inset-left)); }
  .result-art { max-width: 310px; margin-bottom: 10px; }
  .result h1 { font-size: clamp(30px, 8.6vw, 40px); }
  .result-line { font-size: 15px; margin-top: 13px; }
  .result-actions { margin-top: 23px; }
  .result-actions .button { padding-inline: 23px; }
  .result-folds { margin-top: 30px; }
  .loading-pane { padding-top: 80px; }
  .loading-pane h1 { font-size: 23px; }
}

@media (max-width: 350px) {
  .site-header { padding-inline: max(18px, env(safe-area-inset-left)); }
  .home { padding-top: 32px; padding-inline: 18px; }
  .home h1 { font-size: 33px; }
  .hero-characters { margin-block: 24px; }
  .quiz { padding-inline: 18px; }
  .question-heading { font-size: 22px; }
  .option { padding: 16px; gap: 12px; }
  .result { padding-inline: 20px; }
  .result-actions { gap: 8px; }
  .result-actions .button { padding-inline: 19px; }
  .secondary-type { grid-template-columns: 60px minmax(0, 1fr); gap: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
