@property --bg { syntax: "<color>"; inherits: true; initial-value: #f6f7f9; }
@property --bg-gradient { syntax: "<color>"; inherits: true; initial-value: #f0f4f5; }
@property --surface { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --text-primary { syntax: "<color>"; inherits: true; initial-value: #1c2c30; }
@property --text-secondary { syntax: "<color>"; inherits: true; initial-value: #526468; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #255c58; }

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --bg-gradient: #f0f4f5;
  --surface: #ffffff;
  --surface-raised: #edf2f2;
  --text-primary: #1c2c30;
  --text-secondary: #526468;
  --accent: #255c58;
  --accent-soft: #e4efed;
  --border: #d4dfdf;
  --border-strong: #73928e;
  --illustration-glow: #e2e8eb;
  --tarot-gold: #aa9576;
  --ambient-rgb: 184, 205, 211;
  --accent-rgb: 37, 92, 88;
  --notice-bg: #edf2f2;
  --notice-text: #4e6266;
  --notice-strong: #2e484d;
  --focus: #255c58;
  --shadow: rgba(22, 47, 55, .06);
  --card-paper: #eaf2f0;
  --card-ink: #1c3836;
  --card-label: #705536;
  --cta-bg: #255c58;
  --cta-text: #ffffff;
  --moon-lit: #e5eff2;
  --moon-mid: #adc3cc;
  --moon-shadow: #6f929e;
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-deep: var(--bg);
  --bg-emerald: var(--bg-gradient);
  --surface-1: var(--surface);
  --surface-2: var(--surface-raised);
  --gold-dark: var(--card-label);
  --gold: var(--accent);
  --gold-light: var(--accent);
  --champagne: var(--text-primary);
  --ivory: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --ease-ritual: cubic-bezier(.22, .75, .22, 1);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-deep);
  color: var(--ivory);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  transition: --bg 320ms var(--ease-ritual), --bg-gradient 320ms var(--ease-ritual), --surface 320ms var(--ease-ritual), --text-primary 320ms var(--ease-ritual), --text-secondary 320ms var(--ease-ritual), --accent 320ms var(--ease-ritual);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #02080a;
  --bg-gradient: #061413;
  --surface: #0b1d1c;
  --surface-raised: #10332e;
  --text-primary: #f5eee5;
  --text-secondary: #aaa093;
  --accent: #d5b38d;
  --accent-soft: #10332e;
  --border: #625345;
  --border-strong: #c5a786;
  --illustration-glow: #f2d9ae;
  --tarot-gold: #d5b38d;
  --ambient-rgb: 26, 82, 72;
  --accent-rgb: 213, 179, 141;
  --notice-bg: #0b1d1c;
  --notice-text: #aaa093;
  --notice-strong: #f5eee5;
  --focus: #bce2ff;
  --shadow: rgba(0, 0, 0, .18);
  --card-paper: #f2d9ae;
  --card-ink: #241d19;
  --cta-bg: #f2d9ae;
  --cta-text: #241d19;
  --moon-lit: #f2d9ae;
  --moon-mid: #d5b38d;
  --moon-shadow: #705536;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { color: var(--text-primary); background: var(--accent-soft); }
html { min-width: 320px; background: var(--bg-deep); }

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 79% -4%, rgba(var(--ambient-rgb), .42), transparent 31rem),
    radial-gradient(circle at 12% 58%, rgba(var(--ambient-rgb), .2), transparent 28rem),
    linear-gradient(145deg, var(--bg-deep), var(--bg-emerald) 48%, var(--bg-deep));
  transition: color 320ms var(--ease-ritual), background-color 320ms var(--ease-ritual);
  scrollbar-color: var(--border-strong) var(--bg);
}

button, input, select, summary { font: inherit; }
button { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible + span,
summary:focus-visible,
[tabindex="-1"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
button:disabled { cursor: default; }

.celestial-field { position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; opacity: .62; }
.field-orbit { position: absolute; top: -15rem; right: -13rem; width: 40rem; height: 40rem; border: 1px solid rgba(var(--accent-rgb), .14); border-radius: 50%; transform: rotate(-21deg); }
.field-orbit::after { position: absolute; inset: 2.5rem; border: 1px solid rgba(var(--accent-rgb), .1); border-radius: inherit; content: ""; }
.field-orbit-two { top: -11rem; right: -18rem; transform: rotate(21deg); opacity: .5; }
.field-spark { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--tarot-gold); box-shadow: 0 0 14px 3px rgba(var(--accent-rgb), .45); }
.field-spark-one { top: 12%; right: 18%; }
.field-spark-two { top: 38%; left: 8%; width: 2px; height: 2px; opacity: .7; }
.field-spark-three { top: 67%; right: 7%; width: 2px; height: 2px; opacity: .55; }

.app-shell { position: relative; z-index: 1; width: min(100%, 760px); min-height: 100dvh; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) clamp(18px, 5vw, 42px) max(34px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.wordmark { display: inline-flex; flex-direction: column; gap: 4px; color: var(--champagne); text-decoration: none; }
.wordmark > span { font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; letter-spacing: .18em; line-height: .9; }
.wordmark small, .eyebrow, .section-kicker, .prompt-label, .demo-badge { color: var(--gold); font-size: .62rem; font-weight: 700; letter-spacing: .22em; line-height: 1.35; }
.wordmark small { color: var(--muted); font-size: .47rem; letter-spacing: .24em; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.demo-badge { color: var(--gold-light); }
.profile-mark { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 78px; height: 44px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 24px; background: transparent; color: var(--gold-light); cursor: pointer; }
.profile-mark span { font-size: .8125rem; }
.profile-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.4; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 22px; min-height: 290px; padding: 28px 0 24px; }
.eyebrow { margin: 0 0 16px; color: var(--gold); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 12ch; margin-bottom: 18px; color: var(--champagne); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.65rem, 7vw, 4.4rem); font-weight: 400; letter-spacing: -.035em; line-height: 1.05; }
h1 em { color: var(--gold-light); font-style: italic; }
.hero-lead { max-width: 34ch; margin-bottom: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; text-wrap: pretty; }
.moon-mark { position: relative; width: 220px; aspect-ratio: 1; justify-self: end; }
.ulya-emblem { position: relative; display: block; width: 100%; height: auto; }
.emblem-night { display: none; }
:root[data-theme="dark"] .emblem-night { display: block; }
:root[data-theme="dark"] .emblem-pearl { display: none; }
.hero-orbit { position: absolute; inset: 7%; border: 1px solid var(--border); border-radius: 50%; transform: rotate(-28deg); }
.hero-orbit::before { position: absolute; inset: -9%; border: 1px dashed var(--border); border-radius: inherit; opacity: .45; content: ""; }
.hero-orbit::after { position: absolute; inset: 10%; border: 1px solid var(--border); border-radius: inherit; opacity: .4; content: ""; }

.demo-notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 12px 0; border-block: 1px solid var(--line); background: transparent; color: var(--notice-text); font-size: .8125rem; line-height: 1.55; }
.demo-notice strong { color: var(--notice-strong); font-weight: 700; }
.notice-mark { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 6px; border: 1px solid var(--notice-strong); border-radius: 50%; }

.ritual { padding: 12px 0 0; }
.ritual-heading, .result-header, .step-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ritual-heading { align-items: center; margin-bottom: 22px; }
.ritual-heading h2 { margin: 0; color: var(--ivory); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 400; letter-spacing: -.03em; }
.ritual-symbol, .result-seal { color: var(--gold-light); font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; }
.ritual-symbol { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1; }
.step-block { padding: 28px 0; border-top: 1px solid var(--line); }
.step-heading { justify-content: flex-start; }
.step-number { flex: 0 0 auto; padding-top: 4px; color: var(--gold); font-size: .68rem; font-variant-numeric: tabular-nums; letter-spacing: .16em; }
h3 { margin: 0 0 7px; color: var(--ivory); font-size: 1rem; font-weight: 700; letter-spacing: .01em; }
.step-heading p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }

.question-list { display: grid; gap: 9px; margin: 19px 0 0 38px; }
.question-option { display: grid; grid-template-columns: 31px minmax(0, 1fr) 22px; align-items: center; gap: 10px; min-height: 62px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--surface); color: var(--ivory); cursor: pointer; text-align: left; transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
.question-option:hover, .question-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent), 0 9px 24px var(--shadow); }
.question-index { color: var(--gold); font-size: .68rem; letter-spacing: .11em; }
.question-label { min-width: 0; font-size: .88rem; line-height: 1.4; }
.question-arrow { color: var(--gold-light); font-size: 1.15rem; line-height: 1; text-align: right; }

