:root {
  color-scheme: light;
  --night: #4b2735;
  --night-deep: #321923;
  --ink: #402d2b;
  --ink-soft: #735d55;
  --cream: #fbf1e2;
  --paper: #fffaf1;
  --gold: #bd813a;
  --gold-text: #87551d;
  --gold-soft: #f0c985;
  --gold-pale: #f7e1be;
  --line: rgba(91, 54, 45, .16);
  --green: #68785d;
  --rose: #8b3b4a;
  --rose-deep: #652c38;
  --shadow: 0 22px 55px rgba(75, 39, 53, .14);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; scroll-behavior: smooth; background: #ead9c2; }
body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 6%, rgba(166, 78, 77, .16), transparent 25rem),
    linear-gradient(140deg, #ead7c1, #fcf3e5 50%, #e7d1b8);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}
body.modal-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #fffaf1;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #713140;
}
[hidden] { display: none !important; }

.site-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 0 90px rgba(39, 42, 35, .18);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(62px + env(safe-area-inset-top));
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  color: #fdf8ee;
  background: rgba(75, 39, 53, .96);
  border-bottom: 1px solid rgba(241, 211, 154, .24);
  backdrop-filter: blur(16px);
}
.brand, .nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  border: 0;
  color: inherit;
  background: transparent;
}
.top-actions { display: flex; align-items: center; gap: 7px; }
.brand { padding: 4px 0; font: 600 14px/1 Georgia, "Songti SC", serif; letter-spacing: .12em; text-transform: uppercase; }
.brand-moon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(241, 211, 154, .55);
  border-radius: 50%;
  color: var(--gold-soft);
  font-size: 21px;
}
.nav-pill { min-height: 44px; padding: 0 11px; border: 1px solid rgba(255,255,255,.17); border-radius: 99px; color: #eee6d8; font-size: 13px; }
.protocol-warning {
  padding: 10px 18px;
  color: #5e361c;
  background: #f6d8a8;
  border-bottom: 1px solid rgba(135, 85, 29, .22);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 14px 0 4px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}
.consent-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--rose); }
.history-sheet { max-height: min(92svh, 760px); overflow-y: auto; }
.history-list { display: grid; gap: 10px; margin: 20px 0; }
.history-empty { padding: 24px 18px; color: var(--ink-soft); text-align: center; background: rgba(255,255,255,.48); border: 1px dashed var(--line); border-radius: 16px; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 15px; background: rgba(255,255,255,.58); border: 1px solid var(--line); border-radius: 16px; }
.history-open { min-width: 0; padding: 0; color: var(--ink); background: transparent; border: 0; text-align: left; }
.history-open strong, .history-open small { display: block; }
.history-open small { margin-top: 4px; color: var(--ink-soft); }
.history-delete { align-self: center; padding: 8px; color: var(--rose-deep); background: transparent; border: 0; }
.history-detail { margin: 18px 0; }
.history-detail h3 { margin: 18px 0 8px; }
.history-detail p { color: var(--ink-soft); }
.history-actions { display: grid; gap: 10px; margin-top: 18px; }
.account-tools { margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--line); }
.history-safari-notice { margin: 14px 0; padding: 16px; border: 1px solid rgba(189,129,58,.28); border-radius: 16px; background: #fff3df; }
.history-safari-notice > p { margin: 7px 0 12px; color: var(--ink-soft); font-size: 13px; }
.history-safari-notice .button { min-height: 48px; }
.account-tools > h3 { font-size: 19px; }
.account-tools > p { margin: 6px 0 13px; color: var(--ink-soft); font-size: 13px; }
.account-tools > .current-button { margin-top: 0; }
.danger-link { display: block; min-height: 44px; margin: 5px auto 0; padding: 8px 14px; color: #8d343e; border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.delete-account-confirm { margin-top: 12px; padding: 16px; color: var(--ink); border: 1px solid rgba(139,59,74,.28); border-radius: 16px; background: #fae8df; }
.delete-account-confirm h3 { font-size: 18px; }
.delete-account-confirm > p { margin: 7px 0 13px; color: var(--ink-soft); font-size: 13px; }
.delete-account-confirm > label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.delete-account-confirm > input { width: 100%; min-height: 48px; margin-bottom: 12px; padding: 0 13px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); font: inherit; }
.delete-account-confirm > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.delete-account-confirm .button { min-height: 48px; padding-inline: 9px; font-size: 13px; }
.danger-button { color: #fffaf2; border: 1px solid #7b2e39; background: #7b2e39; }

.screen {
  min-height: calc(100svh - 62px);
  padding: 28px 20px calc(42px + env(safe-area-inset-bottom));
}
.screen.active { animation: enter .34s cubic-bezier(.2,.7,.2,1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(9px); } }
.eyebrow, .micro-label {
  display: block;
  margin: 0 0 8px;
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; font-family: Georgia, "Songti SC", "STSong", serif; font-weight: 500; }
h1 { max-width: 10.8em; margin-inline: auto; font-size: clamp(36px, 10.3vw, 48px); line-height: 1.13; letter-spacing: -.055em; }
.hook-line { display: block; white-space: nowrap; }
h2 { font-size: clamp(30px, 8.4vw, 39px); line-height: 1.18; letter-spacing: -.04em; }
h3 { font-size: 22px; line-height: 1.32; }
.section-copy, .hero-copy, .sheet-intro { color: var(--ink-soft); }

.home-screen {
  position: relative;
  text-align: center;
  background:
    radial-gradient(circle at 92% 4%, rgba(180, 104, 86, .13), transparent 15rem),
    radial-gradient(circle at 2% 30%, rgba(197, 144, 74, .12), transparent 13rem),
    var(--cream);
}
.home-screen::before {
  content: "";
  position: absolute;
  top: 26px;
  right: -70px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(189, 129, 58, .13);
  border-radius: 50%;
  pointer-events: none;
}
.site-footer { padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); color: #806d65; border-top: 1px solid var(--line); background: var(--paper); text-align: center; }
.site-footer button { min-height: 44px; padding: 7px 6px; color: var(--ink-soft); border: 0; background: transparent; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.site-footer > span { color: var(--line); }
.site-footer small { display: block; margin-top: 2px; font-size: 10px; }
.home-screen .eyebrow { color: var(--rose); }
.hero-copy { max-width: 34em; margin: 16px auto 22px; font-size: 16px; }
.hero-visual {
  position: relative;
  width: 195px;
  height: 126px;
  margin: -2px auto 14px;
}
.hero-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: 70px;
  height: auto;
  aspect-ratio: 15 / 23;
  object-fit: contain;
  border: 1px solid rgba(189,129,58,.55);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(81,47,45,.18);
  transform-origin: 50% 95%;
}
.hero-card-left { transform: translateX(-86%) rotate(-13deg); }
.hero-card-center { z-index: 2; transform: translateX(-50%); }
.hero-card-right { transform: translateX(-14%) rotate(13deg); }
.hero-seal {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 45px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff8eb;
  border: 1px solid rgba(255,255,255,.66);
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 6px 16px rgba(75,39,53,.24);
  transform: translateX(-50%);
  font: 600 16px/1 Georgia, serif;
}
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 26px 0 16px; text-align: left; }
.topic-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 111px;
  padding: 0;
  overflow: hidden;
  flex-direction: column;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,253,247,.96);
  box-shadow: 0 9px 24px rgba(75,39,53,.07);
  text-align: center;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.topic-card:active { transform: scale(.985); }
