/* Product-wide visual system. See DESIGN.md; chat A/C colors remain in styles.css. */
@font-face { font-family: "Pretendard Variable"; src: url("./fonts/PretendardVariable.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }

:root {
  --ink: #202c28;
  --muted: #68736e;
  --line: #e2e7e3;
  --paper: #f7f8f6;
  --panel: #ffffff;
  --accent: #426e5d;
  --accent-dark: #315345;
  --soft: #edf2ef;
  --amber: #c8dcd0;
  --strong-surface: #202c28;
  --on-strong: #ffffff;
  --action: #202c28;
  --on-action: #ffffff;
  --body: "Pretendard Variable", "Apple SD Gothic Neo", sans-serif;
  --display: var(--body);
  font-family: var(--body);
  color: var(--ink);
  background: #1c2320;
}
html, body { background: #1c2320; }
button, a, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.app-shell { box-shadow: 0 12px 70px #00000025; color: var(--ink); }
.app-shell[data-chat-theme="night"] {
  color-scheme: dark;
  --ink: #e8eee8;
  --muted: #a4ada5;
  --paper: #202624;
  --panel: #252e2a;
  --line: #404b44;
  --accent: #c5d8cc;
  --accent-dark: #c5d8cc;
  --soft: #303b35;
  --amber: #d6ba82;
  --action: #d6ba82;
  --on-action: #292b25;
}
.topbar { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px; min-height: 72px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px 6px; background: var(--paper); border-color: transparent; backdrop-filter: none; }
.topbar-home { grid-template-columns: minmax(0, 1fr) auto; padding-left: 20px; }
.topbar-home .topbar-spacer { display: none; }
.icon-button { width: 44px; min-height: 44px; padding: 0; font-size: 32px; }
.wordmark { padding: 0; }
.brand-lockup { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-logo { flex-shrink: 0; width: 32px; height: 32px; border-radius: 7px; object-fit: cover; }
.wordmark strong { color: var(--ink); font-size: 17px; font-weight: 750; letter-spacing: -.04em; }
.wordmark span { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: -.01em; }
.top-actions { gap: 4px; }
.top-actions button { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; height: 44px; border: 0; padding: 0 6px; color: var(--ink); font-size: 12px; font-weight: 600; }
.top-actions svg { width: 18px; height: 18px; }
.coin-symbol { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid currentColor; border-radius: 50%; font-size: 9px; }
.screen { min-height: calc(100svh - 72px); padding: 24px 20px calc(env(safe-area-inset-bottom) + 28px); }
.screen-gender { display: block; padding-top: 4px; }
.home-scene { position: relative; overflow: hidden; margin: 0 -4px; height: clamp(228px, 69vw, 302px); border-radius: 20px; background: var(--strong-surface); color: var(--on-strong); isolation: isolate; }
.home-scene > picture { display: block; width: 100%; height: 100%; }
.home-scene img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 64%; }
.home-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #14221acc, transparent 70%); pointer-events: none; z-index: 0; }
.scene-caption { position: absolute; z-index: 1; top: 22px; left: 22px; right: 16px; }
.scene-caption h1 { font-family: var(--display); margin: 0; color: #ffffff; font-size: clamp(27px, 7.7vw, 33px); font-weight: 720; line-height: 1.25; letter-spacing: -.045em; text-shadow: 0 2px 10px #0003; }
.home-introduction { padding-top: 24px; }
.home-introduction p { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.7; letter-spacing: -.02em; }
.entry-form { margin-top: 28px; }
.access-notice { margin-top: 18px; color: var(--ink); font-size: 14px; line-height: 1.65; }
.access-notice strong { display: block; font-weight: 650; }
.access-notice p { margin: 4px 0; color: var(--muted); }
.access-notice small { display: block; font-size: 12px; color: var(--muted); }
.access-notice .secondary-button { margin-top: 10px; }
.access-exhausted { border-top: 1px solid var(--line); padding-top: 16px; }
.access-available { margin-top: 14px; }
.entry-gender { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.entry-gender > span { color: var(--ink); font-size: 15px; font-weight: 600; }
.gender-options { display: flex; padding: 3px; border-radius: 9px; background: var(--soft); }
.gender-options label { position: relative; display: block; cursor: pointer; }
.gender-options input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.gender-options span { display: grid; place-items: center; min-width: 74px; min-height: 44px; border-radius: 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.gender-options input:checked + span { background: var(--panel); color: var(--ink); font-weight: 700; }
.gender-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.entry-submit { margin-top: 20px; }
.login-screen { padding-bottom: 24px; }
.login-scene { display: block; margin: 8px 0 28px; overflow: hidden; border-radius: 16px; background: var(--soft); }
.login-scene img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: cover; }
.login-screen .section-heading h1 { font-size: 26px; }
.login-screen .section-heading p, .account-description { font-size: 16px; line-height: 1.65; }
.login-screen .privacy-note { font-size: 12px; }
.login-error { font-size: 14px; line-height: 1.65; margin: 16px 0; color: var(--ink); }
.account-description { margin: 0 0 24px; color: var(--muted); }
.social-login { width: 100%; justify-content: center; margin-top: 10px; text-align: center; min-height: 52px; }
.social-kakao { background: #fee500; border-color: #fee500; color: #191919; }
.social-naver { background: #03c75a; border-color: #03c75a; color: #fff; }
.account-links { margin: 28px 0; }
.account-links h2 { font-size: 18px; margin-bottom: 8px; }
.account-links p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.privacy-note { margin: 20px 0 0; text-align: left; font-size: 11px; line-height: 1.65; color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 650; letter-spacing: .1em; }
.section-heading { margin-bottom: 25px; }
.section-heading h1, .section-heading.compact h1 { font-family: var(--display); color: var(--ink); font-size: 28px; font-weight: 720; line-height: 1.35; letter-spacing: -.04em; }
.section-heading > p:last-child { margin-top: 12px; font-size: 14px; line-height: 1.65; color: var(--muted); }
.primary-button, .secondary-button { display: flex; align-items: center; justify-content: center; text-align: center; gap: 8px; border-radius: 10px; min-height: 52px; font-size: 15px; font-weight: 650; }
.primary-button { color: var(--on-action); background: var(--action); }
.primary-button:disabled { color: var(--muted); background: var(--line); }
.secondary-button { border-color: var(--line); background: var(--panel); color: var(--ink); }
.sticky-action { border-color: var(--line); background: var(--paper); padding: 14px 20px calc(env(safe-area-inset-bottom) + 14px); }
.sticky-action small { color: var(--muted); font-size: 11px; }
.screen-briefing, .messenger-screen { padding: 0; }

/* Choosing a scene: compact navigation and clear content groups. */
.preparation-steps { display: flex; gap: 0; list-style: none; margin: 0 0 27px; padding: 0; }
.preparation-steps li { flex: 1; padding: 0 0 10px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }
.preparation-steps li[aria-current] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.preparation-steps .step-done { border-color: var(--ink); color: var(--ink); }
.catalog-summary { display: flex; justify-content: space-between; gap: 8px; padding: 12px 0; margin-bottom: 23px; border-block: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.catalog-summary b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.topic-group + .topic-group { margin-top: 29px; }
.topic-group-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.topic-group-heading h2 { margin: 0; padding: 0; color: var(--ink); font-size: 18px; font-weight: 700; }
.topic-group-heading > span { color: var(--muted); font-size: 11px; }
.topic-list { background: var(--panel); border-color: var(--line); border-radius: 12px; }
.topic-row { padding: 16px 14px; gap: 12px; min-height: 83px; border-color: var(--line); }
.topic-row > span { min-width: 0; }
.topic-row strong { color: var(--ink); font-size: 15px; line-height: 1.4; font-weight: 650; }
.topic-row small { color: var(--muted); font-size: 12px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.topic-row b { padding-left: 0; color: var(--accent); font-size: 23px; }
.topic-row:hover, .topic-row:active { background: var(--soft); }
.selected-topic { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: baseline; border-radius: 8px; padding: 10px 12px; background: var(--soft); }
.selected-topic > span { color: var(--muted); font-size: 11px; }
.selected-topic > strong { font-weight: 600; font-size: 13px; line-height: 1.5; }
.persona-preview { display: flex; align-items: center; gap: 14px; min-height: 106px; padding: 19px 0; }
.persona-preview > img, .persona-placeholder { width: 64px; height: 64px; flex-shrink: 0; border-radius: 20px; object-fit: cover; background: var(--soft); }
.persona-placeholder { display: grid; place-items: center; color: var(--muted); font-family: var(--display); font-size: 28px; }
.persona-preview div { display: flex; flex-direction: column; gap: 4px; }
.persona-preview small { color: var(--muted); font-size: 11px; }
.persona-preview strong { font-size: 21px; letter-spacing: .03em; font-weight: 650; }
.persona-preview div > span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.mbti-grid { padding-bottom: 0; gap: 8px; }
.mbti-button { min-height: 50px; border-radius: 8px; border-color: var(--line); background: var(--panel); color: var(--ink); font-size: 14px; letter-spacing: .02em; font-weight: 600; }
.mbti-button:hover { border-color: var(--ink); }
.mbti-button.selected { border-color: var(--action); background: var(--action); color: var(--on-action); box-shadow: none; }
.type-disclaimer { margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.screen-mbti { padding-bottom: calc(env(safe-area-inset-bottom) + 130px); }

/* Briefing: a scene cover and a chronological reading surface. */
.briefing-backdrop { min-height: calc(100svh - 72px); padding: 0; background: var(--paper); }
.briefing-card { padding: 0; border-radius: 0; background: var(--panel); color: var(--ink); box-shadow: none; }
.briefing-cover { background: var(--strong-surface); color: var(--on-strong); padding: 26px 24px 24px; border-bottom: 0; }
.briefing-cover .eyebrow { color: #cfdfd5; margin-bottom: 14px; font-size: 11px; letter-spacing: 0; font-weight: 500; }
.briefing-cover h1 { font-family: var(--display); color: #ffffff; margin: 0; font-size: 28px; font-weight: 700; line-height: 1.35; letter-spacing: -.04em; overflow-wrap: anywhere; word-break: keep-all; }
.scene-location { display: flex; flex-direction: column; gap: 7px; margin: 21px 0 0; padding-top: 14px; border-top: 1px solid #cad2b833; }
.scene-location > div { display: flex; align-items: baseline; gap: 12px; }
.scene-location dt { flex: 0 0 58px; color: #b8c6be; font-size: 11px; }
.scene-location dd { margin: 0; color: #eaf0ed; font-size: 12px; line-height: 1.5; }
.briefing-body { padding: 0 22px 22px; }
.briefing-persona { display: flex; align-items: center; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.briefing-persona > img { width: 48px; height: 48px; border-radius: 16px; object-fit: cover; }
.briefing-persona > div { min-width: 0; }
.briefing-persona div > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.briefing-persona strong { display: flex; align-items: baseline; gap: 9px; font-size: 17px; overflow-wrap: anywhere; }
.briefing-persona strong small { font-size: 11px; font-weight: 500; letter-spacing: .05em; color: var(--muted); }
.persona-relation { margin-left: auto; white-space: nowrap; color: var(--muted); font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; }
.incident-section { margin-top: 25px; }
.incident-section h2 { margin: 0 0 20px; font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.briefing-facts { background: none; border: 0; border-radius: 0; margin: 0; overflow: visible; }
.briefing-facts > div { position: relative; display: block; padding: 0 0 24px 20px; margin-left: 4px; border: 0; border-left: 1px solid var(--line); }
.briefing-facts > div::before { content: ""; position: absolute; top: 4px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: #bdc3b3; box-shadow: 0 0 0 4px var(--panel); }
.briefing-facts > div:last-child { padding-bottom: 0; border-left-color: transparent; }
.briefing-facts dt { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.briefing-facts dd { color: var(--ink); font-size: 15px; line-height: 1.7; font-weight: 400; letter-spacing: -.02em; word-break: keep-all; overflow-wrap: anywhere; }
.briefing-facts .incident-now dt { color: var(--accent); }
.briefing-facts .incident-now::before { background: var(--accent); }
.briefing-facts .incident-now dd { font-weight: 600; }
.known-facts { margin: 25px 0 0; padding: 17px; background: var(--soft); border-radius: 12px; border: 0; }
.known-facts h2 { font-size: 13px; font-weight: 700; margin: 0 0 12px; color: var(--ink); }
.known-facts ul { padding: 0 0 0 16px; color: var(--ink); font-size: 13px; line-height: 1.7; }
.known-facts li + li { margin-top: 8px; }
.briefing-footer { margin-top: 22px; }
.briefing-warning { color: var(--muted); font-size: 14px; line-height: 1.65; text-align: left; margin: 0 0 16px; }
.briefing-footer .primary-button { display: flex; justify-content: center; align-items: center; padding: 0 18px; }
.chat-briefing { min-height: 0; padding: 0; background: var(--chat-canvas); }
.chat-briefing .briefing-card { background: var(--chat-surface); }
.chat-briefing .briefing-body { color: var(--chat-ink); }
.chat-briefing .briefing-facts, .chat-briefing .briefing-persona, .chat-briefing .persona-relation { border-color: var(--chat-border); }
.chat-briefing .briefing-facts > div { border-left-color: var(--chat-border); }
.chat-briefing .briefing-facts > div:last-child { border-left-color: transparent; }
.chat-briefing .briefing-facts > div::before { box-shadow: 0 0 0 4px var(--chat-surface); }
.chat-briefing .briefing-persona span, .chat-briefing .briefing-persona small { color: var(--chat-muted); }
.chat-briefing .known-facts { border-color: var(--chat-border); background: var(--chat-bubble); }
.chat-briefing .known-facts h2 { color: var(--chat-ink); }
.chat-briefing .briefing-cover .eyebrow { color: var(--amber); }
.chat-briefing .briefing-facts .incident-now dt { color: var(--chat-ink); }
.chat-briefing .briefing-facts .incident-now::before { background: var(--chat-receipt); }

/* Supporting screens share the same neutral surfaces and type hierarchy. */
.loading-state, .empty-state { min-height: 60svh; }
.loading-state strong, .empty-state strong { font-family: var(--display); font-size: 23px; line-height: 1.5; }
.pulse-mark { border-color: var(--line); }
.pulse-mark::after { background: var(--ink); }
.loading-state p, .empty-state p { font-size: 14px; line-height: 1.7; }
.archive-empty { padding: 4px 0 0; text-align: left; }
.empty-record { border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin: 0 0 25px; min-height: 180px; background: var(--panel); }
.empty-record > span { display: block; color: var(--muted); font-size: 11px; }
.empty-record > b { display: block; font-family: var(--display); font-size: 24px; line-height: 1.4; font-weight: 650; margin-top: 20px; letter-spacing: -.035em; }
.empty-record > i { display: block; color: var(--accent); font-style: normal; font-size: 20px; margin-top: 14px; }
.archive-empty > strong { font-size: 16px; }
.archive-empty > p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.archive-grid { gap: 12px; }
.archive-card { background: var(--panel); border-color: var(--line); border-radius: 14px; border-top: 3px solid var(--accent); }
.archive-card::after { display: none; }
.archive-card h2 { font-family: var(--display); font-size: 18px; line-height: 1.45; }
.archive-card-top small { color: var(--muted); font-size: 10px; }
.archive-card > p { color: var(--muted); font-size: 12px; }
.balance-panel { color: var(--on-strong); background: var(--strong-surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.balance-panel h2 { font-size: 14px; font-weight: 500; padding-bottom: 6px; }
.balance-panel > div { min-height: 46px; border-color: #ffffff24; }
.balance-panel span { color: #d1ddd6; font-size: 13px; }
.balance-panel b { color: #ffffff; font-size: 16px; font-weight: 600; }
.product-list button { border-color: var(--line); background: var(--panel); border-radius: 10px; min-height: 76px; padding: 16px; }
.product-list strong { font-size: 17px; }
.product-list b { font-size: 16px; font-weight: 600; }
.product-list small, .shop-notice { font-size: 12px; line-height: 1.6; color: var(--muted); }
.shop-notice.private { background: var(--soft); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }
.monetization-rules { border: 0; padding: 20px 0 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.monetization-rules h2 { font-size: 14px; }
.monetization-rules p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.outcome-screen { background: var(--strong-surface); padding: 30px 22px; }
.outcome-screen > h1 { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.035em; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.ending-kicker { border: 0; border-radius: 3px; color: var(--strong-surface); background: var(--amber); padding: 6px 9px; font-size: 11px; }
.ending-description { color: #d1ddd6; line-height: 1.7; }
.ending-meta span, .ending-meta b, .ending-meta small { font-size: 11px; border-radius: 4px; }
.analysis-card { background: var(--panel); color: var(--ink); border-radius: 12px; }
.analysis-card li { color: var(--ink); line-height: 1.65; border-color: var(--line); }
.analysis-note, .replay-cost-note { font-size: 12px; line-height: 1.65; }
.analysis-note { color: var(--muted); }
.replay-cost-note { color: #c6cfbd; }
.outcome-actions .primary-button { background: var(--amber); color: var(--strong-surface); }

.service-contact { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.7; }
.service-contact a { color: inherit; text-underline-offset: 3px; overflow-wrap: anywhere; }

@media (max-width: 389px) {
  .wordmark strong { font-size: 14px; }
  .wordmark span { font-size: 9px; }
  .topbar:not(.topbar-home) .brand-logo { display: none; }
  .top-actions { gap: 0; }
}

@media (max-width: 359px) {
  .home-scene { height: 216px; border-radius: 16px; }
  .scene-caption { top: 18px; left: 18px; }
  .home-introduction { padding-top: 16px; }
  .home-introduction p { font-size: 14px; }
  .entry-form { margin-top: 24px; }
  .top-actions button { gap: 3px; padding: 0 4px; }
}

@media (min-width: 700px) {
  .topbar { padding-top: 10px; }
  .app-shell { border-radius: 20px; }
  .sticky-action { border-radius: 0 0 20px 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .home-scene, .section-heading { animation: page-in 220ms ease-out both; }
  @keyframes page-in { from { opacity: .55; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
}