.tone-list { display: flex; flex-wrap: wrap; gap: 9px; margin: 19px 0 0 38px; padding: 0; border: 0; }
.topic-step { padding: 0 0 26px; border-top: 0; }
.topic-step .step-number, .topic-step h3 { display: none; }
.topic-step .step-heading { margin-left: 0; }
.topic-list { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; border: 0; }
.topic-list label { position: relative; cursor: pointer; }
.topic-list input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.topic-surface { display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; align-items: center; gap: 14px; min-height: 76px; padding: 12px 18px; border: 1px solid var(--border-strong); border-radius: 18px 6px 18px 6px; color: var(--text-primary); background: var(--surface); transition: background-color 180ms ease, border-color 180ms ease; }
.topic-surface > svg { width: 32px; height: 32px; fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.topic-surface > .topic-chevron { width: 18px; height: 18px; }
.topic-copy { display: block; }
.topic-copy strong { display: block; font-size: 1.0625rem; font-weight: 550; }
.topic-copy small { display: block; margin-top: 4px; color: var(--text-secondary); font-size: .8125rem; line-height: 1.4; }
.topic-list input:checked + .topic-surface { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.topic-list label:hover .topic-surface { border-color: var(--accent); }
.topic-list input:focus-visible + .topic-surface { outline: 3px solid var(--focus); outline-offset: 4px; }
:root[data-theme="dark"] .topic-copy strong { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 1.25rem; }
.tone-list.conversation-tones { margin: 24px 0 12px; }
.conversation-tones legend { margin-bottom: 12px; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.conversation-tones .tone-option span { min-width: 0; padding-inline: 16px; }
.deeper-entry { margin-top: 24px; }
.deeper-entry > p, .deep-intro { font-size: 1rem; line-height: 1.65; color: var(--text-primary); }
.deeper-entry > .quiet-text { color: var(--text-secondary); font-size: .875rem; }
@media (max-width: 480px) { .topic-list { margin-left: 0; } }
.tone-option { position: relative; cursor: pointer; }
.tone-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tone-option span { display: grid; min-width: 112px; min-height: 48px; place-items: center; padding: 10px 20px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: .86rem; transition: border-color 180ms ease, color 180ms ease, background 180ms ease; }
.tone-option input:checked + span { border-color: var(--gold-light); background: var(--card-paper); color: var(--card-ink); font-weight: 800; }

.cards-block { padding-bottom: 25px; }
.reading-complete { margin-top: 24px; }
.cards-heading { align-items: flex-start; }
.status { max-width: 43ch; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0 0 38px; }
.tarot-card { position: relative; display: grid; min-height: 250px; grid-template-rows: auto 1fr auto; place-items: center; gap: 8px; overflow: hidden; padding: 14px 12px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-1); color: var(--ivory); cursor: pointer; text-align: center; transition: transform 220ms var(--ease-ritual), border-color 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.tarot-card::before { position: absolute; inset: 6px; border: 1px solid var(--border); border-radius: 9px; content: ""; pointer-events: none; }
.tarot-card:hover:not(:disabled) { border-color: var(--gold-light); box-shadow: 0 10px 24px var(--shadow); transform: translateY(-3px); }
.tarot-card:active:not(:disabled) { transform: translateY(-2px) scale(.985); }
.tarot-card:disabled:not(.is-open) { cursor: default; opacity: .42; }
.tarot-card.is-open { grid-template-rows: auto 1fr auto auto; border-color: var(--border-strong); background: var(--card-paper); color: var(--card-ink); cursor: default; }
.tarot-card.is-open::before { border-color: var(--border-strong); opacity: .5; }
.card-back { position: relative; z-index: 1; display: grid; width: 100%; max-width: 122px; place-items: center; color: var(--gold-light); }
.card-back svg { width: 100%; height: auto; fill: none; stroke: currentColor; stroke-width: 1.2; }
.art-moon { fill: currentColor; fill-opacity: .2; }
.card-face { display: grid; align-self: center; width: 100%; max-width: 158px; color: var(--card-ink); }
.card-illustration { display: block; width: 100%; aspect-ratio: 1; border: 1px solid var(--border-strong); border-radius: 6px; background-image: url('./assets/ulya-card-atlas-pearl-v1.webp'); background-size: 300% 300%; background-repeat: no-repeat; }
.card-face svg { display: none; }
:root[data-theme="dark"] .card-illustration { background-image: url('./assets/ulya-card-atlas-night-v1.webp'); }
:root[data-theme="dark"] .tarot-card.is-open { background: var(--surface); color: var(--text-primary); }
:root[data-theme="dark"] .tarot-card.is-open .card-position { color: var(--accent); }
.art-0 { background-position: 0 0; }
.art-1 { background-position: 50% 0; }
.art-2 { background-position: 100% 0; }
.art-3 { background-position: 0 50%; }
.art-4 { background-position: 50% 50%; }
.art-5 { background-position: 100% 50%; }
.art-6 { background-position: 0 100%; }
.art-7 { background-position: 50% 100%; }
.art-8 { background-position: 100% 100%; }
.tarot-card > span:last-child:not(.card-position) { font-size: .8125rem; }
.tarot-card strong, .tarot-card small, .card-position { position: relative; z-index: 1; }
.tarot-card strong { max-width: 100%; overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: .98rem; font-weight: 400; }
.tarot-card small { max-width: 15ch; color: inherit; font-size: .8125rem; line-height: 1.4; }
.card-position { min-height: 24px; color: var(--gold); font-size: .8125rem; font-variant-numeric: tabular-nums; line-height: 1.35; }
.tarot-card.is-open .card-position { color: var(--gold-dark); }

.result { margin: 28px 0 0; padding: 28px 26px 24px; border: 1px solid var(--line-strong); border-radius: 24px 8px 24px 8px; background: var(--surface); box-shadow: 0 18px 40px var(--shadow); }
.result-header { align-items: center; margin-bottom: 18px; }
.result h2 { margin-bottom: 14px; color: var(--champagne); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 6vw, 2.45rem); font-weight: 400; letter-spacing: -.04em; }
.result > p { color: var(--ivory); font-size: 1rem; line-height: 1.75; }
.reflection-prompt { margin: 21px 0; padding: 15px 16px; border-left: 1px solid var(--gold); background: var(--accent-soft); }
.prompt-label { display: block; margin-bottom: 7px; color: var(--gold); font-size: .58rem; }
.reflection-prompt p { margin: 0; color: var(--champagne); font-family: Georgia, "Times New Roman", serif; font-size: 1.02rem; line-height: 1.45; }
.safety-note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted) !important; font-size: .82rem !important; line-height: 1.55 !important; }
.safety-note strong { color: var(--notice-strong); font-weight: 700; }