.topic-card.selected { border-color: var(--rose); background: linear-gradient(145deg, #fffaf2, #f5dfd2); box-shadow: inset 0 0 0 1px rgba(139,59,74,.17), 0 14px 30px rgba(75,39,53,.13); }
.topic-art { display: block; width: 100%; height: auto; aspect-ratio: 12 / 5; object-fit: contain; object-position: center; border-bottom: 1px solid rgba(189,129,58,.14); background: #f8e7ca; filter: saturate(.88) contrast(.98); transition: filter .18s ease; }
.topic-card.selected .topic-art { filter: saturate(1.08) contrast(1.02); }
.topic-copy { position: relative; z-index: 1; display: grid; min-height: 68px; padding: 10px 8px 12px; place-content: center; background: linear-gradient(180deg, rgba(255,250,241,.95), #fffaf7); }
.topic-card strong { display: block; font: 600 17px/1.2 Georgia, "Songti SC", serif; }
.topic-card small { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.topic-check { position: absolute; z-index: 3; top: 8px; right: 8px; display: grid; width: 24px; height: 24px; place-items: center; color: transparent; border: 1px solid rgba(255,250,241,.76); border-radius: 50%; background: rgba(255,250,241,.78); box-shadow: 0 4px 12px rgba(75,39,53,.13); font-size: 12px; font-weight: 800; }
.topic-card.selected .topic-check { color: #fffaf2; border-color: var(--rose); background: var(--rose); }

.button { width: 100%; min-height: 54px; border-radius: 999px; font-weight: 750; }
.primary-button { color: #fffaf2; border: 1px solid #9b4754; background: linear-gradient(135deg, #9b4856, var(--rose-deep)); box-shadow: 0 14px 26px rgba(101,44,56,.22); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.guide-button { color: #fffaf0; border: 1px solid var(--rose-deep); background: linear-gradient(135deg, #91404d, var(--rose-deep)); box-shadow: 0 12px 24px rgba(101,44,56,.16); }
.current-button { color: var(--ink); border: 1px solid rgba(91,54,45,.35); background: transparent; }
.text-button, .quiet-link, .back-button { border: 0; color: var(--ink-soft); background: transparent; }
.text-button { display: block; min-height: 44px; margin: 4px auto 0; padding: 8px 18px; text-decoration: underline; text-underline-offset: 3px; }
.back-button { min-height: 42px; margin: -6px 0 12px -10px; padding: 5px 10px; }
.trust-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin: 12px 0 0; color: #6c7972; font-size: 11px; }
.trust-line i { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); }
.return-preview { display: flex; gap: 13px; margin-top: 26px; padding: 15px; text-align: left; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,247,.7); }
.return-preview strong, .return-preview small { display: block; }
.return-preview small { color: var(--ink-soft); font-size: 12px; }
.return-mark { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; color: var(--gold-text); border: 1px solid rgba(200,137,53,.35); border-radius: 50%; }

.library-screen, .card-detail-screen {
  background:
    radial-gradient(circle at 92% 4%, rgba(180,104,86,.11), transparent 16rem),
    var(--cream);
}
.library-screen h2 { max-width: 9em; }
.library-screen .section-copy { margin: 10px 0 20px; }
.library-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: 0 9px 24px rgba(75,39,53,.06);
}
.library-search > span { color: var(--gold-text); font-size: 21px; }
.library-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.library-search:focus-within { outline: 2px solid #fffaf1; outline-offset: 2px; box-shadow: 0 0 0 5px #713140; }
.library-filters {
  position: sticky;
  top: calc(62px + env(safe-area-inset-top));
  z-index: 10;
  display: flex;
  gap: 8px;
  margin: 16px -20px 0;
  padding: 7px 20px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border-block: 1px solid var(--line);
  background: rgba(251,241,226,.95);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}
.library-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 15px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--paper);
  font-size: 13px;
}
.filter-chip.selected { color: #fffaf2; border-color: var(--rose-deep); background: var(--rose-deep); }
.library-meta { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; }
.library-meta p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.library-clear { min-height: 44px; padding: 0 4px; border: 0; color: var(--rose-deep); background: transparent; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.library-card {
  position: relative;
  min-width: 0;
  padding: 0 0 4px;
  color: var(--ink);
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: center;
}
.library-card:active { transform: scale(.985); }
.tarot-card-artwork {
  position: relative;
  width: 100%;
  aspect-ratio: 15 / 23;
  container-type: inline-size;
}
.tarot-card-artwork > img, .tarot-card-artwork > .code-card-face {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 15 / 23;
  object-fit: contain;
}
.art-card-number, .art-card-title {
  position: absolute;
  z-index: 2;
  left: 50%;
  color: var(--ink);
  font-family: Georgia, "Songti SC", serif;
  line-height: 1;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.art-card-number { top: 6.2%; font-size: clamp(9px, 4.5cqw, 18px); font-weight: 700; }
.art-card-title { top: 92%; width: 72%; overflow: hidden; font-size: clamp(12px, 7cqw, 27px); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.library-card > .tarot-card-artwork {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(75,39,53,.12);
}
.library-card > span { display: block; margin-top: 7px; }
.library-card small { display: block; color: var(--ink-soft); font-size: 11px; }
.library-card > i {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--rose);
  border: 1px solid rgba(189,129,58,.66);
  border-radius: 50%;
  background: rgba(255,250,241,.92);
  font-style: normal;
  box-shadow: 0 5px 14px rgba(75,39,53,.12);
}
.library-empty { margin: 12px 0; padding: 24px 18px; color: var(--ink-soft); text-align: center; border: 1px dashed var(--line); border-radius: 18px; background: rgba(255,255,255,.5); }

.card-detail-screen { padding-top: 18px; text-align: center; }
.card-detail-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-detail-nav .back-button { margin: 0; }
.favorite-compact { min-height: 44px; padding: 0 14px; color: var(--rose-deep); border: 1px solid rgba(139,59,74,.28); border-radius: 99px; background: var(--paper); font-weight: 750; }
.favorite-compact[aria-pressed="true"] { color: #fffaf2; border-color: var(--rose); background: var(--rose); }
.card-detail-art {
  position: relative;
  display: grid;
  width: clamp(220px, 75vw, 310px);
  margin: 8px auto 22px;
  place-items: center;
  aspect-ratio: 15 / 23;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(240,201,133,.3), rgba(255,250,241,.25) 64%, transparent 65%);
}
.card-detail-art > .detail-artwork { width: 100%; }
.detail-card-image, .detail-artwork > .code-card-face { width: 100%; height: auto; aspect-ratio: 15 / 23; object-fit: contain; border: 0; border-radius: 14px; box-shadow: 0 18px 42px rgba(75,39,53,.18); }
.detail-artwork .art-card-number { font-size: clamp(13px, 4.4cqw, 19px); }
.detail-artwork .art-card-title { font-size: clamp(21px, 7cqw, 28px); }
.detail-card-full { animation: detail-focus .16s ease both; }
@keyframes detail-focus { from { opacity: .35; } }
.card-art-status { position: absolute; top: 100%; right: 0; left: 0; margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; }
.card-detail-screen > .eyebrow { margin-bottom: 5px; }
.card-detail-screen h2 { font-size: clamp(34px, 9vw, 42px); }
.keyword-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 15px 0; }
.keyword-list span { padding: 6px 11px; color: var(--gold-text); border: 1px solid rgba(189,129,58,.28); border-radius: 99px; background: var(--gold-pale); font-size: 12px; font-weight: 750; }
.card-detail-summary { margin: 0 auto; color: var(--ink-soft); text-align: left; }
.reflection-card { display: flex; gap: 13px; margin: 19px 0; padding: 17px; text-align: left; border: 1px solid rgba(189,129,58,.22); border-radius: 18px; background: linear-gradient(135deg, #f8e5c7, #f2d7c8); }
.reflection-card > span { color: var(--gold-text); font-size: 23px; }
.reflection-card small, .reflection-card strong { display: block; }
.reflection-card small { color: var(--ink-soft); }
.reflection-card strong { margin-top: 2px; font: 600 17px/1.45 Georgia, "Songti SC", serif; }
.card-detail-screen > .primary-button { margin-top: 2px; }

.draw-screen {
  text-align: center;
  color: #fffaf0;
  background:
    radial-gradient(circle at 50% 16%, rgba(240,201,133,.12), transparent 17rem),
    linear-gradient(180deg, #552d3b, var(--night-deep));
}
.draw-screen .back-button, .draw-screen .section-copy { color: #eaded4; }
.draw-screen .back-button { display: block; }
.draw-screen h2 { max-width: 10em; margin-inline: auto; }
.draw-screen .section-copy { margin: 10px auto 0; }
.selection-count { width: fit-content; margin: 17px auto; padding: 6px 13px; color: var(--gold-soft); border: 1px solid rgba(241,211,154,.28); border-radius: 99px; font-size: 13px; }
.card-fan { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; min-height: 308px; margin: 0 -4px 21px; align-content: center; }
.draw-card {
  position: relative;
  aspect-ratio: 15 / 23;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 8px;
  background: transparent;
  transition: transform .2s ease;
}
.draw-card img { width: 100%; height: 100%; object-fit: contain; border: 1px solid rgba(241,211,154,.55); border-radius: 8px; box-shadow: 0 12px 20px rgba(0,0,0,.24); }
.draw-card:hover { transform: translateY(-4px); }
.draw-card.selected { transform: translateY(-11px); }
.draw-card.selected img { border: 2px solid var(--gold-soft); box-shadow: 0 0 0 3px rgba(200,137,53,.22), 0 16px 26px rgba(0,0,0,.28); }
.choice-index { position: absolute; right: -4px; top: -7px; display: none; width: 24px; height: 24px; place-items: center; color: var(--night-deep); border-radius: 50%; background: var(--gold-soft); font-size: 12px; font-weight: 800; }
.draw-card.selected .choice-index { display: grid; }
.draw-screen .primary-button { margin-top: 3px; }
.draw-screen .text-button { color: #eaded4; }

.result-screen { padding-top: 18px; }
.reading-date { margin: 7px 0 18px; color: var(--ink-soft); font-size: 13px; }
.arrival-banner { display: flex; gap: 11px; margin: -4px 0 15px; padding: 10px 12px; border: 1px solid rgba(64,122,99,.3); border-radius: 14px; background: rgba(64,122,99,.08); }
.arrival-banner > span { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; color: #fff; border-radius: 50%; background: var(--green); }
.arrival-banner p, .arrival-banner small { display: block; margin: 0; }
.arrival-banner small { color: var(--ink-soft); font-size: 11px; }
.revealed-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 18px 0 22px; }
.revealed-card { min-width: 0; text-align: center; }
.revealed-card .tarot-card-artwork > img, .revealed-card .code-card-face { display: block; width: 100%; height: auto; aspect-ratio: 15 / 23; object-fit: contain; border: 1px solid var(--gold); border-radius: 9px; box-shadow: 0 13px 22px rgba(75,39,53,.14); }
.code-card-face {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  color: #f8e7c5;
  background:
    radial-gradient(circle at 50% 38%, rgba(241,211,154,.22), transparent 24%),
    linear-gradient(155deg, #6e2f42, #321d2a 72%);
  container-type: inline-size;
}
.code-card-face::before, .code-card-face::after { content: ""; position: absolute; pointer-events: none; border: 1px solid rgba(241,211,154,.42); }
.code-card-face::before { inset: 6px; border-radius: 6px; }
.code-card-face::after { width: 58%; aspect-ratio: 1; border-radius: 50%; transform: rotate(45deg); }
.code-card-face[data-suit="wands"] { background: radial-gradient(circle at 50% 38%, rgba(237,176,83,.28), transparent 25%), linear-gradient(155deg, #874126, #3b2024 74%); }
.code-card-face[data-suit="cups"] { background: radial-gradient(circle at 50% 38%, rgba(225,181,190,.25), transparent 25%), linear-gradient(155deg, #733a59, #2f2039 74%); }
.code-card-face[data-suit="swords"] { background: radial-gradient(circle at 50% 38%, rgba(207,218,216,.22), transparent 25%), linear-gradient(155deg, #4f5962, #292531 74%); }
.code-card-face[data-suit="pentacles"] { background: radial-gradient(circle at 50% 38%, rgba(227,195,119,.27), transparent 25%), linear-gradient(155deg, #5e5a35, #30291f 74%); }
.code-card-number { position: absolute; top: 9px; left: 10px; font: 700 clamp(9px, 12cqw, 13px)/1 Georgia, serif; letter-spacing: .04em; }
.code-card-orbit { position: relative; z-index: 1; display: grid; width: 48%; aspect-ratio: 1; place-items: center; border: 1px solid rgba(241,211,154,.56); border-radius: 50%; font-size: clamp(22px, 34cqw, 42px); text-shadow: 0 4px 12px rgba(0,0,0,.3); }
.code-card-title { position: absolute; right: 6px; bottom: 9px; left: 6px; z-index: 1; overflow: hidden; font: 600 clamp(9px, 11cqw, 12px)/1.2 Georgia, "Songti SC", serif; letter-spacing: .04em; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.revealed-card small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 10px; }
.revealed-card strong { display: block; overflow: hidden; font: 600 13px/1.25 Georgia, "Songti SC", serif; white-space: nowrap; text-overflow: ellipsis; }
.summary-card { padding: 20px; border: 1px solid rgba(189,129,58,.28); border-radius: var(--radius); background: var(--paper); box-shadow: 0 13px 35px rgba(75,39,53,.08); }
.summary-kicker { color: var(--gold-text); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.summary-card h3 { margin-top: 6px; }
.summary-card p { margin: 10px 0 0; color: var(--ink-soft); }

.browser-save-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 13px;
  margin: 18px 0 28px;
  padding: 20px;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(189,129,58,.48);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0, rgba(155,72,86,.13), transparent 12rem),
    linear-gradient(145deg, #fff8eb, #f4debd);
  box-shadow: 0 18px 42px rgba(93,53,47,.13);
}
.browser-save-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -38px;
  width: 105px;
  height: 105px;
  border: 1px solid rgba(139,59,74,.15);
  border-radius: 50%;
}
.save-icon { position: relative; width: 44px; height: 44px; }
.save-icon i { position: absolute; top: 9px; width: 18px; height: 28px; border: 1px solid rgba(255,248,236,.82); border-radius: 3px; background: var(--rose); box-shadow: 0 5px 10px rgba(75,39,53,.15); }
.save-icon i:nth-child(1) { left: 2px; transform: rotate(-10deg); }
.save-icon i:nth-child(2) { z-index: 2; left: 13px; top: 6px; }
.save-icon i:nth-child(3) { right: 1px; transform: rotate(10deg); }
.save-content { position: relative; z-index: 1; }
.save-content .micro-label { margin-bottom: 5px; color: var(--rose); }
.save-content h3 { font-size: 22px; }
.save-content p { margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; }
.browser-save-card .button, .browser-save-card .button-helper, .save-benefits { position: relative; z-index: 1; grid-column: 1 / -1; }
.save-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 16px; }
.save-benefits span { padding: 7px 4px; color: var(--rose-deep); border: 1px solid rgba(139,59,74,.16); border-radius: 99px; background: rgba(255,250,241,.7); font-size: 11px; font-weight: 750; text-align: center; }
.browser-save-card .guide-button { margin-top: 12px; }
.browser-save-card .current-button { margin-top: 9px; color: var(--ink); border-color: rgba(91,54,45,.35); background: rgba(255,250,241,.45); }
.button-helper { margin-top: 5px; color: var(--ink-soft); text-align: center; }
.safari-required-card {
  position: relative;
  margin: 22px 0 28px;
  padding: 24px 20px 20px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(139,59,74,.32);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0, rgba(189,129,58,.17), transparent 10rem),
    var(--paper);
  box-shadow: 0 16px 38px rgba(75,39,53,.1);
}
.safari-required-card::before {
  content: "";
  position: absolute;
  inset: 11px;
  pointer-events: none;
  border: 1px solid rgba(189,129,58,.13);
  border-radius: 16px;
}
.safari-required-card > * { position: relative; z-index: 1; }
.gate-lock {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 11px;
  place-items: center;
  color: #fff8eb;
  border: 1px solid rgba(255,255,255,.56);
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 9px 20px rgba(75,39,53,.17);
  font: 700 24px/1 Georgia, serif;
}
.safari-required-card .micro-label { margin-bottom: 5px; }
.safari-required-card h3 { font-size: 24px; }
.safari-required-card > p:not(.micro-label) { margin: 9px auto 0; color: var(--ink-soft); }
.safari-required-card .button { margin-top: 17px; }
.safari-required-card > small { display: block; margin: 8px 4px 0; color: #806d65; font-size: 11px; line-height: 1.45; }
body.safari-gated #fullReading { display: none; }
.section-heading { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; color: var(--gold-text); font-size: 12px; font-weight: 800; letter-spacing: .13em; }
.section-heading i { flex: 1; height: 1px; background: rgba(200,137,53,.28); }
.reading-section { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.reading-number { display: grid; width: 32px; height: 32px; place-items: center; color: var(--gold-text); border: 1px solid rgba(200,137,53,.4); border-radius: 50%; font: 600 14px/1 Georgia, serif; }
.reading-section h3 { font-size: 19px; }
.reading-section p { margin: 7px 0 0; color: var(--ink-soft); }
.next-step-card { display: flex; gap: 13px; margin-top: 20px; padding: 17px; border: 1px solid rgba(189,129,58,.18); border-radius: 17px; background: linear-gradient(135deg, #f8e5c7, #f2d7c8); }
.next-step-card > span { color: var(--gold-text); font-size: 22px; }
.next-step-card small, .next-step-card strong { display: block; }
.next-step-card small { color: var(--ink-soft); }
.account-card { margin-top: 30px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 16px 38px rgba(75,39,53,.09); text-align: center; }
.account-glyph { display: grid; width: 46px; height: 46px; margin: 0 auto 10px; place-items: center; color: var(--gold-text); border: 1px solid rgba(200,137,53,.38); border-radius: 50%; font-size: 24px; }
.account-card p:not(.micro-label) { color: var(--ink-soft); }
.account-card .primary-button { margin-top: 7px; }
.safari-retention-card { margin-top: 18px; padding: 21px; border: 1px solid rgba(189,129,58,.24); border-radius: var(--radius); background: linear-gradient(145deg, #f8e5c7, #fff7eb); text-align: center; }
.retention-moon { display: grid; width: 42px; height: 42px; margin: 0 auto 9px; place-items: center; color: var(--gold-text); border: 1px solid rgba(189,129,58,.42); border-radius: 50%; font-size: 23px; }
.safari-retention-card > p:not(.micro-label) { margin: 8px 0 15px; color: var(--ink-soft); }
.safari-retention-card .current-button { margin-top: 0; background: rgba(255,250,241,.72); }
.retention-help { margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(189,129,58,.24); text-align: left; }
.retention-help ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.retention-help li { display: grid; grid-template-columns: 27px 1fr; gap: 9px; align-items: start; }
.retention-help li b { display: grid; width: 25px; height: 25px; place-items: center; color: var(--gold-text); border: 1px solid rgba(189,129,58,.42); border-radius: 50%; font-size: 11px; }
.retention-help small { display: block; margin-top: 12px; color: #806d65; font-size: 11px; }
.quiet-link { display: block; min-height: 44px; margin: 22px auto 0; padding: 8px 10px; text-decoration: underline; text-underline-offset: 3px; }
.disclaimer { margin: 16px 8px 0; color: #806d65; font-size: 11px; text-align: center; }

.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: end; justify-content: center; padding-top: env(safe-area-inset-top); }
.overlay-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(50,25,35,.58); backdrop-filter: blur(4px); }
.sheet { position: relative; z-index: 1; width: min(100%, 460px); max-height: 88vh; max-height: 88svh; overflow: auto; padding: 27px 20px calc(23px + env(safe-area-inset-bottom)); border: 1px solid rgba(200,137,53,.26); border-radius: 26px 26px 0 0; background: var(--paper); box-shadow: 0 -22px 70px rgba(0,0,0,.2); animation: sheet-up .26s ease both; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .4; } }
.sheet-handle { width: 42px; height: 4px; margin: -14px auto 18px; border-radius: 99px; background: rgba(91,54,45,.2); }
.sheet-close { position: absolute; top: 14px; right: 14px; display: grid; width: 42px; height: 42px; place-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-size: 26px; }
.sheet h2 { padding-right: 48px; }
.guide-sheet h2 { padding-right: 0; font-size: 32px; }
.sheet-intro { margin: 10px 0 18px; }
.guide-sheet { display: flex; flex-direction: column; overflow: hidden; }
.sheet-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.guide-actions { flex: 0 0 auto; padding-top: 12px; border-top: 1px solid var(--line); background: var(--paper); }
.safari-gate-sheet { display: flex; max-height: 92svh; flex-direction: column; overflow: hidden; }
.gate-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.gate-lock-large { width: 54px; height: 54px; margin: 1px 0 13px; font-size: 28px; }
.safari-gate-sheet h2 { max-width: 9.5em; padding-right: 42px; }
.safari-gate-sheet .eyebrow { color: var(--rose); }
.gate-actions { flex: 0 0 auto; padding-top: 13px; border-top: 1px solid var(--line); background: var(--paper); }
.gate-preserved { display: flex; gap: 10px; margin: 17px 0 14px; padding: 12px; text-align: left; border: 1px solid rgba(104,120,93,.25); border-radius: 14px; background: rgba(104,120,93,.08); }
.gate-preserved > span { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; color: #fff; border-radius: 50%; background: var(--green); }
.gate-preserved p, .gate-preserved small { display: block; margin: 0; }
.gate-preserved small { color: var(--ink-soft); font-size: 12px; }
.menu-example { overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--cream); }
.menu-example-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.menu-example-head span { color: var(--gold-text); font-size: 20px; font-weight: 900; letter-spacing: .16em; }
.menu-example-head small { font-size: 10px; }
.menu-example-row { display: grid; grid-template-columns: 27px 1fr; gap: 9px; align-items: start; padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 13px; }
.menu-example-row:last-child { border-bottom: 0; }
.menu-example-row b { display: grid; width: 23px; height: 23px; place-items: center; color: var(--gold-text); border: 1px solid rgba(200,137,53,.4); border-radius: 50%; font-size: 11px; }
.prepared-state { display: flex; gap: 10px; margin: 14px 0; padding: 11px; border: 1px solid rgba(64,122,99,.25); border-radius: 14px; background: rgba(64,122,99,.07); }
.prepared-state > span { display: grid; flex: 0 0 27px; width: 27px; height: 27px; place-items: center; color: #fff; border-radius: 50%; background: var(--green); }
.prepared-state p, .prepared-state small { display: block; margin: 0; }
.prepared-state small { color: var(--ink-soft); }
.sheet .current-button { margin-top: 9px; }
.guide-fact, .privacy-note { margin: 10px 5px 0; color: #806d65; font-size: 11px; text-align: center; }
.manual-copy { margin-top: 13px; padding: 13px; border: 1px solid rgba(200,137,53,.26); border-radius: 14px; background: var(--gold-pale); }
.manual-copy p { margin: 0 0 10px; font-size: 13px; }
.manual-copy textarea { width: 100%; padding: 10px; resize: none; color: var(--ink); border: 1px solid rgba(91,54,45,.24); border-radius: 10px; background: #fff; font-size: 12px; }
.prototype-badge { display: inline-block; margin-bottom: 12px; padding: 5px 9px; color: #8d5521; border: 1px solid rgba(200,137,53,.35); border-radius: 99px; background: var(--gold-pale); font-size: 10px; font-weight: 800; }
.register-sheet form { margin-top: 17px; }
.register-sheet label { display: block; margin-bottom: 6px; font-weight: 700; }
.register-sheet input { width: 100%; min-height: 52px; padding: 0 14px; color: var(--ink); border: 1px solid rgba(91,54,45,.28); border-radius: 13px; background: #fff; }
.register-sheet form .primary-button { margin-top: 8px; }
.consent-summary { margin: 7px 0 4px; padding: 9px 11px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.48); font-size: 12px; }
.consent-summary summary { min-height: 32px; padding-top: 5px; color: var(--rose-deep); cursor: pointer; font-weight: 700; }
.consent-summary p { margin: 7px 0 2px; }
.info-sheet { display: flex; max-height: 92svh; flex-direction: column; overflow: hidden; }
.info-tabs { display: flex; gap: 7px; margin: 15px 0 13px; overflow-x: auto; }
.info-tabs button { flex: 0 0 auto; min-height: 40px; padding: 0 13px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 99px; background: var(--cream); font-size: 12px; }
.info-tabs button[aria-selected="true"] { color: #fffaf2; border-color: var(--rose-deep); background: var(--rose-deep); }
.info-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.info-section { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.46); }
.info-section h3 { font-size: 20px; }
.info-section p { color: var(--ink-soft); }
.info-section strong { color: var(--ink); overflow-wrap: anywhere; }
.field-message { min-height: 23px; margin: 5px 3px 0; color: #9b4c43; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 200; width: max-content; max-width: calc(100% - 34px); padding: 11px 15px; color: #fff; border-radius: 99px; background: var(--night-deep); box-shadow: 0 13px 35px rgba(0,0,0,.22); transform: translateX(-50%); font-size: 13px; }

@media (max-width: 350px) {
  .screen { padding-inline: 15px; }
  .topbar { padding-inline: 15px; }
  .brand { font-size: 12px; letter-spacing: .08em; }
  .top-actions { gap: 4px; }
  .nav-pill { padding-inline: 8px; font-size: 12px; }
  .topic-grid { gap: 7px; }
  .topic-art { height: auto; }
  .topic-copy { min-height: 65px; padding-inline: 6px; }
  .topic-card strong { font-size: 15px; }
  .card-fan { gap: 6px; }
  .browser-save-card { padding: 16px; }
  .library-filters { margin-inline: -15px; padding-inline: 15px; }
  .library-grid { gap: 14px 8px; }
  .library-card strong { font-size: 12px; }
  .card-detail-art { width: 220px; min-height: 0; }
}
@media (max-height: 650px) {
  .home-screen { padding-top: 14px; }
  .hero-visual { width: 132px; height: 78px; margin-bottom: 7px; }
  .hero-card { width: 43px; height: auto; }
  .hero-seal { top: 26px; width: 24px; height: 24px; font-size: 13px; }
  .home-screen h1 { font-size: 30px; line-height: 1.12; }
  .hero-copy { margin: 9px auto 12px; font-size: 14px; }
  .topic-grid { gap: 6px; margin: 13px 0 10px; }
  .topic-card { display: grid; min-height: 66px; grid-template-columns: 62px 1fr; grid-template-rows: 66px; }
  .topic-art { width: 62px; height: 66px; object-fit: contain; border-right: 1px solid rgba(189,129,58,.14); border-bottom: 0; }
  .topic-copy { min-height: 66px; padding: 7px 5px; background: rgba(255,250,241,.94); }
  .topic-card strong { font-size: 14px; }
  .topic-card small { display: none; }
  .topic-check { top: 5px; right: 5px; width: 19px; height: 19px; font-size: 10px; }
  .return-preview { margin-top: 16px; }
  .guide-sheet, .safari-gate-sheet { max-height: 96svh; padding-top: 21px; }
  .menu-example-row { padding-block: 8px; }
  .guide-actions .button, .gate-actions .button { min-height: 46px; }
  .safari-gate-sheet h2 { font-size: 29px; }
  .guide-fact { font-size: 10px; line-height: 1.35; }
}
@media (min-width: 700px) {
  body { padding-block: 24px; }
  .site-shell { min-height: calc(100vh - 48px); border-radius: 28px; }
  .topbar { border-radius: 28px 28px 0 0; }
  .sheet { margin-bottom: 20px; border-radius: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
