:root {
  color-scheme: light;
  --ink: #1e2430;
  --muted: #656b76;
  --line: #dfe2e8;
  --soft: #f4f5f7;
  --paper: #ffffff;
  --accent: #3e5fc9;
  --accent-soft: #eaf0ff;
  --warm: #f2eee6;
  --danger: #a54646;
  --danger-surface: #a54646;
  --on-danger: #ffffff;
  --on-ink: #ffffff;
  --on-accent: #ffffff;
  --ink-secondary: #c9ced8;
  --ink-accent: #aebeff;
  --topbar: rgba(255,255,255,.94);
  --bottom-bar: rgba(255,255,255,.96);
  --dock: rgba(255,255,255,.92);
  --dock-clear: rgba(255,255,255,0);
  --shade: rgba(21,25,33,.38);
  --card-placeholder: #e3e6eb;
  --card-surface: #f2f4f8;
  --card-border: #cbd0da;
  --accent-border: #c9d4f3;
  --accent-copy: #596276;
  --body-copy: #444d5d;
  --field-on-accent: rgba(255,255,255,.86);
  --focus-ring: rgba(72,105,215,.36);
  --hover-line: #b9c5ea;
  --primary-muted: #c8ccd5;
  --ghost-line: #bfcbed;
  --day-sunday: #ad5a5a;
  --danger-link: #9a5555;
  --switch-bg: #d8dbe2;
  --switch-ink: #555c68;
  --switch-knob: #ffffff;
  --thumb-border: #ffffff;
  --share-copy: #39445e;
  --front-surface: #e7dfc6;
  --front-border: #cbc2a8;
  --front-label: rgba(255,255,255,.9);
  --front-label-ink: var(--ink);
  --scroll-thumb: #c2c8d5;
  --radius: 22px;
  font-family: Inter, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--soft); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--soft); }
button, input, textarea { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100dvh; max-width: 760px; margin: 0 auto; background: var(--paper); padding-bottom: 90px; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; background: var(--topbar); backdrop-filter: blur(14px); }
.brand { min-width: 44px; min-height: 44px; display: flex; align-items: center; border: 0; background: none; padding: 8px 0; font-weight: 800; font-size: 1rem; letter-spacing: .13em; cursor: pointer; }
.brand-dot { color: var(--accent); }
.icon-button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 13px; font-size: .82rem; cursor: pointer; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button.icon-only { position: relative; width: 44px; height: 44px; padding: 11px; display: grid; place-items: center; border: 0; background: transparent; }
.icon-button.icon-only::before { content: ''; position: absolute; inset: 2px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); }
.icon-button.icon-only svg { position: relative; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gear-button { font-size: 1.05rem; line-height: 1; }
main { min-height: calc(100dvh - 158px); }
main:focus, main:focus-visible { outline: none; }
.screen { padding: 30px 22px 44px; animation: rise .24s ease both; }
@keyframes rise { from { transform: translateY(6px); } }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-weight: 800; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; max-width: 15ch; font-size: clamp(2rem, 8vw, 3.6rem); line-height: 1.09; letter-spacing: -.045em; }
h2 { font-size: 1.5rem; line-height: 1.35; letter-spacing: -.025em; }
.lead { max-width: 31rem; color: var(--muted); font-size: 1rem; line-height: 1.8; }
:where(h1, h2, h3, .lead, .map-heading p, .deep-help, .draw-instruction, .decision-nudge, .panel-title) {
  text-wrap: balance;
  word-break: auto-phrase;
  line-break: strict;
}
:where(.reading p, .compare-node p, .saved-card p, .saved-memo p, .story-head span, .review-hint, .micro-note) {
  text-wrap: pretty;
  line-break: strict;
}
.choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 30px; }
.draw-choice { position: relative; overflow: hidden; min-height: 188px; padding: 15px 13px 38px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.draw-choice:active { transform: scale(.985); }
.draw-choice:hover { border-color: var(--hover-line); box-shadow: 0 12px 30px rgba(30,36,48,.08); }
.draw-choice strong { display: block; margin-bottom: 5px; font-size: 1.08rem; }
.draw-choice span { color: var(--muted); font-size: .76rem; line-height: 1.5; }
.draw-choice small { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.draw-choice.primary small { color: var(--primary-muted); }
.draw-choice::after { content: "→"; position: absolute; right: 14px; bottom: 12px; color: var(--accent); font-size: 1.2rem; }
.draw-choice.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.draw-choice.primary span { color: var(--primary-muted); }
.mode-art { position: relative; height: 78px; margin-bottom: 10px; display: block; }
.mode-art i { position: absolute; top: 4px; left: 50%; width: 42px; height: 67px; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; box-shadow: 0 7px 16px rgba(0,0,0,.18); }
.one-art i { transform: translateX(-50%) rotate(-4deg); }
.two-art i:first-child { transform: translateX(-78%) rotate(-9deg); }
.two-art i:last-child { transform: translateX(-22%) rotate(8deg); }
.draw-choice:not(.primary) .mode-art i { border-color: rgba(30,36,48,.18); }
.micro-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; line-height: 1.55; }
.micro-note b { color: var(--ink); }
.bottom-nav { position: fixed; z-index: 12; left: 50%; bottom: 0; transform: translateX(-50%); width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1fr; padding: 10px max(20px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: var(--bottom-bar); border-top: 1px solid var(--line); backdrop-filter: blur(16px); }
.nav-item { border: 0; background: transparent; min-height: 44px; border-radius: 13px; color: var(--muted); cursor: pointer; font-weight: 700; }
.nav-item.active { color: var(--ink); background: var(--soft); }
.nav-item span { font-size: .75rem; letter-spacing: .07em; }
.card-stage { display: grid; place-items: center; padding: 26px 0 30px; }
.tarot-card { width: min(250px, 72vw); aspect-ratio: 5 / 8; border: 1px solid var(--card-border); border-radius: 18px; background: linear-gradient(145deg, var(--paper), var(--card-surface)); box-shadow: 0 24px 55px rgba(30,36,48,.14); display: flex; flex-direction: column; justify-content: space-between; padding: 24px; text-align: left; }
.tarot-index { color: var(--muted); font-size: .8rem; letter-spacing: .12em; }
.tarot-symbol { align-self: center; font-size: 3.5rem; font-weight: 300; color: var(--accent); }
.tarot-card strong { font-size: 1.25rem; }
.button { width: 100%; min-height: 52px; border-radius: 15px; padding: 13px 18px; border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink); font-weight: 800; cursor: pointer; transition: transform .14s ease, opacity .14s ease, box-shadow .14s ease; }
.button:not(:disabled):active, .decision-option:active, .prompt-button:active, .review-button:active { transform: scale(.982); }
.button.secondary { color: var(--ink); background: var(--paper); border-color: var(--line); }
.button.ghost { color: var(--accent); background: transparent; border-color: var(--ghost-line); }
.toast { position: fixed; left: 50%; bottom: 92px; z-index: 30; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--ink); color: white; border-radius: 999px; padding: 10px 16px; font-size: .85rem; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 680px) {
  body { padding: 22px 0; }
  .app-shell { min-height: calc(100dvh - 44px); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: 0 24px 70px rgba(30,36,48,.09); }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .draw-choice { min-height: 220px; padding: 22px 22px 44px; }
  .draw-choice strong { font-size: 1.35rem; }
  .draw-choice span { font-size: .88rem; }
  .bottom-nav { bottom: 22px; border: 1px solid var(--line); border-radius: 0 0 28px 28px; }
}

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