.reset-button { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 38px); min-height: 52px; margin: 20px 0 0 38px; padding: 11px 17px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--gold-light); cursor: pointer; font-size: .86rem; transition: background 180ms ease, border-color 180ms ease; }
.reset-button:hover { border-color: var(--gold-light); background: var(--accent-soft); }
.reset-button span { font-size: 1.1rem; }
.footer-note { display: flex; align-items: center; gap: 11px; margin: 34px 0 0 38px; color: var(--muted); font-size: .68rem; letter-spacing: .11em; line-height: 1.55; text-transform: uppercase; }
.footer-rule { flex: 0 0 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.appearance-panel { margin: 0 0 28px; border-block: 1px solid var(--line); }
.appearance-panel summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 16px; color: var(--text-primary); cursor: pointer; list-style: none; }
.appearance-panel summary::-webkit-details-marker { display: none; }
.appearance-panel summary span { color: var(--accent); font-size: .85rem; }
.theme-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; padding: 0; border: 0; }
.theme-list label { position: relative; cursor: pointer; }
.theme-list input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.theme-list span { display: grid; min-height: 48px; padding: 10px 6px; place-items: center; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text-secondary); font-size: .9rem; }
.theme-list input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--text-primary); font-weight: 700; }
.appearance-description { margin: 0 0 18px; color: var(--text-secondary); font-size: .85rem; line-height: 1.5; }
.ritual-setting { display: flex; align-items: center; gap: 14px; min-height: 64px; cursor: pointer; }
.ritual-setting input { width: 24px; height: 24px; flex-shrink: 0; accent-color: var(--accent); }
.ritual-setting input:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.ritual-setting strong, .ritual-setting small { display: block; }
.ritual-setting strong { font-size: .95rem; }
.ritual-setting small { margin-top: 5px; color: var(--text-secondary); font-size: .82rem; line-height: 1.5; }
.appearance-footnote { margin: 12px 0 18px; color: var(--text-secondary); font-size: .82rem; line-height: 1.5; }
.reading-entry { margin: 0 0 26px 38px; }
.reading-entry p { color: var(--text-secondary); font-size: .9rem; line-height: 1.5; }
.primary-button { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; min-height: 56px; padding: 14px 20px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--cta-bg); color: var(--cta-text); font-size: 1rem; font-weight: 700; cursor: pointer; }
.primary-button:hover { box-shadow: 0 8px 20px var(--shadow); }
.back-button { min-height: 48px; margin: 0 0 16px; padding: 0 8px; border: 0; background: transparent; color: var(--accent); font-size: .9rem; cursor: pointer; }
.cards-heading h2 { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 400; color: var(--text-primary); }
.cards-block .deck { margin-left: 0; }
.text-button { min-height: 44px; padding: 10px 4px; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: .9rem; text-align: left; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.text-button:hover { color: var(--text-primary); }
.topbar-actions { gap: 10px; }
.topbar-actions .text-button { font-size: .82rem; }
.history-panel { margin-bottom: 22px; padding: 22px 0; border-block: 1px solid var(--border); }
.history-panel h2 { margin-bottom: 12px; font-size: 1.4rem; font-weight: 600; }
.history-question { margin-bottom: 8px; font-size: 1.05rem; font-weight: 600; }
.quiet-text { color: var(--text-secondary); font-size: .875rem; line-height: 1.65; }
.history-panel .quiet-text:last-child { margin-bottom: 0; }
.memory-summary { margin: 18px 0 22px; }
.memory-summary dt { margin-top: 16px; color: var(--text-secondary); font-size: .8125rem; }
.memory-summary dd { margin: 5px 0 0; color: var(--text-primary); font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.secondary-button { min-height: 48px; padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text-primary); cursor: pointer; font-size: .9rem; }
.secondary-button:hover { background: var(--accent-soft); }
.history-edit, .delete-confirmation { margin: 18px 0; padding-block: 18px; border-block: 1px solid var(--border); }
.history-edit label { display: block; margin-bottom: 12px; font-size: 1rem; line-height: 1.5; }
.history-edit select { width: 100%; min-height: 52px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text-primary); font-size: 1rem; }
.history-edit .quiet-text { margin-top: 12px; }
.delete-button { margin-top: 4px; color: var(--text-secondary); }
.feedback { margin: 18px 0; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text-primary); background: var(--accent-soft); font-size: .9rem; line-height: 1.6; }
.feedback[data-error="true"] { background: var(--notice-bg); color: var(--notice-strong); }
.scenario-description { margin: 18px 0 0 38px; color: var(--text-secondary); font-size: .875rem; line-height: 1.6; }
.tarot-card .card-position { max-width: 100%; min-height: 36px; font-size: .8125rem; letter-spacing: 0; line-height: 1.4; }
.reading-details { margin-top: 24px; border-block: 1px solid var(--border); }
.reading-details summary { min-height: 52px; padding: 16px 0; color: var(--accent); cursor: pointer; font-size: .95rem; }
.position-readings { margin: 0 0 16px; padding-left: 23px; }
.position-readings li { padding: 10px 0; }
.position-readings strong { font-size: .95rem; line-height: 1.5; }
.position-readings p { margin: 8px 0 0; color: var(--text-secondary); font-size: .95rem; line-height: 1.7; }
.conversation { margin-top: 32px; }
.conversation h3 { margin-bottom: 8px; font-size: 1.15rem; }
.conversation-log { margin: 0; padding: 0; list-style: none; }
.message { padding: 18px 0; border-bottom: 1px solid var(--border); }
.message p { margin: 7px 0 0; font-size: 1rem; line-height: 1.75; }
.message-name { color: var(--accent); font-size: .8125rem; font-weight: 700; }
.message-ulya .message-name { display: inline-flex; align-items: center; gap: 9px; }
.message-ulya .message-name::before { display: block; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 50%; background: url('./assets/ulya-moon-pearl-v1.webp') center / 29px no-repeat; content: ""; }
:root[data-theme="dark"] .message-ulya .message-name::before { background-image: url('./assets/ulya-moon-night-v1.webp'); }
.message-you { margin-top: 18px; padding: 14px 16px; border-bottom: 0; border-radius: 8px; background: var(--accent-soft); }
.message-you p { font-size: .95rem; }
.conversation-prompt { margin: 24px 0 16px; color: var(--text-primary); font-size: 1.05rem; font-weight: 600; line-height: 1.6; }
.conversation-choices { display: grid; gap: 12px; }
.conversation-choice { width: 100%; min-height: 56px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-primary); cursor: pointer; text-align: left; font-size: 1rem; line-height: 1.5; }
.conversation-choice:hover { background: var(--accent-soft); border-color: var(--accent); }
.memory-draft { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.memory-draft h3 { font-size: 1.15rem; }
.memory-consent { display: flex; align-items: flex-start; gap: 12px; margin: 22px 0; cursor: pointer; font-size: .95rem; line-height: 1.6; }
.memory-consent input { width: 24px; height: 24px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--accent); }
.memory-consent input:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.primary-button:disabled { opacity: .5; box-shadow: none; cursor: default; }
.result > .quiet-text { font-size: .875rem; color: var(--text-secondary); }
@media (max-width: 480px) {
  .cards-block .tarot-card:last-child { grid-column: 1 / -1; min-height: 220px; width: calc(50% - 5px); justify-self: center; }
  .topbar-actions { gap: 8px; }
  .topbar .demo-badge { font-size: .56rem; letter-spacing: .08em; }
  .result { margin-left: 0; padding: 22px 16px; }
  .scenario-description { margin-left: 30px; }
}
:root[data-ritual="true"] .cards-block { animation: ritual-arrive 380ms var(--ease-ritual) both; }
@keyframes ritual-arrive { from { opacity: .65; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

:root[data-theme="light"] h1,
:root[data-theme="light"] .ritual-heading h2,
:root[data-theme="light"] .result h2,
:root[data-theme="light"] .cards-heading h2 { font-family: var(--font-ui); font-weight: 550; letter-spacing: -.035em; }
:root[data-theme="light"] h1 { max-width: 12ch; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.12; }
:root[data-theme="light"] h1 em { color: var(--accent); font-style: normal; }
:root[data-theme="light"] .ritual-heading h2 { font-size: clamp(1.75rem, 5vw, 2.55rem); }
:root[data-theme="light"] .result h2 { font-size: clamp(1.6rem, 5vw, 2.1rem); }
:root[data-theme="light"] .tarot-card strong { font-family: var(--font-ui); font-size: .95rem; font-weight: 600; }
:root[data-theme="light"] .tarot-card.is-open .card-position { color: var(--accent); }
:root[data-theme="light"] .reflection-prompt p { font-family: var(--font-ui); }
:root[data-theme="light"] .field-spark { background: var(--accent); box-shadow: none; }
:root[data-theme="light"] .celestial-field { opacity: .3; }

@media (min-width: 680px) {
  .hero { grid-template-columns: minmax(0, 1fr) 250px; min-height: 310px; }
  .moon-mark { width: 250px; }
  .topic-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .topic-surface { grid-template-columns: 1fr 18px; min-height: 142px; align-content: space-between; padding: 18px 14px; gap: 12px; }
  .topic-copy { grid-column: 1 / -1; grid-row: 2; }
  .topic-chevron { grid-row: 1; grid-column: 2; }
  .question-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .question-option { grid-template-columns: 1fr 20px; min-height: 118px; align-content: space-between; }
  .question-index { grid-column: 1 / -1; }
  .question-label { align-self: end; }
  .question-arrow { align-self: end; }
  .deck { gap: 14px; }
  .tarot-card { min-height: 300px; }
  .card-back { max-width: 148px; }
  .result { padding: 28px 28px 24px; }
}

@media (max-width: 480px) {
  .hero { grid-template-columns: minmax(0, 1fr) 142px; gap: 10px; min-height: 0; padding: 22px 0; }
  .hero h1 { margin-bottom: 14px; font-size: 2.25rem; }
  :root[data-theme="light"] .hero h1 { font-size: 2rem; }
  .hero-lead { font-size: .8125rem; line-height: 1.55; }
  .moon-mark { width: 142px; }
  .appearance-panel { margin-bottom: 12px; }
  .ritual { padding-top: 8px; }
  .ritual-heading { margin-bottom: 10px; }
  .topic-step { padding: 0 0 24px; }
  .topic-list { margin-top: 14px; gap: 8px; }
  .topic-surface { min-height: 62px; padding: 10px 14px; gap: 10px; }
  .topic-copy strong { font-size: 1rem; }
  .topic-copy small { font-size: .8125rem; margin-top: 3px; }
  :root[data-theme="dark"] .topic-copy strong { font-size: 1.125rem; }
  .demo-notice { gap: 8px; margin-bottom: 16px; font-size: .8125rem; }
  .deck { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 390px) {
  .hero { grid-template-columns: minmax(0, 1fr) 130px; }
  .moon-mark { width: 130px; }
  .question-list, .tone-list, .deck, .reset-button, .footer-note, .reading-entry { margin-left: 30px; }
  .reset-button { width: calc(100% - 30px); }
  .step-number { font-size: .6rem; }
  .tarot-card { min-height: 240px; }
  .card-back { max-width: 118px; }
}

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