.text-back { border: 0; background: none; padding: 4px 0 22px; color: var(--muted); cursor: pointer; font-weight: 700; }
.last-log { width: 100%; margin-top: 34px; padding: 20px; display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); border-radius: 18px; background: var(--soft); cursor: pointer; }
.last-log span, .saved-memo span, .outcome span { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; }
.last-log strong { margin-top: 3px; font-size: 1rem; }
.last-log small { color: var(--muted); font-size: .78rem; }
.map-heading { margin-bottom: 30px; }
.map-heading h1 { max-width: none; margin-bottom: 0; font-size: 1.5rem; line-height: 1.35; letter-spacing: -.025em; }
.map-heading p:last-child { margin: 9px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.65; }
.thought-map { max-width: 560px; margin: 0 auto; }
.thought-node { position: relative; padding-bottom: 50px; }
.node-label { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.node-label span { color: var(--accent); font-size: .75rem; font-weight: 900; letter-spacing: .1em; }
.node-label b { font-size: .92rem; }
.compact-card { width: 100%; min-height: 126px; border: 1px solid var(--card-border); border-radius: 19px 19px 8px 19px; padding: 20px; background: linear-gradient(145deg,var(--paper),var(--card-surface)); box-shadow: 0 12px 32px rgba(30,36,48,.08); display: flex; align-items: center; justify-content: space-between; text-align: left; }
.card-detail-button { cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.card-detail-button:hover { box-shadow: 0 15px 36px rgba(30,36,48,.14); }
.compact-card div { display: grid; gap: 12px; flex: 1; }
.compact-card strong { font-size: clamp(1.08rem,5vw,1.35rem); word-break: keep-all; overflow-wrap: normal; }
.is-reversed .compact-card { background: linear-gradient(145deg,var(--card-surface),var(--paper)); }
.card-image-frame { position: relative; display: block; overflow: hidden; aspect-ratio: 480 / 830; background: var(--card-placeholder); }
.card-image-frame > picture { display: block; width: 100%; height: 100%; }
.card-image-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
img[data-card-image] { opacity: 0; transition: opacity .24s ease; }
img[data-card-image].is-loaded { opacity: 1; }
.reading-image-frame { flex: 0 0 auto; width: 104px; margin-right: 18px; border-radius: 7px; box-shadow: 0 5px 14px rgba(30,36,48,.16); }
.reversed-image { transform: rotate(180deg); }
.reading { padding: 16px 4px 0 16px; }
.reading b { display: block; margin-bottom: 6px; color: var(--accent); font-size: .92rem; }
.reading p { margin: 0; color: var(--muted); line-height: 1.7; font-size: .92rem; }
.connector { position: absolute; left: 50%; bottom: 10px; height: 26px; width: 1px; background: var(--line); }
.connector::after { content: ''; position: absolute; bottom: 0; left: -3px; width: 7px; height: 7px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg); }
.deep-panel { max-width: 560px; margin: 6px auto 18px; padding-top: 24px; border-top: 1px solid var(--line); }
.panel-title { margin-bottom: 14px; font-weight: 800; }
.prompt-list { display: grid; gap: 9px; }
.deep-help { margin: -6px 0 14px; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.prompt-button { min-height: 66px; padding: 12px 15px; display: grid; gap: 5px; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; text-align: left; cursor: pointer; }
.prompt-button b { font-size: .88rem; }
.prompt-button span { color: var(--accent); font-size: .75rem; font-weight: 800; }
.prompt-button em { width: fit-content; padding: 3px 7px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-style: normal; font-weight: 900; }
.prompt-button.recommended-prompt { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.decision-nudge { margin-bottom: 16px; padding: 18px; background: var(--accent-soft); border-radius: 16px; }
.decision-nudge b { display: block; margin-bottom: 6px; }
.decision-nudge p, .limit-note { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.map-screen { padding-bottom: 48px; }
.reflection-card { max-width: 640px; margin: 0 auto 28px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--soft); }
.thought-node .reflection-card { margin: 20px 0 0; }
.reflection-card h3 { margin: 0 0 13px; font-size: 1rem; }
.reflection-actions { display: grid; gap: 9px; }
.reflection-actions .button { min-height: 48px; }
.reflection-options { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.reflection-options > p { margin: 0 0 11px; color: var(--muted); font-size: .86rem; font-weight: 800; }
.reflection-done { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 13px; border-radius: 99px; background: var(--paper); color: var(--muted); font-size: .78rem; font-weight: 800; }
.reflection-card.answered { padding-top: 14px; padding-bottom: 14px; }
.reflection-card.answered h3 { margin-bottom: 8px; color: var(--muted); font-size: .86rem; }
.button span { float: right; }
.button:disabled { opacity: .38; cursor: not-allowed; }
.decide-screen h1, .history-screen h1, .detail-screen h1 { max-width: 18ch; font-size: clamp(2rem,7vw,3rem); }
.decision-options { display: grid; gap: 10px; margin: 30px 0; }
.decision-option { min-height: 62px; padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); cursor: pointer; font-weight: 800; text-align: left; }
.decision-option i { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-style: normal; }
.decision-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.decision-option.selected i { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.save-form { display: grid; gap: 18px; padding-top: 24px; border-top: 1px solid var(--line); }
.save-form label { display: grid; gap: 8px; font-weight: 800; }
.save-form label span { color: var(--muted); font-size: .76rem; font-weight: 500; }
.decision-meta { display: grid; gap: 22px; padding-bottom: 4px; }
.form-section { display: grid; gap: 11px; }
.form-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.form-section-head b { font-size: .9rem; }
.form-section-head span, .recent-options > span { color: var(--muted); font-size: .75rem; }
.genre-chips, .pair-candidates, .recent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-chip, .pair-chip { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--ink); cursor: pointer; font-size: .78rem; font-weight: 800; }
.meta-chip.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pair-chip { border-radius: 12px; text-align: left; }
.pair-chip:hover, .meta-chip:hover { border-color: var(--hover-line); }
.pair-hint { margin: 0; color: var(--muted); font-size: .78rem; }
.option-editor { display: grid; grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); gap: 9px; align-items: end; }
.option-editor label { min-width: 0; font-size: .76rem; }
.option-editor input { min-width: 0; font-size: 16px; }
.swap-options { width: 44px; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); color: var(--accent); cursor: pointer; font-size: 1.2rem; font-weight: 900; }
.recent-options { display: grid; gap: 7px; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--ink); padding: 14px; font-size: 1rem; outline: none; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.timestamp { margin: -5px 0 0; text-align: center; color: var(--muted); font-size: .78rem; }
.history-list { display: grid; gap: 10px; margin-top: 28px; }
.swipe-hint { margin: 10px 2px -14px; color: var(--muted); font-size: .75rem; text-align: right; }
.history-swipe { position: relative; overflow: hidden; border-radius: 16px; background: var(--danger-surface); }
.history-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 54px; width: 100%; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); transform: translateX(var(--swipe,0)); transition: transform .2s ease; overflow: hidden; }
.history-swipe.swiped .history-row { transform: translateX(-82px); }
.swipe-delete { position: absolute; inset: 0 0 0 auto; width: 82px; border: 0; background: var(--danger-surface); color: var(--on-danger); cursor: pointer; font-size: .78rem; font-weight: 800; }
.history-delete-action { min-width: 54px; border: 0; border-left: 1px solid var(--line); background: var(--soft); color: var(--danger); cursor: pointer; font-size: .75rem; font-weight: 800; }
.history-head { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; }
.history-head h1 { margin-bottom: 0; }
.storage-banner { position: relative; margin-top: 20px; padding: 17px 54px 17px 17px; border: 1px solid var(--accent-border); border-radius: 16px; background: var(--accent-soft); color: var(--ink); }
.storage-banner b { display: block; font-size: .95rem; }
.storage-banner p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.storage-banner b + p { margin-top: 5px; }
.storage-banner .banner-close { position: absolute; top: 5px; right: 5px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer; font-size: 1.1rem; }
.storage-banner .button { min-height: 44px; margin-top: 12px; padding: 9px 13px; font-size: .76rem; }
.banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.a2hs-banner { margin: 12px 0 22px; }
.view-switch { flex: 0 0 auto; display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--soft); }
.view-switch button { min-height: 44px; padding: 7px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: .78rem; font-weight: 800; }
.view-switch button.selected { background: var(--paper); color: var(--ink); box-shadow: 0 2px 8px rgba(30,36,48,.08); }
.history-search { position: relative; display: flex; align-items: center; margin-top: 24px; }
.history-search > span { position: absolute; left: 14px; z-index: 1; color: var(--muted); font-size: 1.25rem; }
.history-search input { height: 50px; padding: 12px 54px 12px 42px; border-radius: 15px; background: var(--soft); }
.history-search small { position: absolute; right: 14px; color: var(--accent); font-size: .75rem; font-weight: 800; }
.history-item { position: relative; display: grid; grid-template-columns: 62px minmax(0,1fr) auto; grid-template-rows: auto 1fr; gap: 3px 13px; width: 100%; min-height: 104px; padding: 14px; text-align: left; border: 0; background: var(--paper); cursor: pointer; }
.history-thumbs { position: relative; grid-column: 1; grid-row: 1 / 3; align-self: center; width: 60px; height: 78px; }
.history-thumbs img { position: absolute; left: calc(var(--stack) * 7px); top: calc(var(--stack) * 2px); width: 46px; aspect-ratio: 7 / 12; object-fit: cover; border: 2px solid var(--thumb-border); border-radius: 5px; box-shadow: 0 4px 10px rgba(30,36,48,.2); }
.history-copy { grid-column: 2; grid-row: 1 / 3; min-width: 0; display: grid; align-content: center; gap: 3px; color: var(--muted); font-size: .84rem; }
.history-copy time { color: var(--muted); font-size: .75rem; }
.history-copy strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: .96rem; }
.history-copy > span { color: var(--muted); font-size: .8rem; }
.history-copy small { margin-top: 3px; overflow: hidden; color: var(--accent); text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; font-weight: 700; }
.history-copy .history-genre { justify-self: start; margin: 1px 0; padding: 3px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); line-height: 1.2; }
.history-item em { grid-column: 3; grid-row: 1; align-self: start; flex: 0 0 auto; white-space: nowrap; font-style: normal; color: var(--accent); font-size: .75rem; font-weight: 800; }
.history-item em.pending { color: var(--muted); font-weight: 500; }
.history-arrow { grid-column: 3; grid-row: 2; align-self: end; justify-self: end; color: var(--accent); font-style: normal; }
.calendar-wrap { margin-top: 28px; }
.calendar-toolbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 18px; }
.calendar-toolbar strong { text-align: center; font-size: 1.05rem; }
.calendar-toolbar button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); cursor: pointer; font-size: 1.1rem; }
.week-row, .calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; }
.week-row { margin-bottom: 6px; }
.week-row span { padding: 5px 0; text-align: center; color: var(--muted); font-size: .75rem; font-weight: 800; }
.week-row span:first-child { color: var(--day-sunday); }
.week-row span:last-child { color: var(--accent); }
.calendar-day, .calendar-blank { aspect-ratio: 1 / 1; min-width: 0; border-radius: 11px; }
.calendar-day { position: relative; display: grid; place-items: center; padding: 4px; border: 1px solid transparent; background: var(--soft); color: var(--muted); font-size: .82rem; }
.calendar-day:disabled { opacity: 1; }
.calendar-day.has-log { border-color: var(--accent-border); background: var(--paper); color: var(--ink); cursor: pointer; font-weight: 800; }
.calendar-day.has-log::after { content: ''; position: absolute; bottom: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.calendar-day.today span { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.calendar-day.selected { border-color: var(--accent); background: var(--accent-soft); }
.calendar-day i { position: absolute; right: 5px; top: 4px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; border-radius: 99px; background: var(--ink); color: var(--on-ink); font-size: .75rem; font-style: normal; }
.calendar-detail { min-height: 94px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.calendar-detail .history-item + .history-item { margin-top: 9px; }
.calendar-date-label { margin-bottom: 12px; font-weight: 800; }
.calendar-hint { color: var(--muted); text-align: center; font-size: .84rem; line-height: 1.65; }
.search-empty { margin-top: 24px; padding: 34px 18px; display: grid; place-items: center; gap: 7px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; }
.search-empty > span { color: var(--accent); font-size: 1.8rem; }
.search-empty p { margin: 0; color: var(--muted); font-size: .82rem; }
.empty-state { margin-top: 54px; text-align: center; padding: 34px 22px; border: 1px dashed var(--card-border); border-radius: 20px; }
.empty-state p { color: var(--muted); line-height: 1.7; }
.empty-state .button { margin-top: 14px; }
.outcome { margin: 26px 0 16px; padding: 22px; display: grid; gap: 8px; border-radius: 18px; background: var(--ink); color: var(--on-ink); }
.outcome span { color: var(--ink-secondary); }
.outcome strong { font-size: 1.5rem; }
.outcome button { width: fit-content; min-height: 44px; margin-top: 2px; padding: 8px 0; border: 0; background: transparent; color: var(--ink-accent); cursor: pointer; font-size: .78rem; font-weight: 800; }
.card-trail { display: flex; gap: 8px; align-items: center; overflow-x: auto; padding: 8px 2px 20px; color: var(--muted); font-size: .82rem; scrollbar-width: none; }
.card-trail span { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; }
.card-trail b { font-weight: 400; }
.saved-cards { margin: 8px 0 26px; padding-top: 4px; }
.saved-card { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.saved-card-image-frame { width: 92px; border-radius: 8px; box-shadow: 0 8px 18px rgba(30,36,48,.13); }
.saved-card-image-button { align-self: start; width: 92px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.saved-card-image-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.saved-card > div { min-width: 0; align-self: center; }
.saved-card > div > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .03em; }
.saved-card h3 { margin: 0 0 8px; font-size: 1.02rem; word-break: keep-all; overflow-wrap: normal; }
.saved-card h3 small { margin-left: 5px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.saved-card > div > b { display: block; color: var(--accent); font-size: .83rem; }
.saved-card p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.card-more { min-height: 44px; margin-top: 4px; padding: 8px 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: .75rem; font-weight: 800; }
.saved-memo { margin: 8px 0 30px; padding: 18px; border-left: 3px solid var(--accent); background: var(--soft); }
.saved-memo p { margin: 7px 0 0; white-space: pre-wrap; line-height: 1.7; }
.story-panel { margin: 28px 0; padding: 22px; border: 1px solid var(--accent-border); border-radius: 18px; background: var(--accent-soft); }
.story-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.story-head .panel-title { margin-bottom: 4px; }
.story-head span { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.story-head time { flex: 0 0 auto; color: var(--muted); font-size: .75rem; }
.story-panel textarea { margin: 16px 0 10px; border-color: var(--accent-border); background: var(--field-on-accent); line-height: 1.65; }
.story-panel .button { background: var(--paper); }
.story-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.story-actions .button:only-child { grid-column: 1 / -1; }
.review-panel { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.review-button { min-height: 82px; padding: 10px; display: grid; place-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; }
.review-button b { color: var(--accent); font-size: 1.3rem; }
.review-button span { font-size: .82rem; }
.review-button.selected { border-color: var(--accent); background: var(--accent-soft); }
.review-hint, .review-saved { margin: 14px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.danger-zone { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; }
.danger-zone button { min-height: 44px; padding: 9px 14px; border: 0; background: transparent; color: var(--danger-link); cursor: pointer; font-size: .76rem; font-weight: 700; }
.confirm-sheet { max-width: 520px; padding-top: 16px; }
.confirm-sheet h2 { margin-bottom: 10px; }
.confirm-sheet > p:not(.eyebrow) { color: var(--muted); font-size: .86rem; line-height: 1.7; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
.google-signin { grid-column: 1 / -1; display: flex; justify-content: center; min-height: 44px; }
.google-signin[hidden] { display: none; }
/* 自前の「Google でログイン」ボタン（押すまでGoogleへ通信しない）。マークと文字は横並びで重ならない */
.button.google-login { display: flex; align-items: center; justify-content: center; gap: 10px; }
.data-actions .button.google-login { grid-column: 1 / -1; }
.google-login-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 2px; background: #fff; }
.google-login-mark svg { display: block; width: 18px; height: 18px; }
.button.google-login[aria-busy="true"] { cursor: progress; opacity: .72; }
.button.danger { border-color: var(--danger-surface); background: var(--danger-surface); color: var(--on-danger); }
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; opacity: 0; transition: opacity .18s ease; }
.modal-wrap.open { opacity: 1; }
.modal-wrap.closing { pointer-events: none; }
.modal-shade { position: absolute; inset: 0; border: 0; background: var(--shade); }
.modal-open { overflow: hidden; overscroll-behavior: none; }
.modal-open .app-shell { position: fixed; left: 0; right: 0; width: 100%; }
.settings-sheet { position: relative; width: min(760px,100%); max-height: 92dvh; overflow-y: auto; margin: 0 auto; padding: 10px 22px calc(30px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--paper); transform: translateY(20px); transition: transform .18s ease; }
.modal-wrap.open .settings-sheet { transform: translateY(0); }
.settings-sheet.is-dragging { transition: none; }
.sheet-handle { width: 38px; height: 4px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; }
.sheet-head button { box-sizing: border-box; width: 48px; min-width: 48px; max-width: 48px; height: 48px; min-height: 48px; flex: 0 0 48px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); cursor: pointer; font-size: 1.4rem; line-height: 1; }
.setting-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 24px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.setting-row span { display: grid; gap: 5px; }
.setting-row small { color: var(--muted); font-size: .78rem; }
.setting-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.setting-row i { width: 48px; height: 28px; flex: 0 0 auto; padding: 3px; border-radius: 99px; background: var(--primary-muted); transition: .2s ease; }
.setting-row i::after { content: ''; display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--switch-knob); box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .2s ease; }
.setting-row input:checked + i { background: var(--accent); }
.setting-row input:checked + i::after { transform: translateX(20px); }
.setting-row input:focus-visible + i { outline: 3px solid var(--accent-soft); }
.setting-note { margin-top: 20px; padding: 17px; border-radius: 14px; background: var(--soft); }
.setting-note b { font-size: .9rem; }
.setting-note p { margin: 6px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.tutorial-replay { width: 100%; min-height: 44px; margin-top: 18px; padding: 10px 2px; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: .94rem; font-weight: 700; text-align: left; }
.tutorial-intro { position: fixed; inset: 0; z-index: 60; background: var(--soft); overflow-y: auto; overscroll-behavior: contain; }
.tutorial-intro-card { position: relative; width: min(760px,100%); min-height: 100dvh; margin: 0 auto; padding: max(64px, env(safe-area-inset-top)) 24px calc(30px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: center; background: var(--paper); }
.tutorial-intro-card h2 { max-width: 15ch; margin: 28px 0 22px; font-size: clamp(2rem,8vw,3rem); line-height: 1.25; }
.tutorial-intro-lines { display: grid; gap: 14px; }
.tutorial-intro-lines p { margin: 0; font-size: 16px; line-height: 1.65; font-weight: 700; }
.tutorial-intro-note { margin: 22px 0 28px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.tutorial-intro-start { max-width: 480px; }
.tutorial-progress { min-height: 44px; display: flex; align-items: center; gap: 8px; }
.tutorial-progress span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.tutorial-progress span.current { width: 12px; height: 12px; background: var(--accent); }
.tutorial-stage-controls { position: fixed; z-index: 30; top: max(8px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 8px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.tutorial-stage-controls button { min-height: 44px; padding: 7px 8px; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 15px; font-weight: 800; }
.tutorial-callout { position: relative; z-index: 2; max-width: 560px; margin: 12px auto; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 16px; background: var(--accent-soft); color: var(--ink); box-shadow: 0 8px 26px rgba(0,0,0,.08); }
.tutorial-callout p { margin: 0; font-size: 15px; line-height: 1.6; font-weight: 700; }
.tutorial-callout .button { margin-top: 14px; }
.tutorial-keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tutorial-keywords button { min-height: 44px; padding: 9px 13px; border: 1px solid var(--accent); border-radius: 99px; background: var(--paper); color: var(--accent); cursor: pointer; font-size: 15px; font-weight: 700; }
.tutorial-keywords button.selected { background: var(--accent); color: var(--on-accent); }
.tutorial-running .draw-screen > [data-tutorial-inert] { opacity: .36; }
.tutorial-running .topbar[data-tutorial-inert], .tutorial-running .bottom-nav[data-tutorial-inert] { opacity: .36; }
.tutorial-running .reflection-card[inert]:not(.tutorial-highlight) { opacity: .45; }
.tutorial-highlight { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .tutorial-running .fan-deck { scroll-behavior: auto; } }
.share-sheet { max-width: 560px; }
.share-sheet .sheet-head .eyebrow { margin-bottom: 4px; }
.share-sheet .sheet-head h2 { font-size: 1.45rem; }
.share-lead { margin: 18px 0; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.share-preview { max-height: 150px; overflow-y: auto; margin: -2px 0 16px; padding: 14px; border: 1px solid var(--accent-border); border-radius: 13px; background: var(--accent-soft); color: var(--share-copy); font-size: .8rem; line-height: 1.65; white-space: pre-wrap; }
.share-card-preview { margin-bottom: 16px; padding: 14px; border: 1px solid var(--accent-border); border-radius: 15px; background: var(--accent-soft); }
.share-card-preview .share-preview { margin: 10px 0 0; padding: 0; border: 0; background: transparent; }
.share-preview-images { display: flex; justify-content: center; gap: 10px; }
.share-preview-images img { width: 82px; aspect-ratio: 7/12; object-fit: cover; border-radius: 7px; box-shadow: 0 7px 16px rgba(30,36,48,.18); }
.image-save { margin-top: 16px; }
.share-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.share-option { min-width: 0; min-height: 88px; padding: 11px 6px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer; }
.share-option b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--soft); font-size: .9rem; }
.share-option span { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; font-weight: 700; }
.share-option.line b { background: #06c755; color: white; font-size: .75rem; }
.share-option.x-share b { background: #111; color: white; }
.share-option.facebook b { background: #1877f2; color: white; font-family: Arial,sans-serif; font-size: 1.1rem; }
.copy-link { width: 100%; min-height: 50px; margin-top: 14px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--soft); cursor: pointer; }
.copy-link span { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; text-align: left; }
.copy-link b { flex: 0 0 auto; color: var(--accent); font-size: .75rem; }
.share-theme-picker { margin-top: 14px; }
.share-theme-picker > b { display: block; margin-bottom: 8px; font-size: .78rem; }
.share-theme-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.share-theme-chip { min-height: 44px; padding: 6px 4px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: inherit; font-size: .75rem; cursor: pointer; }
.share-theme-chip.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.share-theme-swatch { width: 14px; height: 18px; flex: 0 0 auto; border: 1px solid; }
.referral-setting { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.referral-setting p { margin: 4px 0 10px; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.referral-count b { color: var(--ink, inherit); }
.referral-code b { margin-left: 6px; font-size: 1rem; letter-spacing: .14em; color: var(--accent); }
.deck-setting { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.deck-setting > b { font-size: .9rem; }
.deck-setting > p { margin: 4px 0 12px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.deck-presets { display: grid; gap: 10px; }
.deck-preset { width: 100%; min-height: 44px; padding: 15px; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.deck-preset.selected { border-color: var(--accent); background: var(--accent-soft); }
.deck-preset:focus-visible, .deck-advanced summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.deck-preset-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deck-preset-head strong { font-size: 1rem; }
.deck-preset-badge { flex: 0 0 auto; padding: 3px 8px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 800; }
.deck-preset-badge[hidden] { display: none; }
.deck-preset-subtitle { color: var(--accent); font-size: .875rem; font-weight: 800; }
.deck-preset-line { min-width: 0; font-size: .875rem; line-height: 1.5; overflow-wrap: break-word; }
.deck-preset-line b { font-weight: 800; }
.deck-preset-notes { margin: 11px 0 0; }
.deck-preset-notes p { margin: 4px 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.deck-advanced { margin-top: 16px; border-top: 1px solid var(--line); }
.deck-advanced summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; color: var(--accent); cursor: pointer; font-size: .875rem; font-weight: 800; list-style: none; }
.deck-advanced summary::-webkit-details-marker { display: none; }
.deck-advanced summary::after { content: '＋'; font-size: 1.1rem; }
.deck-advanced[open] summary::after { content: '−'; }
.deck-mode-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.deck-mode { position: relative; min-height: 82px; padding: 13px 32px 13px 13px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); cursor: pointer; text-align: left; }
.deck-mode > span { display: grid; gap: 3px; }
.deck-mode span b { font-size: .83rem; }
.deck-mode small { color: var(--muted); font-size: .75rem; }
.deck-mode > i { color: var(--accent); font-size: .75rem; font-style: normal; font-weight: 800; }
.deck-mode > em { position: absolute; right: 11px; top: 11px; color: var(--accent); font-style: normal; font-weight: 900; }
.deck-mode.selected { border-color: var(--accent); background: var(--accent-soft); }
.setting-switch-row { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-switch-row > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.setting-switch-row > span b { font-size: .84rem; }
.setting-switch-row > span small { color: var(--muted); font-size: .75rem; }
.segmented-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 12px; background: var(--soft); }
.segmented-switch button { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: 800; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.segmented-switch button.selected { background: var(--paper); color: var(--accent); box-shadow: 0 2px 9px rgba(30,36,48,.1); }
.deck-summary { margin-top: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-radius: 11px; background: var(--accent-soft); }
.deck-summary span { color: var(--muted); font-size: .75rem; font-weight: 800; }
.deck-summary strong { color: var(--accent); font-size: .78rem; text-align: right; }
.feedback-setting { margin-top: 22px; padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feedback-setting > div { min-width: 0; }
.feedback-setting > div > b { font-size: .9rem; }
.feedback-setting p { margin: 5px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.data-setting { margin-top: 22px; padding: 18px 0; border-top: 1px solid var(--line); }
.data-setting > div:first-child { display: grid; gap: 4px; }
.data-setting > div:first-child > b { font-size: .9rem; }
.data-setting > div:first-child > p { margin: 0; color: var(--muted); font-size: .78rem; }
.data-setting > div:first-child > small { color: var(--muted); font-size: .75rem; }
.data-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 14px; }
.data-actions .button { min-height: 48px; padding: 10px 8px; font-size: .78rem; }
.backup-format-note { margin: 10px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.65; }
.backup-status { min-height: 1.2em; margin: 11px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.backup-status.is-error { color: var(--danger); }
.sync-status.is-error { color: var(--danger); }
.sync-status.is-busy { opacity: .85; }
.sync-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sync-action-button { min-height: 40px; padding: 8px 14px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: .76rem; font-weight: 800; cursor: pointer; }
.sync-action-button:disabled { opacity: .5; cursor: default; }
.storage-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-surface); color: var(--on-danger); font-size: .78rem; font-weight: 800; }
.safari-storage-note { margin: 12px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.65; }
.a2hs-steps { display: grid; gap: 12px; margin: 18px 0 0; padding-left: 1.7em; color: var(--ink); font-size: .9rem; line-height: 1.65; }
.backup-output { display: grid; gap: 9px; margin-top: 12px; padding: 12px; border: 1px solid var(--accent-border); border-radius: 13px; background: var(--accent-soft); }
.backup-output[hidden] { display: none; }
.backup-output label { display: grid; gap: 7px; color: var(--muted); font-size: .75rem; font-weight: 800; }
.backup-output textarea { min-height: 130px; resize: vertical; padding: 10px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; line-height: 1.5; }
.backup-output .button { min-height: 44px; font-size: .78rem; }
.import-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 18px 0 0; }
.import-summary div { padding: 12px; border-radius: 12px; background: var(--soft); }
.import-summary dt { color: var(--muted); font-size: .75rem; font-weight: 700; }
.import-summary dd { margin: 4px 0 0; color: var(--accent); font-size: 1.1rem; font-weight: 900; }
.import-note { margin: 13px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.6; }
.toggle-button { flex: 0 0 auto; min-width: 74px; min-height: 44px; padding: 4px 8px 4px 4px; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 99px; background: var(--switch-bg); color: var(--switch-ink); cursor: pointer; transition: background .18s ease, color .18s ease; }
.toggle-button span { width: 25px; height: 25px; border-radius: 50%; background: var(--switch-knob); box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .18s ease; }
.toggle-button b { min-width: 25px; font-size: .75rem; }
.toggle-button.on { background: var(--accent); color: var(--on-accent); }
.toggle-button.on span { transform: translateX(33px); }
.toggle-button.on b { transform: translateX(-28px); }

.draw-screen h1 { max-width: 17ch; }
.back-picker { display: flex; gap: 9px; align-items: center; overflow-x: auto; padding: 22px 0 18px; scrollbar-width: none; }
.back-picker > span { margin-right: 4px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.back-choice { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 29px 7px 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; text-align: left; }
.back-choice.selected { border-color: var(--accent); background: var(--accent-soft); }
.back-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; font-weight: 700; }
.back-choice > b { position: absolute; right: 9px; color: var(--accent); font-size: .8rem; }
.back-choice .card-back { width: 30px; height: 46px; flex: 0 0 auto; border-radius: 4px; }
.card-back { display: block; overflow: hidden; border: 2px solid rgba(255,255,255,.72); background-color: #1e2735; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.back-lines { background-image: linear-gradient(rgba(28,35,46,.08),rgba(28,35,46,.08)), url('./assets/card-back-lines.jpg'); background-size: cover; background-position: center; }
.back-classic { background-color: #284a8b; background-image: radial-gradient(circle at 50% 50%,transparent 0 13%,rgba(255,255,255,.85) 14% 16%,transparent 17% 29%,rgba(255,255,255,.65) 30% 32%,transparent 33%), repeating-linear-gradient(45deg,transparent 0 8px,rgba(255,255,255,.12) 8px 10px); }
.back-plain { background: #222b38; background-image: linear-gradient(135deg,transparent 48%,#698cf0 49% 51%,transparent 52%), linear-gradient(45deg,transparent 48%,rgba(255,255,255,.65) 49% 51%,transparent 52%); background-size: 28px 28px; }
.back-ivory { background-color: #eee8db; border-color: rgba(38,46,60,.28); background-image: linear-gradient(90deg,transparent 49%,#506078 49% 51%,transparent 51%), radial-gradient(circle at 50% 50%,transparent 0 20%,#506078 21% 22%,transparent 23% 32%,#8da2c9 33% 35%,transparent 36%); }
.back-ivory i { color: #273348; }
.back-cobalt { background-color: #365fce; background-image: linear-gradient(135deg,rgba(255,255,255,.22),transparent 42%), radial-gradient(circle at 50% 46%,rgba(255,255,255,.86) 0 2%,transparent 3% 13%,rgba(255,255,255,.52) 14% 15%,transparent 16%); }
.back-graph { background-color: #202a39; background-image: linear-gradient(rgba(128,163,255,.28) 1px,transparent 1px),linear-gradient(90deg,rgba(128,163,255,.28) 1px,transparent 1px),linear-gradient(rgba(255,255,255,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.12) 1px,transparent 1px); background-size: 24px 24px,24px 24px,8px 8px,8px 8px; }
.back-ripple { background-color: #173747; background-image: repeating-radial-gradient(circle at 50% 50%,transparent 0 12px,rgba(177,220,224,.75) 13px 14px,transparent 15px 24px); }
.back-sunrise { background-color: #28324b; background-image: radial-gradient(circle at 50% 68%,#f5b75d 0 8%,#e17654 9% 17%,transparent 18%),repeating-linear-gradient(165deg,transparent 0 14px,rgba(255,255,255,.17) 15px 16px); }
.back-ink { background-color: #11161d; background-image: radial-gradient(ellipse at 30% 20%,rgba(255,255,255,.15),transparent 35%),radial-gradient(ellipse at 75% 72%,rgba(77,105,180,.38),transparent 42%); }
.back-steps { background-color: #2c3440; background-image: linear-gradient(135deg,transparent 0 42%,#7695ed 43% 48%,transparent 49% 60%,rgba(255,255,255,.68) 61% 65%,transparent 66%); background-size: 38px 38px; }
.back-night-sky { background-color: #111b3b; background-image: radial-gradient(circle at 50% 48%,transparent 0 19%,#e2d7ab 20% 21%,transparent 22% 30%,#a8b9df 31% 32%,transparent 33%),radial-gradient(circle,#f4e9ca 0 1px,transparent 2px); background-size: 72px 112px,17px 23px; }
.back-moon-ring { background-color: #34354f; background-image: repeating-radial-gradient(circle at 50% 50%,transparent 0 9px,#d4c8d9 10px 11px,transparent 12px 19px),linear-gradient(145deg,#252a47,#5c5874); }
.back-forest-breath { background-color: #1c453e; background-image: repeating-linear-gradient(115deg,transparent 0 17px,rgba(196,222,176,.3) 18px 19px,transparent 20px 35px),linear-gradient(160deg,#143831,#46745c); }
.back-moss { background-color: #596b46; background-image: radial-gradient(circle at 20% 28%,rgba(213,229,173,.7),transparent 30%),radial-gradient(circle at 80% 70%,rgba(27,61,49,.65),transparent 45%),repeating-linear-gradient(35deg,transparent 0 15px,rgba(255,255,255,.16) 16px 17px); }
.back-deep-sea { background-color: #122d46; background-image: repeating-radial-gradient(ellipse at 50% 100%,transparent 0 13px,rgba(121,194,202,.45) 14px 15px,transparent 16px 28px),linear-gradient(#10283f,#226176); }
.back-soft-tide { background-color: #88bac2; border-color: rgba(28,72,83,.5); background-image: repeating-linear-gradient(165deg,transparent 0 15px,rgba(255,255,255,.65) 16px 17px,transparent 18px 30px),linear-gradient(135deg,#669eac,#b6d5ce); }
.back-sakura-mist { background-color: #d9aeb9; border-color: rgba(112,61,77,.4); background-image: radial-gradient(circle at 24% 34%,rgba(255,243,239,.9),transparent 27%),radial-gradient(circle at 77% 70%,rgba(164,84,111,.5),transparent 37%),linear-gradient(120deg,#edd2d5,#bc8ea7); }
.back-coral-glow { background-color: #cc756e; background-image: radial-gradient(circle at 50% 50%,transparent 0 15%,rgba(255,231,203,.85) 16% 18%,transparent 19% 31%,rgba(255,221,197,.6) 32% 33%,transparent 34%),linear-gradient(145deg,#ac5d68,#e9a07a); }
.back-violet-haze { background-color: #8177a4; background-image: radial-gradient(ellipse at 20% 20%,rgba(245,232,255,.75),transparent 40%),radial-gradient(ellipse at 80% 80%,rgba(66,51,112,.66),transparent 45%),linear-gradient(135deg,#a89bc5,#675e8b); }
.back-amber { background-color: #986c36; background-image: repeating-radial-gradient(circle at 50% 50%,transparent 0 12px,rgba(255,224,160,.65) 13px 14px,transparent 15px 26px),linear-gradient(135deg,#67432e,#c89b54); }
.back-wine { background-color: #55253a; background-image: linear-gradient(45deg,transparent 43%,rgba(237,188,188,.44) 44% 46%,transparent 47%),linear-gradient(-45deg,transparent 43%,rgba(237,188,188,.44) 44% 46%,transparent 47%); background-size: 38px 38px; }
.back-clay { background-color: #ad7057; background-image: repeating-linear-gradient(90deg,transparent 0 22px,rgba(255,222,185,.4) 23px 24px),repeating-linear-gradient(0deg,transparent 0 34px,rgba(88,44,33,.28) 35px 36px); }
.back-slate { background-color: #52606c; background-image: linear-gradient(135deg,rgba(255,255,255,.25),transparent 35%),repeating-linear-gradient(175deg,transparent 0 11px,rgba(18,30,43,.28) 12px 13px); }
.back-silver { background-color: #bcc4cf; border-color: rgba(43,54,69,.5); background-image: repeating-linear-gradient(45deg,transparent 0 12px,rgba(52,72,103,.4) 13px 14px,transparent 15px 26px),linear-gradient(135deg,#e5e8e9,#8f9dab); }
.back-washi { background-color: #ece1cb; border-color: rgba(84,68,53,.45); background-image: repeating-linear-gradient(12deg,transparent 0 6px,rgba(131,111,86,.16) 7px 8px),radial-gradient(circle at 50% 50%,transparent 0 18%,rgba(104,92,75,.58) 19% 20%,transparent 21%); }
.back-linen { background-color: #b8ad98; border-color: rgba(77,67,52,.45); background-image: repeating-linear-gradient(0deg,transparent 0 3px,rgba(255,255,255,.23) 4px 5px),repeating-linear-gradient(90deg,transparent 0 3px,rgba(72,62,45,.17) 4px 5px); }
.back-indigo { background-color: #1e355d; background-image: linear-gradient(45deg,transparent 46%,rgba(199,220,230,.52) 47% 49%,transparent 50%),linear-gradient(-45deg,transparent 46%,rgba(199,220,230,.52) 47% 49%,transparent 50%); background-size: 44px 44px; }
.back-brass { background-color: #6a5738; background-image: radial-gradient(circle at 50% 50%,#e0c283 0 3%,transparent 4% 18%,#b9a06b 19% 20%,transparent 21%),repeating-linear-gradient(90deg,transparent 0 19px,rgba(244,222,165,.3) 20px 21px); background-size: 62px 88px,40px 40px; }
.back-aurora { background-color: #173547; background-image: linear-gradient(165deg,transparent 15%,rgba(111,207,180,.7) 32%,transparent 47%,rgba(142,153,221,.68) 66%,transparent 82%),linear-gradient(120deg,#10273e,#315b69); }
.back-prism { background-color: #303d64; background-image: linear-gradient(135deg,transparent 0 38%,rgba(255,185,157,.82) 39% 43%,transparent 44% 56%,rgba(153,219,234,.76) 57% 61%,transparent 62%),linear-gradient(45deg,rgba(208,181,238,.45),transparent 60%); background-size: 52px 52px; }
.back-mint { background-color: #a4cbbd; border-color: rgba(34,88,75,.5); background-image: repeating-radial-gradient(circle at 50% 50%,transparent 0 11px,rgba(37,100,91,.45) 12px 13px,transparent 14px 24px); }
.back-dusk { background-color: #545c7e; background-image: linear-gradient(180deg,#373d65 0 38%,#b38690 72%,#e2b699),repeating-linear-gradient(0deg,transparent 0 18px,rgba(255,255,255,.2) 19px 20px); }
.back-snow { background-color: #dce7ea; border-color: rgba(56,89,111,.45); background-image: radial-gradient(circle at 50% 50%,transparent 0 19%,rgba(87,132,157,.52) 20% 21%,transparent 22%),linear-gradient(60deg,transparent 47%,rgba(107,148,174,.33) 48% 49%,transparent 50%); background-size: 40px 40px,24px 24px; }
.back-cacao { background-color: #4a342e; background-image: repeating-linear-gradient(135deg,transparent 0 16px,rgba(213,177,142,.42) 17px 18px,transparent 19px 35px),radial-gradient(ellipse at 50% 50%,rgba(149,105,77,.45),transparent 65%); }
.draw-row { display: flex; gap: 12px; overflow-x: auto; padding: 18px 12px 34px; margin: 0 -12px; scrollbar-width: none; }
.deck-count { margin: 18px 0 2px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .78rem; }
.deck-count b { padding: 5px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; }
.fan-deck { display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden; margin: 0 -22px 18px; padding: 34px max(46%, 150px) 46px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.fan-deck .flip-card { flex: 0 0 82px; width: 82px; margin-left: -44px; transform: translateY(var(--drop)) rotate(var(--tilt)); transform-origin: 50% 115%; transition: transform .2s ease, opacity .2s ease; }
.fan-deck .flip-card:first-child { margin-left: 0; }
.fan-deck .flip-card:not(:disabled):not(.flipped):hover { z-index: 90; transform: translateY(-16px) rotate(0deg) scale(1.22); }
.fan-deck .flip-card:not(:disabled):not(.flipped):hover .flip-inner { transform: none; filter: drop-shadow(0 14px 16px rgba(30,36,48,.2)); }
.fan-deck .flip-card.chosen { z-index: 100; transform: translateY(-12px) rotate(0deg) scale(1.16); }
.dual-draw { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; max-width: 500px; margin: 16px auto 30px; }
.flip-card { position: relative; flex: 0 0 112px; width: 112px; min-width: 0; padding: 0; border: 0; background: none; perspective: 1000px; cursor: pointer; }
.dual-draw .flip-card { width: 100%; max-width: 190px; justify-self: center; }
.flip-card:disabled { cursor: default; opacity: .38; }
.fan-deck .flip-card:focus-visible { z-index: 110; outline: 4px solid var(--accent); outline-offset: 5px; border-radius: 12px; transform: translateY(-16px) rotate(0deg) scale(1.18); }
.flip-card:not(:disabled):not(.flipped):hover .flip-inner { transform: translateY(-8px) rotate(-1deg); }
.pair-card { cursor: default; }
.dual-draw .pair-card:not(.flipped):hover .flip-inner { transform: none; }
.flip-inner { position: relative; display: block; width: 100%; aspect-ratio: 5 / 8; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.76,.25,1), filter .2s ease; }
.flip-card.flipped .flip-inner { transform: rotateY(180deg) translateY(-6px); }
.flip-face { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; border-radius: 11px; box-shadow: 0 15px 32px rgba(30,36,48,.2); overflow: hidden; }
.flip-back i { color: rgba(255,255,255,.82); font-size: .75rem; font-style: normal; font-weight: 800; letter-spacing: .17em; }
.flip-front { transform: rotateY(180deg); background: var(--front-surface); border: 1px solid var(--front-border); }
.flip-front picture { display: block; width: 100%; height: 100%; }
.flip-front img { width: 100%; height: 100%; object-fit: cover; }
.flip-front em { position: absolute; inset: auto 4px 4px; padding: 4px 3px; border-radius: 5px; background: var(--front-label); color: var(--front-label-ink); font-style: normal; font-size: .75rem; font-weight: 800; line-height: 1.2; }
.draw-label { display: block; margin-bottom: 9px; color: var(--accent); font-size: 1rem; }
.draw-instruction { margin: 0; text-align: center; color: var(--muted); font-size: .86rem; font-weight: 700; animation: pulse-text 1.8s ease-in-out infinite; }
.reveal-both { display: block; width: min(100%, 500px); margin: 0 auto 14px; }
@keyframes pulse-text { 50% { opacity: .58; } }
.choice-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; max-width: 640px; margin: 0 auto 42px; }
.verdict-card { max-width: 640px; margin: 0 auto 24px; padding: 19px; border: 1px solid var(--accent-border); border-radius: 17px; background: var(--accent-soft); }
.verdict-kicker { color: var(--accent); font-size: .75rem; font-weight: 900; letter-spacing: .08em; }
.verdict-card h3 { margin: 7px 0 14px; font-size: 1.12rem; }
.verdict-card p { color: var(--accent-copy); font-size: .82rem; line-height: 1.65; }
.score-lines { display: grid; gap: 7px; padding: 12px; border-radius: 12px; background: var(--paper); }
.score-lines > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.score-lines b { font-size: .78rem; }
.score-stars { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 2px; white-space: nowrap; }
.score-stars svg { width: 15px; height: 15px; fill: var(--line); stroke: none; }
.score-stars svg.filled { fill: var(--accent); }
.score-help { margin: 8px 0 0; }
.score-help summary { width: fit-content; color: var(--accent); cursor: pointer; font-size: .75rem; font-weight: 800; }
.score-help p { margin: 6px 0 0; padding: 9px 11px; border-radius: 10px; background: var(--paper); }
.verdict-reason { margin: 14px 0 0; }
.verdict-note { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 0 9px 9px 0; background: var(--paper); }
.verdict-closing { margin: 12px 0 0; font-weight: 800; }
.compare-node { min-width: 0; }
.compare-heading { display: grid; justify-items: start; gap: 5px; margin-bottom: 9px; }
.compare-heading > span:first-child { display: inline-flex; align-items: center; min-height: 31px; padding: 6px 10px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 900; }
.compare-heading .score-stars svg { width: 13px; height: 13px; }
.compare-card { width: 100%; padding: 10px; display: grid; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); animation: reveal-card .48s ease both; text-align: left; cursor: pointer; }
.compare-card .card-image-frame { width: 100%; border-radius: 8px; }
.compare-card b { margin-top: 10px; font-size: .86rem; word-break: keep-all; overflow-wrap: normal; }
.compare-card small { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.compare-node p { margin: 12px 3px 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.compare-node p strong { display: block; margin-bottom: 4px; color: var(--accent); }
.deep-map:not(:empty) { padding-top: 30px; border-top: 1px solid var(--line); }
.setting-backs { padding-top: 20px; }
.setting-backs > b { font-size: .9rem; }
.setting-backs .back-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; max-height: min(44dvh,390px); overflow-y: auto; padding: 12px 2px 4px; }
.setting-backs .back-choice { width: 100%; }
.back-single { display: flex; align-items: center; gap: 12px; padding: 12px 2px 4px; }
.back-single .card-back { width: 34px; height: 52px; flex: 0 0 auto; border-radius: 4px; }
.back-single p { display: grid; gap: 2px; margin: 0; }
.back-single b { font-size: .86rem; }
.back-single small { color: var(--muted); font-size: .78rem; line-height: 1.5; }
@keyframes reveal-card { from { opacity: 0; transform: translateY(10px) scale(.97); } }

@media (min-width: 680px) {
  .screen { padding-left: 44px; padding-right: 44px; }
  .settings-sheet { border-radius: 24px; margin-bottom: 22px; }
  .review-grid { grid-template-columns: repeat(4,1fr); }
  .draw-row { justify-content: center; }
  .flip-card { flex-basis: 128px; width: 128px; }
  .choice-comparison { gap: 24px; }
  .compare-card { padding: 14px; }
  .setting-backs .back-picker { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 460px) {
  .map-screen { padding-top: 18px; }
  .map-heading { margin-bottom: 20px; }
  .reflection-card { padding: 15px; }
  .history-head { align-items: flex-start; flex-direction: column; }
  .view-switch { align-self: stretch; }
  .view-switch button { flex: 1; }
  .calendar-wrap { margin-inline: -10px; }
  .week-row, .calendar-grid { gap: 2px; }
  .calendar-day, .calendar-blank { border-radius: 8px; }
  .calendar-day.has-log::after { bottom: 5px; }
  .calendar-day i { right: 3px; top: 3px; }
}

@media (max-width: 460px) and (max-height: 720px) {
  .map-screen { padding-top: 10px; }
  .map-screen .text-back { padding-bottom: 10px; }
  .map-screen .eyebrow { margin-bottom: 5px; }
  .map-heading p:last-child { display: none; }
  .map-heading { margin-bottom: 10px; }
  .thought-node { padding-bottom: 24px; }
  .node-label { margin-bottom: 6px; }
  .compact-card { min-height: 0; padding: 12px; }
  .compact-card div { gap: 7px; }
  .reading-image-frame { width: 76px; margin-right: 12px; }
  .reading { padding: 9px 2px 0 10px; }
  .reading p { line-height: 1.5; }
  .thought-node .reflection-card { margin-top: 10px; }
  .reflection-card { margin-bottom: 14px; padding: 12px; }
  .reflection-card h3 { margin-bottom: 8px; }
  .reflection-actions { gap: 7px; }
  .reflection-actions .button { min-height: 46px; padding-top: 10px; padding-bottom: 10px; }
  .verdict-card { margin-bottom: 12px; padding: 14px; }
  .verdict-card h3 { margin: 5px 0 10px; font-size: 1rem; }
  .score-lines { gap: 4px; padding: 9px; }
  .verdict-reason { margin-top: 9px; }
  .verdict-note { margin-top: 7px; padding: 7px 9px; }
  .verdict-closing { margin-top: 8px; }
}

.card-detail-sheet { max-width: 620px; max-height: 85dvh; }
.card-detail-header { display: grid; grid-template-columns: 132px minmax(0,1fr); gap: 18px; align-items: start; margin-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.card-detail-image-frame { width: 132px; border-radius: 11px; box-shadow: 0 14px 30px rgba(30,36,48,.18); }
.card-detail-header h3 { margin: 9px 0 2px; font-size: 1.35rem; word-break: keep-all; overflow-wrap: normal; }
.orientation-badge { display: inline-flex; padding: 5px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 900; }
.card-english, .card-meta, .card-symbol { color: var(--muted); }
.card-english { margin: 0 0 12px; font-size: .78rem; }
.card-meta { margin: 0 0 7px; font-size: .75rem; font-weight: 800; }
.card-symbol { margin: 0; font-size: .75rem; line-height: 1.55; }
.card-detail-copy { min-width: 0; }
.card-detail-copy p { color: var(--body-copy); line-height: 1.75; }
.keyword-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 12px; }
.keyword-chips i { padding: 6px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-style: normal; font-weight: 800; }
.card-detail-copy section { margin-top: 0; padding: 18px 0; border-bottom: 1px solid var(--line); }
.card-detail-copy section h3 { margin: 0 0 8px; font-size: .9rem; }
.card-detail-copy section p { margin: 0; font-size: .86rem; }
.direction-meaning { color: var(--ink) !important; font-size: .92rem !important; }
.theme-tabs { display: flex; gap: 7px; overflow-x: auto; margin: 11px -2px 0; padding: 2px 2px 9px; scrollbar-width: thin; }
.theme-tabs button { flex: 0 0 auto; min-height: 44px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--muted); font-size: .75rem; font-weight: 800; cursor: pointer; }
.theme-tabs button span { margin-right: 5px; color: var(--accent); font-size: .75rem; }
.theme-tabs button.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.theme-panel { margin-top: 7px; padding: 14px; border-radius: 13px; background: var(--soft); }
.theme-panel b { display: block; margin-bottom: 6px; color: var(--accent); font-size: .76rem; }
.theme-panel p { color: var(--body-copy); }
.opposite-meaning { margin: 18px 0; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; }
.opposite-meaning summary { padding: 14px 0; cursor: pointer; font-size: .82rem; font-weight: 800; }
.opposite-meaning summary span { color: var(--muted); font-size: .75rem; }
.opposite-meaning[open] { padding-bottom: 14px; }
.opposite-meaning p { margin: 0; font-size: .84rem; }
.card-disclaimer { display: block; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; line-height: 1.65; }
.card-detail-close { width: 100%; min-height: 52px; margin-top: 22px; }
.shared-screen { padding-bottom: 60px; }
.shared-screen > h1 { max-width: 18ch; font-size: clamp(2rem,8vw,3.2rem); }
.shared-outcome { margin: 24px 0; padding: 20px; display: grid; gap: 6px; border-radius: 18px; background: var(--ink); color: var(--on-ink); }
.shared-outcome span { color: var(--ink-secondary); font-size: .75rem; font-weight: 800; }
.shared-outcome strong { font-size: 1.45rem; }
.shared-outcome p { margin: 4px 0 0; color: var(--ink-accent); font-size: .82rem; }
.shared-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.shared-card-grid article { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.shared-card-grid article > img { width: 100%; aspect-ratio: 7/12; object-fit: cover; border-radius: 9px; }
.shared-card-grid article span { display: block; margin-top: 10px; color: var(--muted); font-size: .75rem; }
.shared-card-grid h2 { margin: 3px 0 7px; font-size: .95rem; word-break: keep-all; overflow-wrap: normal; }
.shared-card-grid b { color: var(--accent); font-size: .8rem; }
.shared-card-grid p { margin: 7px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.card-detail-sheet .sheet-head button { width: 48px; height: 48px; }
.shared-keywords { margin: 7px 0 9px; }
.shared-background { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.shared-background h3 { margin: 0; color: var(--ink); font-size: .76rem; }
.shared-story, .shared-note { margin: 24px 0; padding: 18px; border-radius: 16px; background: var(--accent-soft); }
.shared-story span, .shared-note b { color: var(--accent); font-size: .75rem; font-weight: 900; }
.shared-story p, .shared-note p { margin: 7px 0 0; white-space: pre-wrap; line-height: 1.7; }
.shared-note { background: var(--soft); }

@media (max-width: 460px) {
  .option-editor { grid-template-columns: minmax(0,1fr) 44px; }
  .option-editor label:last-child { grid-column: 1; }
  .swap-options { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .card-detail-header { grid-template-columns: 108px minmax(0,1fr); gap: 14px; }
  .card-detail-image-frame { width: 108px; }
  .card-detail-header h3 { font-size: 1.15rem; }
  .shared-card-grid h2 { font-size: .88rem; }
}

@media (max-width: 679px) {
  .settings-sheet { max-height: calc(100dvh - max(env(safe-area-inset-top), 48px) - 8px); padding-top: 10px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .sheet-handle { width: 46px; height: 5px; margin-bottom: 8px; touch-action: none; }
  .sheet-head { position: sticky; top: -10px; z-index: 4; min-height: 60px; margin: 0 -10px 0; padding: 10px 0 8px 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .sheet-head button { width: 48px; height: 48px; flex: 0 0 48px; transform: translateX(0); background: var(--accent); color: var(--on-accent); }
  .setting-backs .back-picker { max-height: none; overflow-y: visible; }
}

@media (max-width: 679px) and (orientation: landscape) {
  .settings-sheet { width: min(760px,calc(100% - 16px)); border-radius: 20px 20px 0 0; }
  .card-detail-header { grid-template-columns: 92px minmax(0,1fr); }
  .card-detail-image-frame { width: 92px; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #f3f5fa;
    --muted: #b5bdca;
    --line: #414a59;
    --soft: #171c25;
    --paper: #222936;
    --accent: #9bb4ff;
    --accent-soft: #293654;
    --warm: #302d28;
    --danger: #ffabab;
    --on-ink: #151a22;
    --on-accent: #111722;
    --ink-secondary: #46505e;
    --ink-accent: #334f9e;
    --topbar: rgba(34,41,54,.94);
    --bottom-bar: rgba(34,41,54,.96);
    --dock: rgba(34,41,54,.94);
    --dock-clear: rgba(34,41,54,0);
    --shade: rgba(2,5,10,.7);
    --card-placeholder: #343d4b;
    --card-surface: #1b212b;
    --card-border: #4c5667;
    --accent-border: #50628f;
    --accent-copy: #c2c9d5;
    --body-copy: #d7dce5;
    --field-on-accent: rgba(23,28,37,.9);
    --focus-ring: rgba(155,180,255,.5);
    --hover-line: #7087c6;
    --primary-muted: #4d5868;
    --ghost-line: #6679ae;
    --day-sunday: #ffabab;
    --danger-link: #ffabab;
    --switch-bg: #4b5565;
    --switch-ink: #eef2f8;
    --switch-knob: #f3f5fa;
    --thumb-border: #303846;
    --share-copy: #d8deea;
    --front-surface: #d9d0b8;
    --front-border: #b8ae93;
    --front-label: rgba(20,24,31,.9);
    --front-label-ink: #f3f5fa;
    --scroll-thumb: #657186;
  }
}

/* P19: the learning sub-screen is separate from the main tab navigation. */
.learn-entry { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); text-align: left; font-weight: 800; cursor: pointer; }
.learn-entry span:last-child { margin-left: auto; color: var(--accent); }
.learn-active .topbar { display: none; }
body[data-view="learn"] .bottom-nav { display: grid !important; }
body[data-view="learn"] .app-shell { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
.learn-screen { min-height: 100dvh; padding-top: max(18px,env(safe-area-inset-top)); padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.learn-header { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.learn-header h1 { margin: 0; font-size: clamp(1.45rem,6vw,2rem); line-height: 1.3; }
.learn-back, .learn-lesson-back { min-height: 44px; padding: 7px 10px; border: 0; background: transparent; color: var(--accent); font-weight: 800; cursor: pointer; white-space: nowrap; }
.learn-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.learn-tab { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-weight: 800; cursor: pointer; }
.learn-tab[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.learn-progress { margin: 0 0 14px; color: var(--muted); font-size: .85rem; font-weight: 800; }
.learn-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.learn-filter { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); font-size: .8rem; font-weight: 800; cursor: pointer; }
.learn-filter[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.learn-search { width: 100%; min-height: 48px; margin-bottom: 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 16px; }
.learn-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px 9px; }
.learn-tile { min-width: 0; min-height: 44px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: center; cursor: pointer; }
.learn-thumb { display: block; aspect-ratio: 480 / 830; overflow: hidden; border-radius: 7px; background: var(--card-placeholder); }
.learn-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.learn-tile-name { display: block; margin-top: 7px; font-size: .75rem; font-weight: 800; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.learn-tile-number { display: block; margin-top: 2px; color: var(--muted); font-size: .75rem; }
.learn-empty { grid-column: 1/-1; padding: 30px 0; text-align: center; color: var(--muted); }
.learn-direction, .learn-card-nav { display: flex; gap: 8px; margin: 16px 0; }
.learn-direction button { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); cursor: pointer; }
.learn-direction button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.learn-card-nav button { flex: 1; min-height: 48px; }
.learn-card-nav button:disabled { opacity: .45; cursor: default; }
.learn-card-type p + p { margin-top: 8px; }
.learn-related { display: grid; gap: 7px; margin-top: 12px; }
.learn-related-link { min-height: 44px; padding: 9px 12px; border: 1px solid var(--accent-border); border-radius: 10px; background: var(--accent-soft); color: var(--accent); text-align: left; cursor: pointer; }
.learn-detail-sheet .theme-tabs button[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.learn-lessons { line-height: 1.75; }
.learn-lesson-item { width: 100%; min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); text-align: left; cursor: pointer; }
.learn-lesson-item strong, .learn-lesson-item small { display: block; }
.learn-lesson-item small, .learn-minutes { color: var(--muted); font-size: .75rem; }
.learn-lesson-item p { margin: 4px 0 0; color: var(--body-copy); font-size: .85rem; }
.learn-read { flex: 0 0 auto; color: var(--accent); font-size: .75rem; font-weight: 800; }
.learn-lessons > h2 { margin: 12px 0 5px; }
.learn-lessons > p { line-height: 1.8; }
.learn-journey { display: grid; gap: 8px; margin: 20px 0; }
.learn-journey-step { display: grid; grid-template-columns: 68px 1fr; gap: 0 12px; padding: 12px; border-left: 4px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.learn-journey-step b { grid-row: span 2; color: var(--accent); }
.learn-journey-step p { margin: 2px 0 0; font-size: .83rem; }
.learn-suit-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 20px 0; }
.learn-suit-cards article { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.learn-suit-cards h3 { margin-bottom: 5px; font-size: .9rem; }
.learn-suit-cards p { margin: 4px 0; font-size: .8rem; }
.learn-rank-table { width: 100%; margin: 20px 0; border-collapse: collapse; font-size: .85rem; }
.learn-rank-table th, .learn-rank-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.learn-rank-table th { width: 34%; color: var(--accent); }
.learn-points, .learn-complete { margin: 20px 0; padding: 16px; border-radius: 14px; background: var(--soft); }
.learn-points h3 { margin-bottom: 8px; font-size: 1rem; }
.learn-points ul { margin: 0; padding-left: 22px; }
.learn-mark-read { width: 100%; min-height: 48px; }
.learn-complete .button { min-height: 48px; }
@media (max-width: 380px) { .learn-grid { gap: 8px 6px; } .learn-tile { padding: 4px; } .learn-tile-name { font-size: .75rem; } }

/* P33: editorial collage redesign */
:root,
:root:not([data-theme="light"]) {
  color-scheme: light;
  --ink: #0b0b0b;
  --muted: #625f58;
  --line: #c9c3b6;
  --soft: #e8e2d6;
  --paper: #f4efe3;
  --accent: #175b8d;
  --accent-soft: #dce7e8;
  --warm: #e6d8bd;
  --danger: #9c2929;
  --danger-surface: #a52525;
  --on-danger: #fffdf5;
  --on-ink: #fffdf5;
  --on-accent: #fffdf5;
  --ink-secondary: #d8d0c0;
  --ink-accent: #f1d625;
  --topbar: rgba(8,8,8,.96);
  --bottom-bar: rgba(8,8,8,.97);
  --dock: rgba(8,8,8,.94);
  --dock-clear: rgba(8,8,8,0);
  --shade: rgba(0,0,0,.62);
  --card-placeholder: #d2ccbf;
  --card-surface: #eee8dc;
  --card-border: #111;
  --accent-border: #8fa9ad;
  --accent-copy: #33484e;
  --body-copy: #35322d;
  --field-on-accent: rgba(255,253,245,.9);
  --focus-ring: rgba(23,91,141,.35);
  --hover-line: #151515;
  --primary-muted: #ddd5c6;
  --ghost-line: #9a9489;
  --switch-bg: #bdb6a9;
  --switch-ink: #111;
  --switch-knob: #fffdf5;
  --thumb-border: #f4efe3;
  --share-copy: #34312c;
  --front-surface: #e7dfc6;
  --front-border: #151515;
  --front-label: rgba(244,239,227,.94);
  --front-label-ink: #0b0b0b;
  --scroll-thumb: #8e887e;
  --radius: 18px;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

html,
body { background: #080808; }

body {
  min-height: 100dvh;
  background-image:
    radial-gradient(circle at 14% 8%, rgba(22,87,137,.24), transparent 24rem),
    radial-gradient(circle at 86% 80%, rgba(225,43,30,.14), transparent 22rem);
}

.app-shell {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 30px 90px rgba(0,0,0,.55);
}

.topbar {
  height: 64px;
  padding: 0 18px;
  color: #fffdf5;
  border-bottom-color: rgba(255,255,255,.2);
}

.brand {
  color: #fffdf5;
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.035em;
}

.brand-dot { color: #f4d51e; }
.icon-button.icon-only::before { border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.06); }
.screen { position: relative; padding: 26px 20px 48px; }
.screen:not(.home-screen) {
  background-color: var(--paper);
  background-image:
    linear-gradient(115deg, transparent 0 72%, rgba(16,16,16,.035) 72% 73%, transparent 73%),
    radial-gradient(circle at 105% 4%, rgba(245,214,18,.34) 0 52px, transparent 53px),
    radial-gradient(circle at -8% 88%, rgba(28,99,152,.18) 0 72px, transparent 73px);
}

.screen:not(.home-screen)::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: -35px;
  bottom: 22%;
  width: 115px;
  height: 9px;
  background: #e93322;
  transform: rotate(-7deg);
  opacity: .85;
  pointer-events: none;
}

.screen:not(.home-screen) > * { position: relative; z-index: 1; }
.eyebrow {
  color: var(--accent);
  font-size: .75rem;
  letter-spacing: .22em;
}

h1,
h2,
h3,
.panel-title,
.draw-choice strong,
.decision-option span {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", Didot, serif;
}
/* A/B の判断ボタンに、入力した選択肢の文言を小さく添える */
.decision-option span { min-width: 0; overflow-wrap: anywhere; }
.decision-option small { display: block; margin-top: 2px; font-size: .82em; font-weight: 600; opacity: .8; }

h1 { font-weight: 600; line-height: 1.18; letter-spacing: -.055em; }
.lead { color: #4e4a43; line-height: 1.85; }
.text-back { color: var(--ink); font-size: .8rem; letter-spacing: .03em; }
.button {
  min-height: 52px;
  border-radius: 999px;
  border-color: #050505;
  background: #050505;
  box-shadow: 0 7px 0 rgba(0,0,0,.08);
  letter-spacing: .04em;
}

.button.secondary { background: rgba(255,253,245,.64); border-color: #0b0b0b; }
input,
textarea { border-radius: 4px; border-color: #aaa397; background: rgba(255,253,245,.72); }

/* Home: a poster-like opening screen inspired by the supplied collage. */
.home-screen {
  min-height: calc(100dvh - 138px);
  padding: 22px 18px 30px;
  overflow: hidden;
  color: #fffdf5;
  background:
    radial-gradient(circle at 85% 34%, rgba(14,75,114,.48), transparent 30%),
    linear-gradient(155deg, #050505 0 58%, #111 58% 72%, #050505 72%);
}

.home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .55;
  pointer-events: none;
}

.home-intro { position: relative; z-index: 5; }
.home-screen .eyebrow { margin-bottom: 0; color: #e4ddcf; font-size: .75rem; }
.home-wordmark {
  max-width: none;
  margin: 0;
  color: #fffdf5;
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: clamp(3.6rem, 18vw, 6.3rem);
  font-weight: 700;
  line-height: .94;
  letter-spacing: -.075em;
  white-space: nowrap;
}

.home-wordmark span { color: #f3d51f; }
.home-tagline { margin: 7px 0 0 3px; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: .95rem; letter-spacing: .06em; }
.home-collage { position: relative; z-index: 2; height: 258px; margin: -6px -18px -18px; overflow: hidden; }
.home-collage::before {
  content: "";
  position: absolute;
  left: -30px;
  right: -30px;
  bottom: -95px;
  height: 245px;
  border-radius: 50% 50% 0 0;
  background:
    repeating-radial-gradient(ellipse at 50% 98%, transparent 0 14px, rgba(255,255,255,.15) 15px 16px),
    linear-gradient(180deg, #5d5d5d, #111 66%);
  filter: grayscale(1) contrast(1.25);
}

.collage-card { position: absolute; overflow: hidden; width: 112px; border: 1px solid rgba(255,255,255,.65); box-shadow: 0 15px 35px #000; filter: grayscale(1) contrast(1.35); }
.collage-card img { display: block; width: 100%; }
.collage-card-left { left: -17px; top: 66px; transform: rotate(-13deg); opacity: .72; }
.collage-card-right { right: -13px; top: 20px; transform: rotate(11deg); opacity: .66; }
.collage-portrait {
  position: absolute;
  left: 50%;
  bottom: -51px;
  width: 262px;
  height: 210px;
  transform: translateX(-50%);
  border-radius: 49% 51% 44% 42%;
  background:
    radial-gradient(ellipse at 50% 30%, #ddd 0 12%, #858585 13% 25%, transparent 26%),
    radial-gradient(ellipse at 31% 45%, #111 0 4%, transparent 5%),
    radial-gradient(ellipse at 69% 45%, #111 0 4%, transparent 5%),
    radial-gradient(ellipse at 50% 72%, #333 0 7%, transparent 8%),
    radial-gradient(ellipse at 50% 44%, #bdbdbd 0 43%, #5f5f5f 44% 59%, #181818 60%);
  filter: grayscale(1) contrast(1.22);
  box-shadow: inset 0 0 38px #000, 0 0 0 1px rgba(255,255,255,.15);
}

.collage-portrait::before,
.collage-portrait::after { content: ""; position: absolute; background: #111; opacity: .65; }
.collage-portrait::before { inset: 48px 22px auto; height: 1px; transform: rotate(9deg); }
.collage-portrait::after { left: 32px; right: 32px; top: 100px; height: 1px; transform: rotate(-7deg); }
.collage-orbit { position: absolute; z-index: 4; left: 50%; top: 26px; width: 325px; height: 170px; transform: translateX(-50%) rotate(-8deg); border: 1px solid rgba(255,255,255,.5); border-radius: 50%; }
.collage-orbit::after { content: ""; position: absolute; inset: 18px -8px; border: 1px solid rgba(28,99,152,.9); border-radius: 50%; transform: rotate(18deg); }
.collage-portal {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 19px;
  width: 72px;
  height: 112px;
  transform: translateX(-50%);
  border: 2px solid #e6d58d;
  background: linear-gradient(90deg, #d0b15c, #fffbd4 48%, #a98034);
  box-shadow: 0 0 23px rgba(255,235,137,.72);
}
.collage-portal i { position: absolute; left: 50%; bottom: 7px; width: 9px; height: 30px; transform: translateX(-50%); border-radius: 50% 50% 20% 20%; background: #090909; }
.collage-stairs { position: absolute; z-index: 5; left: 50%; bottom: -21px; width: 145px; height: 76px; transform: translateX(-50%); background: repeating-linear-gradient(0deg, #1a1a1a 0 6px, #b9b4a8 7px 8px); clip-path: polygon(40% 0,60% 0,100% 100%,0 100%); }
.home-lead { position: relative; z-index: 7; margin: 0 4px 12px; color: #eee7db; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: .82rem; letter-spacing: .06em; text-align: center; }
.home-screen .choice-grid { position: relative; z-index: 8; gap: 7px; margin-top: 0; }
.home-screen .draw-choice {
  min-height: 151px;
  padding: 12px 11px 31px;
  border-color: rgba(255,255,255,.64);
  border-radius: 16px;
  background: rgba(244,239,227,.96);
  color: #0b0b0b;
  box-shadow: 0 15px 30px rgba(0,0,0,.38);
}

.home-screen .draw-choice.primary { background: rgba(244,239,227,.96); color: #0b0b0b; }
.home-screen .draw-choice span,
.home-screen .draw-choice.primary span { color: #4c4841; }
.home-screen .draw-choice small,
.home-screen .draw-choice.primary small { color: #6b665e; font-size: .75rem; letter-spacing: .12em; }
.home-screen .draw-choice strong { margin-bottom: 1px; font-size: 1.08rem; }
.home-screen .draw-choice::after { right: 11px; bottom: 10px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #080808; color: #fff; font-size: .85rem; }
.choice-number { position: absolute; left: 11px; top: 9px; font-family: Didot, serif; font-size: .75rem; letter-spacing: .08em; }
.home-screen .mode-art { height: 68px; margin-bottom: 4px; }
.home-screen .mode-art i { top: 2px; width: 39px; height: 62px; border-color: #aaa; }
.home-screen .last-log { margin-top: 10px; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; }
.home-screen .last-log span,
.home-screen .last-log small { color: #d4cdbf; }

/* Cards, results and logs use a cut-paper editorial treatment. */
.draw-screen h1,
.map-heading h1,
.decide-screen h1,
.history-screen h1,
.detail-screen h1 { color: #080808; }
.deck-count,
.verdict-card,
.reflection-card,
.storage-banner,
.decision-nudge { border: 1px solid #171717; border-radius: 3px; background: rgba(255,253,245,.76); box-shadow: 7px 7px 0 rgba(23,91,141,.12); }
.flip-face { border-radius: 4px; box-shadow: 9px 13px 25px rgba(0,0,0,.3); }
.flip-back { border: 1px solid rgba(255,255,255,.65); }
.compact-card,
.compare-card { border-radius: 4px; border-color: #111; background: rgba(255,253,245,.78); box-shadow: 8px 9px 0 rgba(0,0,0,.09); }
.reading-image-frame,
.compare-card .card-image-frame { border-radius: 2px; }
.node-label span,
.verdict-kicker { color: #fff; background: #0b0b0b; padding: 5px 8px; }
.compare-heading > span:first-child { border-radius: 2px; background: #0b0b0b; }
.keyword-chips i,
.history-copy .history-genre,
.orientation-badge { border-radius: 2px; background: #f1d527; color: #0b0b0b; }
.decision-option,
.prompt-button,
.history-row,
.history-swipe,
.last-log { border-radius: 4px; }
.decision-option.selected { color: #fff; background: var(--accent); }
.decision-option.selected i { border-color: #fff; background: #fff; color: var(--accent); }
.view-switch,
.view-switch button,
.calendar-day,
.calendar-blank { border-radius: 2px; }
.bottom-nav {
  color: #fff;
  border-top-color: rgba(255,255,255,.2);
  background: var(--bottom-bar);
}
.nav-item { color: #9e9b94; border-radius: 2px; }
.nav-item::before { display: block; margin-bottom: 2px; font-size: 1rem; }
.nav-item:first-child::before { content: "◆"; }
.nav-item:last-child::before { content: "≡"; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.11); }
.nav-item.active::before { color: #f1d527; }
.nav-item span { font-size: .75rem; letter-spacing: .1em; }
.settings-sheet { background: var(--paper); border-radius: 18px 18px 0 0; }
.sheet-head { background: var(--paper); }
.toast { background: #0a0a0a; color: #fffdf5; border: 1px solid rgba(255,255,255,.25); }

@media (min-width: 680px) {
  body { padding: 24px 0; }
  .app-shell { border-color: rgba(255,255,255,.22); border-radius: 24px; }
  .bottom-nav { bottom: 24px; border-color: rgba(255,255,255,.22); border-radius: 0 0 24px 24px; }
  .home-collage { height: 330px; }
  .collage-portrait { width: 350px; height: 280px; }
  .home-screen .choice-grid { max-width: 560px; margin-inline: auto; }
}

@media (max-width: 460px) {
  .screen { padding-inline: 18px; }
  .home-screen { padding-inline: 14px; }
  .home-collage { margin-inline: -14px; }
  .home-wordmark { font-size: clamp(3rem, 17vw, 4.7rem); }
  .home-screen .draw-choice { min-width: 0; }
  .home-screen .draw-choice span:not(.mode-art):not(.choice-number) { display: block; font-size: .75rem; line-height: 1.35; }
  .home-screen .draw-choice small { margin-top: 3px; }
  .history-head h1 { font-size: 2.2rem; }
}

@media (max-width: 360px) {
  .home-collage { height: 235px; }
  .home-screen .draw-choice { min-height: 142px; padding-inline: 8px; }
  .home-screen .draw-choice strong { font-size: .98rem; }
}

/* P34: direct translation of the supplied 12-screen art direction. */
.app-shell { max-width: 430px; }
.topbar { display: none; }
main { min-height: 100dvh; }
.app-shell { min-height: 100dvh; padding-bottom: 0; }
.screen { min-height: 100dvh; padding-bottom: calc(34px + env(safe-area-inset-bottom)); }

.bottom-nav {
  grid-template-columns: repeat(3,1fr);
  width: min(430px,100%);
  padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
  background: rgba(8,8,8,.96);
}
.bottom-nav .nav-item { min-height: 52px; }
.nav-item:first-child::before { content: "◆"; }
.nav-item:nth-child(2)::before { content: "▣"; }
.nav-item:nth-child(3)::before { content: "⚙"; }
.nav-item span { font-size: .75rem; }
body:not([data-view="history"]):not([data-view="detail"]) .bottom-nav { display: none; }
body[data-view="history"] .app-shell,
body[data-view="detail"] .app-shell { padding-bottom: 70px; }

/* 01 — splash */
.splash-screen {
  display: block;
  min-height: 100dvh;
  padding: max(28px,env(safe-area-inset-top)) 18px calc(26px + env(safe-area-inset-bottom));
  color: #fff;
  background: #050505 url("./assets/editorial/home-collage.webp") 50% 52% / cover no-repeat;
}
.splash-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,rgba(0,0,0,.5),transparent 20%,transparent 68%,rgba(0,0,0,.54));
  pointer-events: none;
}
.splash-copy { position: relative; z-index: 2; }
.splash-screen .home-wordmark { font-size: clamp(4.1rem,22vw,6.2rem); line-height: .9; text-shadow: 0 3px 20px #000; }
.splash-screen .home-tagline { margin-top: 9px; color: #fff; font-size: 1rem; text-shadow: 0 2px 12px #000; }
.splash-sidecopy {
  position: absolute;
  z-index: 2;
  left: 18px;
  top: 33%;
  margin: 0;
  color: #fff;
  font-family: Arial,sans-serif;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .1em;
  text-shadow: 0 2px 7px #000;
}
.splash-start {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(72px + env(safe-area-inset-bottom));
  width: min(230px,72vw);
  transform: translateX(-50%);
  text-align: center;
}
.splash-start::before { content: ""; position: absolute; left: 0; right: 0; top: 31px; height: 1px; background: rgba(255,255,255,.72); }
.splash-start button {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: #fffdf5;
  color: #080808;
  box-shadow: 0 7px 24px rgba(0,0,0,.4);
  cursor: pointer;
}
.splash-start button span { font-size: 1.7rem; }
.splash-start b { display: block; margin-top: 12px; color: #fff; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1.05rem; letter-spacing: .08em; text-shadow: 0 2px 8px #000; }

/* 02 — quick start */
.quickstart-screen {
  min-height: 100dvh;
  padding: max(28px,env(safe-area-inset-top)) 16px calc(30px + env(safe-area-inset-bottom));
  color: #080808;
  background: #f3eee2 url("./assets/editorial/choice-collage.webp") 50% 42% / cover no-repeat;
}
.quickstart-screen::before { content: ""; position: absolute; inset: auto 0 0; height: 39%; background: linear-gradient(180deg,transparent,#f3eee2 22%); pointer-events: none; }
.quickstart-title {
  display: none;
}
.quickstart-screen .choice-grid {
  position: absolute;
  z-index: 3;
  left: 16px;
  right: 16px;
  bottom: calc(70px + env(safe-area-inset-bottom));
  gap: 8px;
  margin: 0;
}
.quickstart-screen .draw-choice,
.quickstart-screen .draw-choice.primary {
  min-height: 174px;
  padding: 13px 10px 25px;
  border: 1px solid rgba(10,10,10,.42);
  border-radius: 22px;
  background: rgba(250,247,238,.9);
  color: #080808;
  box-shadow: none;
  backdrop-filter: blur(8px);
}
.quickstart-screen .draw-choice span,
.quickstart-screen .draw-choice.primary span { color: #3f3b35; }
.quickstart-screen .draw-choice::after { color: #0a0a0a; background: none; font-size: 1.1rem; }
.quickstart-screen .mode-art { height: 78px; }
.quickstart-help {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 8px 16px;
  transform: translateX(-50%);
  border: 0;
  border-bottom: 1px solid #111;
  background: transparent;
  color: #111;
  font-weight: 800;
  cursor: pointer;
}
.quickstart-screen .last-log { display: none; }

/* 03 — pull the card */
.draw-screen {
  min-height: 100dvh;
  padding: max(18px,env(safe-area-inset-top)) 0 calc(26px + env(safe-area-inset-bottom));
  overflow: hidden;
  color: #fff;
  background: #030303 url("./assets/editorial/draw-collage.webp") 50% 50% / cover no-repeat !important;
}
.draw-screen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(0,0,0,.12),transparent 58%,rgba(0,0,0,.76)); pointer-events: none; }
.draw-screen::after { display: none; }
.draw-screen .text-back {
  position: absolute;
  z-index: 5;
  top: max(12px,env(safe-area-inset-top));
  left: 16px;
  padding: 8px;
  color: #fff;
  text-shadow: 0 2px 6px #000;
}
.draw-screen > .eyebrow,
.draw-screen > h1,
.draw-screen > .lead,
.draw-screen > .deck-count { display: none; }
.draw-screen .fan-deck {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 19%;
  margin: 0;
  padding: 42px 40vw 55px;
  background: rgba(0,0,0,.05);
}
.draw-screen .fan-deck .flip-card { flex-basis: 92px; width: 92px; }
.draw-screen .dual-draw { position: absolute; z-index: 3; left: 20px; right: 20px; bottom: 29%; margin: 0 auto; }
.draw-screen .draw-label { color: #fff; text-shadow: 0 2px 8px #000; }
.draw-screen .reveal-both { position: absolute; z-index: 4; left: 20px; right: 20px; bottom: 13%; width: auto; margin: 0; }
.draw-screen .draw-instruction {
  position: absolute;
  z-index: 4;
  left: 20px;
  right: 20px;
  bottom: calc(5% + env(safe-area-inset-bottom));
  color: #fff;
  font-family: "Hiragino Mincho ProN","Yu Mincho",serif;
  font-size: .9rem;
  line-height: 1.7;
  text-shadow: 0 2px 10px #000;
}

/* 04/05/07 — card results */
.map-screen {
  min-height: 100dvh;
  padding: max(18px,env(safe-area-inset-top)) 18px calc(32px + env(safe-area-inset-bottom));
  background-color: #f4efe3 !important;
  background-image: url("./assets/editorial/result-collage.webp") !important;
  background-position: 50% 0 !important;
  background-size: 100% auto !important;
  background-repeat: no-repeat !important;
}
.map-screen::after { display: none; }
.map-screen .text-back { padding: 5px 0 9px; }
.map-screen .map-heading { display: none; }
.map-screen .map-heading .eyebrow { display: none; }
.map-screen .map-heading h1 { font-size: 1.15rem; }
.map-screen .map-heading p:last-child { display: none; }
.one-result .thought-map { max-width: 350px; padding-top: 48px; }
.one-result .thought-node { padding-bottom: 20px; }
.one-result .node-label { display: none; }
.one-result .compact-card {
  width: 154px;
  min-height: 0;
  margin: 0 auto;
  padding: 6px;
  display: block;
  border: 1px solid #111;
  background: #faf7ee;
  box-shadow: 7px 9px 20px rgba(0,0,0,.3);
}
.one-result .compact-card .reading-image-frame { width: 100%; margin: 0; border-radius: 0; }
.one-result .compact-card > div { display: none; }
.one-result .reading { margin: 10px -4px 0; padding: 13px 12px; background: rgba(250,247,238,.92); text-align: center; }
.one-result .reading b { color: #111; font-size: 1.25rem; }
.one-result .reading p { color: #24211e; font-size: .86rem; line-height: 1.65; }
.map-screen .reflection-card { margin-bottom: 0; background: rgba(250,247,238,.94); box-shadow: none; }
.map-screen .reflection-actions { grid-template-columns: 1fr 1fr; }
.map-screen .reflection-actions .button:first-child:last-child { grid-column: 1/-1; }
.two-result { background-image: linear-gradient(rgba(244,239,227,.54),rgba(244,239,227,.92)),url("./assets/editorial/result-collage.webp") !important; }
.two-result .choice-comparison { gap: 10px; margin-bottom: 20px; }
.two-result .compare-card { padding: 7px; background: rgba(250,247,238,.92); }
.two-result .compare-node p { padding: 9px; background: rgba(250,247,238,.86); color: #111; }
.two-result .verdict-card { background: rgba(255,247,208,.94); box-shadow: none; }

/* 06/08/09 — deep, decide and completion */
.map-screen.has-deep,
.decide-screen,
.detail-screen {
  color: #fff;
  background-color: #050505 !important;
  background-image: linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,.46)),url("./assets/editorial/dark-collage.webp") !important;
  background-position: 50% 0 !important;
  background-size: cover !important;
  background-attachment: fixed !important;
}
.map-screen.has-deep h1,
.map-screen.has-deep h2,
.map-screen.has-deep h3,
.map-screen.has-deep .text-back,
.decide-screen h1,
.decide-screen .text-back,
.detail-screen h1,
.detail-screen .text-back { color: #fff; }
.map-screen.has-deep .compact-card,
.map-screen.has-deep .reflection-card,
.map-screen.has-deep .prompt-button { background: rgba(12,12,12,.76); color: #fff; border-color: rgba(255,255,255,.45); }
.map-screen.has-deep .reading { background: rgba(8,8,8,.78); }
.map-screen.has-deep .reading b { color: #f1d527; }
.map-screen.has-deep .reading p,
.map-screen.has-deep .prompt-button span { color: #eee8db; }
.decide-screen { padding-top: max(28px,env(safe-area-inset-top)); }
.decide-screen .lead { color: #eee8db; text-shadow: 0 2px 8px #000; }
.decide-screen .decision-options { gap: 9px; margin: 24px 0; }
.decide-screen .decision-option { min-height: 58px; border-color: rgba(255,255,255,.55); border-radius: 999px; background: rgba(20,20,20,.62); color: #fff; backdrop-filter: blur(8px); }
.decide-screen .decision-option.selected { background: #f4efe3; color: #080808; }
.decide-screen .save-form { padding: 16px; border: 1px solid rgba(255,255,255,.4); background: rgba(8,8,8,.66); backdrop-filter: blur(10px); }
.decide-screen input,
.decide-screen textarea { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); color: #fff; }
.decide-screen .timestamp,
.decide-screen label span { color: #d6d0c3; }
.detail-screen .saved-card,
.detail-screen .review-panel,
.detail-screen .story-panel,
.detail-screen .outcome { background: rgba(245,240,228,.94); color: #111; }

/* 10/11 — black decision log and paper review cards */
.history-screen {
  min-height: calc(100dvh - 70px);
  padding-top: max(26px,env(safe-area-inset-top));
  color: #fff;
  background: #050505 !important;
}
.history-screen::before { content: ""; position: absolute; inset: 0; opacity: .2; background: url("./assets/editorial/dark-collage.webp") 50% 0 / cover fixed; pointer-events: none; }
.history-screen::after { display: none; }
.history-screen h1 { color: #fff; font-family: Arial,sans-serif; font-size: 1.65rem; letter-spacing: -.04em; }
.history-screen .view-switch { background: #181818; }
.history-screen .view-switch button { color: #bbb; }
.history-screen .view-switch button.selected { background: #f4efe3; color: #080808; }
.history-screen .history-search input { border-color: #474747; background: #121212; color: #fff; }
.history-screen .history-row { border-color: #373737; background: rgba(12,12,12,.9); }
.history-screen .history-copy strong { color: #fff; }
.history-screen .history-copy,
.history-screen .history-copy time,
.history-screen .history-copy > span { color: #c8c2b7; }
.history-screen .history-copy small,
.history-screen .history-item em,
.history-screen .history-arrow { color: #f1d527; }
.history-screen .calendar-day { background: #171717; color: #ddd; }
.history-screen .calendar-toolbar button { border-color: #4a4a4a; background: #111; color: #fff; }

@media (min-width: 680px) {
  .app-shell { border-radius: 26px; }
  .bottom-nav { bottom: 24px; border-radius: 0 0 26px 26px; }
  .screen { padding-left: 22px; padding-right: 22px; }
}

@media (max-height: 720px) {
  .quickstart-screen .choice-grid { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .quickstart-screen .draw-choice { min-height: 150px; }
  .quickstart-screen .mode-art { height: 58px; }
  .splash-start { bottom: calc(46px + env(safe-area-inset-bottom)); }
}

/* P35: screen-by-screen parity with the reference composition. */
.bottom-nav { grid-template-columns: repeat(4,1fr); }
.nav-item:nth-child(3)::before { content: "▂▅▇"; font-size: .75rem; letter-spacing: 1px; }
.nav-item:nth-child(4)::before { content: "⚙"; }
body:not([data-view="history"]):not([data-view="detail"]):not([data-view="stats"]) .bottom-nav,
body[data-detail-mode="complete"] .bottom-nav { display: none; }
body[data-view="stats"] .app-shell { padding-bottom: 70px; }

/* 05 — exact A/B comparison hierarchy */
.two-result {
  color: #0a0a0a;
  background-color: #f3eee2 !important;
  background-image: url("./assets/editorial/compare-collage.webp") !important;
  background-size: 100% auto !important;
  background-position: 50% 0 !important;
  background-repeat: no-repeat !important;
}
.two-result .text-back { position: absolute; z-index: 5; top: 12px; left: 17px; padding: 7px; color: #111; background: rgba(247,242,230,.76); }
.two-result .choice-comparison { gap: 12px; margin: 80px 0 10px; }
.two-result .compare-node { display: grid; align-content: start; }
.two-result .compare-heading { min-height: 42px; display: flex; align-items: center; justify-content: space-between; margin: 0 4px 5px; }
.two-result .compare-heading > span.compare-letter {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #fffdf5;
  font-family: Didot,"Times New Roman",serif;
  font-size: 3rem;
  font-weight: 500;
  line-height: .8;
  text-shadow: 0 2px 8px #000;
}
.two-result .compare-heading .score-stars { padding: 3px 5px; background: rgba(247,242,230,.86); }
.two-result .compare-card {
  padding: 6px;
  border: 1px solid #111;
  border-radius: 4px;
  background: rgba(250,247,238,.9);
  box-shadow: 4px 7px 16px rgba(0,0,0,.28);
}
.two-result .compare-card .card-image-frame { max-height: 236px; }
.two-result .compare-card b { margin-top: 5px; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; text-align: center; }
.two-result .compare-card small { text-align: center; }
.two-result .compare-node > p { margin: 8px 0 0; padding: 8px 6px; background: rgba(250,247,238,.9); color: #1a1815; text-align: center; }
.two-result .compare-node > p strong { color: #111; }
.two-result .verdict-card {
  margin: 10px 0 9px;
  padding: 13px;
  border: 0;
  border-radius: 9px;
  background: rgba(255,238,169,.95);
  box-shadow: none;
  text-align: center;
}
.two-result .verdict-card h3 { margin: 3px 0 8px; font-size: 1rem; }
.two-result .verdict-kicker { padding: 0; background: transparent; color: #29251e; }
.two-result .score-lines { display: flex; justify-content: center; gap: 18px; padding: 6px; background: rgba(255,255,255,.45); }
.two-result .score-lines > div { gap: 5px; }
.two-result .verdict-reason,
.two-result .verdict-note,
.two-result .verdict-closing { margin-top: 7px; }
.two-result .score-lines { display: none; }
.two-result > .reflection-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
.two-result > .reflection-card > h3 { display: none; }
.two-result > .reflection-card .reflection-actions { grid-template-columns: 1fr 1fr; }
.two-result > .reflection-card .button { min-height: 48px; padding-inline: 8px; }

/* 06 — dedicated Deep menu rather than an inline accordion. */
.map-screen.deep-menu-open {
  min-height: 100dvh;
  color: #fff;
  background: #050505 url("./assets/editorial/deep-collage.webp") 50% 0 / cover no-repeat fixed !important;
}
.map-screen.deep-menu-open::before { content: "DEEPER"; position: absolute; z-index: 2; top: 40px; left: 20px; color: #fff; font-family: Didot,serif; font-size: 1rem; letter-spacing: .22em; transform: rotate(-9deg); }
.map-screen.deep-menu-open::after { content: "どの視点から\Aもう少し考えますか？"; display: block; position: absolute; z-index: 2; top: 105px; left: 20px; right: 55px; white-space: pre; color: #fff; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1.05rem; line-height: 1.65; text-shadow: 0 2px 10px #000; }
.deep-menu-open > .text-back,
.deep-menu-open > .choice-comparison,
.deep-menu-open > .verdict-card,
.deep-menu-open > .thought-map,
.deep-menu-open > .map-heading { display: none; }
.deep-menu-open > .reflection-card { position: relative; z-index: 4; margin: 230px 0 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.deep-menu-open > .reflection-card > h3,
.deep-menu-open > .reflection-card > .reflection-actions,
.deep-menu-open .reflection-options > p { display: none; }
.deep-menu-open .reflection-options { margin: 0; padding: 0; border: 0; }
.deep-menu-open .prompt-list { gap: 9px; }
.deep-menu-open .prompt-button {
  position: relative;
  min-height: 51px;
  padding: 9px 40px 9px 45px;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 11px;
  background: rgba(10,10,10,.72);
  color: #fff;
  backdrop-filter: blur(8px);
}
.deep-menu-open .prompt-button::before { content: "◇"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); }
.deep-menu-open .prompt-button::after { content: "→"; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); }
.deep-menu-open .prompt-button b { font-family: inherit; }
.deep-menu-open .prompt-button span { color: #ddd6cb; }

/* 08 — final decision */
.decide-screen {
  background-image: linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.45)),url("./assets/editorial/decision-collage.webp") !important;
  background-position: 50% 0 !important;
  background-size: cover !important;
}
.decide-screen > .eyebrow { display: none; }
.decide-screen > h1 { margin-top: 44px; font-size: 1.35rem; font-weight: 500; }
.decide-screen > .lead { display: none; }
.decide-screen .decision-option { background: rgba(18,18,18,.62); }
.decide-screen .decision-option span::first-letter { font-family: Didot,serif; font-size: 1.2rem; }
.decide-screen .save-form { border-radius: 10px; }

/* 09 — completion is now its own screen. */
.screen.completion-screen {
  min-height: 100dvh;
  padding: max(28px,env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  color: #fff;
  background: #050505 url("./assets/editorial/complete-collage.webp") 50% 50% / cover no-repeat !important;
}
.completion-screen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(0,0,0,.28),transparent 44%,rgba(0,0,0,.62)); pointer-events: none; }
.completion-script { position: relative; z-index: 2; margin: 4px 0 0; font-family: "Snell Roundhand","Bradley Hand",cursive; font-size: 3.4rem; transform: rotate(-8deg); text-shadow: 0 3px 14px #000; }
.screen.completion-screen > .completion-copy { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: calc(150px + env(safe-area-inset-bottom)); text-align: center; text-shadow: 0 3px 10px #000; }
.completion-copy h1 { margin: 0; color: #fff; font-size: 1.45rem; }
.completion-copy p { margin: 5px 0 10px; color: #eee7da; }
.completion-copy strong { display: block; color: #f1d527; }
.screen.completion-screen > .completion-actions { position: absolute; z-index: 3; left: 20px; right: 20px; bottom: calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.completion-actions .button.secondary { border-color: #fff; background: #fff; color: #080808; }
.completion-actions .button.ghost { border-color: rgba(255,255,255,.7); color: #fff; }

/* 11 — review */
.detail-screen {
  min-height: calc(100dvh - 70px);
  padding: max(24px,env(safe-area-inset-top)) 30px 38px;
  color: #111;
  background-color: #050505 !important;
  background-image: url("./assets/editorial/review-collage.webp") !important;
  background-position: 50% 0 !important;
  background-size: 100% auto !important;
  background-repeat: repeat-y !important;
  background-attachment: scroll !important;
}
.detail-screen h1,
.detail-screen h2,
.detail-screen h3,
.detail-screen .text-back { color: #111; }
.detail-screen > .text-back { padding: 5px 9px; background: rgba(247,242,230,.86); }
.detail-screen > .eyebrow { margin-top: 14px; color: #5e5950; }
.detail-screen > h1 { font-size: 1.1rem; }
.detail-screen .outcome,
.detail-screen .saved-card,
.detail-screen .saved-memo,
.detail-screen .story-panel,
.detail-screen .review-panel { border: 1px solid #d3ccbe; border-radius: 3px; background: rgba(250,247,238,.9); color: #111; box-shadow: none; }
.detail-screen .review-grid { grid-template-columns: 1fr 1fr; }
.detail-screen .review-button { min-height: 88px; border-radius: 3px; background: rgba(255,255,255,.6); }
.detail-screen .review-button b { font-size: 1.6rem; }
.detail-screen .review-button.selected { border-color: #111; background: #f2d526; color: #111; }

/* 12 — live statistics from the user's decision log. */
.screen.stats-screen {
  min-height: calc(100dvh - 70px);
  padding: max(28px,env(safe-area-inset-top)) 22px 34px;
  color: #0a0a0a;
  background: #f4efe3 url("./assets/editorial/result-collage.webp") 50% 0 / 100% auto no-repeat !important;
}
.stats-screen::before { content: ""; position: absolute; inset: 0; background: rgba(244,239,227,.65); pointer-events: none; }
.stats-title h1 { margin: 0; font-family: Didot,"Times New Roman",serif; font-size: 2.65rem; line-height: .78; letter-spacing: -.055em; }
.stats-title p { margin: 8px 0 15px; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: .8rem; }
.stats-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin-bottom: 14px; }
.stats-tabs > * { padding: 7px 4px; border-radius: 999px; background: rgba(236,230,217,.9); text-align: center; font-size: .75rem; }
.stats-tabs b { background: #080808; color: #fff; }
.stats-summary,
.satisfaction,
.stats-themes { margin-top: 10px; padding: 14px; border: 1px solid #cfc7b8; background: rgba(250,247,238,.92); }
.stats-summary > span { font-size: .75rem; }
.stats-summary > strong { display: block; margin: 3px 0 10px; font-family: Didot,serif; font-size: 2.4rem; }
.stats-summary > strong small { margin-left: 5px; font-family: inherit; font-size: .8rem; }
.satisfaction { display: grid; grid-template-columns: 115px 1fr; gap: 10px; }
.satisfaction h2,
.stats-themes h2 { grid-column: 1/-1; margin: 0 0 5px; font-family: inherit; font-size: .82rem; }
.satisfaction-ring { position: relative; width: 105px; height: 105px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#17659a var(--score),#ded8cb 0); }
.satisfaction-ring::before { content: ""; position: absolute; width: 77px; height: 77px; border-radius: 50%; background: #faf7ee; }
.satisfaction-ring strong { position: relative; font-family: Didot,serif; font-size: 1.8rem; }
.satisfaction-ring small { font-size: .75rem; }
.review-bars > div { display: grid; grid-template-columns: 1fr 34px; gap: 3px 6px; margin-bottom: 7px; font-size: .75rem; }
.review-bars i { grid-column: 1; height: 5px; border-radius: 99px; background: linear-gradient(90deg,#17659a var(--value),#ddd7ca 0); }
.review-bars span { grid-row: 1; grid-column: 1; }
.review-bars b { grid-row: 1/3; grid-column: 2; align-self: center; }
.stats-themes > div { display: flex; flex-wrap: wrap; gap: 7px; }
.stats-themes span { padding: 7px 10px; border-radius: 999px; background: #e8e1d5; font-size: .75rem; }
.stats-themes span b { margin-left: 5px; }

@media (max-width: 360px) {
  .two-result .choice-comparison { margin-top: 64px; }
  .two-result .compare-card .card-image-frame { max-height: 200px; }
  .completion-script { font-size: 2.8rem; }
}

body[data-view="home"] .bottom-nav { display: grid !important; }
body[data-view="home"] .app-shell { padding-bottom: 70px; }
body[data-view="home"][data-home-stage="quickstart"] .quickstart-screen .choice-grid { bottom: calc(152px + env(safe-area-inset-bottom)); }
body[data-view="home"][data-home-stage="quickstart"] .quickstart-help { bottom: calc(108px + env(safe-area-inset-bottom)); }
body[data-view="home"][data-home-stage="splash"] .splash-screen { min-height: calc(100dvh - 70px); }
body[data-view="home"][data-home-stage="splash"] .splash-start { bottom: calc(40px + env(safe-area-inset-bottom)); }
@media (max-height: 720px) { body[data-view="home"][data-home-stage="splash"] .splash-start { bottom: calc(24px + env(safe-area-inset-bottom)); } }
body[data-view="home"][data-home-stage="splash"] .app-shell { padding-bottom: 70px; height: 100dvh; overflow: hidden; }
body[data-view="home"][data-home-stage="quickstart"] .app-shell { padding-bottom: 0; }

/* P36 — one visual language: Japanese typography, celestial backs and reliable contrast. */
body,
button,
input,
textarea,
select {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
}

.back-celestial,
.flip-back.card-back,
.mode-art .card-back,
.back-choice .card-back {
  position: relative;
  isolation: isolate;
  border: 3px solid #e1c37d !important;
  background:
    radial-gradient(circle at 50% 50%, #e7ca85 0 4%, #102948 4.5% 8%, #d7b76e 8.5% 9.5%, transparent 10%),
    repeating-conic-gradient(from -1deg at 50% 50%, rgba(222,190,117,.85) 0deg 1deg, transparent 1.4deg 10deg),
    radial-gradient(ellipse at 38% 30%, #1d446f 0, #102947 45%, #061426 100%);
  box-shadow: inset 0 0 0 3px #0b2039, inset 0 0 0 4px rgba(225,195,125,.82), inset 0 0 22px rgba(0,0,0,.55), 0 9px 22px rgba(0,0,0,.34);
}
.back-celestial::before,
.flip-back.card-back::before,
.mode-art .card-back::before,
.back-choice .card-back::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 7%;
  border: 1px solid rgba(226,195,124,.92);
  border-radius: 4px;
  background:
    linear-gradient(45deg,transparent 0 42%,rgba(226,195,124,.8) 43% 45%,transparent 46%) 0 0 / 22px 22px,
    linear-gradient(-45deg,transparent 0 42%,rgba(226,195,124,.8) 43% 45%,transparent 46%) 100% 0 / 22px 22px;
  opacity: .9;
}
.back-celestial::after,
.flip-back.card-back::after,
.mode-art .card-back::after,
.back-choice .card-back::after {
  content: "✦";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 26%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%,-50%);
  border: 1px solid #e4c67f;
  border-radius: 50%;
  background: #102947;
  color: #e8cd8b;
  font-family: Didot,serif;
  font-size: clamp(.55rem,2.8vw,1rem);
  box-shadow: 0 0 0 3px rgba(16,41,71,.9),0 0 0 4px rgba(225,195,125,.7);
}
.back-celestial > i,
.flip-back.card-back > i,
.mode-art .card-back > i,
.back-choice .card-back > i { display: none; }

/* A centered card rises into a protected viewing area while the deck scrolls. */
.draw-screen .fan-deck {
  height: 338px;
  bottom: 11%;
  align-items: flex-start;
  padding: 112px 44vw 64px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.draw-screen .fan-deck::-webkit-scrollbar { display: none; }
.draw-screen .fan-deck::before {
  content: "選ぶカード";
  position: sticky;
  z-index: 0;
  left: calc(50% - 46px);
  top: 25px;
  width: 92px;
  flex: 0 0 0;
  color: rgba(255,255,255,.86);
  font-size: .75rem;
  letter-spacing: .16em;
  text-align: center;
  text-shadow: 0 2px 8px #000;
  pointer-events: none;
}
.draw-screen .fan-deck .flip-card {
  scroll-snap-align: center;
  transform: translateY(var(--drop)) rotate(var(--tilt));
}
.draw-screen .fan-deck .flip-card.is-centered:not(:disabled):not(.flipped) {
  z-index: 100;
  transform: translateY(-42px) rotate(0) scale(1.2);
}
.draw-screen .fan-deck .flip-card { margin-left: -26px; }
.draw-screen .fan-deck .flip-card:first-child { margin-left: 0; }
.draw-screen .fan-deck .flip-back {
  position: absolute;
  inset: 0;
  border: 4px solid #eee3ca !important;
  filter: brightness(1.14) saturate(1.08);
  box-shadow: inset 0 0 0 2px #102947,0 12px 26px rgba(0,0,0,.9);
}
.draw-screen .fan-deck .flip-card:not(:disabled):not(.flipped):hover,
.draw-screen .fan-deck .flip-card:focus-visible {
  z-index: 110;
  transform: translateY(-38px) rotate(0) scale(1.16);
}
.draw-screen .fan-deck .flip-card.chosen {
  z-index: 120;
  transform: translateY(-38px) rotate(0) scale(1.16);
}
.draw-screen .text-back,
.draw-screen .draw-instruction,
.draw-screen .draw-label {
  border-radius: 999px;
  background: rgba(0,0,0,.74);
  box-shadow: 0 0 0 1px rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
}
.draw-screen .draw-instruction { left: 28px; right: 28px; padding: 8px 14px; }
.draw-screen .draw-label { margin: 0 auto 9px; padding: 5px 10px; }
.flip-front em {
  inset: auto 0 0;
  margin: 0;
  padding: 6px 4px;
  border-radius: 0;
  background: rgba(248,244,233,.96);
  color: #111;
  box-shadow: 0 -1px 0 rgba(0,0,0,.2);
}

/* Comparison copy always occupies its own opaque row below the cards. */
.two-result .compare-node { grid-template-rows: auto auto auto; min-width: 0; }
.two-result .compare-card { position: relative; z-index: 2; align-self: start; overflow: visible; }
.two-result .compare-card .card-image-frame { width: 100%; height: clamp(174px,44vw,236px); max-height: none; aspect-ratio: auto; }
.two-result .compare-node > p {
  position: relative;
  z-index: 1;
  min-height: 88px;
  margin-top: 10px;
  padding: 10px 8px;
  border: 1px solid rgba(17,17,17,.18);
  background: #faf7ee;
  font-size: .78rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.two-result .compare-node > p strong { display: block; margin-bottom: 4px; font-size: .82rem; }

/* Deep mode has an explicit exit independent from the hidden result controls. */
.deep-menu-open .deep-back {
  position: fixed;
  z-index: 20;
  top: max(14px,env(safe-area-inset-top));
  left: max(16px,calc(50% - 204px));
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  background: rgba(0,0,0,.82);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 5px 18px rgba(0,0,0,.35);
  backdrop-filter: blur(9px);
}
.reflection-options:not([hidden]) .deep-back { display: inline-flex; align-items: center; }
.reflection-options[hidden] .deep-back { display: none; }
.deep-menu-open .prompt-button { background: rgba(0,0,0,.86); }

/* Compact, readable decision log rows. */
.history-screen .history-row { min-height: 78px; padding: 10px; }
.history-screen .history-item { grid-template-columns: 46px minmax(0,1fr) auto; }
.history-thumbs { width: 46px; height: 66px; }
/* Tiny tarot spread: full card at its true 480:831 ratio, cream frame, offset shadow, fanned tilt. */
.history-thumbs img {
  left: calc(var(--stack) * 9px);
  top: calc(2px + var(--stack) * 1px);
  width: 34px;
  height: 59px;
  aspect-ratio: auto;
  object-fit: cover;
  border: 2px solid #f4efe3;
  border-radius: 3px;
  background: #f4efe3;
  box-shadow: 3px 4px 0 rgba(0,0,0,.6);
  rotate: calc(-4deg + var(--stack) * 9deg);
}
.history-screen .history-copy .history-genre { color: #0b0b0b; }
.history-screen .history-copy small {
  display: -webkit-box;
  white-space: normal;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
}

/* Functional statistics tabs and an always-visible return route. */
.stats-back {
  position: relative;
  z-index: 2;
  min-height: 42px;
  margin: 0 0 13px;
  padding: 7px 12px;
  border: 1px solid #161616;
  border-radius: 999px;
  background: rgba(250,247,238,.94);
  color: #111;
  font-weight: 800;
}
.stats-title,
.stats-tabs,
.stats-panel { position: relative; z-index: 1; }
.stats-tabs > button {
  min-height: 40px;
  padding: 7px 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(236,230,217,.96);
  color: #191714;
  font-size: .75rem;
  font-weight: 800;
}
.stats-tabs > button.selected {
  border-color: #080808;
  background: #080808;
  color: #fff;
}
.stats-breakdown {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid #bdb4a4;
  background: rgba(250,247,238,.97);
  color: #111;
}
.stats-breakdown h2 { margin: 0 0 8px; font-size: 1rem; }
.stats-breakdown > p { color: #4a443b; line-height: 1.7; }
.stats-breakdown-row { display: grid; grid-template-columns: 72px 1fr 42px; gap: 8px; align-items: center; margin: 12px 0; font-size: .78rem; }
.stats-breakdown-row > i { height: 9px; overflow: hidden; border-radius: 99px; background: #ded7ca; }
.stats-breakdown-row > i > b { display: block; height: 100%; background: #155b8b; }
.stats-breakdown-row > strong { text-align: right; }

/* High-contrast text surfaces on collage backgrounds. */
.decide-screen > h1,
.completion-copy,
.map-screen.has-deep > .map-heading,
.history-screen .history-search,
.quickstart-screen .quickstart-help {
  border-radius: 10px;
  background: rgba(0,0,0,.78);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
}
.decide-screen > h1 { display: inline-block; padding: 8px 12px; }
.screen.completion-screen > .completion-copy { padding: 12px 14px; }
.history-screen .history-search { padding: 7px; }
button:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 3px solid #f1d527; outline-offset: 3px; }

@media (max-width: 380px), (max-height: 700px) {
  .draw-screen .fan-deck { height: 300px; bottom: 12%; padding-top: 96px; }
  .draw-screen .fan-deck .flip-card.is-centered:not(:disabled):not(.flipped),
  .draw-screen .fan-deck .flip-card:not(:disabled):not(.flipped):hover,
  .draw-screen .fan-deck .flip-card:focus-visible { transform: translateY(-30px) rotate(0) scale(1.12); }
  .two-result .choice-comparison { margin-top: 68px; gap: 8px; }
  .two-result .compare-card .card-image-frame { height: 184px; }
  .two-result .compare-node > p { min-height: 80px; padding: 8px 5px; font-size: .75rem; }
}

/* P38 — restore contained mode art and both hidden card faces. */
.home-screen .mode-art .card-back {
  position: absolute;
  top: 2px;
  width: 39px;
  height: 62px;
}
.home-screen .one-art .card-back { left: 50%; transform: translateX(-50%) rotate(-7deg); }
.home-screen .two-art .card-back:first-child { left: calc(50% - 19px); transform: translateX(-50%) rotate(-8deg); }
.home-screen .two-art .card-back:last-child { left: calc(50% + 19px); transform: translateX(-50%) rotate(8deg); }
.quickstart-screen .mode-art { height: 70px; margin-bottom: 5px; overflow: visible; }
.quickstart-screen .draw-choice strong,
.quickstart-screen .draw-choice > span:not(.mode-art):not(.choice-number):not(.choice-kicker):not(.choice-stamp),
.quickstart-screen .draw-choice small { position: relative; z-index: 3; }

.draw-screen .flip-back.card-back {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
}
.draw-screen .dual-draw .flip-back {
  border: 4px solid #eee3ca !important;
  filter: brightness(1.1) saturate(1.05);
  box-shadow: inset 0 0 0 2px #102947,0 14px 28px rgba(0,0,0,.72);
}

/* The tutorial now belongs to the same collage world as the rest of DECIDE. */
.tutorial-intro {
  isolation: isolate;
  color: #fff;
  background: #080808 url("./assets/editorial/choice-collage.webp") 50% 50% / cover no-repeat fixed;
}
.tutorial-intro::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg,rgba(0,0,0,.12),rgba(0,0,0,.32) 38%,rgba(0,0,0,.88) 76%,#050505);
}
.tutorial-intro-card {
  width: min(560px,100%);
  justify-content: flex-end;
  padding: max(76px,env(safe-area-inset-top)) 24px calc(34px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg,transparent 0 23%,rgba(5,5,5,.18) 42%,rgba(5,5,5,.9) 68%,rgba(5,5,5,.98));
  color: #fff;
}
.tutorial-progress { min-height: 28px; }
.tutorial-progress span { background: rgba(255,255,255,.42); }
.tutorial-progress span.current { background: #f1d527; box-shadow: 0 0 0 4px rgba(241,213,39,.18); }
.tutorial-intro-card h2 {
  max-width: 10ch;
  margin: 15px 0 20px;
  color: #fff;
  font-size: clamp(2.35rem,10vw,4rem);
  line-height: 1.18;
  text-shadow: 0 3px 18px #000;
}
.tutorial-intro-lines { gap: 8px; }
.tutorial-intro-lines p {
  padding: 10px 12px;
  border-left: 3px solid #f1d527;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 15px;
  line-height: 1.55;
  backdrop-filter: blur(7px);
}
.tutorial-intro-note { margin: 14px 0 18px; color: #ded7ca; text-shadow: 0 2px 8px #000; }
.tutorial-intro-start {
  max-width: none;
  border: 2px solid #f1d527;
  border-radius: 999px;
  background: #f4efe3;
  color: #090909;
  box-shadow: 0 8px 24px rgba(0,0,0,.46);
}

@media (max-height: 700px) {
  .tutorial-intro-card { padding-top: 64px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .tutorial-intro-card h2 { margin-block: 8px 12px; font-size: 2.25rem; }
  .tutorial-intro-lines p { padding-block: 7px; }
  .tutorial-intro-note { margin-block: 9px 12px; }
}

/* P39 — one-card reflection lives inside the thought node; expose it in Deep mode. */
.one-result.deep-menu-open > .thought-map {
  display: block;
  position: relative;
  z-index: 4;
  max-width: none;
  margin: 230px 0 0;
  padding: 0;
}
.one-result.deep-menu-open .thought-node { display: none; }
.one-result.deep-menu-open .thought-node:last-child { display: block; }
.one-result.deep-menu-open .thought-node:last-child > * { display: none; }
.one-result.deep-menu-open .thought-node:last-child > .reflection-card {
  display: block;
  position: relative;
  z-index: 5;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.one-result.deep-menu-open .thought-node:last-child > .reflection-card > h3,
.one-result.deep-menu-open .thought-node:last-child > .reflection-card > .reflection-actions,
.one-result.deep-menu-open .reflection-options > p { display: none; }
.one-result.deep-menu-open .reflection-options {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

/* P37 — reachable navigation and tighter editorial components. */
.bottom-nav {
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 0;
  padding: 7px max(8px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
  border-top: 1px solid rgba(255,255,255,.18);
  background: rgba(4,4,4,.96);
}
.nav-item {
  position: relative;
  min-width: 0;
  min-height: 52px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 0;
  color: #aaa49a;
  font-weight: 700;
}
.nav-item::before { color: currentColor; font-family: Arial,sans-serif; font-size: 1rem; line-height: 1; }
.bottom-nav .nav-back::before { content: "←"; }
.nav-item[data-nav="home"]::before { content: "⌂"; }
.nav-item[data-nav="history"]::before { content: "▣"; }
.nav-item[data-nav="stats"]::before { content: "▂▅▇"; font-size: .75rem; letter-spacing: 1px; }
.nav-item[data-action="open-settings"]::before { content: "⚙"; }
.nav-item span { font-size: .75rem; letter-spacing: .01em; }
.nav-item.active {
  background: transparent;
  color: #fff;
}
.nav-item.active::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 28%;
  right: 28%;
  height: 3px;
  background: #f1d527;
}
.nav-item:disabled { opacity: .28; }
body:not([data-view="home"]) .nav-back { color: #fff; }
body:not([data-view="home"]) .nav-back::before { color: #f1d527; }
body[data-view="session"] .bottom-nav,
body[data-view="decide"] .bottom-nav { display: grid !important; }
body[data-view="session"] .app-shell,
body[data-view="decide"] .app-shell { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
body[data-view="session"] .map-screen > .text-back,
body[data-view="decide"] .decide-screen > .text-back,
body[data-view="detail"] .detail-screen > .text-back,
body[data-view="stats"] .stats-back,
body[data-view="history"] .history-screen > .text-back { display: none; }
.deep-menu-open .deep-back { display: none !important; }

/* Return the draw to a simple, legible fan with no oversized spotlight. */
.draw-screen .fan-deck {
  height: 248px;
  bottom: 18%;
  padding: 54px calc(50% - 46px) 46px;
  scroll-snap-type: none;
  background: linear-gradient(90deg,rgba(0,0,0,.18),rgba(0,0,0,.72) 22% 78%,rgba(0,0,0,.18));
  box-shadow: inset 0 1px rgba(255,255,255,.16),inset 0 -1px rgba(255,255,255,.12);
}
.draw-screen .fan-deck::before { display: none; }
.draw-screen .fan-deck .flip-card.is-centered:not(:disabled):not(.flipped) {
  z-index: 80;
  transform: translateY(calc(var(--drop) - 8px)) rotate(0) scale(1.05);
}
.draw-screen .fan-deck .flip-card:not(:disabled):not(.flipped):hover,
.draw-screen .fan-deck .flip-card:focus-visible {
  z-index: 90;
  transform: translateY(-10px) rotate(0) scale(1.06);
}
.draw-screen .fan-deck .flip-card.chosen { transform: translateY(-8px) rotate(0) scale(1.06); }
.draw-screen .fan-deck .flip-face { box-shadow: 0 12px 24px rgba(0,0,0,.82); }
.draw-screen .fan-guide {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(18% + 208px);
  width: max-content;
  max-width: calc(100% - 40px);
  margin: 0;
  padding: 7px 14px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  background: rgba(0,0,0,.82);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-align: center;
  backdrop-filter: blur(8px);
}
.draw-screen .text-back {
  top: auto;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 18px;
  min-height: 44px;
  padding: 8px 14px;
}
.draw-screen .draw-instruction { bottom: calc(70px + env(safe-area-inset-bottom)); }

/* Two-card results: artwork, title and reading are separate blocks. */
.two-result .compare-node { grid-template-rows: auto auto auto auto; }
.two-result .compare-card {
  padding: 5px;
  overflow: hidden;
  border: 1px solid #111;
  border-radius: 4px;
  background: #f8f3e8;
}
.two-result .compare-card .card-image-frame {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 480 / 830;
  border-radius: 0;
  background: #e6dfd0;
}
.two-result .compare-card .card-image-frame img { object-fit: contain; }
.two-result .compare-meta {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  padding: 8px 5px;
  border: 1px solid rgba(17,17,17,.22);
  background: rgba(250,247,238,.97);
  color: #111;
  text-align: center;
}
.two-result .compare-meta b { font-size: .82rem; line-height: 1.35; }
.two-result .compare-meta small { color: #5d574e; font-size: .75rem; }
.two-result .compare-node > p { margin-top: 7px; }

/* Card detail and sharing use thumbnails, not poster-sized cards. */
.card-detail-header { grid-template-columns: 86px minmax(0,1fr); gap: 14px; }
.card-detail-image-frame { width: 86px; border-radius: 6px; }
.share-preview-images picture { flex: 0 0 54px; width: 54px; height: 94px; overflow: hidden; }
.share-preview-images img { width: 54px; height: 94px; aspect-ratio: auto; object-fit: contain; border-radius: 3px; box-shadow: 2px 4px 10px rgba(0,0,0,.4); }
.share-card-preview { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: start; }
.share-card-preview .share-preview { max-height: 112px; margin: 0; }
.saved-card { grid-template-columns: 72px minmax(0,1fr); gap: 13px; }
.saved-card-image-button,
.saved-card-image-frame { width: 72px; }

/* Share sheet: compact black editorial panel matching the reference. */
#share-modal .share-sheet {
  max-width: 520px;
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255,255,255,.28);
  border-bottom: 0;
  background:
    linear-gradient(135deg,transparent 0 72%,rgba(92,37,173,.2) 72% 76%,transparent 76%),
    #080808;
  color: #fff;
}
#share-modal .sheet-handle { background: #777; }
#share-modal .sheet-head { position: sticky; z-index: 5; top: -12px; padding: 8px 0 13px; border-bottom: 1px solid #4b4740; background: #080808; }
#share-modal .sheet-head h2 { color: #fff; font-size: 1.25rem; }
#share-modal .sheet-head .eyebrow { color: #f1d527; }
#share-modal .sheet-head button { border: 1px solid #5a554d; background: #151515; color: #fff; }
#share-modal .share-lead { color: #d8d0c3; }
#share-modal .share-card-preview,
#share-modal .share-preview { border-color: #514b42; border-radius: 3px; background: #111; color: #eee7da; }
#share-modal .share-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
#share-modal .share-option {
  min-height: 54px;
  grid-template-columns: 34px 1fr;
  justify-items: start;
  padding: 8px 11px;
  border-color: #4f4a43;
  border-radius: 3px;
  background: #111;
  color: #fff;
}
#share-modal .share-option b { border-radius: 50%; }
#share-modal .share-option span { font-size: .78rem; }
#share-modal .copy-link {
  border-color: #625b50;
  border-radius: 3px;
  background: #171717;
  color: #fff;
}
#share-modal .copy-link span { color: #d2cbbf; }
#share-modal .copy-link b { color: #f1d527; }
#share-modal .share-theme-picker > b { color: #fff; }
#share-modal .share-theme-chip { border-color: #625b50; background: #171717; color: #d2cbbf; }
#share-modal .share-theme-chip.active { border-color: #f1d527; color: #f1d527; }

/* Settings sheet: monochrome editorial rows instead of generic rounded cards. */
#settings-modal .settings-sheet {
  max-width: 560px;
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255,255,255,.28);
  border-bottom: 0;
  background: #090909;
  color: #fff;
}
#settings-modal .sheet-handle { background: #777; }
#settings-modal .sheet-head { position: sticky; z-index: 5; top: -12px; padding: 8px 0 12px; border-bottom: 1px solid #504a42; background: #090909; }
#settings-modal .sheet-head h2 { color: #fff; font-family: Didot,"Times New Roman",serif; font-size: 1.7rem; letter-spacing: .03em; }
#settings-modal .sheet-head button { border: 1px solid #5b554c; background: #151515; color: #fff; }
#settings-modal .deck-setting { margin-top: 12px; padding-top: 12px; border-color: #4d4841; }
#settings-modal .deck-setting > p,
#settings-modal .deck-preset-notes p,
#settings-modal .feedback-setting p,
#settings-modal .data-setting p,
#settings-modal .data-setting small,
#settings-modal .setting-note p,
#settings-modal .backup-format-note { color: #cfc7ba; }
#settings-modal .referral-setting { border-color: #4d4841; }
#settings-modal .referral-setting p { color: #cfc7ba; }
#settings-modal .referral-code b { color: #f1d527; }
#settings-modal .referral-count b { color: #f4efe3; }
#settings-modal .deck-quad { display: grid; grid-template-columns: 64px repeat(2,minmax(0,1fr)); gap: 8px; align-items: stretch; border: 0; }
#settings-modal .deck-quad-col { align-self: end; padding: 0 0 2px; color: #f1d527; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-align: center; }
#settings-modal .deck-quad-row { display: flex; flex-direction: column; justify-content: center; gap: 2px; color: #f1d527; font-size: .75rem; font-weight: 800; line-height: 1.3; word-break: keep-all; writing-mode: horizontal-tb; }
#settings-modal .deck-quad-row em { color: #cfc7ba; font-style: normal; font-weight: 600; }
#settings-modal .deck-preset { position: relative; min-height: 118px; padding: 30px 6px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #4c4740; border-radius: 6px; background: #131313; color: #fff; text-align: center; }
#settings-modal .deck-preset strong { font-size: 1rem; }
#settings-modal .deck-preset small { color: #cfc7ba; font-size: .75rem; }
#settings-modal .deck-preset.selected { border-color: #f1d527; background: #f4efe3; color: #0a0a0a; box-shadow: 0 0 0 2px #f1d527; }
#settings-modal .deck-preset.selected small { color: #4a453e; }
#settings-modal .deck-preset-badge { position: absolute; top: 6px; right: 6px; padding: 2px 6px; background: #0a0a0a; color: #f1d527; font-size: .75rem; }
.deck-preset-visual { display: flex; gap: 10px; justify-content: center; margin-bottom: 4px; }
.deck-fig { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.deck-fig svg { display: block; overflow: visible; fill: currentColor; }
.deck-fig .face { fill: none; stroke: currentColor; stroke-width: 1.5; }
.deck-fig .ghost { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .35; }
.deck-fig em { font-style: normal; font-size: .75rem; font-weight: 700; line-height: 1; opacity: .75; }
.deck-fig.rev em { color: #f1d527; opacity: 1; }
#settings-modal .deck-preset.selected .deck-fig.rev em { color: #8a6d00; }
#settings-modal .deck-quad-detail { margin-top: 12px; padding: 12px 14px; border: 1px solid #4d4841; border-radius: 3px; background: #131313; color: #fff; font-size: .84rem; line-height: 1.55; }
#settings-modal .deck-quad-detail b { margin-right: 8px; color: #f1d527; }
#settings-modal .deck-quad-detail span { color: #cfc7ba; font-size: .78rem; }
#settings-modal .deck-quad-detail p { margin: 6px 0 0; }
#settings-modal .deck-quad-detail em { display: inline-block; margin-right: 6px; color: #f1d527; font-style: normal; font-size: .75rem; font-weight: 800; }
#settings-modal .deck-advanced,
#settings-modal .feedback-setting,
#settings-modal .data-setting { border-color: #4d4841; }
#settings-modal .deck-advanced summary,
#settings-modal .tutorial-replay { color: #f1d527; }
#settings-modal .segmented-switch { border: 1px solid #4d4841; border-radius: 3px; background: #141414; }
#settings-modal .segmented-switch button { border-radius: 2px; color: #d2cabd; }
#settings-modal .segmented-switch button.selected { background: #f4efe3; color: #111; }
#settings-modal .deck-summary,
#settings-modal .setting-note,
#settings-modal .learn-entry { border: 1px solid #4d4841; border-radius: 3px; background: #131313; color: #fff; }
#settings-modal .deck-summary strong,
#settings-modal .learn-entry span:last-child { color: #f1d527; }
#settings-modal .setting-backs .back-picker { grid-template-columns: 1fr; max-height: none; }
#settings-modal .back-choice { max-width: 180px; border-color: #5a544b; border-radius: 3px; background: #151515; color: #fff; }
#settings-modal .back-choice.selected { border-color: #f1d527; background: #151515; }
#settings-modal .data-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
#settings-modal .data-actions .button { border-color: #5d574f; border-radius: 3px; background: #151515; color: #fff; }

.sheet-bottom-close {
  position: sticky;
  z-index: 6;
  bottom: 0;
  width: 100%;
  min-height: 50px;
  margin-top: 16px;
  border: 1px solid #f4efe3;
  border-radius: 999px;
  background: #f4efe3;
  color: #090909;
  font-weight: 900;
  box-shadow: 0 -12px 24px rgba(0,0,0,.4);
}

@media (max-width: 380px), (max-height: 700px) {
  .draw-screen .fan-deck { height: 224px; bottom: 18%; padding-top: 44px; }
  .draw-screen .fan-guide { bottom: calc(18% + 184px); }
  .two-result .compare-card .card-image-frame { height: auto; }
  .two-result .compare-node > p { font-size: .75rem; }
}

/* P40 — results are editorial compositions, not a stack of generic UI cards. */
.one-result {
  background-color: #07090b !important;
  background-image:
    linear-gradient(180deg,rgba(5,7,9,.02) 0 48%,rgba(5,7,9,.78) 82%,#050607 100%),
    url("./assets/editorial/result-collage.webp") !important;
  background-position: 50% 0 !important;
  background-size: 100% auto !important;
}
.one-result .thought-map {
  width: 100%;
  max-width: 390px;
  padding-top: 50px;
}
.one-result .thought-node {
  display: grid;
  justify-items: center;
  padding-bottom: 12px;
}
.one-result .compact-card {
  width: min(45vw,174px);
  margin: 0;
  padding: 6px 6px 0;
  overflow: visible;
  border: 0;
  border-radius: 2px;
  background: #eee5d4;
  box-shadow: 0 18px 36px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.7);
  transform: rotate(-1deg);
}
.one-result .compact-card .reading-image-frame {
  width: 100%;
  aspect-ratio: 480 / 830;
  background: #dcd2c1;
}
.one-result .compact-card .reading-image-frame img { object-fit: contain; }
.one-result .compact-card > div {
  display: grid;
  gap: 1px;
  margin: 0 -6px;
  padding: 8px 7px 9px;
  background: #eee5d4;
  color: #090909;
  text-align: center;
}
.one-result .compact-card .tarot-index {
  color: #61594d;
  font-size: .75rem;
  letter-spacing: .08em;
}
.one-result .compact-card strong {
  font-family: "Hiragino Mincho ProN","Yu Mincho",serif;
  font-size: 1rem;
  line-height: 1.35;
}
.one-result .reading {
  position: relative;
  z-index: 2;
  width: min(100%,350px);
  margin: -5px 0 0;
  padding: 15px 20px 17px;
  border: 0;
  border-left: 3px solid #f1d527;
  border-radius: 0;
  background: rgba(248,243,231,.96);
  box-shadow: 0 11px 26px rgba(0,0,0,.28);
  clip-path: polygon(1% 3%,99% 0,100% 94%,2% 100%);
  transform: rotate(.35deg);
}
.one-result .reading::before {
  content: "CARD MESSAGE";
  display: block;
  margin-bottom: 5px;
  color: #766d60;
  font-family: Arial,sans-serif;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .19em;
}
.one-result .reading b { font-size: 1.15rem; }
.one-result .reading p { margin-top: 7px; font-size: .82rem; line-height: 1.7; }
.one-result .reflection-card {
  width: min(100%,350px);
  margin: 13px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.one-result .reflection-card > h3 {
  margin: 0 0 9px;
  color: #fff;
  font-size: .84rem;
  text-align: center;
  text-shadow: 0 2px 10px #000;
}
.one-result .reflection-actions { gap: 8px; }
.one-result .reflection-actions .button {
  min-height: 50px;
  padding: 9px 8px;
  border: 1px solid #f4efe3;
  border-radius: 999px;
  background: #070707;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.32);
  font-size: .8rem;
}
.one-result .reflection-actions .button.secondary {
  background: rgba(244,239,227,.96);
  color: #090909;
}

/* A/B result: full cards with captions, paper notes and a decisive black band. */
.two-result .compare-card {
  padding: 5px;
  border: 0;
  border-radius: 2px;
  background: #eee5d4;
  box-shadow: 0 12px 24px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.6);
}
.two-result .compare-node:first-child .compare-card { transform: rotate(-.8deg); }
.two-result .compare-node:last-child .compare-card { transform: rotate(.8deg); }
.two-result .compare-meta {
  position: relative;
  z-index: 3;
  gap: 1px;
  margin: -2px 3px 0;
  padding: 8px 4px 7px;
  border: 0;
  border-radius: 0;
  background: #eee5d4;
  box-shadow: 0 7px 14px rgba(0,0,0,.16);
}
.two-result .compare-meta b { font-size: .86rem; }
.two-result .compare-meta small { font-size: .75rem; letter-spacing: .08em; }
.two-result .compare-node > p {
  min-height: 90px;
  margin: 8px 1px 0;
  padding: 10px 9px 11px;
  border: 0;
  border-left: 3px solid #111;
  border-radius: 0;
  background: rgba(249,245,235,.96);
  box-shadow: 0 8px 17px rgba(0,0,0,.14);
  text-align: left;
  clip-path: polygon(0 2%,98% 0,100% 96%,2% 100%);
}
.two-result .compare-node:last-child > p { transform: rotate(.45deg); }
.two-result .verdict-card {
  margin: 15px -3px 10px;
  padding: 13px 18px 15px;
  border: 0;
  border-radius: 0;
  background: #080808;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.3);
  text-align: left;
  clip-path: polygon(1% 2%,100% 0,98.5% 96%,0 100%);
}
.two-result .verdict-kicker { color: #cfc8bc; font-size: .75rem; letter-spacing: .1em; }
.two-result .verdict-card h3 { margin: 5px 0 0; color: #fff; font-size: 1.05rem; line-height: 1.55; }
.two-result .verdict-card h3::before { content: "✦ "; color: #f1d527; }
.two-result > .reflection-card .reflection-actions { gap: 8px; }
.two-result > .reflection-card .button {
  border: 1px solid #111;
  border-radius: 999px;
  background: #080808;
  color: #fff;
}
.two-result > .reflection-card .button.secondary { background: rgba(248,243,231,.96); color: #090909; }

/* Log and statistics use dividers and torn paper, avoiding generic card grids. */
.history-screen .history-list { gap: 0; border-top: 1px solid #4c4740; }
.history-screen .history-swipe { border-radius: 0; background: #611f1f; }
.history-screen .history-row {
  border: 0;
  border-bottom: 1px solid #4c4740;
  border-radius: 0;
  background: rgba(7,7,7,.88);
}
.history-screen .history-item { background: transparent; }
.stats-summary,
.satisfaction,
.stats-themes,
.stats-breakdown {
  border: 0;
  border-radius: 0;
  background: rgba(249,245,235,.96);
  box-shadow: 7px 9px 0 rgba(17,17,17,.08);
  clip-path: polygon(0 1.5%,99% 0,100% 97%,1% 100%);
}
.stats-panel > :nth-child(even) { transform: rotate(-.25deg); }

@media (max-width: 380px), (max-height: 700px) {
  .one-result .thought-map { padding-top: 32px; }
  .one-result .compact-card { width: min(39vw,145px); }
  .one-result .reading { padding-block: 12px 14px; }
  .one-result .reading p { line-height: 1.55; }
  .one-result .reflection-card { margin-top: 9px; }
}

/* P41 — every persistent destination keeps a thumb-reachable escape route. */
body[data-view="history"] .bottom-nav,
body[data-view="detail"] .bottom-nav,
body[data-view="stats"] .bottom-nav {
  display: grid !important;
}
body[data-view="history"] .app-shell,
body[data-view="detail"] .app-shell,
body[data-view="stats"] .app-shell {
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* P42 — dark editorial statistics with theme log drill-down. */
.screen.stats-screen {
  color: #f4efe3;
  background: #050505 url("./assets/editorial/dark-collage.webp") 50% 0 / 100% auto no-repeat !important;
}
.stats-screen::before { background: linear-gradient(180deg,rgba(5,5,5,.35) 0,rgba(5,5,5,.82) 260px,#050505 520px); }
.stats-back { border-color: #f4efe3; background: #050505; color: #f4efe3; }
.stats-title h1 { color: #f4efe3; font-size: 3rem; text-shadow: 4px 4px 0 #000; }
.stats-title p {
  display: inline-block;
  margin: 12px 0 18px;
  padding: 4px 9px;
  background: #f1d527;
  color: #0b0b0b;
  font-weight: 700;
  transform: rotate(-1.5deg);
  box-shadow: 4px 4px 0 #000;
}
.stats-tabs { gap: 6px; }
.stats-tabs > button {
  border: 1px solid #f4efe3;
  border-radius: 2px;
  background: #0b0b0b;
  color: #f4efe3;
  letter-spacing: .08em;
}
.stats-tabs > button.selected { border-color: #f1d527; background: #f1d527; color: #0b0b0b; box-shadow: 3px 3px 0 #f4efe3; }
.stats-summary,
.satisfaction,
.stats-themes,
.stats-breakdown {
  margin-top: 18px;
  padding: 16px;
  border: 2px solid #0b0b0b;
  border-radius: 0;
  background: #f4efe3;
  color: #0b0b0b;
  box-shadow: 6px 7px 0 #000, 6px 7px 0 1px #3d3a34;
  clip-path: none;
}
.stats-panel > :nth-child(odd) { transform: rotate(.35deg); }
.stats-panel > :nth-child(even) { transform: rotate(-.45deg); }
.stats-summary { display: flex; align-items: flex-end; justify-content: space-between; background: #0b0b0b; color: #f4efe3; border-color: #f4efe3; }
.stats-summary > span { font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: .85rem; letter-spacing: .08em; }
.stats-summary > strong { margin: 0; color: #f1d527; font-size: 4.2rem; line-height: .85; text-shadow: 4px 4px 0 #3b3510; }
.stats-summary > strong small { color: #f4efe3; font-size: .9rem; text-shadow: none; }
.satisfaction h2,
.stats-themes h2,
.stats-breakdown h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 12px;
  font-family: "Hiragino Mincho ProN","Yu Mincho",serif;
  font-size: 1rem;
}
.satisfaction-ring { background: conic-gradient(#f1d527 var(--score),#0b0b0b 0); box-shadow: 3px 4px 0 rgba(0,0,0,.35); }
.satisfaction-ring::before { background: #f4efe3; border: 2px solid #0b0b0b; }
.review-bars i { height: 7px; border-radius: 0; background: linear-gradient(90deg,#0b0b0b var(--value),#dcd4c3 0); }
.review-bars b { font-family: Didot,"Bodoni 72",serif; font-size: .95rem; }

/* Theme tickets: cut-paper labels that open the matching decision log. */
.stats-themes > div { gap: 10px 8px; }
.stats-theme-ticket {
  min-height: 40px;
  padding: 8px 12px;
  border: 2px solid #0b0b0b;
  border-radius: 0;
  background: #fffaf0;
  color: #0b0b0b;
  font: 700 .82rem "Hiragino Mincho ProN","Yu Mincho",serif;
  box-shadow: 3px 3px 0 #0b0b0b;
  transform: rotate(-1.2deg);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stats-theme-ticket:nth-child(3n+2) { background: #f1d527; transform: rotate(1deg); }
.stats-theme-ticket:nth-child(3n) { transform: rotate(-.4deg); }
.stats-theme-ticket b { margin-left: 6px; font-family: Didot,"Bodoni 72",serif; font-size: 1.05rem; }
.stats-theme-ticket:hover,
.stats-theme-ticket:focus-visible { transform: translate(-1px,-2px) rotate(0); box-shadow: 5px 5px 0 #0b0b0b; }
.stats-theme-ticket.selected { background: #0b0b0b; color: #f1d527; box-shadow: 3px 3px 0 #f1d527, 3px 3px 0 2px #0b0b0b; transform: rotate(0); }

/* Theme breakdown rows are buttons too. */
button.stats-breakdown-row {
  width: 100%;
  margin: 6px 0;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .8rem;
  text-align: left;
  cursor: pointer;
}
button.stats-breakdown-row:hover,
button.stats-breakdown-row:focus-visible { border-color: #0b0b0b; background: #fffaf0; }
button.stats-breakdown-row.selected { border-color: #0b0b0b; background: #0b0b0b; color: #f4efe3; }
.stats-breakdown-row > i { height: 10px; border-radius: 0; background: #dcd4c3; }
.stats-breakdown-row > i > b { background: #0b0b0b; }
.stats-breakdown-row.selected > i { background: #3a372f; }
.stats-breakdown-row.selected > i > b,
.stats-breakdown-row > strong { font-family: Didot,"Bodoni 72",serif; }
.stats-breakdown-row.selected > i > b { background: #f1d527; }

/* Drill-down log list for the selected theme. */
.stats-theme-logs {
  position: relative;
  margin-top: 22px;
  padding: 14px 12px 6px;
  border: 1px solid #f4efe3;
  background: rgba(5,5,5,.94);
  color: #f4efe3;
  box-shadow: 6px 7px 0 #f1d527;
  scroll-margin-top: 16px;
  animation: stats-log-in .25s ease;
}
@keyframes stats-log-in { from { opacity: 0; transform: translateY(8px); } }
.stats-panel > .stats-theme-logs { transform: none; }
.stats-theme-logs header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.stats-theme-logs h2 { margin: 0; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1rem; line-height: 1.5; }
.stats-theme-logs h2 span { display: block; margin-bottom: 4px; color: #f1d527; font: 700 .75rem/1 Didot,"Bodoni 72",serif; letter-spacing: .22em; }
.stats-theme-logs h2 b { margin-left: 8px; padding: 1px 6px; background: #f1d527; color: #0b0b0b; font-size: .75rem; }
.stats-theme-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid #f4efe3;
  border-radius: 0;
  background: transparent;
  color: #f4efe3;
  font-size: 1.2rem;
  cursor: pointer;
}
.stats-theme-close:hover { background: #f1d527; border-color: #f1d527; color: #0b0b0b; }
.stats-theme-logs .history-list { display: grid; gap: 0; border-top: 1px solid #4c4740; }
.stats-theme-logs .history-row {
  grid-template-columns: minmax(0,1fr);
  min-height: 78px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid #4c4740;
  border-radius: 0;
  background: transparent;
  transform: none;
}
.stats-theme-logs .history-item { grid-template-columns: 46px minmax(0,1fr) auto; min-height: 0; padding: 0; background: transparent; color: inherit; }
.stats-theme-logs .history-copy strong { color: #fff; }
.stats-theme-logs .history-copy,
.stats-theme-logs .history-copy time,
.stats-theme-logs .history-copy > span { color: #c8c2b7; }
.stats-theme-logs .history-copy small,
.stats-theme-logs .history-item em,
.stats-theme-logs .history-arrow { color: #f1d527; }
.stats-theme-logs .history-copy .history-genre { color: #0b0b0b; }
.stats-theme-logs .history-copy small { display: -webkit-box; white-space: normal; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.45; }

/* Satisfaction: color-coded review rows that open the matching decision log. */
.satisfaction { --good: #f1d527; --fair: #a3ab3a; --neutral: #8d877c; --bad: #c8372d; --pending: #c8c2b7; align-items: center; }
.satisfaction-ring {
  width: 108px;
  height: 108px;
  background: conic-gradient(var(--good) var(--good-from,0deg) var(--good-to,0deg),var(--fair) 0 var(--fair-to,0deg),var(--neutral) 0 var(--neutral-to,0deg),var(--bad) 0 var(--bad-to,0deg),#dcd4c3 0);
  border: 2px solid #0b0b0b;
}
.satisfaction-ring.empty { background: #dcd4c3; }
.satisfaction-ring strong { line-height: 1; }
.satisfaction-ring > span { position: absolute; bottom: 27px; font-size: .75rem; font-weight: 700; letter-spacing: .12em; color: #6b6458; }
.satisfaction-ring strong { transform: translateY(-5px); }
.review-bars { display: grid; gap: 6px; min-width: 0; }
.review-bars .review-row {
  --tone: var(--pending);
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 4px 8px;
  min-height: 44px;
  margin: 0;
  padding: 6px 8px 6px 10px;
  border: 1.5px solid #0b0b0b;
  border-left: 7px solid var(--tone);
  border-radius: 0;
  background: #fbf8f0;
  color: #0b0b0b;
  font: inherit;
  font-size: .75rem;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.review-bars .review-good { --tone: var(--good); }
.review-bars .review-fair { --tone: var(--fair); }
.review-bars .review-neutral { --tone: var(--neutral); }
.review-bars .review-bad { --tone: var(--bad); }
.review-bars .review-row:hover:not(:disabled) { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 #0b0b0b; }
.review-bars .review-row.selected { background: #0b0b0b; color: #f4efe3; box-shadow: 3px 3px 0 var(--tone); }
.review-bars .review-row:disabled { opacity: .45; cursor: default; }
.review-bars .review-label { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-bars .review-label em { flex: 0 0 auto; display: grid; place-items: center; width: 20px; height: 20px; background: var(--tone); color: #0b0b0b; font-style: normal; font-size: .75rem; }
.review-bars .review-row i { grid-column: 1 / -1; grid-row: 2; height: 7px; border-radius: 0; background: linear-gradient(90deg,var(--tone) var(--value),#dcd4c3 0); outline: 1px solid rgba(11,11,11,.25); }
.review-bars .review-row.selected i { background: linear-gradient(90deg,var(--tone) var(--value),#4c4740 0); }
.review-bars .review-row b { grid-row: 1; grid-column: 2; display: flex; align-items: baseline; gap: 5px; font-size: .95rem; }
.review-bars .review-row b small { font-family: system-ui,sans-serif; font-size: .75rem; font-weight: 600; color: #6b6458; }
.review-bars .review-row.selected b small { color: #c8c2b7; }
@media (max-width: 480px) {
  .satisfaction { grid-template-columns: 1fr; justify-items: stretch; }
  .satisfaction .satisfaction-ring { justify-self: center; }
}

/* Stats: awaiting-review block and ranked theme / period tabs */
.stats-pending {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 2px 12px;
  width: 100%;
  margin-top: 18px;
  padding: 14px 16px 14px 26px;
  border: 2px solid #0b0b0b;
  border-radius: 0;
  background: #f1d527;
  color: #0b0b0b;
  font: inherit;
  text-align: left;
  box-shadow: 6px 7px 0 #000;
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.stats-pending::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 12px;
  border-right: 2px solid #0b0b0b;
  background: repeating-linear-gradient(-45deg,#0b0b0b 0 5px,#f1d527 5px 10px);
}
.stats-pending-kicker { grid-column: 1 / -1; font-family: Didot,"Bodoni 72",serif; font-size: .75rem; font-weight: 700; letter-spacing: .22em; }
.stats-pending-title { display: flex; flex-direction: column; gap: 4px; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1.25rem; font-weight: 700; letter-spacing: .06em; }
.stats-pending strong { font-family: Didot,"Bodoni 72",serif; font-size: 3.4rem; line-height: .85; text-shadow: 3px 3px 0 #fffaf0; }
.stats-pending strong small { margin-left: 3px; font-size: .9rem; text-shadow: none; }
button.stats-pending:hover,
button.stats-pending:focus-visible { transform: translate(-2px,-2px) rotate(.35deg); box-shadow: 8px 9px 0 #000; }
.stats-pending.selected { background: #0b0b0b; color: #f4efe3; border-color: #0b0b0b; box-shadow: 6px 7px 0 #f1d527, 6px 7px 0 2px #0b0b0b; }
.stats-pending.selected::before { border-right-color: #f1d527; }
.stats-pending.selected .stats-pending-kicker,
.stats-pending.selected strong { color: #f1d527; text-shadow: none; }
.stats-pending.empty { background: #fbf8f0; cursor: default; }
.stats-pending.empty::before { background: repeating-linear-gradient(-45deg,#dcd4c3 0 5px,#fbf8f0 5px 10px); }
.stats-pending.empty strong { color: #6b6458; text-shadow: none; }

.stats-rank {
  margin-top: 18px;
  border: 2px solid #0b0b0b;
  background: #f4efe3;
  color: #0b0b0b;
  box-shadow: 6px 7px 0 #000, 6px 7px 0 1px #3d3a34;
}
.stats-rank-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 2px 12px;
  padding: 14px 16px;
  background: #0b0b0b;
  color: #f4efe3;
}
.stats-rank-head > span { grid-column: 1 / -1; color: #f1d527; font-family: Didot,"Bodoni 72",serif; font-size: .75rem; font-weight: 700; letter-spacing: .22em; }
.stats-rank-head h2 { margin: 0; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1.2rem; letter-spacing: .06em; }
.stats-rank-head b { color: #f1d527; font-family: Didot,"Bodoni 72",serif; font-size: 2.2rem; line-height: .9; }
.stats-rank-head b small { margin-left: 3px; color: #f4efe3; font-size: .8rem; }
.stats-rank-list { display: grid; gap: 8px; padding: 12px; }
.stats-rank-row {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px 8px 0;
  border: 1.5px solid #0b0b0b;
  border-radius: 0;
  background: #fbf8f0;
  color: #0b0b0b;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.stats-rank-row:hover,
.stats-rank-row:focus-visible { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 #0b0b0b; }
.stats-rank-lead {
  grid-row: 1 / 3;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: -8px 0;
  border-right: 1.5px solid #0b0b0b;
  font-family: Didot,"Bodoni 72",serif;
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
.stats-rank-lead small { margin-top: 2px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; color: #6b6458; }
.stats-rank-row:first-child .stats-rank-lead { background: #f1d527; }
.stats-rank-name { min-width: 0; overflow: hidden; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: .95rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.stats-rank-row > strong { font-family: Didot,"Bodoni 72",serif; font-size: 1.3rem; line-height: 1; text-align: right; }
.stats-rank-row > strong small { margin-left: 2px; font-family: system-ui,sans-serif; font-size: .75rem; }
.stats-rank-row > i { grid-column: 2; height: 8px; background: #dcd4c3; outline: 1px solid rgba(11,11,11,.25); }
.stats-rank-row > i > b { display: block; height: 100%; background: #0b0b0b; }
.stats-rank-share { grid-column: 3; font-size: .75rem; font-weight: 700; color: #6b6458; text-align: right; }
.stats-rank-row.selected { background: #0b0b0b; color: #f4efe3; box-shadow: 3px 3px 0 #f1d527; }
.stats-rank-row.selected .stats-rank-lead { border-right-color: #f1d527; background: #f1d527; color: #0b0b0b; }
.stats-rank-row.selected .stats-rank-lead small { color: #3b3510; }
.stats-rank-row.selected > i { background: #3a372f; }
.stats-rank-row.selected > i > b { background: #f1d527; }
.stats-rank-row.selected .stats-rank-share { color: #c8c2b7; }
.stats-rank-empty { margin: 0; padding: 0 12px 12px; font-size: .75rem; font-weight: 600; color: #6b6458; line-height: 1.7; }
.stats-rank-empty { padding-top: 14px; font-size: .85rem; }

/* Two-card draw: editorial A/B plates, VS emblem and hold-to-reveal CTA */
.draw-two .pair-card { position: relative; }
.draw-screen.draw-two .draw-plate {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  width: max-content;
  margin: 0 auto 10px;
  padding: 4px 12px 5px;
  border: 2px solid #f1d527;
  border-radius: 0;
  background: #0b0b0b;
  box-shadow: 4px 4px 0 #f1d527;
  color: #fffaf0;
  text-shadow: none;
  backdrop-filter: none;
  animation: none;
  transform: rotate(-2deg);
}
.draw-screen.draw-two .pair-card[data-slot="1"] .draw-plate { transform: rotate(2deg); }
.draw-plate small { color: #f1d527; font-family: Didot,"Bodoni 72",serif; font-size: .75rem; font-weight: 700; letter-spacing: .22em; }
.draw-plate span { color: #f1d527; font-family: Didot,"Bodoni 72",serif; font-size: 1.9rem; font-weight: 700; line-height: .9; }
.draw-vs {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 56%;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: #0b0b0b;
  font-family: Didot,"Bodoni 72",serif;
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  transform: translate(-50%,-50%);
  pointer-events: none;
  transition: transform .35s cubic-bezier(.2,.76,.25,1), opacity .3s ease;
}
.draw-vs::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: -1;
  border: 2px solid #000;
  background: #f1d527;
  box-shadow: 4px 4px 0 #000;
  transform: rotate(45deg);
}
.draw-screen.draw-two .reveal-hold {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "kicker hint" "title title";
  align-items: center;
  row-gap: 2px;
  bottom: calc(13% + 16px);
  min-height: 70px;
  padding: 10px 16px 12px 30px;
  overflow: hidden;
  border: 2px solid #000;
  border-radius: 0;
  background: #f1d527;
  box-shadow: 6px 7px 0 #000;
  color: #0b0b0b;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transform: rotate(-.6deg);
  transition: transform .15s ease, box-shadow .15s ease;
}
.draw-screen.draw-two .reveal-hold::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 14px;
  background: repeating-linear-gradient(-45deg,#0b0b0b 0 5px,#f1d527 5px 10px);
  border-right: 2px solid #000;
}
.draw-screen.draw-two .reveal-hold:hover:not(:disabled) { transform: translate(-2px,-2px) rotate(-.3deg); box-shadow: 8px 9px 0 #000; }
.draw-screen.draw-two .reveal-hold:focus-visible { outline: 3px solid #fffaf0; outline-offset: 4px; }
.reveal-hold > span { position: relative; z-index: 1; }
.reveal-kicker { grid-area: kicker; font-family: Didot,"Bodoni 72",serif; font-size: .75rem; font-weight: 700; letter-spacing: .22em; }
.reveal-title { grid-area: title; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; }
.reveal-hint { grid-area: hint; padding: 2px 8px; background: #0b0b0b; color: #f1d527; font-size: .75rem; font-weight: 700; letter-spacing: .08em; }
.reveal-charge {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0b0b0b;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}
.reveal-hold.charging .reveal-charge { transform: scaleX(1); transition: transform .9s linear; }
.reveal-hold.charging > span { color: #f1d527; transition: color .45s ease .3s; }
.reveal-hold.charging .reveal-hint { background: #f1d527; color: #0b0b0b; }
.draw-screen.draw-two .reveal-hold.charging { transform: translate(3px,4px) rotate(-.6deg); box-shadow: 2px 3px 0 #000; }
.draw-screen.draw-two .reveal-hold:disabled { opacity: 1; background: #0b0b0b; color: #f1d527; box-shadow: 6px 7px 0 #f1d527; border-color: #f1d527; }
.draw-screen.draw-two .reveal-hold:disabled .reveal-hint { background: #f1d527; color: #0b0b0b; }
.reveal-hold.nudge { animation: reveal-nudge .42s ease; }
@keyframes reveal-nudge {
  0%,100% { translate: 0 0; }
  20% { translate: -6px 0; }
  40% { translate: 5px 0; }
  60% { translate: -3px 0; }
  80% { translate: 2px 0; }
}
.draw-two.is-charging .pair-card:not(.flipped) { animation: card-charge .9s ease-in forwards; }
.draw-two.is-charging .pair-card[data-slot="1"]:not(.flipped) { animation-delay: -.05s; }
@keyframes card-charge {
  0% { translate: 0 0; rotate: 0deg; }
  15% { translate: -1px 0; rotate: -.4deg; }
  30% { translate: 1px -1px; rotate: .5deg; }
  45% { translate: -2px 0; rotate: -.8deg; }
  60% { translate: 2px -2px; rotate: 1deg; }
  75% { translate: -3px -2px; rotate: -1.3deg; }
  90% { translate: 3px -4px; rotate: 1.5deg; }
  100% { translate: 0 -6px; rotate: 0deg; }
}
.draw-two.is-charging .draw-vs { transform: translate(-50%,-50%) scale(1.2); }
.draw-two.is-revealing .draw-vs { transform: translate(-50%,-50%) rotate(180deg) scale(.4); opacity: 0; }
.draw-two .dual-draw .pair-card[data-slot="1"] .flip-inner { transition-delay: .18s; }
.draw-two.is-revealing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #f1d527;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: reveal-flash .7s ease-out forwards;
}
@keyframes reveal-flash { 0% { opacity: .55; } 100% { opacity: 0; } }

/* Quickstart: editorial mode selector — black / yellow plates, taped, with a draw interaction. */
.quickstart-screen .quickstart-plate {
  position: absolute;
  left: 2px;
  bottom: calc(100% + 16px);
  z-index: 4;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  background: #0b0b0b;
  border: 2px solid #f1d527;
  box-shadow: 4px 4px 0 #f1d527;
  transform: rotate(-2deg);
  animation: qs-plate-in .5s cubic-bezier(.2,1.4,.4,1) both;
}
.quickstart-screen .quickstart-plate small {
  font: 700 .75rem/1 Didot,"Bodoni 72",serif;
  letter-spacing: .22em;
  color: #f1d527;
}
.quickstart-screen .quickstart-plate span {
  font: italic 700 1.35rem/1 Didot,"Bodoni 72",serif;
  letter-spacing: .04em;
  color: #fff;
}
.quickstart-screen .quickstart-plate::after {
  content: "";
  position: absolute;
  right: -34px;
  top: 50%;
  width: 26px;
  height: 10px;
  background: repeating-linear-gradient(-45deg,#0b0b0b 0 5px,#f1d527 5px 10px);
  transform: translateY(-50%) rotate(8deg);
}
.quickstart-screen .choice-grid { gap: 14px; }
.quickstart-screen .draw-choice {
  overflow: visible;
  border-radius: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-family: "Hiragino Mincho ProN","Yu Mincho",serif;
  padding-top: 24px;
  transition: transform .2s cubic-bezier(.2,1.4,.4,1), box-shadow .2s ease, opacity .25s ease;
  animation: qs-slam-in .55s cubic-bezier(.2,1.4,.4,1) both;
}
.quickstart-screen .draw-choice.primary {
  border-radius: 0;
  --qs-tilt: -1.5deg;
  background: #0b0b0b;
  border: 2px solid #f1d527;
  box-shadow: 5px 5px 0 #f1d527;
  color: #fff;
  transform: rotate(var(--qs-tilt));
}
.quickstart-screen .draw-choice:not(.primary) {
  --qs-tilt: 1.5deg;
  background: #f1d527;
  border: 2px solid #0b0b0b;
  box-shadow: 5px 5px 0 #000;
  color: #0b0b0b;
  transform: rotate(var(--qs-tilt));
  animation-delay: .09s;
}
/* striped tape across the top edge */
.quickstart-screen .draw-choice::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  z-index: 4;
  width: 54px;
  height: 14px;
  background: repeating-linear-gradient(-45deg,#0b0b0b 0 5px,#f1d527 5px 10px);
  border: 1px solid #0b0b0b;
  transform: translateX(-50%) rotate(-4deg);
  opacity: .95;
}
.quickstart-screen .draw-choice:not(.primary)::before { transform: translateX(-50%) rotate(5deg); }
.home-screen.quickstart-screen .draw-choice > span.choice-kicker {
  position: absolute;
  left: 10px;
  top: 14px;
  display: block;
  font: 700 .75rem/1 Didot,"Bodoni 72",serif;
  letter-spacing: .03em;
  white-space: nowrap;
  opacity: .85;
}
.quickstart-screen .draw-choice.primary > span.choice-kicker { color: #f1d527; }
.quickstart-screen .draw-choice strong {
  font-family: "Hiragino Mincho ProN","Yu Mincho",serif;
  font-weight: 700;
  letter-spacing: .06em;
}
.quickstart-screen .draw-choice.primary strong { color: #fff; }
.quickstart-screen .draw-choice.primary > span:not(.mode-art):not(.choice-number):not(.choice-kicker):not(.choice-stamp) { color: rgba(255,255,255,.78); }
.quickstart-screen .draw-choice:not(.primary) > span:not(.mode-art):not(.choice-number):not(.choice-kicker):not(.choice-stamp) { color: #1d1b17; }
.quickstart-screen .draw-choice small {
  font-family: Didot,"Bodoni 72",serif;
  font-weight: 700;
  letter-spacing: .2em;
}
.quickstart-screen .draw-choice.primary small { color: #f1d527; }
.quickstart-screen .draw-choice:not(.primary) small { color: #0b0b0b; opacity: .7; }
/* arrow badge */
.quickstart-screen .draw-choice::after {
  right: -7px;
  bottom: -7px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 0;
  font-size: 1rem;
  line-height: 1;
  z-index: 4;
  transition: transform .2s cubic-bezier(.2,1.4,.4,1);
}
.quickstart-screen .draw-choice.primary::after { background: #f1d527; color: #0b0b0b; border: 2px solid #0b0b0b; }
.quickstart-screen .draw-choice:not(.primary)::after { background: #0b0b0b; color: #f1d527; border: 2px solid #f1d527; }

/* card motion — only position / transform of the card backs changes */
.quickstart-screen .mode-art { transition: transform .4s cubic-bezier(.2,1.2,.4,1); }
.quickstart-screen .mode-art .card-back { transition: left .25s cubic-bezier(.2,1.4,.4,1), transform .25s cubic-bezier(.2,1.4,.4,1); }
.quickstart-screen .one-art { animation: qs-float 3.2s ease-in-out infinite; }
.quickstart-screen .two-art { animation: qs-float 3.2s ease-in-out -1.6s infinite; }
.quickstart-screen .choice-vs {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font: italic 700 .75rem/1 Didot,"Bodoni 72",serif;
  color: #f1d527;
  transform: translate(-50%,-38%);
}
.quickstart-screen .choice-vs::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #0b0b0b;
  border: 2px solid #f1d527;
  transform: rotate(45deg);
}
.home-screen.quickstart-screen .draw-choice > span.choice-stamp {
  position: absolute;
  left: 50%;
  top: 38px;
  z-index: 5;
  display: block;
  padding: 5px 10px;
  font: italic 700 1.2rem/1 Didot,"Bodoni 72",serif;
  letter-spacing: .08em;
  color: #0b0b0b;
  background: #f1d527;
  border: 2px solid #0b0b0b;
  box-shadow: 3px 3px 0 #000;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%,0) rotate(-12deg) scale(2.2);
}
.quickstart-screen .draw-choice.primary > span.choice-stamp { color: #f1d527; background: #0b0b0b; border-color: #f1d527; box-shadow: 3px 3px 0 #f1d527; }

@media (hover: hover) {
  .quickstart-screen .draw-choice:hover { transform: translate(-2px,-3px) rotate(0deg); }
  .quickstart-screen .draw-choice.primary:hover { box-shadow: 8px 8px 0 #f1d527; }
  .quickstart-screen .draw-choice:not(.primary):hover { box-shadow: 8px 8px 0 #000; }
}
.quickstart-screen .draw-choice:focus-visible { transform: translate(-2px,-3px) rotate(0deg); }
.quickstart-screen .draw-choice:hover .one-art .card-back,
.quickstart-screen .draw-choice:focus-visible .one-art .card-back { transform: translateX(-50%) translateY(-5px) rotate(4deg); }
.quickstart-screen .draw-choice:hover .two-art .card-back:first-child,
.quickstart-screen .draw-choice:focus-visible .two-art .card-back:first-child { left: calc(50% - 30px); transform: translateX(-50%) rotate(-16deg); }
.quickstart-screen .draw-choice:hover .two-art .card-back:last-child,
.quickstart-screen .draw-choice:focus-visible .two-art .card-back:last-child { left: calc(50% + 30px); transform: translateX(-50%) rotate(16deg); }
.quickstart-screen .draw-choice:hover::after,
.quickstart-screen .draw-choice:focus-visible::after { transform: translateX(3px); }
.quickstart-screen .draw-choice:active { transform: translate(2px,2px) rotate(var(--qs-tilt)); box-shadow: 2px 2px 0 #000; }
.quickstart-screen .draw-choice.primary:active { box-shadow: 2px 2px 0 #f1d527; }

/* picked: the chosen plate straightens, cards shoot up and the stamp lands; the other plate drops away */
.quickstart-screen.is-choosing .draw-choice { pointer-events: none; }
.quickstart-screen .draw-choice.is-picked { transform: translate(0,-6px) rotate(0deg) scale(1.03); z-index: 5; }
.quickstart-screen .draw-choice.is-picked .mode-art { animation: none; transform: translateY(-30px) scale(1.12); }
.quickstart-screen .draw-choice.is-picked .two-art .card-back:first-child { left: calc(50% - 32px); transform: translateX(-50%) rotate(-18deg); }
.quickstart-screen .draw-choice.is-picked .two-art .card-back:last-child { left: calc(50% + 32px); transform: translateX(-50%) rotate(18deg); }
.home-screen.quickstart-screen .draw-choice.is-picked > span.choice-stamp { animation: qs-stamp .3s cubic-bezier(.2,1.6,.4,1) .08s both; }
.quickstart-screen.is-choosing .draw-choice:not(.is-picked) { opacity: 0; transform: translateY(40px) rotate(calc(var(--qs-tilt) * 6)); }
.quickstart-screen.is-choosing .quickstart-help { opacity: 0; transition: opacity .2s ease; }

@keyframes qs-slam-in {
  from { opacity: 0; transform: translateY(60px) rotate(calc(var(--qs-tilt) * 5)) scale(.92); }
  to { opacity: 1; transform: rotate(var(--qs-tilt)); }
}
@keyframes qs-plate-in {
  from { opacity: 0; transform: translateX(-40px) rotate(-8deg); }
  to { opacity: 1; transform: rotate(-2deg); }
}
@keyframes qs-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes qs-stamp {
  from { opacity: 0; transform: translate(-50%,0) rotate(-12deg) scale(2.2); }
  to { opacity: 1; transform: translate(-50%,0) rotate(-12deg) scale(1); }
}
@media (max-width: 360px) {
  .home-screen.quickstart-screen .draw-choice > span.choice-kicker { display: none; }
  .quickstart-screen .quickstart-plate span { font-size: 1.15rem; }
}
@media (max-height: 720px) {
  .quickstart-screen .quickstart-plate { bottom: calc(100% + 12px); }
}

/* Editorial chrome: quickstart help, one-card fan labels and reflection buttons. */
.home-screen.quickstart-screen .quickstart-help {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 10px;
  border: 2px solid #0b0b0b;
  border-radius: 0;
  background: #f4efe3;
  color: #0b0b0b;
  box-shadow: 4px 4px 0 #0b0b0b;
  backdrop-filter: none;
  font: 800 .8rem/1 "Hiragino Mincho ProN","Yu Mincho",serif;
  letter-spacing: .08em;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-1.5deg);
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}
.home-screen.quickstart-screen .quickstart-help::before {
  content: "?";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: #0b0b0b;
  color: #f1d527;
  font: italic 700 1rem/1 Didot,"Bodoni 72",serif;
}
.home-screen.quickstart-screen .quickstart-help::after { content: "→"; font-family: Didot,"Bodoni 72",serif; }
.home-screen.quickstart-screen .quickstart-help:active { transform: translate(calc(-50% + 3px),3px) rotate(-1.5deg); box-shadow: 1px 1px 0 #0b0b0b; }

.draw-screen .fan-guide {
  padding: 7px 16px;
  border: 2px solid #0b0b0b;
  border-radius: 0;
  background: #f1d527;
  color: #0b0b0b;
  box-shadow: 4px 4px 0 #0b0b0b;
  backdrop-filter: none;
  font: 800 .82rem/1.2 "Hiragino Mincho ProN","Yu Mincho",serif;
  letter-spacing: .08em;
  transform: translateX(-50%) rotate(-2deg);
}
.draw-screen .fan-guide::before,
.draw-screen .fan-guide::after { font-family: Didot,"Bodoni 72",serif; font-style: italic; }
.draw-screen .fan-guide::before { content: "← "; }
.draw-screen .fan-guide::after { content: " →"; }
.draw-screen:not(.draw-two) .draw-instruction {
  left: 24px;
  right: 24px;
  padding: 9px 14px 9px 18px;
  border: 0;
  border-left: 5px solid #f1d527;
  border-radius: 0;
  background: #0b0b0b;
  box-shadow: 4px 4px 0 rgba(241,213,39,.9);
  backdrop-filter: none;
  font-family: "Hiragino Mincho ProN","Yu Mincho",serif;
  text-align: left;
}
.draw-screen .text-back {
  border: 1.5px solid #f1d527;
  border-radius: 0;
  background: #0b0b0b;
  color: #f1d527;
  box-shadow: 3px 3px 0 #f1d527;
  backdrop-filter: none;
  font-family: "Hiragino Mincho ProN","Yu Mincho",serif;
  letter-spacing: .06em;
}
.draw-screen .text-back:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #f1d527; }

.one-result .reflection-actions .button,
.two-result > .reflection-card .reflection-actions .button {
  min-height: 50px;
  padding: 9px 10px;
  border: 2px solid #0b0b0b;
  border-radius: 0;
  background: #f1d527;
  color: #0b0b0b;
  box-shadow: 4px 4px 0 #0b0b0b;
  font: 800 .86rem/1.3 "Hiragino Mincho ProN","Yu Mincho",serif;
  letter-spacing: .02em;
  white-space: nowrap;
  transform: rotate(-1deg);
  transition: transform .12s ease, box-shadow .12s ease;
}
.one-result .reflection-actions .button.secondary,
.two-result > .reflection-card .reflection-actions .button.secondary {
  border-color: #f1d527;
  background: #0b0b0b;
  color: #f1d527;
  box-shadow: 4px 4px 0 #f1d527;
  transform: rotate(.8deg);
}
.one-result .reflection-actions .button:active,
.two-result > .reflection-card .reflection-actions .button:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 #0b0b0b; }
.one-result .reflection-actions .button.secondary:active,
.two-result > .reflection-card .reflection-actions .button.secondary:active { box-shadow: 1px 1px 0 #f1d527; }
.one-result .reflection-actions .button.secondary[aria-expanded="true"],
.two-result > .reflection-card .reflection-actions .button.secondary[aria-expanded="true"] { background: #f4efe3; color: #0b0b0b; border-color: #0b0b0b; box-shadow: 4px 4px 0 #0b0b0b; }
/* Quickstart kicker sits in flow above the card art so it never overlaps it. */
.home-screen.quickstart-screen .draw-choice > span.choice-kicker {
  position: static;
  align-self: center;
  margin: 2px auto 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  letter-spacing: .12em;
}
@media (max-width: 359px) {
  .one-result .reflection-actions .button,
  .two-result > .reflection-card .reflection-actions .button { white-space: normal; }
}
/* Two-card instruction matches the one-card black plate (placed above OPTION A — see rule at end of file). */
.draw-screen.draw-two .draw-instruction {
  border: 0;
  border-left: 5px solid #f1d527;
  border-radius: 0;
  background: #0b0b0b;
  color: #f4efe3;
  box-shadow: 4px 4px 0 rgba(241,213,39,.9);
  backdrop-filter: none;
  font-family: "Hiragino Mincho ProN","Yu Mincho",serif;
}

/* P-polish: tutorial pages, settings bands, stamps, plates, tape, peel */
.tutorial-progress{display:flex;align-items:center;gap:8px;min-height:36px}
.tutorial-progress .tutorial-page-no{margin-right:auto;font:italic 700 2.3rem/1 Didot,"Bodoni 72",serif;color:#0b0b0b;text-shadow:3px 3px 0 #f1d527;letter-spacing:-.02em}
.tutorial-progress .tutorial-page-no small{margin-left:6px;padding:2px 6px;vertical-align:middle;font:700 .75rem/1.2 Didot,"Bodoni 72",serif;letter-spacing:.14em;color:#f4efe3;background:#0b0b0b;text-shadow:none}
.tutorial-progress>span{width:10px;height:10px;border-radius:0;background:transparent;border:1.5px solid #0b0b0b;box-shadow:none;transform:rotate(45deg)}
.tutorial-progress>span.current{width:22px;height:10px;background:#f1d527;box-shadow:2px 2px 0 #0b0b0b;transform:rotate(-4deg)}
.tutorial-intro-lines p{background:#0b0b0b;color:#f4efe3;border-left:0;padding:8px 12px;box-shadow:3px 3px 0 rgba(241,213,39,.9);transform:rotate(-.8deg);font-family:"Hiragino Mincho ProN","Yu Mincho",serif}
.tutorial-intro-lines p:nth-child(even){transform:rotate(.7deg)}
.tutorial-intro-start{border-radius:0;box-shadow:4px 4px 0 #0b0b0b;font-family:"Hiragino Mincho ProN","Yu Mincho",serif;letter-spacing:.08em}

#settings-modal .deck-setting>b#deck-setting-title,#settings-modal .setting-backs>b,#settings-modal .feedback-setting>div>b,#settings-modal .referral-setting>div>b,#settings-modal .data-setting b#data-setting-title,#settings-modal .data-setting b#account-setting-title{display:inline-block;width:auto;justify-self:start;align-self:start;margin:0 0 10px;padding:3px 10px;background:#f1d527;color:#0b0b0b;font-family:"Hiragino Mincho ProN","Yu Mincho",serif;letter-spacing:.06em;transform:rotate(-1.5deg);box-shadow:3px 3px 0 rgba(244,239,227,.85)}
.toggle-button{border-radius:0;background:#0b0b0b;border:1.5px solid #f4efe3;box-shadow:3px 3px 0 rgba(244,239,227,.35);transition:background .2s,box-shadow .2s}
.toggle-button span{border-radius:0;background:#f4efe3}
.toggle-button b{color:#f4efe3;font-family:Didot,"Bodoni 72",serif;letter-spacing:.08em}
.toggle-button.on{background:#f1d527;border-color:#0b0b0b;box-shadow:3px 3px 0 rgba(244,239,227,.9)}
.toggle-button.on span{background:#0b0b0b}
.toggle-button.on b{color:#0b0b0b}
.toggle-button.is-busy{opacity:.55;cursor:wait}

.detail-date{display:inline-flex;align-items:flex-end;gap:10px;margin:14px 0 10px;padding:8px 14px 8px 10px;color:#0b0b0b;background:#f4efe3;border:1.5px solid #0b0b0b;box-shadow:4px 4px 0 #f1d527;transform:rotate(-1.5deg)}
.detail-date>b{font:700 3.6rem/.82 Didot,"Bodoni 72",serif;letter-spacing:-.03em;text-shadow:3px 3px 0 #f1d527}
.detail-date>span{display:flex;flex-direction:column;gap:2px;padding-bottom:2px}
.detail-date i{font:italic 700 1.2rem/1 Didot,"Bodoni 72",serif;letter-spacing:.12em}
.detail-date small{font:600 .75rem/1 Didot,"Bodoni 72",serif;letter-spacing:.24em;color:#6d665a}
.detail-screen .outcome{position:relative}
.decided-stamp{position:absolute;top:10px;right:10px;padding:3px 8px;border:2px solid #b3261e;color:#b3261e;font:700 .75rem/1 Didot,"Bodoni 72",serif;letter-spacing:.24em;transform:rotate(8deg);opacity:.85;pointer-events:none;mix-blend-mode:multiply}

.toast{border-radius:0;background:#0b0b0b;color:#f4efe3;border:1.5px solid #f4efe3;box-shadow:4px 4px 0 rgba(241,213,39,.9);font-family:"Hiragino Mincho ProN","Yu Mincho",serif;letter-spacing:.04em;transform:translate(-50%,16px) rotate(-1deg)}
.toast.show{transform:translate(-50%,0) rotate(-1deg)}

.settings-sheet.confirm-sheet{background:#0b0b0b;color:#f4efe3;border-radius:0;border-top:4px solid #f1d527;box-shadow:0 -6px 0 rgba(241,213,39,.25)}
.confirm-sheet h2,.confirm-sheet h3{color:#f4efe3;font-family:"Hiragino Mincho ProN","Yu Mincho",serif}
.confirm-sheet .eyebrow{display:inline-block;background:#f1d527;color:#0b0b0b;padding:2px 8px;transform:rotate(-1.5deg)}
.confirm-sheet>p:not(.eyebrow),.confirm-sheet label{color:rgba(244,239,227,.78)}
.confirm-sheet .sheet-handle{background:#f1d527;border-radius:0}
.confirm-sheet .sheet-head{background:#0b0b0b;border-bottom-color:rgba(244,239,227,.2)}
.confirm-sheet .sheet-head button{border-radius:0;background:transparent;color:#f4efe3;border:1.5px solid #f4efe3}
.confirm-sheet .confirm-actions .button{border-radius:0;box-shadow:3px 3px 0 rgba(241,213,39,.9);font-family:"Hiragino Mincho ProN","Yu Mincho",serif}
.confirm-sheet .confirm-actions .button:not(.secondary):not(.danger){background:#f1d527;color:#0b0b0b;border-color:#f1d527;box-shadow:3px 3px 0 #f4efe3}
.confirm-sheet .confirm-actions .button.secondary{background:transparent;color:#f4efe3;border:1.5px solid #f4efe3}
.confirm-sheet .confirm-actions .button.danger{background:#b3261e;color:#fff;border-color:#b3261e}

.learn-header{flex-wrap:wrap;row-gap:4px}
.learn-kicker{flex-basis:auto;order:1;align-self:flex-start;margin:0 100% 0 0;padding:5px 9px 4px;font:italic 700 .75rem/1 Didot,"Bodoni 72",serif;letter-spacing:.32em;color:#f1d527;background:#0b0b0b;box-shadow:3px 3px 0 #f1d527;transform:rotate(-1.5deg);width:max-content;white-space:nowrap}
.learn-kicker::before{content:"";display:inline-block;width:22px;height:2px;margin-right:8px;vertical-align:middle;background:currentColor}
.learn-header h1{order:2}
.learn-kicker+h2{margin-top:4px}

.nav-item.active::after{top:-8px;left:22%;right:22%;height:7px;background:rgba(241,213,39,.92);transform:rotate(-3deg);box-shadow:1px 1px 0 rgba(0,0,0,.35)}

@keyframes splash-peel{0%{transform:none;opacity:1}40%{transform:translate(-4px,-6px) rotate(-4deg);opacity:1}100%{transform:translate(-40px,-120px) rotate(-18deg) scale(.9);opacity:0}}
@keyframes splash-fade{to{opacity:0;transform:translateX(-50%) translateY(14px)}}
.splash-screen.peeling .home-wordmark{transform-origin:0 100%;animation:splash-peel .46s cubic-bezier(.5,0,.75,0) forwards}
.splash-screen.peeling .splash-start{animation:splash-fade .3s ease-in forwards}
@media (prefers-reduced-motion:reduce){.splash-screen.peeling .home-wordmark,.splash-screen.peeling .splash-start{animation:none}.toast,.toast.show{transition:opacity .2s}}

/* Editorial calendar: unreviewed days stand out in yellow */
.history-screen .calendar-toolbar{grid-template-columns:44px 1fr 44px;gap:10px;margin-bottom:14px}
.history-screen .calendar-toolbar button{border-radius:0;border:1.5px solid #f4efe3;background:#0b0b0b;color:#f4efe3;box-shadow:3px 3px 0 #f1d527;font-family:Didot,"Bodoni 72",serif;transition:transform .12s,box-shadow .12s}
.history-screen .calendar-toolbar button:active{transform:translate(3px,3px);box-shadow:0 0 0 #f1d527}
.history-screen .calendar-toolbar strong{display:grid;justify-items:center;gap:2px;color:#f4efe3}
.calendar-toolbar strong small{font:italic 700 .75rem/1 Didot,"Bodoni 72",serif;letter-spacing:.34em;color:#f1d527}
.calendar-toolbar strong span{font:700 1.35rem/1.1 "Hiragino Mincho ProN","Yu Mincho",serif;letter-spacing:.06em}
.calendar-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 16px}
.calendar-pending-plate{display:inline-flex;align-items:baseline;gap:8px;margin:0;padding:7px 12px 6px;background:#f1d527;color:#0b0b0b;box-shadow:3px 3px 0 #f4efe3;transform:rotate(-1.2deg)}
.calendar-pending-plate span{font:italic 700 .75rem/1 Didot,"Bodoni 72",serif;letter-spacing:.2em}
.calendar-pending-plate strong{font:700 1.4rem/1 Didot,"Bodoni 72",serif}
.calendar-pending-plate small{font:700 .75rem/1 "Hiragino Mincho ProN","Yu Mincho",serif}
.calendar-pending-plate.clear{background:#0b0b0b;color:#f4efe3;border:1.5px solid #f4efe3;box-shadow:3px 3px 0 #6b6458}
.calendar-legend{display:flex;gap:10px;margin:0;padding:0;list-style:none;color:#c8c2b7;font:600 .75rem/1 "Hiragino Mincho ProN","Yu Mincho",serif}
.calendar-legend li{display:flex;align-items:center;gap:5px}
.calendar-legend li::before{content:"";width:11px;height:11px;border:1.5px solid #0b0b0b}
.calendar-legend .pending::before{background:#f1d527;box-shadow:2px 2px 0 #f4efe3}
.calendar-legend .reviewed::before{background:#f4efe3;box-shadow:2px 2px 0 #6b6458}
.history-screen .week-row{margin-bottom:6px;padding:5px 0;border-block:1px solid #4c4740}
.history-screen .week-row span{font:700 .75rem/1 "Hiragino Mincho ProN","Yu Mincho",serif;color:#c8c2b7}
.history-screen .week-row span:first-child{color:#e0705f}
.history-screen .week-row span:last-child{color:#8fb3d9}
.history-screen .calendar-grid{gap:5px}
.history-screen .calendar-day{border-radius:0;border:1px solid #2c2a26;background:rgba(17,17,17,.82);color:#8a8378;font:600 .82rem/1 Didot,"Bodoni 72",serif}
.history-screen .calendar-blank{border-radius:0}
.history-screen .calendar-day.has-log{border:1.5px solid #0b0b0b;font-weight:700;font-size:.95rem;transition:transform .12s,box-shadow .12s}
.history-screen .calendar-day.has-log::after{display:none}
.history-screen .calendar-day.all-reviewed{background:#f4efe3;color:#0b0b0b;box-shadow:2px 2px 0 #6b6458}
.history-screen .calendar-day.has-pending{background:#f1d527 repeating-linear-gradient(-45deg,transparent 0 5px,rgba(11,11,11,.9) 5px 8px) bottom/100% 6px no-repeat;color:#0b0b0b;box-shadow:3px 3px 0 #f4efe3;transform:rotate(-1.5deg)}
.history-screen .calendar-day.has-log:active{transform:translate(2px,2px);box-shadow:0 0 0 transparent}
.history-screen .calendar-day i{top:3px;right:3px;min-width:16px;height:16px;border-radius:0;background:#0b0b0b;color:#f4efe3;font:700 .75rem/1 Didot,"Bodoni 72",serif}
.history-screen .calendar-day b{position:absolute;left:3px;top:3px;width:16px;height:16px;display:grid;place-items:center;background:#b3261e;color:#fff;font:700 .75rem/1 Didot,"Bodoni 72",serif}
.history-screen .calendar-day.today span{text-decoration:none;padding-bottom:2px;border-bottom:2px solid #f1d527}
.history-screen .calendar-day.has-log.today span{border-bottom-color:#0b0b0b}
.history-screen .calendar-day.selected{outline:2px solid #f1d527;outline-offset:3px;z-index:1}
.history-screen .calendar-day.has-pending.selected{outline-color:#f4efe3}
.history-screen .calendar-detail{margin-top:20px;padding-top:18px;border-top:2px solid #f1d527}
.history-screen .calendar-date-label{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.calendar-date-label span{display:inline-block;padding:5px 10px 4px;background:#0b0b0b;color:#f4efe3;border:1.5px solid #f4efe3;box-shadow:3px 3px 0 #f1d527;font:700 .9rem/1.2 "Hiragino Mincho ProN","Yu Mincho",serif;transform:rotate(-1deg)}
.calendar-date-label em{padding:4px 8px;background:#f1d527;color:#0b0b0b;font:700 .75rem/1.2 "Hiragino Mincho ProN","Yu Mincho",serif;font-style:normal}
.history-screen .calendar-hint{padding:12px 14px;border:1.5px dashed #6b6458;color:#c8c2b7;font-family:"Hiragino Mincho ProN","Yu Mincho",serif}
@media (max-width:460px){.history-screen .calendar-grid{gap:3px}.calendar-legend{flex-direction:column;gap:5px}}
@media (prefers-reduced-motion:reduce){.history-screen .calendar-day.has-pending{transform:none}}
.history-screen .calendar-day.has-log span{margin-top:12px}

/* P46: tutorial bottom skip, remind picker, due review, farewell */
.tutorial-intro-lines p b { display: inline-block; margin-right: 10px; padding: 1px 7px; background: #f1d527; color: #0b0b0b; font-family: Didot,"Bodoni 72",serif; font-size: .8rem; font-weight: 700; letter-spacing: .14em; vertical-align: 2px; }
.tutorial-intro-lines p span { font-family: "Hiragino Mincho ProN","Yu Mincho",serif; }
.tutorial-intro-actions { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 14px; align-items: stretch; max-width: 480px; width: 100%; }
.tutorial-intro-actions .tutorial-intro-start { max-width: none; width: 100%; margin: 0; }
.tutorial-intro-skip-bottom { position: relative; display: grid; place-content: center; gap: 1px; min-height: 52px; padding: 6px 10px; border: 2px solid #0b0b0b; border-radius: 0; background: #f4efe3; color: #0b0b0b; box-shadow: 4px 4px 0 #0b0b0b; transform: rotate(-1.2deg); font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: .95rem; font-weight: 800; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease; }
.tutorial-intro-skip-bottom small { font-family: Didot,"Bodoni 72",serif; font-size: .75rem; letter-spacing: .3em; color: #6b6458; line-height: 1; }
.tutorial-intro-skip-bottom::after { content: "»"; position: absolute; top: -9px; right: -7px; width: 22px; height: 22px; display: grid; place-items: center; background: #f1d527; border: 2px solid #0b0b0b; font-family: Didot,"Bodoni 72",serif; font-size: .8rem; line-height: 1; }
.tutorial-intro-skip-bottom:active { transform: translate(3px,3px) rotate(-1.2deg); box-shadow: 1px 1px 0 #0b0b0b; }
.tutorial-intro-skip-bottom:focus-visible { outline: 3px solid #f1d527; outline-offset: 3px; }

.screen.completion-screen > .completion-dock { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin: 0 auto; }
.completion-dock .completion-copy { position: static; padding: 12px 14px; text-align: center; }
.completion-dock .completion-actions { display: grid; gap: 8px; }
.completion-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.completion-sub .button { min-height: 44px; }

.button.satisfied-button { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; width: 100%; border: 2px solid #0b0b0b; border-radius: 0; background: #f1d527; color: #0b0b0b; box-shadow: 5px 5px 0 #0b0b0b, 5px 5px 0 2px #f4efe3; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1.15rem; font-weight: 900; letter-spacing: .06em; transform: rotate(-.6deg); }
.button.satisfied-button small { padding: 2px 6px; background: #0b0b0b; color: #f1d527; font-family: Didot,"Bodoni 72",serif; font-size: .75rem; letter-spacing: .24em; font-weight: 700; }
.button.satisfied-button:active { transform: translate(3px,3px) rotate(-.6deg); box-shadow: 2px 2px 0 #0b0b0b; }
.review-panel .satisfied-button { margin-top: 14px; }

.remind-picker { position: relative; padding: 16px 14px 12px; border: 2px solid #0b0b0b; background: #f4efe3; color: #0b0b0b; box-shadow: 5px 5px 0 #f1d527; transform: rotate(.4deg); }
.review-panel .remind-picker { margin-top: 16px; }
.remind-kicker { position: absolute; top: -12px; left: 12px; margin: 0; padding: 2px 9px; background: #0b0b0b; color: #f1d527; font-family: Didot,"Bodoni 72",serif; font-size: .75rem; font-weight: 700; letter-spacing: .28em; transform: rotate(-2deg); }
.remind-picker h2 { margin: 2px 0 10px; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1.05rem; font-weight: 900; color: #0b0b0b; }
.remind-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.remind-options button { min-height: 44px; padding: 4px 2px; border: 2px solid #0b0b0b; border-radius: 0; background: #fff; color: #0b0b0b; box-shadow: 2px 2px 0 #0b0b0b; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: .8rem; font-weight: 800; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.remind-options button:active { transform: translate(2px,2px); box-shadow: 0 0 0 #0b0b0b; }
.remind-options button.selected { background: #0b0b0b; color: #f1d527; box-shadow: 2px 2px 0 #f1d527; transform: rotate(-1.5deg); }
.remind-status { margin: 9px 0 0; color: #6b6458; font-size: .75rem; line-height: 1.5; }
.remind-status b { color: #0b0b0b; background: linear-gradient(transparent 55%, #f1d527 55%); }

.due-review-sheet { border: 2px solid #0b0b0b; box-shadow: 0 -6px 0 #f1d527; }
.due-review-kicker { display: inline-block; margin: 4px 0 0; padding: 2px 9px; background: #f1d527; color: #0b0b0b; font-family: Didot,"Bodoni 72",serif; font-size: .75rem; font-weight: 700; letter-spacing: .3em; transform: rotate(-2deg); }
.due-review-sheet .sheet-head h2 { font-family: "Hiragino Mincho ProN","Yu Mincho",serif; }
.due-review-log { display: grid; gap: 4px; margin: 6px 0 12px; padding: 12px 14px; border-left: 6px solid #f1d527; background: #0b0b0b; color: #f4efe3; box-shadow: 4px 4px 0 #f1d527; transform: rotate(-.5deg); }
.due-review-log time { font-family: Didot,"Bodoni 72",serif; font-size: .8rem; letter-spacing: .12em; color: #f1d527; }
.due-review-log strong { font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1.1rem; }
.due-review-log span { font-size: .85rem; color: #d9d2c3; }
.due-review-note { margin: 0 0 12px; font-size: .85rem; line-height: 1.6; }

.farewell { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); background: #0b0b0b; color: #f4efe3; overflow: hidden; opacity: 0; transition: opacity .45s ease; }
.farewell.is-open { opacity: 1; }
.farewell::before { content: ""; position: absolute; left: -20%; right: -20%; top: 38%; height: 34px; background: #f1d527; transform: rotate(-8deg); box-shadow: 0 4px 0 #f4efe3; opacity: .92; }
.farewell::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(244,239,227,.25); pointer-events: none; }
.farewell-inner { position: relative; z-index: 1; width: min(420px,100%); display: grid; justify-items: center; text-align: center; gap: 14px; }
.farewell.is-open .farewell-inner > * { animation: farewell-in .6s cubic-bezier(.2,.8,.2,1) both; }
.farewell.is-open .farewell-inner > *:nth-child(2) { animation-delay: .08s; }
.farewell.is-open .farewell-inner > *:nth-child(3) { animation-delay: .18s; }
.farewell.is-open .farewell-inner > *:nth-child(4) { animation-delay: .3s; }
.farewell.is-open .farewell-inner > *:nth-child(5) { animation-delay: .42s; }
.farewell.is-open .farewell-inner > *:nth-child(6) { animation-delay: .54s; }
.farewell.is-open .farewell-inner > *:nth-child(7) { animation-delay: .66s; }
@keyframes farewell-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.farewell-kicker { margin: 0; padding: 3px 12px; background: #f4efe3; color: #0b0b0b; font-family: Didot,"Bodoni 72",serif; font-size: .8rem; font-weight: 700; letter-spacing: .34em; transform: rotate(-2deg); box-shadow: 3px 3px 0 #f1d527; }
.farewell-mark { margin: 0; font-family: Didot,"Bodoni 72",serif; font-size: clamp(3rem,16vw,4.6rem); font-weight: 700; letter-spacing: -.02em; line-height: 1; color: #f4efe3; text-shadow: 4px 4px 0 #f1d527; }
.farewell-mark span { color: #f1d527; text-shadow: none; }
.farewell h2 { margin: 6px 0 0; padding: 14px 20px; background: #f1d527; color: #0b0b0b; border: 2px solid #0b0b0b; box-shadow: 6px 6px 0 #f4efe3; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: clamp(1.7rem,8vw,2.3rem); font-weight: 900; line-height: 1.35; transform: rotate(-1.5deg); }
.farewell-copy { margin: 4px 0 0; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: .95rem; line-height: 1.8; color: #e9e2d3; }
.farewell-count { display: grid; grid-template-columns: auto auto auto auto; align-items: baseline; gap: 4px 8px; margin: 0; padding: 8px 14px; border: 1px solid rgba(244,239,227,.35); }
.farewell-count b { font-family: Didot,"Bodoni 72",serif; font-size: 1.6rem; color: #f1d527; }
.farewell-count span { font-family: Didot,"Bodoni 72",serif; font-size: .75rem; letter-spacing: .18em; color: #bdb5a6; }
.farewell-note { margin: 0; color: #bdb5a6; font-size: .8rem; letter-spacing: .06em; }
.button.farewell-home { min-width: 180px; min-height: 48px; border: 2px solid #f4efe3; border-radius: 0; background: transparent; color: #f4efe3; box-shadow: 4px 4px 0 #f1d527; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-weight: 800; }
.button.farewell-home:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 #f1d527; }
.farewell-share { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 180px; min-height: 44px; margin-top: 2px; padding: 0 18px; border: 0; border-radius: 0; background: #f1d527; color: #0b0b0b; box-shadow: 4px 4px 0 #f4efe3; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: .9rem; font-weight: 800; cursor: pointer; }
.farewell-share b { font-size: 1.05rem; line-height: 1; }
.farewell-share:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 #f4efe3; }
.farewell.is-open .farewell-inner > *:nth-child(8) { animation-delay: .78s; }
@media (prefers-reduced-motion: reduce) { .farewell, .farewell.is-open .farewell-inner > * { transition: none; animation: none; } }
@media (max-height: 700px) { .screen.completion-screen .completion-script { display: none; } .completion-dock .completion-copy p { margin: 3px 0 6px; } }

/* P47: quickstart app-name header */
.quickstart-screen .quickstart-brand {
  position: relative; z-index: 4; width: max-content; max-width: 100%;
  margin: 4px 0 0 2px; transform: rotate(-3deg); transform-origin: 0 50%;
  animation: qb-in .7s cubic-bezier(.2,1.4,.4,1) both;
}
.quickstart-brand small {
  display: inline-block; margin-left: 4px; padding: 4px 9px 3px;
  font: 700 .75rem/1 Didot,"Bodoni 72",serif; letter-spacing: .24em;
  color: #f1d527; background: #0b0b0b; box-shadow: 3px 3px 0 #f1d527;
  transform: rotate(2deg);
}
.quickstart-brand h1 {
  margin: 2px 0 0; display: flex; align-items: baseline;
  font: 900 clamp(3.4rem,17vw,4.6rem)/.86 Didot,"Bodoni 72",serif; letter-spacing: -.02em;
  color: #f4efe3; -webkit-text-stroke: 1.5px #0b0b0b;
  text-shadow: 4px 4px 0 #0b0b0b, 7px 7px 0 #f1d527;
}
.quickstart-brand .qb-dot {
  color: #f1d527; -webkit-text-stroke: 1.5px #0b0b0b;
  text-shadow: 4px 4px 0 #0b0b0b; margin-left: 2px;
  display: inline-block; animation: qb-dot 2.8s ease-in-out 1s infinite;
}
.quickstart-brand p {
  display: inline-flex; align-items: center; gap: 8px; margin: 9px 0 0 6px; padding: 4px 10px 4px 4px;
  background: #f4efe3; border: 2px solid #0b0b0b; box-shadow: 4px 4px 0 #0b0b0b; transform: rotate(1.5deg);
  font: 700 .8rem/1.2 "Hiragino Mincho ProN","Yu Mincho",serif; letter-spacing: .12em; color: #0b0b0b;
}
.quickstart-brand p i {
  font: italic 700 .75rem/1 Didot,"Bodoni 72",serif; letter-spacing: 0;
  padding: 3px 6px; background: #f1d527; border: 1.5px solid #0b0b0b;
}
@keyframes qb-in { from { opacity: 0; transform: translateY(-14px) rotate(-9deg); } to { opacity: 1; transform: rotate(-3deg); } }
@keyframes qb-dot { 0%,86%,100% { transform: none; } 92% { transform: translateY(-6px) scale(1.15); } }
@media (max-height: 720px) {
  .quickstart-brand h1 { font-size: 3.1rem; }
  .quickstart-brand p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .quickstart-screen .quickstart-brand, .quickstart-brand .qb-dot { animation: none; }
}

/* P48: decide screen redesign — editorial "final call" layout. Background untouched. */
.decide-screen .decide-title { position: relative; display: grid; justify-items: start; gap: 0; margin: 34px 0 6px; }
.decide-screen .decide-kicker {
  position: relative; z-index: 2; margin-left: 6px; padding: 5px 10px 4px;
  background: #0b0b0b; color: #f1d527; box-shadow: 3px 3px 0 #f1d527;
  font: 700 .78rem/1 Didot, "Bodoni 72", serif; letter-spacing: .24em; transform: rotate(-3deg);
}
.decide-screen .decide-title h1 {
  position: relative; z-index: 1; max-width: none; margin: -3px 0 0; padding: 14px 18px 12px;
  border: 2px solid #0b0b0b; border-radius: 0; background: #f1d527; color: #0b0b0b;
  box-shadow: 7px 7px 0 #0b0b0b, 7px 7px 0 2px #f4efe3; backdrop-filter: none;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: clamp(1.9rem, 9vw, 2.6rem); font-weight: 800;
  line-height: 1.12; letter-spacing: -.06em; transform: rotate(-1.5deg);
}
.decide-screen .decide-sub {
  position: relative; z-index: 2; align-self: end; margin: -2px 0 0 auto; padding: 5px 9px 4px;
  background: #f4efe3; color: #0b0b0b; border: 1px solid #0b0b0b; box-shadow: 3px 3px 0 #0b0b0b;
  font: italic 700 .75rem/1 Didot, "Bodoni 72", serif; letter-spacing: .12em; transform: rotate(2deg);
}
.decide-screen .decision-options { counter-reset: none; gap: 14px; margin: 30px 0 28px; }
body[data-view="decide"] .decide-screen .decision-option {
  position: relative; min-height: 64px; padding: 0 16px 0 0; gap: 14px; justify-content: flex-start;
  border: 2px solid #0b0b0b; border-radius: 0; background: #f4efe3; color: #0b0b0b;
  box-shadow: 5px 5px 0 #0b0b0b; backdrop-filter: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
body[data-view="decide"] .decide-screen .decision-option:nth-child(1) { transform: rotate(-.8deg); }
body[data-view="decide"] .decide-screen .decision-option:nth-child(2) { transform: rotate(.7deg); }
body[data-view="decide"] .decide-screen .decision-option:nth-child(3) { transform: rotate(-.4deg); background: #0b0b0b; color: #f4efe3; border-color: #f4efe3; box-shadow: 5px 5px 0 #f4efe3; }
body[data-view="decide"] .decide-screen .decision-option:active { transform: translate(3px,3px); box-shadow: 2px 2px 0 #0b0b0b; }
.decide-screen .decision-index {
  align-self: stretch; display: grid; place-items: center; min-width: 62px; padding: 0 8px;
  background: #0b0b0b; color: #f1d527; font: 700 1.25rem/1 Didot, "Bodoni 72", serif; letter-spacing: .06em;
}
.decide-screen .decision-option:nth-child(3) .decision-index { background: #f4efe3; color: #0b0b0b; font-size: .95rem; letter-spacing: .14em; }
body[data-view="decide"] .decide-screen .decision-option span { flex: 1; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; }
body[data-view="decide"] .decide-screen .decision-option span::first-letter { font-family: inherit; font-size: inherit; }
body[data-view="decide"] .decide-screen .decision-option i {
  width: 28px; height: 28px; border: 2px solid currentColor; border-radius: 0; background: transparent; color: inherit;
  font: 900 .95rem/1 system-ui, sans-serif;
}
body[data-view="decide"] .decide-screen .decision-option.selected {
  z-index: 1; background: #f1d527; color: #0b0b0b; border-color: #0b0b0b;
  box-shadow: 7px 7px 0 #0b0b0b, 7px 7px 0 2px #f4efe3; transform: rotate(0) translate(-2px,-2px);
}
body[data-view="decide"] .decide-screen .decision-option.selected .decision-index { background: #0b0b0b; color: #f1d527; }
body[data-view="decide"] .decide-screen .decision-option.selected i { border-color: #0b0b0b; background: #0b0b0b; color: #f1d527; }
body[data-view="decide"] .decide-screen .decision-option.selected::after {
  content: "CHOSEN"; position: absolute; top: -11px; right: 12px; padding: 3px 7px 2px;
  border: 2px solid #b3261e; background: #f4efe3; color: #b3261e;
  font: 700 .75rem/1 Didot, "Bodoni 72", serif; letter-spacing: .18em; transform: rotate(4deg);
  animation: decide-stamp .28s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes decide-stamp { from { opacity: 0; transform: rotate(4deg) scale(1.8); } to { opacity: 1; transform: rotate(4deg) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  body[data-view="decide"] .decide-screen .decision-option.selected::after { animation: none; }
}

body[data-view="decide"] .decide-screen .save-form {
  position: relative; gap: 18px; margin-top: 8px; padding: 30px 16px 18px;
  border: 2px solid #0b0b0b; border-top: 2px solid #0b0b0b; border-radius: 0; background: #f4efe3; color: #0b0b0b;
  box-shadow: 8px 8px 0 #0b0b0b; backdrop-filter: none;
}
body[data-view="decide"] .decide-screen .save-form::before {
  content: "RECORD — 記録する"; position: absolute; top: -13px; left: 12px; padding: 5px 10px 4px;
  background: #0b0b0b; color: #f1d527; box-shadow: 3px 3px 0 #f1d527;
  font: 700 .78rem/1 Didot, "Bodoni 72", "Hiragino Mincho ProN", serif; letter-spacing: .18em; transform: rotate(-2deg);
}
body[data-view="decide"] .decide-screen .save-form label,
body[data-view="decide"] .decide-screen .form-section-head b {
  color: #0b0b0b; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-weight: 800;
}
body[data-view="decide"] .decide-screen .save-form > label,
body[data-view="decide"] .decide-screen .form-section-head b { position: relative; }
body[data-view="decide"] .decide-screen .form-section-head b,
body[data-view="decide"] .decide-screen .save-form > label { padding-left: 12px; }
body[data-view="decide"] .decide-screen .form-section-head b::before,
body[data-view="decide"] .decide-screen .save-form > label::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 5px; height: 1em; background: #f1d527; box-shadow: 1px 1px 0 #0b0b0b;
}
body[data-view="decide"] .decide-screen .save-form label span,
body[data-view="decide"] .decide-screen .form-section-head span,
body[data-view="decide"] .decide-screen .recent-options > span { color: #6b6458; font-weight: 600; }
body[data-view="decide"] .decide-screen .save-form label > span:first-child,
body[data-view="decide"] .decide-screen .save-form > label > span {
  display: inline-block; justify-self: start; margin-left: 6px; padding: 2px 6px; border: 1px solid #6b6458;
  font-size: .75rem; letter-spacing: .08em;
}
body[data-view="decide"] .decide-screen .save-form > label { display: block; }
body[data-view="decide"] .decide-screen .save-form > label > input,
body[data-view="decide"] .decide-screen .save-form > label > textarea { display: block; width: 100%; margin-top: 8px; }
body[data-view="decide"] .decide-screen input,
body[data-view="decide"] .decide-screen textarea {
  border: 2px solid #0b0b0b; border-radius: 0; background: #fffdf6; color: #0b0b0b; box-shadow: inset 3px 3px 0 rgba(11,11,11,.08);
}
body[data-view="decide"] .decide-screen input::placeholder,
body[data-view="decide"] .decide-screen textarea::placeholder { color: #8a8274; }
body[data-view="decide"] .decide-screen input:focus,
body[data-view="decide"] .decide-screen textarea:focus { outline: none; box-shadow: 4px 4px 0 #f1d527; border-color: #0b0b0b; }
body[data-view="decide"] .decide-screen .decision-meta { padding-bottom: 18px; border-bottom: 2px dashed #0b0b0b; }
body[data-view="decide"] .decide-screen .meta-chip,
body[data-view="decide"] .decide-screen .pair-chip {
  min-height: 40px; border: 2px solid #0b0b0b; border-radius: 0; background: #fffdf6; color: #0b0b0b;
  box-shadow: 3px 3px 0 #0b0b0b; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}
body[data-view="decide"] .decide-screen .meta-chip.selected,
body[data-view="decide"] .decide-screen .meta-chip[aria-pressed="true"] { background: #0b0b0b; color: #f1d527; box-shadow: 3px 3px 0 #f1d527, 3px 3px 0 1px #0b0b0b; }
body[data-view="decide"] .decide-screen .option-editor label { color: #0b0b0b; font-family: Didot, "Bodoni 72", "Hiragino Mincho ProN", serif; letter-spacing: .04em; }
body[data-view="decide"] .decide-screen .swap-options { border: 2px solid #0b0b0b; border-radius: 0; background: #f1d527; color: #0b0b0b; box-shadow: 3px 3px 0 #0b0b0b; }
body[data-view="decide"] .decide-screen .save-form .button[type="submit"] {
  min-height: 60px; border: 2px solid #0b0b0b; border-radius: 0; background: #0b0b0b; color: #f1d527;
  box-shadow: 6px 6px 0 #f1d527, 6px 6px 0 2px #0b0b0b;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1.05rem; font-weight: 800; letter-spacing: .08em;
  transition: transform .14s ease, box-shadow .14s ease;
}
body[data-view="decide"] .decide-screen .save-form .button[type="submit"]::after { content: " →"; font-family: Didot, "Bodoni 72", serif; }
body[data-view="decide"] .decide-screen .save-form .button[type="submit"]:not(:disabled):active { transform: translate(4px,4px); box-shadow: 2px 2px 0 #f1d527, 2px 2px 0 2px #0b0b0b; }
body[data-view="decide"] .decide-screen .save-form .button[type="submit"]:disabled {
  opacity: 1; background: repeating-linear-gradient(-45deg,#e4ddcd 0 8px,#f4efe3 8px 16px); color: #6b6458;
  border-style: dashed; border-color: #6b6458; box-shadow: none;
}
body[data-view="decide"] .decide-screen .save-form .button[type="submit"]:disabled::after { content: ""; }
body[data-view="decide"] .decide-screen .timestamp { margin: 0; color: #6b6458; font: italic .75rem/1.4 Didot, "Bodoni 72", "Hiragino Mincho ProN", serif; letter-spacing: .04em; text-align: center; }

/* Tutorial trial: LOOK BACK page (stage 4) with a mock decision log */
.tutorial-lookback .tutorial-intro-card { justify-content: flex-start; gap: 14px; }
.tutorial-lookback-top { display: flex; align-items: center; gap: 12px; }
.tutorial-lookback-top .tutorial-progress { flex: 1; }
.tutorial-lookback-top .tutorial-progress .tutorial-page-no { color: #f4efe3; text-shadow: 3px 3px 0 #0b0b0b; }
.tutorial-lookback-top .tutorial-progress > span { border-color: #f4efe3; }
.tutorial-lookback-skip { min-height: 44px; padding: 6px 10px; border: 0; background: transparent; color: #f1d527; font-weight: 800; font-size: 15px; cursor: pointer; }
.tutorial-lookback .tutorial-intro-card h2 { max-width: none; margin: 4px 0 2px; }
.tutorial-mock-log { padding: 16px; background: #f4efe3; color: #0b0b0b; border: 2px solid #0b0b0b; box-shadow: 5px 5px 0 #f1d527; transform: rotate(-.6deg); }
.tutorial-mock-meta { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; }
.tutorial-mock-meta b { padding: 1px 7px; background: #0b0b0b; color: #f4efe3; font: 700 .75rem/1.4 Didot,"Bodoni 72",serif; letter-spacing: .16em; }
.tutorial-mock-meta span { font-size: .82rem; font-weight: 700; color: #6b6458; }
.tutorial-mock-log h3 { margin: 0 0 4px; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-size: 1.15rem; }
.tutorial-mock-card { margin: 0 0 12px; font-size: .88rem; color: #4a453c; }
.tutorial-mock-question { margin: 0 0 8px; font-weight: 800; font-size: .95rem; }
.tutorial-mock-reviews { grid-template-columns: repeat(4,1fr); gap: 6px; }
.tutorial-mock-reviews .review-button { min-height: 72px; padding: 6px 2px; border-radius: 3px; border-color: #0b0b0b; background: rgba(255,255,255,.6); color: #0b0b0b; }
.tutorial-mock-reviews .review-button span { font-size: .75rem; line-height: 1.3; text-align: center; }
.tutorial-mock-reviews .review-button.selected { background: #f1d527; box-shadow: 2px 2px 0 #0b0b0b; }
.tutorial-lookback-callout { margin: 4px 0 0; max-width: none; }
.tutorial-log-lead { margin: -4px 0 2px; color: #f4efe3; font-size: 15px; font-weight: 700; }
.tutorial-mock-decisions { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 0 0 12px; }
.tutorial-mock-decisions button { min-height: 44px; padding: 6px 4px; border: 2px solid #0b0b0b; border-radius: 3px; background: rgba(255,255,255,.6); color: #0b0b0b; font-weight: 800; font-size: 15px; cursor: pointer; }
.tutorial-mock-decisions button.selected { background: #f1d527; box-shadow: 2px 2px 0 #0b0b0b; }
.tutorial-mock-field { margin: 0; padding: 8px 10px; border: 1.5px dashed #6b6458; background: rgba(255,255,255,.45); }
.tutorial-mock-field span { display: block; font-size: .75rem; font-weight: 800; color: #6b6458; letter-spacing: .04em; }
.tutorial-mock-field p { margin: 2px 0 0; font-size: .92rem; line-height: 1.45; }
.tutorial-mock-past { display: grid; gap: 6px; margin: 0 0 12px; }
.tutorial-mock-past .tutorial-mock-field:first-child p { font-weight: 800; }
/* Two-card instruction sits above the OPTION A plate (inside .dual-draw). */
.draw-screen.draw-two .dual-draw .draw-instruction {
  top: auto;
  right: auto;
  bottom: calc(100% + 14px);
  left: 0;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 7px 12px 7px 14px;
  font-size: .8rem;
  text-align: left;
  white-space: nowrap;
  transform: rotate(-1deg);
}

/* Optional preparation and mobile readability, 2026-10-04. */
.prepare-screen { max-width: 620px; margin: auto; padding-bottom: 110px; }
.prepare-screen h1 { font-size: clamp(1.65rem,7vw,2.5rem); }
.prepare-screen .save-form { background: #fffaf0; color: #0b0b0b; padding: 20px; border: 2px solid #0b0b0b; }
.prepare-screen .lead { color: #fffaf0; }
.prepare-screen .genre-chips { margin-bottom: 18px; }
.prepare-screen .meta-chip { min-height: 44px; color: #0b0b0b; }
.option-candidate-group { margin-bottom: 18px; }
.option-candidate-group > b { display: block; margin-bottom: 8px; }
.option-editor { grid-template-columns: minmax(0,1fr) 44px; }
.option-editor label:last-child { grid-column: 1 / -1; }
.option-editor textarea { width: 100%; min-height: 76px; font-size: 16px; line-height: 1.5; resize: vertical; overflow-wrap: anywhere; }
.session-context { padding: 10px 14px; background: #fffaf0; color: #0b0b0b; border: 2px solid #0b0b0b; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.draw-screen .draw-prompt { position: relative; z-index: 3; margin: 6px 0 12px; width: fit-content; max-width: 100%; padding: 8px 12px; background: #0b0b0b; color: #fffaf0; font-size: 1rem; font-weight: 700; }
.draw-screen .session-context { position: relative; z-index: 3; }
.draw-screen .draw-prompt { margin: 54px 16px 10px; }
.draw-screen .session-context { margin: 0 16px 10px; }
.prepare-screen { width: 100%; overflow: hidden; color: #0b0b0b; }
.prepare-screen .lead { color: #333; }
.prepare-screen::after { display: none; }
/* Keep variable-length choices and controls in flow on short phone screens. */
.draw-screen.draw-two { padding-bottom: 24px; }
.draw-screen.draw-two .dual-draw { position: relative; left: auto; right: auto; bottom: auto; margin: 16px 20px 24px; }
.draw-screen.draw-two .dual-draw .draw-instruction { position: static; grid-column: 1 / -1; grid-row: 1; width: 100%; white-space: normal; transform: none; margin-bottom: 10px; }
.draw-screen.draw-two .pair-card { grid-row: 2; }
.draw-screen.draw-two .reveal-both { position: relative; left: auto; right: auto; bottom: auto; width: calc(100% - 40px); margin: 0 20px 18px; }

#settings-modal .account-email{word-break:break-all;font-size:.9em;opacity:.85}
/* Completion: keep the doorway visible above the saved-decision controls. */
body[data-detail-mode="complete"] .bottom-nav { display: none !important; }
body[data-detail-mode="complete"] .app-shell { padding-bottom: 0; }
.screen.completion-screen {
  display: flex;
  flex-direction: column;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
  background: #080808 !important;
  animation: none;
  overflow: hidden;
}
.completion-screen::before,
.screen.completion-screen::after { content: none; }
.screen.completion-screen > .completion-hero {
  position: relative;
  flex: none;
  height: clamp(300px, 48svh, 520px);
  margin: 0 -16px;
  background: #080808 url("./assets/editorial/complete-collage.webp") 50% 66% / cover no-repeat;
  animation: completion-light 1.2s ease-out both;
}
.completion-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.18), transparent 65%, #080808);
  pointer-events: none;
}
.screen.completion-screen .completion-script {
  display: inline-block;
  position: relative;
  z-index: 1;
  margin: max(30px, env(safe-area-inset-top)) 0 0 24px;
  padding: 10px 16px;
  border: 2px solid #080808;
  background: #f1d527;
  color: #080808;
  box-shadow: 5px 5px 0 #080808, 5px 5px 0 1px #f4efe3;
  font: 900 clamp(2rem, 8vw, 3rem)/1 Didot, "Bodoni 72", serif;
  text-shadow: none;
  transform: rotate(-6deg);
  animation: completion-stamp .5s .15s ease-out both;
}
.completion-script span { display: block; margin-top: 8px; font: 700 .75rem/1.5 "Hiragino Mincho ProN", "Yu Mincho", serif; letter-spacing: .08em; }
.screen.completion-screen > .completion-dock {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  gap: 18px;
  animation: completion-settle .6s ease-out both;
}
.completion-dock .completion-copy {
  padding: 12px 10px 18px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.completion-copy strong { overflow-wrap: anywhere; }
.completion-dock .remind-picker { transform: rotate(.4deg); }
@keyframes completion-light { from { opacity: .35; } to { opacity: 1; } }
@keyframes completion-stamp { from { opacity: 0; transform: translateY(-12px) rotate(-10deg) scale(1.08); } to { opacity: 1; transform: rotate(-6deg); } }
@keyframes completion-settle { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .screen.completion-screen > .completion-hero,
  .screen.completion-screen .completion-script,
  .screen.completion-screen > .completion-dock { animation: none; }
}

.completion-dock .completion-sub .button { border-radius: 0; border-width: 2px; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }

/* Prepare screen: match editorial black / yellow style, 2026-10-07. */
.prepare-screen .eyebrow {
  display: inline-block; margin: 14px 0 10px; padding: 5px 10px 4px; background: #0b0b0b; color: #f1d527;
  box-shadow: 3px 3px 0 #f1d527; font: 700 .8rem/1 Didot, "Bodoni 72", "Hiragino Mincho ProN", serif; letter-spacing: .18em; transform: rotate(-2deg);
}
.prepare-screen h1 { color: #0b0b0b; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.prepare-screen .save-form {
  position: relative; display: grid; gap: 14px; margin-top: 26px; padding: 30px 16px 20px;
  border: 2px solid #0b0b0b; border-radius: 0; background: #f4efe3; box-shadow: 8px 8px 0 #0b0b0b; backdrop-filter: none;
}
.prepare-screen .save-form::before {
  content: "SELECT — 選ぶ"; position: absolute; top: -13px; left: 12px; padding: 5px 10px 4px;
  background: #0b0b0b; color: #f1d527; box-shadow: 3px 3px 0 #f1d527;
  font: 700 .78rem/1 Didot, "Bodoni 72", "Hiragino Mincho ProN", serif; letter-spacing: .18em; transform: rotate(-2deg);
}
.prepare-screen .genre-chips { gap: 10px; margin-bottom: 8px; }
.prepare-screen .meta-chip {
  min-height: 42px; border: 2px solid #0b0b0b; border-radius: 0; background: #fffdf6; color: #0b0b0b;
  box-shadow: 3px 3px 0 #0b0b0b; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  transition: transform .12s ease, box-shadow .12s ease;
}
.prepare-screen .meta-chip:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #0b0b0b; }
.prepare-screen .meta-chip.selected,
.prepare-screen .meta-chip[aria-pressed="true"] { border-color: #0b0b0b; background: #0b0b0b; color: #f1d527; box-shadow: 3px 3px 0 #f1d527, 3px 3px 0 1px #0b0b0b; }
.prepare-screen .option-candidate-group > b { position: relative; padding-left: 12px; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.prepare-screen .option-candidate-group > b::before { content: ""; position: absolute; left: 0; top: .2em; width: 5px; height: 1em; background: #f1d527; box-shadow: 1px 1px 0 #0b0b0b; }
.prepare-screen input, .prepare-screen textarea { border: 2px solid #0b0b0b; border-radius: 0; background: #fffdf6; color: #0b0b0b; }
.prepare-screen .save-form .button {
  min-height: 58px; border: 2px solid #0b0b0b; border-radius: 0; background: #0b0b0b; color: #f1d527;
  box-shadow: 6px 6px 0 #f1d527, 6px 6px 0 2px #0b0b0b;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1.05rem; font-weight: 800; letter-spacing: .08em;
  transition: transform .14s ease, box-shadow .14s ease;
}
.prepare-screen .save-form .button:active { transform: translate(4px,4px); box-shadow: 2px 2px 0 #f1d527, 2px 2px 0 2px #0b0b0b; }
.prepare-screen .save-form .button.secondary { min-height: 48px; margin-top: 6px; background: #fffdf6; color: #0b0b0b; box-shadow: 4px 4px 0 #0b0b0b; font-size: .95rem; }
.prepare-screen .save-form .button.secondary:active { box-shadow: 1px 1px 0 #0b0b0b; }
.prepare-screen .session-context { border-radius: 0; box-shadow: 3px 3px 0 #0b0b0b; }
.prepare-screen .swap-options { border: 2px solid #0b0b0b; border-radius: 0; background: #f1d527; color: #0b0b0b; box-shadow: 3px 3px 0 #0b0b0b; }
/* Reveal: reserve room so the bottom-anchored back button never covers the reveal button. */
.draw-screen.draw-two { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* P41 — deep menu: hide context box; two-card follow-up deep cards reuse the one-card layout. */
.deep-menu-open > .session-context { display: none; }
.two-result.deep-menu-open > .reflection-card.answered { display: none; }
.two-result.has-deep.deep-menu-open > .thought-map.deep-map {
  display: block;
  position: relative;
  z-index: 4;
  max-width: none;
  margin: 230px 0 0;
  padding: 0;
}
.two-result.deep-menu-open .deep-map .thought-node { display: none; }
.two-result.deep-menu-open .deep-map .thought-node:last-child { display: block; }
.two-result.deep-menu-open .deep-map .thought-node:last-child > * { display: none; }
.two-result.deep-menu-open .deep-map .thought-node:last-child > .reflection-card {
  display: block;
  position: relative;
  z-index: 5;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.two-result.deep-menu-open .deep-map .thought-node:last-child > .reflection-card > h3,
.two-result.deep-menu-open .deep-map .thought-node:last-child > .reflection-card > .reflection-actions,
.two-result.deep-menu-open .deep-map .reflection-options > p { display: none; }
.two-result.deep-menu-open .deep-map .reflection-options {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

/* P41 — settings: bottom close sits after content instead of floating over sections. */
#settings-modal .sheet-bottom-close { position: static; box-shadow: none; margin-bottom: 0; }

/* SNSシェア（Instagramストーリーズ・X） */
.share-primary{display:grid;gap:10px;margin:14px 0 12px}
.share-big{display:flex;align-items:center;justify-content:center;gap:10px;min-height:56px;padding:12px 16px;border-radius:14px;border:0;font:inherit;font-weight:800;font-size:16px;text-decoration:none;cursor:pointer;color:#fff}
.share-big b{font-size:20px;line-height:1}
.share-big.instagram{background:linear-gradient(90deg,#f58529,#dd2a7b 55%,#8134af)}
.share-big.x-post{background:#000;color:#f4efe3;border:1px solid #f4efe3}
.share-big:active{transform:translateY(1px)}
#share-modal .share-big.x-post{border-color:#f4efe3}
/* シェア：Instagram → X → LINE → Facebook の縦並び */
.share-big.line{background:#06c755}
.share-big.facebook{background:#1877f2}
#share-modal .share-grid.share-grid-single{grid-template-columns:1fr}
.card-entry-guide{position:fixed;top:calc(12px + env(safe-area-inset-top,0px));left:50%;transform:translateX(-50%);z-index:40;width:min(560px,calc(100% - 32px));box-sizing:border-box;display:flex;align-items:flex-start;gap:12px;padding:12px 14px;background:#0b0b0b;color:#f4efe3;border:1.5px solid #f1d527;box-shadow:4px 4px 0 rgba(241,213,39,.9)}
.card-entry-guide p{margin:0;flex:1;display:grid;gap:4px}
.card-entry-guide strong{color:#f1d527;font-family:"Hiragino Mincho ProN","Yu Mincho",serif;letter-spacing:.04em}
.card-entry-guide span{font-size:.82rem;line-height:1.5}
.card-entry-guide button{background:none;border:0;color:#f4efe3;font-size:1.2rem;line-height:1;padding:2px 4px;cursor:pointer}
/* 親指で届くよう、準備・カード選択画面も上部の戻るを下部ナビへ集約 */
body[data-view="prepare-genre"] .bottom-nav,
body[data-view="prepare-options"] .bottom-nav,
body[data-view="draw"] .bottom-nav { display: grid !important; }
body[data-view="prepare-genre"] .prepare-screen > .text-back,
body[data-view="prepare-options"] .prepare-screen > .text-back,
body[data-view="draw"] .draw-screen > .text-back { display: none !important; }
body[data-view="prepare-genre"] .app-shell,
body[data-view="prepare-options"] .app-shell,
body[data-view="draw"] .app-shell { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

.update-bar { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 8px; max-width: 480px; margin: 0 auto; padding: 8px 8px 8px 14px; background: #0b0b0b; color: #f4efe3; border: 1.5px solid #f4efe3; font-size: .8rem; line-height: 1.5; }
.update-bar p { flex: 1; margin: 0; }
.update-bar button { min-height: 44px; min-width: 44px; padding: 0 10px; border: 1px solid #f4efe3; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.update-bar .update-bar-close { border: 0; font-size: 1.1rem; }


/* Settings bottom: links list + compact legal row */
.backup-status:empty { display: none; }
#settings-modal .data-setting:not(.account-setting) { padding-bottom: 14px; }
.settings-links { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.settings-link { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 0; background: transparent; color: inherit; font: inherit; font-size: .94rem; text-align: left; cursor: pointer; }
.settings-link + .settings-link { border-top: 1px solid var(--line); }
.settings-link-chevron { font-size: 1.25rem; line-height: 1; opacity: .55; }
#settings-modal .settings-links { border-color: #4d4841; border-radius: 3px; background: #131313; }
#settings-modal .settings-link { color: #fff; }
#settings-modal .settings-link + .settings-link { border-top-color: #4d4841; }
#settings-modal .settings-link:hover, #settings-modal .settings-link:focus-visible { background: #1c1c1c; }
#settings-modal .settings-link-chevron { color: #f1d527; opacity: 1; }
.paywall-legal { margin: 12px 0 0; font-size: .75rem; color: var(--muted); text-align: center; }
.paywall-legal a { color: inherit; }

a.settings-link{text-decoration:none;color:inherit}
#paywall-modal .confirm-actions{grid-template-columns:1.7fr 1fr}
#paywall-modal .confirm-actions .button{white-space:nowrap;padding-left:10px;padding-right:10px}
#paywall-modal .confirm-actions .google-signin{grid-column:auto;align-items:center;justify-content:center;min-width:0;overflow:hidden}
#paywall-modal .confirm-actions [hidden]{display:none}
#paywall-modal .confirm-actions:has(.google-signin:not([hidden])) .button.secondary{min-height:44px;height:44px;padding-top:0;padding-bottom:0;align-self:center}
#paywall-modal .confirm-actions:has(.google-signin:not([hidden])){align-items:center}
#paywall-modal .confirm-actions .google-signin > div{width:100%}
#paywall-modal .confirm-actions:has(.google-signin:not([hidden])) .button.secondary{min-height:40px;height:40px;border:1px solid rgba(255,255,255,.32);border-radius:4px;background:transparent;box-shadow:none;color:rgba(255,255,255,.78);font-size:14px;letter-spacing:.08em}

/* Home: quiet link to the 78-card index, between "使い方を見る" and the bottom nav */
.quickstart-cards { position: absolute; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 6px; color: #0b0b0b; text-decoration: none; white-space: nowrap; font: 600 .78rem/1 "Hiragino Mincho ProN","Yu Mincho",serif; letter-spacing: .04em; transition: opacity .2s ease; }
.quickstart-cards b { font: italic 700 .78rem/1 Didot,"Bodoni 72",serif; letter-spacing: .12em; padding-bottom: 2px; border-bottom: 2px solid #f1d527; }
.quickstart-cards span { border-bottom: 1px solid rgba(11,11,11,.35); padding-bottom: 2px; }
.quickstart-cards::after { content: "→"; font-family: Didot,"Bodoni 72",serif; font-size: .8rem; }
.quickstart-screen.is-choosing .quickstart-cards { opacity: 0; pointer-events: none; }

/* Settings: UNLIMITED entry (non-Pro only) and the low-key legal row */
#settings-modal .settings-link-pro span:first-child { display: grid; gap: 3px; }
#settings-modal .settings-link-pro small { font: italic 700 .75rem/1 Didot,"Bodoni 72",serif; letter-spacing: .14em; color: #f1d527; }
.settings-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; margin: 10px 0 env(safe-area-inset-bottom); font-size: .75rem; line-height: 1.4; }
.settings-legal a { padding: 6px 4px; color: #8a847a; text-decoration: none; }
.settings-legal a + a::before { content: "·"; margin-right: 8px; color: #5c574f; }

/* 2026-10-10 — splash hit area, prepare paper background, learn editorial restyle. */
.splash-screen { position: relative; }
.splash-hit { position: absolute; left: 0; right: 0; bottom: 0; height: 42%; z-index: 4; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.splash-start { cursor: pointer; }
.splash-screen.peeling .splash-hit { display: none; }

.prepare-screen {
  position: relative; isolation: isolate;
  background:
    radial-gradient(rgba(11,11,11,.09) 1px, transparent 1.4px) 0 0 / 14px 14px,
    #f4efe3 !important;
}
.prepare-screen::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 46%;
  background: url("./assets/editorial/choice-collage.webp") center bottom / cover no-repeat;
  opacity: .14; filter: grayscale(.35) contrast(1.05); pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%); mask-image: linear-gradient(to bottom, transparent, #000 40%);
}
.prepare-screen::after {
  content: "" !important; display: block !important; position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(-45deg, #0b0b0b 0 10px, #f1d527 10px 20px); pointer-events: none;
}
.prepare-screen > * { position: relative; z-index: 1; }

body.learn-active, body.learn-active .app-shell { background: #f4efe3 !important; }
body.learn-active .learn-screen {
  position: relative;
  isolation: isolate;
  background: transparent !important;
  color: #0b0b0b;
  animation: none;
  --learn-background: url('./assets/editorial/learn-celestial-v1.webp');
}
body.learn-active .learn-screen[data-learn-tab="lessons"] {
  --learn-background: url('./assets/editorial/learn-elements-v1.webp');
}
.learn-screen::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  width: min(100vw, 430px);
  height: 100dvh;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(rgba(244,239,227,.24), rgba(244,239,227,.24)), var(--learn-background) center / cover no-repeat;
}
.learn-header { position: relative; padding-top: 8px; }
.learn-back {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; margin-bottom: 14px;
  border: 2px solid #0b0b0b; border-radius: 0; background: #0b0b0b; color: #f1d527;
  box-shadow: 3px 3px 0 #f1d527, 3px 3px 0 1px #0b0b0b;
  font: 700 .95rem/1 "Hiragino Mincho ProN","Yu Mincho",serif; letter-spacing: .06em; cursor: pointer;
}
.learn-back:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #f1d527; }
.learn-kicker {
  display: inline-block; margin: 0 0 8px; padding: 4px 9px 3px; background: #f1d527; color: #0b0b0b;
  box-shadow: 2px 2px 0 #0b0b0b; font: italic 700 .78rem/1 Didot,"Bodoni 72",serif; letter-spacing: .18em;
}
.learn-header h1 { margin: 4px 0 6px; color: #0b0b0b; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-weight: 800; letter-spacing: .04em; }
.learn-screen p, .learn-screen li { color: #2a2620; line-height: 1.85; }
.learn-tabs { gap: 8px; }
.learn-tab, .learn-filter, .learn-direction button, .learn-direction > * {
  border: 2px solid #0b0b0b !important; border-radius: 0 !important; background: #fffdf6 !important; color: #0b0b0b !important;
  box-shadow: 3px 3px 0 #0b0b0b; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-weight: 700;
}
.learn-tab[aria-selected="true"], .learn-tab.active, .learn-tab.selected,
.learn-filter[aria-pressed="true"], .learn-filter.active, .learn-filter.selected,
.learn-direction .active, .learn-direction [aria-pressed="true"] {
  background: #0b0b0b !important; color: #f1d527 !important; box-shadow: 3px 3px 0 #f1d527, 3px 3px 0 1px #0b0b0b;
}
.learn-search, .learn-search input {
  border-radius: 0 !important; border: 2px solid #0b0b0b; background: #fffdf6; color: #0b0b0b; box-shadow: 3px 3px 0 #0b0b0b;
}
.learn-search input { border: 0; box-shadow: none; }
.learn-tile, .learn-lesson-item, .learn-journey-step, .learn-points, .learn-suit-cards > *, .learn-related-link, .learn-progress, .learn-complete, .learn-empty, .learn-rank-table {
  border: 2px solid #0b0b0b !important; border-radius: 0 !important; background: #fffdf6 !important; color: #0b0b0b;
  box-shadow: 4px 4px 0 #0b0b0b !important;
}
.learn-tile:active, .learn-related-link:active, .learn-lesson-item:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 #0b0b0b !important; }
.learn-thumb { border-radius: 0 !important; }
.learn-tile-number, .learn-card-type { font-family: Didot,"Bodoni 72",serif; font-style: italic; letter-spacing: .1em; color: #6f6656; }
.learn-tile-name { font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-weight: 800; color: #0b0b0b; }
.learn-lesson-back { border: 2px solid #0b0b0b; border-radius: 0; background: #0b0b0b; color: #f1d527; box-shadow: 3px 3px 0 #f1d527; }

/* Lesson reading view: plain article text, single plates. */
.learn-lessons > h2 { margin: 6px 0 4px; font-family: "Hiragino Mincho ProN","Yu Mincho",serif; font-weight: 800; font-size: 1.6rem; line-height: 1.35; color: #0b0b0b; border-left: 8px solid #f1d527; padding-left: 12px; }
.learn-lessons > p:not(.learn-kicker):not(.learn-minutes) { margin: 0 0 1.1em; padding: 0 2px; font-size: 1.02rem; line-height: 1.95; color: #1e1b16; max-width: 38em; }
.learn-minutes { margin: 0 0 18px; font-size: .82rem; color: #6f6656; letter-spacing: .08em; }
.learn-lesson-back { display: inline-block; margin: 4px 0 14px; padding: 8px 14px; font-weight: 800; letter-spacing: .04em; }
.learn-points { padding: 16px 18px !important; margin: 20px 0 22px; }
.learn-points h3 { margin: 0 0 8px; display: inline-block; background: #0b0b0b; color: #f1d527; padding: 3px 10px; font-size: .9rem; letter-spacing: .12em; }
.learn-points ul { margin: 0; padding-left: 1.2em; }
.learn-points li { margin: 6px 0; line-height: 1.8; }
.learn-lesson-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.learn-read { flex: none; white-space: nowrap; padding: 4px 10px; background: #0b0b0b; color: #f1d527; font-size: .8rem; font-weight: 800; letter-spacing: .06em; }

/* 横向きの案内：スマホを横にしたときは下に小さく「縦向きがおすすめ」と出すだけで、操作は止めない */
.rotate-lock { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .rotate-lock { display: block; position: fixed; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 9999; pointer-events: none; }
  .rotate-lock-card { display: flex; align-items: center; gap: 10px; margin: 0 auto; max-width: 420px; background: #f4efe3; color: #0b0b0b; border: 2px solid #0b0b0b; box-shadow: 4px 4px 0 #f1d527; padding: 8px 14px; }
  .rotate-lock-icon { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; background: #f1d527; border: 2px solid #0b0b0b; font-size: 1rem; font-weight: 900; }
  .rotate-lock-card p { margin: 0; font-family: var(--serif, serif); font-size: .9rem; font-weight: 800; letter-spacing: .06em; }
  .rotate-lock-card small { font-size: .78rem; letter-spacing: .04em; opacity: .75; }
}

/* 削除ボタン：赤い目立つボタン */
.danger-zone .danger-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; background: #c8321e; color: #fff; border: 2px solid #0b0b0b; box-shadow: 4px 4px 0 #0b0b0b; font-weight: 800; font-size: 15px; letter-spacing: .04em; }
.danger-zone .danger-button:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 #0b0b0b; }
.danger-zone .danger-button .danger-icon { font-size: 17px; line-height: 1; }

/* 決定ログのステータスバッジ */
.history-item em.status-badge,
.history-screen .history-item em.status-badge,
.stats-theme-logs .history-item em.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1.5px solid #0b0b0b; font-style: normal; font-weight: 800; font-size: 12px; line-height: 1.3; white-space: nowrap; }
.history-item em.status-badge span { font-size: 12px; }
.history-item em.status-badge.status-good, .history-screen .history-item em.status-badge.status-good, .stats-theme-logs .history-item em.status-badge.status-good { background: #f1d527; color: #0b0b0b; }
.history-item em.status-badge.status-fair, .history-screen .history-item em.status-badge.status-fair, .stats-theme-logs .history-item em.status-badge.status-fair { background: #cfe3c4; color: #0b0b0b; }
.history-item em.status-badge.status-neutral, .history-screen .history-item em.status-badge.status-neutral, .stats-theme-logs .history-item em.status-badge.status-neutral { background: #ddd6c6; color: #0b0b0b; }
.history-item em.status-badge.status-bad, .history-screen .history-item em.status-badge.status-bad, .stats-theme-logs .history-item em.status-badge.status-bad { background: #c8321e; color: #fff; }
.history-item em.status-badge.status-pending, .history-screen .history-item em.status-badge.status-pending, .stats-theme-logs .history-item em.status-badge.status-pending { background: transparent; color: #8a8478; border-style: dashed; border-color: currentColor; font-weight: 600; }
.history-screen .history-item em.status-badge.status-pending { color: #b8b09e; }

/* その後のストーリー共有：結果シェアと見分けがつくBEFORE→AFTERの構成 */
#share-modal .story-share .sheet-head .eyebrow { display: inline-block; padding: 2px 8px; background: #f1d527; color: #0b0b0b; transform: rotate(-2deg); }
#share-modal .story-share-preview { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 2px solid #f1d527; border-radius: 3px; background: #111; color: #eee7da; }
.story-share-label { margin: 0 0 6px; color: #f1d527; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.story-share-row { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.story-share-row .share-preview-images { display: flex; flex: 0 0 auto; gap: 4px; }
.story-share-decision { flex: 1 1 auto; min-width: 0; margin: 0; font-weight: 700; line-height: 1.55; overflow-wrap: anywhere; }
.story-share-after { padding-top: 12px; border-top: 1px dashed #514b42; }
.story-share-review { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.story-share-review b { font-size: 1.05rem; }
.story-share-review small { flex-basis: 100%; color: #b8b09e; font-size: 12px; }
#share-modal em.status-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; padding: 2px 8px; border: 1.5px solid #0b0b0b; font-style: normal; font-weight: 800; font-size: 16px; }
#share-modal em.status-badge.status-good { background: #f1d527; color: #0b0b0b; }
#share-modal em.status-badge.status-fair { background: #cfe3c4; color: #0b0b0b; }
#share-modal em.status-badge.status-neutral { background: #ddd6c6; color: #0b0b0b; }
#share-modal em.status-badge.status-bad { background: #c8321e; color: #fff; }
#share-modal em.status-badge.status-pending { background: transparent; color: #b8b09e; border-style: dashed; border-color: currentColor; }
.story-share-quote { margin: 12px 0 4px; padding: 12px 14px; border: 2px solid #0b0b0b; background: #f4efe3; color: #0b0b0b; box-shadow: 4px 4px 0 #f1d527; line-height: 1.6; overflow-wrap: anywhere; }
#share-modal .story-share-preview .share-preview { max-height: 96px; margin: 0; }

/* 設定：ホーム画面に追加 */
.a2hs-settings { margin: 14px 0; padding: 14px; border: 2px solid #0b0b0b; background: #f4efe3; color: #0b0b0b; box-shadow: 4px 4px 0 #0b0b0b; }
.a2hs-settings p { margin: 0 0 10px; line-height: 1.6; }
.a2hs-settings .button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; border: 2px solid #0b0b0b; background: #f1d527; color: #0b0b0b; font-weight: 800; }

/* #13 決定画面：要約＋「変更する」で保存ボタンを押し下げない */
.decision-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.decision-summary-values { display: flex; flex-wrap: wrap; gap: 6px 14px; min-width: 0; font-size: .82rem; line-height: 1.5; overflow-wrap: anywhere; }
.decision-summary-values span b { margin-right: 6px; padding: 0 5px; background: #0b0b0b; color: #f1d527; font-size: .75rem; letter-spacing: .06em; }
.decision-summary-empty { color: #6b6458; }
.decision-meta-toggle { flex: none; min-height: 44px; padding: 6px 12px; border: 2px solid #0b0b0b; background: #fffdf6; color: #0b0b0b; box-shadow: 3px 3px 0 #0b0b0b; font-weight: 800; font-size: .8rem; cursor: pointer; }
.decision-meta-toggle[aria-expanded="true"] { background: #f1d527; }
.decision-meta-toggle:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #0b0b0b; }
.decision-meta-editor { display: grid; gap: 22px; padding-top: 14px; }
.decision-meta-editor[hidden] { display: none; }
body[data-view="decide"] .decide-screen .decision-meta { display: grid; gap: 0; padding-top: 16px; border-top: 2px dashed #0b0b0b; border-bottom: 0; }
.decision-options small[hidden] { display: none; }

/* #14 準備画面：A/B と組合せ候補、同一内容ヒント */
.same-option-hint { margin: 0; padding: 8px 10px; border-left: 4px solid #f1d527; background: #fff6cf; color: #0b0b0b; font-size: .8rem; line-height: 1.5; }
.same-option-hint[hidden] { display: none; }
.prepare-candidates { margin-top: 22px; padding-top: 16px; border-top: 2px dashed #0b0b0b; }
.prepare-screen .pair-chip { border: 2px solid #0b0b0b; border-radius: 0; background: #fffdf6; color: #0b0b0b; box-shadow: 3px 3px 0 #0b0b0b; }
.pair-chip.selected, .pair-chip[aria-pressed="true"],
body[data-view="decide"] .decide-screen .pair-chip.selected { background: #0b0b0b; color: #f1d527; box-shadow: 3px 3px 0 #f1d527, 3px 3px 0 1px #0b0b0b; }

/* #15 無料ドローの残り回数 */
.quickstart-quota{margin:14px auto 0;max-width:340px;text-align:center;font-size:12px;line-height:1.6;color:var(--muted,#6b6257)}
.quickstart-quota b{font-weight:700;color:var(--ink,#1f1a14)}
.quickstart-quota span{display:block}

/* #16 通知グループ（アプリ内のお知らせ／閉じていても通知） */
#settings-modal .notify-group-title{margin:28px 0 0;font-size:.9rem;font-weight:800;color:#f1d527;letter-spacing:.06em}
#settings-modal .notify-group-title+.feedback-setting{margin-top:10px}
#settings-modal .settings-group-title{margin:28px 0 0;font-size:.9rem;font-weight:800;color:#f1d527;letter-spacing:.06em}
#settings-modal .sheet-head+.settings-group-title{margin-top:8px}
#settings-modal .settings-group-title+*{margin-top:10px}
#settings-modal .remind-setting+.push-setting{margin-top:0;border-top:0}
#settings-modal .push-setting+.email-remind-setting,#settings-modal .remind-setting+.email-remind-setting{margin-top:0;border-top:0}
#settings-modal .email-remind-setting p{overflow-wrap:anywhere}
#settings-modal .push-status{margin-top:8px;font-size:.75rem;color:#cfc7ba}

/* #17 リマインド候補の日付 */
.remind-options button small{display:block;font-size:.75rem;font-family:inherit;opacity:.78;margin-top:2px;letter-spacing:.02em}
.verdict-basis{margin:4px 0 0;font-size:.75rem;line-height:1.6;color:#5b5348}
.verdict-questions{margin:10px 0 0;padding:9px 12px 9px 26px;border-radius:10px;background:rgba(255,255,255,.55);text-align:left;font-size:.8125rem;line-height:1.65;color:#29251e}
.verdict-questions li+li{margin-top:4px}
.two-result .score-help summary{margin:0 auto}

#settings-modal .back-single b { color: #f4efe3; background: none; transform: none; box-shadow: none; padding: 0; margin: 0; }
#settings-modal .back-single small { color: #cfc7ba; }

/* Compact sync settings: keep the switch visible and move guidance to a dialog. */
.sync-help-button { min-height:44px; padding:4px 0; border:0; background:transparent; color:inherit; font:inherit; font-size:.75rem; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }

/* First-use guidance: concrete example and optional card learning. */
.tutorial-example { margin: 0 0 18px; padding: 12px 14px; border-left: 3px solid #f1d527; background: #0b0b0b; color: #f4efe3; font-size: 15px; line-height: 1.7; }
.tutorial-callout .tutorial-meaning-help { margin-top: 16px; padding-top: 14px; border-top: 1px solid currentColor; font-weight: 500; }
.tutorial-callout > .button { width: 100%; min-height: 44px; white-space: normal; }

.tutorial-welcome .tutorial-intro-card { justify-content: center; padding-top: max(32px, env(safe-area-inset-top)); }
.tutorial-welcome .tutorial-intro-card h2 { max-width: none; margin: 0 0 18px; font-size: clamp(1.8rem, 7vw, 2.3rem); line-height: 1.35; }
.tutorial-guidance { scroll-margin-top: 72px; }

.tutorial-mock-decisions button span, .tutorial-mock-decisions button small { display: block; }
.tutorial-mock-decisions button small { margin-top: 4px; font-size: 12px; font-weight: 500; line-height: 1.4; }

/* A visible tutorial entry on the opening cover. */
body[data-view="home"][data-home-stage="splash"] .splash-start { bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 5; }
.splash-links { position: absolute; z-index: 5; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(360px, calc(100% - 36px)); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.splash-help, .splash-atlas { min-width: 0; min-height: 44px; padding: 10px 8px; border: 1px solid #f4efe3; border-radius: 0; background: rgba(8,8,8,.85); color: #f4efe3; font: 700 15px/1.5 "Hiragino Mincho ProN","Yu Mincho",serif; cursor: pointer; }
.splash-help:focus-visible, .splash-atlas:focus-visible { outline: 3px solid #f1d527; outline-offset: 4px; }
.splash-screen.peeling .splash-links { pointer-events: none; }

.card-direction-help { margin: 14px 0; padding: 12px; border-left: 3px solid var(--accent); font-size: 15px; line-height: 1.7; }

/* Related reading uses the same cream, black and yellow as the lessons. */
.learn-tab { min-width: 0; font-size: 15px; }
.learn-articles { color: #0b0b0b; }
.learn-articles-intro, .learn-article-count { padding: 12px; background: #f4efe3; font-size: 15px; line-height: 1.7; }
.learn-article-list { display: grid; gap: 14px; }
.learn-article-item { width: 100%; padding: 16px; text-align: left; border: 2px solid #0b0b0b; border-radius: 0; background: #f4efe3; color: #0b0b0b; box-shadow: 4px 4px 0 #0b0b0b; cursor: pointer; overflow-wrap: anywhere; }
.learn-article-item strong { display: block; margin: 8px 0; font-size: 17px; line-height: 1.6; }
.learn-article-item p { margin: 0; font-size: 15px; line-height: 1.7; }
.learn-article-meta { font-size: 12px; color: #555044; }
.learn-article-reader { padding: 16px; background: #f4efe3; color: #0b0b0b; border: 2px solid #0b0b0b; overflow-wrap: anywhere; }
.learn-article-reader > h2 { font-size: clamp(20px, 5.2vw, 23px); line-height: 1.55; margin: 20px 0; }
.learn-article-body { font-size: 16px; line-height: 1.9; }
.learn-article-body p { white-space: pre-line; }
.learn-article-body h2 { margin-top: 28px; font-size: 20px; line-height: 1.6; }
.learn-article-body h3 { font-size: 18px; line-height: 1.6; }
.learn-article-reader > .button { width: 100%; margin-top: 24px; }

.learn-articles .learn-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
.learn-articles .learn-filter { flex: 0 0 auto; white-space: nowrap; }

/* Crawlable reading links share the cover's existing auxiliary navigation. */
.home-reading-links { grid-column: 1 / -1; background: rgba(8,8,8,.85); display: flex; align-items: center; justify-content: center; gap: 4px; }
.home-reading-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 4px 6px; color: #f4efe3; font-size: 12px; line-height: 1.4; text-underline-offset: 4px; }
.home-reading-links a:focus-visible { outline: 3px solid #f1d527; outline-offset: 1px; }
body[data-view="home"][data-home-stage="splash"] .splash-start { bottom: calc(136px + env(safe-area-inset-bottom)); }
