/* The Map. Built on the Room 8 studio system (app.css + ig.css + ios.css):
   soft grey page, white cards with 22px corners and a soft shadow, the system font, grouped-list labels,
   pill buttons (the one action that matters wears the Sorter's yellow), segmented controls with a grey track
   and a white thumb, filled inputs, switches instead of checkboxes, an iPad-style sidebar, and the sun/moon switch. */

:root {
  --ios-bg: #F5F5F7; --ios-card: #FFFFFF; --ios-ink: #1C1C1E; --ios-ink2: #6E6E73; --ios-ink3: #AEAEB2;
  --ios-line: rgba(60, 60, 67, .12); --ios-fill: rgba(118, 118, 128, .12); --ios-fill2: rgba(118, 118, 128, .2);
  --ios-blue: #0A84FF; --ios-green: #34C759; --ios-red: #FF3B30;
  --ios-go: linear-gradient(180deg, #FFDE3B, #FFC400);
  --ios-go-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 2px rgba(150, 100, 0, .2), 0 6px 16px rgba(255, 180, 0, .28);
  --ios-shadow: 0 1px 1px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .07);
  --hl: #FFD60A;
  --page: var(--ios-bg); --sheet: var(--ios-card); --text: var(--ios-ink); --line: var(--ios-line); --edge: rgba(60, 60, 67, .18);
  --fill: var(--ios-fill); --fill-2: var(--ios-fill); --hover: rgba(118, 118, 128, .1);
  --muted: var(--ios-ink2); --body: #3A3A3C; --accent: var(--ios-blue);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-serif: "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --shadow: var(--ios-shadow); --r: 22px; --side: 244px;
  /* lineage colours (Sorter-style category squircles) */
  --fire: #FF6B3D; --ether: #8E6CF0; --earth: #A2845E; --water: #30B0C7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ios-bg: #0E0E10; --ios-card: #1C1C1E; --ios-ink: #F2F2F7; --ios-ink2: #98989D; --ios-ink3: #636366;
  --ios-line: rgba(255, 255, 255, .1); --ios-fill: rgba(118, 118, 128, .24); --ios-fill2: rgba(118, 118, 128, .36);
  --ios-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 8px 24px rgba(0, 0, 0, .4);
  --edge: rgba(255, 255, 255, .16); --body: #D1D1D6; --hover: rgba(255, 255, 255, .08); color-scheme: dark; } }
:root[data-theme="dark"] {
  --ios-bg: #0E0E10; --ios-card: #1C1C1E; --ios-ink: #F2F2F7; --ios-ink2: #98989D; --ios-ink3: #636366;
  --ios-line: rgba(255, 255, 255, .1); --ios-fill: rgba(118, 118, 128, .24); --ios-fill2: rgba(118, 118, 128, .36);
  --ios-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 8px 24px rgba(0, 0, 0, .4);
  --edge: rgba(255, 255, 255, .16); --body: #D1D1D6; --hover: rgba(255, 255, 255, .08); color-scheme: dark; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--page); color: var(--text); font: 15px/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; letter-spacing: -.003em; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--ios-blue); }
button, select, input, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--text); color: var(--page); padding: 10px 14px; border-radius: 10px; z-index: 40; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }

/* ---------- sidebar: an iPad-style list with a rounded selection ---------- */
.side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side); z-index: 15; display: flex; flex-direction: column; padding: 8px 12px 18px; background: var(--page); }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 26px 12px 20px; font: 600 19px/1.1 var(--font-display); letter-spacing: -.02em; }
.side-logo .mark { width: 30px; height: 30px; flex: none; border-radius: 9px; background: #1C1C1E; display: grid; place-items: center; }
.side-logo .mark svg { width: 20px; height: 20px; }
.tabs { display: flex; flex-direction: column; gap: 4px; }
.tabs [role=tab] { width: 100%; justify-content: flex-start; gap: 14px; padding: 10px 12px; min-height: 44px; border: 0; border-radius: 12px; background: transparent;
  box-shadow: none; font-size: 15px; font-weight: 500; color: var(--text); display: flex; align-items: center; cursor: pointer; text-align: left; }
.tabs [role=tab]:hover { background: var(--hover); }
.tabs [role=tab]:active { transform: none; }
.tabs [role=tab][aria-selected=true] { background: var(--sheet); font-weight: 600; box-shadow: var(--ios-shadow); }
.tabs [role=tab][aria-selected=true] .ico { stroke-width: 2.2; color: var(--ios-blue); }
.tabs .num { font-size: 11px; font-weight: 700; color: var(--muted); width: 18px; text-align: center; flex: none; }
.tabs [role=tab] .tick { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--ios-green); color: #fff; display: none; place-items: center; font-size: 11px; font-weight: 800; }
.tabs [role=tab].done .tick { display: grid; }
.tab-sep { height: 1px; background: var(--line); margin: 8px 12px; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.tabs [role=tab]:hover .ico { transform: scale(1.06); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 0; }
.side-k { font-size: 12px; font-weight: 600; color: var(--muted); }
.side-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.save-state { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.save-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ios-green); flex: none; transition: background .2s; }
.save-state.saving .save-dot { background: var(--hl); }
.save-state.error .save-dot { background: var(--ios-red); }

/* the sun/moon switch (Room 8) */
.theme-switch { position: relative; width: 68px; height: 36px; min-height: 0; padding: 0 8px; border-radius: 999px; border: 0; box-shadow: none;
  background: var(--ios-fill2); display: inline-flex; align-items: center; justify-content: space-between; cursor: pointer; }
.theme-switch:hover { background: var(--ios-fill2); }
.ts-icon { width: 18px; height: 18px; position: relative; z-index: 1; display: grid; place-items: center; transition: color .2s; }
.ts-icon svg { width: 18px; height: 18px; }
.ts-sun svg { fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ts-moon svg { fill: currentColor; }
.ts-knob { position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 50%; background: var(--sheet); box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .22s cubic-bezier(.3, .7, .4, 1); }
.theme-switch[aria-checked=false] .ts-sun { color: #D98A1E; } .theme-switch[aria-checked=false] .ts-moon { color: var(--muted); }
.theme-switch[aria-checked=true] .ts-knob { transform: translateX(32px); background: #3A3A3C; }
.theme-switch[aria-checked=true] .ts-moon { color: #F1D58A; } .theme-switch[aria-checked=true] .ts-sun { color: var(--muted); }

/* ---------- page ---------- */
.page { margin: 0 0 0 var(--side); padding: 30px 32px 110px; }
main { max-width: 975px; margin: 0 auto; outline: none; }
.profile { display: flex; align-items: center; gap: 26px; padding: 10px 6px 28px; }
.avatar-ring { flex: none; width: 96px; height: 96px; border-radius: 50%; padding: 3px; background: var(--sheet); box-shadow: var(--ios-shadow); }
.avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center 22%; }
.profile-text { min-width: 0; }
.masthead { font: 400 26px/1.15 var(--font-display); letter-spacing: -.025em; }
.masthead b { font-weight: 700; }
.profile .eyebrow { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.status-line { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 14px 0 0; }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; font-size: 13px; }
.steps li { padding: 4px 11px; border-radius: 999px; background: var(--sheet); box-shadow: 0 0 0 1px var(--line); color: var(--muted); cursor: pointer; }
.steps li.done { color: var(--text); }
.steps li.done::before { content: "✓ "; color: var(--ios-green); font-weight: 700; }
.steps li.current { background: var(--text); color: var(--sheet); box-shadow: none; font-weight: 600; }
.next { font-size: 14px; }
.next-label { font-size: 12px; font-weight: 700; background: var(--ios-blue); color: #fff; padding: 3px 9px; border-radius: 999px; margin-right: 6px; }

/* ---------- section heads ---------- */
.sec-head { padding-bottom: 22px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.sec-head .kicker { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.sec-head h2 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 700; letter-spacing: -.03em; margin-bottom: 10px; }
.sec-head p { color: var(--muted); max-width: 680px; font-size: 15px; }
.sec-head.with-action { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.group-title { font-size: 22px; font-weight: 700; margin: 34px 0 14px; display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.group-sub { color: var(--muted); margin: -8px 0 16px; max-width: 680px; }

/* ---------- cards ---------- */
.sheet { background: var(--sheet); border: 0; border-radius: var(--r); padding: 22px 24px; box-shadow: var(--ios-shadow); margin-bottom: 16px; }
.sheet h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.sheet > p + p { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid2 > .sheet, .grid3 > .sheet, .grid4 > .sheet { margin-bottom: 0; }
.fill-box { background: var(--fill); border-radius: 14px; padding: 14px 16px; }
.empty-note { color: var(--muted); border: 1.5px dashed var(--edge); border-radius: 18px; padding: 34px 20px; text-align: center; }
.empty-note .btn { margin-top: 14px; }

/* ---------- grouped-list labels and fields ---------- */
.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 18px 4px 7px; }
.field-label:first-child { margin-top: 0; }
.opt { color: var(--ios-ink3); font-weight: 500; margin-left: 4px; }
input[type=text], input[type=number], input[type=url], input[type=email], select, textarea {
  width: 100%; background: var(--fill); border: 0; border-radius: 12px; min-height: 42px; padding: 10px 14px; font-size: 15px; color: var(--text); }
textarea { resize: vertical; line-height: 1.5; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ios-blue) 35%, transparent); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
::placeholder { color: var(--ios-ink3); opacity: 1; }
input[type=radio], input[type=range] { accent-color: var(--ios-blue); }
.help { color: var(--muted); font-size: 13px; margin-top: 8px; }
.form-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.check { display: inline-flex; gap: 10px; align-items: center; font-size: 15px; min-height: 44px; cursor: pointer; }
/* checkboxes become switches (still real checkboxes) */
input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0;
  border-radius: 999px; background: var(--ios-fill2); cursor: pointer; transition: background .2s ease; }
input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .22s cubic-bezier(.3, .7, .4, 1); }
input[type=checkbox]:checked { background: var(--ios-green); }
input[type=checkbox]:checked::after { transform: translateX(18px); }

/* ---------- buttons: pills; the main action is the Sorter's yellow ---------- */
button, .btn { cursor: pointer; border: 0; border-radius: 999px; background: var(--sheet); color: var(--text); min-height: 38px; padding: 8px 18px; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .05); transition: transform .12s ease, background .15s ease; display: inline-flex; align-items: center;
  justify-content: center; gap: 7px; line-height: 1.2; text-decoration: none; }
button:hover, .btn:hover { background: color-mix(in srgb, var(--sheet) 92%, var(--text)); }
button:active, .btn:active { transform: scale(.97); }
button.primary, .btn.primary { background: var(--ios-go); color: #1C1C1E; box-shadow: var(--ios-go-shadow); }
button.primary:hover, .btn.primary:hover { background: var(--ios-go); filter: brightness(1.03); }
button.ghost, .btn.ghost { background: transparent; box-shadow: none; color: var(--ios-blue); }
button.ghost:hover, .btn.ghost:hover { background: var(--hover); }
button.small, .btn.small { min-height: 32px; padding: 5px 13px; font-size: 13.5px; }
button.big, .btn.big { min-height: 48px; padding: 12px 26px; font-size: 16px; }
button:disabled { opacity: .45; transform: none; cursor: not-allowed; }
.btn svg, button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.link { border: 0; background: none; padding: 0; min-height: 0; box-shadow: none; color: var(--ios-blue); font-weight: 500; font-size: 14px; }
.link:hover { background: none; text-decoration: underline; }
.danger { color: var(--ios-red); }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: var(--sheet); box-shadow: 0 0 0 1px var(--line); font-weight: 600; font-size: 13.5px;
  min-height: 34px; padding: 6px 14px; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--text); color: var(--sheet); box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--fill); color: var(--body); }

/* segmented controls: grey track, white thumb */
.seg { display: inline-flex; flex-wrap: wrap; padding: 2px; border-radius: 10px; background: var(--fill); }
.seg > button { border: 0; border-radius: 8px; background: transparent; box-shadow: none; min-height: 32px; padding: 5px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg > button:hover { background: transparent; color: var(--text); }
.seg > button[aria-pressed=true] { background: var(--sheet); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
:root[data-theme="dark"] .seg > button[aria-pressed=true] { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg > button[aria-pressed=true] { background: #636366; } }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: rgba(28, 28, 30, .92); color: #fff; padding: 11px 20px; border-radius: 16px;
  backdrop-filter: blur(20px); font-size: 14.5px; font-weight: 500; max-width: 92vw; box-shadow: var(--ios-shadow); z-index: 50; }
.toast:empty { display: none; }

/* ================================================================ The Map components */

/* lineage squircles */
.sq { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; flex: none; color: #fff; font-size: 13px; background: var(--k, var(--muted)); }
.sq svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sq.lg { width: 44px; height: 44px; border-radius: 13px; } .sq.lg svg { width: 24px; height: 24px; }
.k-voices { --k: var(--fire); } .k-seers { --k: var(--ether); } .k-guardians { --k: var(--earth); } .k-healers { --k: var(--water); }

/* hero (overview) */
.hero { position: relative; overflow: hidden; padding: 34px 34px 30px; }
.hero h2 { font-size: clamp(32px, 5vw, 52px); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; max-width: 720px; }
.hero h2 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; background: linear-gradient(transparent 62%, var(--hl) 62%, var(--hl) 92%, transparent 92%); padding: 0 4px; }
:root[data-theme="dark"] .hero h2 em { background: none; color: var(--hl); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero h2 em { background: none; color: var(--hl); } }
.hero p.lede { color: var(--muted); font-size: 16.5px; max-width: 620px; margin-top: 16px; }
.hero .form-foot { margin-top: 26px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px 22px; }
.stat { padding: 2px 16px; border-left: 1px solid var(--line); min-width: 0; } .stat:first-child { border-left: 0; padding-left: 0; }
.stat small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.stat b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* journey cards */
.journey { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.jcard { all: unset; box-sizing: border-box; cursor: pointer; background: var(--sheet); border-radius: 18px; padding: 16px; box-shadow: var(--ios-shadow); display: flex; flex-direction: column; gap: 8px; min-height: 150px;
  transition: transform .15s ease, box-shadow .15s ease; }
.jcard:hover { transform: translateY(-2px); box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 14px 30px rgba(0,0,0,.1); }
.jcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.jcard .jn { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.jcard strong { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.jcard span.d { font-size: 13px; color: var(--muted); line-height: 1.35; }
.jcard .state { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.jcard.done .state { color: var(--ios-green); }

/* lineage grid */
.lineages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lcard { background: var(--sheet); border-radius: 18px; padding: 16px; box-shadow: var(--ios-shadow); }
.lcard h4 { font-size: 15px; margin: 10px 0 2px; }
.lcard .el { font-size: 12px; color: var(--muted); font-weight: 600; }
.lcard p { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.lcard ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.lcard li { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.lcard li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--k); }
.lcard.mine { box-shadow: 0 0 0 2px var(--k), var(--ios-shadow); }

/* quiz */
.quiz-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.qbar { flex: 1; height: 8px; border-radius: 4px; background: var(--ios-fill2); overflow: hidden; }
.qbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #FFDE3B, #34C759); transition: width .5s cubic-bezier(.3,.7,.4,1); }
.qcount { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qcard { padding: 28px 30px; }
.qcard .qtheme { font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.qcard h3 { font-size: clamp(21px, 2.6vw, 27px); font-weight: 700; letter-spacing: -.025em; margin: 10px 0 18px; line-height: 1.2; display: block; }
.opts { display: grid; gap: 10px; }
.opt-btn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--fill);
  font-size: 15px; line-height: 1.4; transition: background .15s ease, box-shadow .15s ease, transform .1s ease; }
.opt-btn:hover { background: var(--ios-fill2); }
.opt-btn:active { transform: scale(.99); }
.opt-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt-btn .bullet { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--ios-ink3); margin-top: 1px; display: grid; place-items: center; transition: all .15s; }
.opt-btn[aria-checked=true] { background: var(--sheet); box-shadow: 0 0 0 2px var(--ios-blue), var(--ios-shadow); }
.opt-btn[aria-checked=true] .bullet { box-shadow: none; background: var(--ios-blue); }
.opt-btn[aria-checked=true] .bullet::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.deep { margin-top: 18px; padding: 14px 16px 16px; border-radius: 14px; background: color-mix(in srgb, var(--hl) 14%, var(--sheet)); }
:root[data-theme="dark"] .deep { background: color-mix(in srgb, var(--hl) 8%, var(--sheet)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .deep { background: color-mix(in srgb, var(--hl) 8%, var(--sheet)); } }
.deep .field-label { margin: 0 0 8px; color: var(--text); font-weight: 600; }
.deep textarea { background: var(--sheet); min-height: 74px; }
.qnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }

/* results */
.result-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.arch-card { position: relative; overflow: hidden; padding: 26px; }
.arch-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--k); }
.arch-card .lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.arch-card h3 { font-size: 34px; font-weight: 700; letter-spacing: -.035em; margin: 8px 0 6px; display: block; }
.arch-card .lin { display: flex; gap: 8px; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.arch-card p.ess { font-family: var(--font-serif); font-size: 18px; line-height: 1.45; margin-top: 14px; }
.arch-card.secondary h3 { font-size: 26px; }
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 38px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row b { font-weight: 600; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 4px; background: var(--ios-fill); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 4px; background: var(--k); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.fact { background: var(--fill); border-radius: 14px; padding: 14px 16px; }
.fact small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.fact p { font-size: 14.5px; line-height: 1.45; }
.code-quote { font-family: var(--font-serif); font-style: italic; font-size: 20px; line-height: 1.4; text-align: center; padding: 26px 28px; }

/* rating rows (gap analysis) */
.rate { padding: 16px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.rate:first-of-type { border-top: 0; padding-top: 4px; }
.rate p { font-size: 15px; }
.rate .seg > button { padding: 5px 11px; font-size: 12.5px; }
.tried { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.tried .check { font-size: 14.5px; justify-content: space-between; border-top: 1px solid var(--line); padding: 4px 0; }
.leak { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.leak-out { text-align: center; padding: 18px; border-radius: 16px; background: color-mix(in srgb, var(--ios-red) 9%, var(--sheet)); }
.leak-out b { display: block; font-size: 34px; font-weight: 700; letter-spacing: -.03em; color: var(--ios-red); font-variant-numeric: tabular-nums; }
.leak-out small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.diag { position: relative; padding-left: 28px; }
.diag::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sev, var(--hl)); }
.diag .sev { font-size: 12px; font-weight: 700; color: var(--sev); }
.diag h3 { margin-top: 4px; }
.diag .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }

/* offer */
.offer-card { padding: 0; overflow: hidden; }
.offer-head { padding: 26px 28px 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--k) 16%, var(--sheet)), var(--sheet) 70%); }
.offer-head .lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; }
input.offer-title, input.offer-title:focus { all: unset; box-sizing: border-box; display: block; width: 100%; font: 700 clamp(26px, 3.4vw, 36px)/1.1 var(--font-display); letter-spacing: -.035em; margin-top: 10px; }
input.offer-title:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ios-blue) 35%, transparent); border-radius: 8px; }
.offer-body { padding: 6px 28px 26px; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 22px; }
.price-tag { background: var(--fill); border-radius: 18px; padding: 18px; text-align: center; align-self: start; }
.price-tag b { display: block; font-size: 46px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.price-tag small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.price-tag .seg { margin-top: 12px; }
.inside { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.inside li { display: flex; gap: 10px; font-size: 14.5px; }
.inside li::before { content: "✦"; color: var(--k); flex: none; }
.variant-dots { display: flex; gap: 6px; align-items: center; }
.variant-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ios-fill2); }
.variant-dots i.on { background: var(--text); }

/* ManyChat flow */
.flow { position: relative; display: grid; gap: 0; }
.node { position: relative; background: var(--sheet); border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.04), 0 8px 20px rgba(0,0,0,.06); padding: 16px 18px 18px 22px; }
.node::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--k, var(--ios-blue)); }
.node-h { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.node-h small { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.node-h strong { font-size: 15px; font-weight: 600; }
.node-h .copy { margin-left: auto; }
.node textarea { min-height: 64px; font-size: 14.5px; }
.node .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.node .btns span { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--ios-blue) 12%, var(--sheet)); color: var(--ios-blue); }
.conn { height: 30px; position: relative; }
.conn::before { content: ""; position: absolute; left: 40px; top: 0; bottom: 0; border-left: 2px dashed color-mix(in srgb, var(--text) 25%, transparent); }
.branches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.branch-k { font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 8px 4px; display: flex; gap: 6px; align-items: center; }
.branches .node + .conn + .node { margin-top: 0; }
.k-trigger { --k: #FF375F; } .k-dm { --k: #0A84FF; } .k-q { --k: #BF5AF2; } .k-buy { --k: #34C759; } .k-nurture { --k: #FF9F0A; } .k-human { --k: #AC8E68; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--k); flex: none; }
.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; font-size: 14.5px; }
.steps-list li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--text); color: var(--sheet); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
code, .kbd { font-family: var(--font-mono); font-size: .88em; background: var(--fill); padding: 1px 6px; border-radius: 6px; }

/* audio */
.track { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 22px; align-items: center; }
.track-art { width: 132px; height: 132px; border-radius: 20px; position: relative; overflow: hidden; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 45%), var(--art); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.track-art svg { width: 64px; height: 64px; fill: none; stroke: rgba(255,255,255,.9); stroke-width: 1.4; }
.track h3 { margin-bottom: 4px; }
.track-len { margin-bottom: 8px; }
.track .sub { font-size: 14px; color: var(--muted); }
.player { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.play { width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 50%; flex: none; }
.play svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.scrub { flex: 1; display: grid; gap: 4px; }
.scrub input[type=range] { width: 100%; margin: 0; }
.scrub .times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.track-note { font-size: 13px; color: var(--muted); margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.transcript { margin-top: 14px; max-height: 360px; overflow: auto; white-space: pre-wrap; font-family: var(--font-serif); font-size: 16px; line-height: 1.6; background: var(--fill); border-radius: 14px; padding: 18px 20px; }

/* folds (playbook) */
.fold { padding: 0; }
.fold > summary { list-style: none; cursor: pointer; padding: 18px 24px; display: flex; align-items: center; gap: 14px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 22px; transition: transform .15s; }
.fold[open] > summary::after { transform: rotate(90deg); }
.fold-title { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.fold-hint { color: var(--muted); font-size: 13.5px; display: block; font-weight: 400; margin-top: 2px; }
.fold-body { padding: 0 24px 22px; }
.fold-body p { color: var(--body); margin-top: 10px; }
.fold-body h4 { font-size: 14px; margin: 16px 0 6px; }
.script { font-family: var(--font-serif); font-size: 16px; line-height: 1.55; background: var(--fill); border-radius: 14px; padding: 14px 58px 14px 18px; margin-top: 10px; position: relative; white-space: pre-line; }
.script .copy { position: absolute; top: 10px; right: 10px; }
.fold-body ul, .fold-body ol { padding-left: 20px; margin: 8px 0 0; color: var(--body); }
.fold-body li { margin-top: 5px; }
.pnum { width: 30px; height: 30px; border-radius: 10px; background: var(--text); color: var(--sheet); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }

/* library */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.book { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.book:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 6px 10px 10px 6px; overflow: hidden; background: var(--k); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 10px 22px rgba(0,0,0,.14);
  transition: transform .2s ease, box-shadow .2s ease; }
.book:hover .cover { transform: translateY(-3px) rotate(-.6deg); box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 18px 34px rgba(0,0,0,.2); }
.cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.cover::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: linear-gradient(90deg, rgba(0,0,0,.25), rgba(255,255,255,.12) 60%, transparent); }
.cover .ph { position: absolute; inset: 0; padding: 18px 14px 14px 18px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  background: radial-gradient(circle at 80% 10%, rgba(255,255,255,.28), transparent 50%), linear-gradient(160deg, color-mix(in srgb, var(--k) 85%, #fff), color-mix(in srgb, var(--k) 70%, #000)); }
.cover .ph b { font-family: var(--font-serif); font-size: 17px; line-height: 1.15; font-weight: 600; }
.cover .ph small { font-size: 11px; font-weight: 600; opacity: .85; }
.book strong { font-size: 14px; font-weight: 600; line-height: 1.25; }
.book span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

/* next steps tray: compact cards */
.tray { margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line); }
.tray-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tray-head h3 { font-size: 17px; font-weight: 600; }
.tray-head span { font-size: 13px; color: var(--muted); }
.tray-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tcard { all: unset; box-sizing: border-box; cursor: pointer; background: var(--sheet); border-radius: 16px; overflow: hidden; box-shadow: var(--ios-shadow); display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease; }
.tcard:hover { transform: translateY(-2px); box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 14px 30px rgba(0,0,0,.12); }
.tcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tcard .thumb { aspect-ratio: 16 / 9; background: #111; position: relative; }
.tcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tcard .badge { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(28,28,30,.82); color: #fff; backdrop-filter: blur(8px); }
.tcard .tbody { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tcard .trow { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tcard strong { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.tcard .pr { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tcard p { font-size: 12.5px; color: var(--muted); line-height: 1.38; }
.tcard .go { margin-top: auto; padding-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--ios-blue); }

/* Step 3: offer history + ladder */
.group-title .pnum { width: 28px; height: 28px; font-size: 13px; border-radius: 9px; }
.hist-row { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.hist-row:first-child { padding-top: 0; }
.hist-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, .8fr); gap: 12px; }
.hist-grid .field-label { margin-top: 0; }
.insight { background: color-mix(in srgb, var(--ios-blue) 8%, var(--sheet)); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; font-size: 14.5px; }
.tier { position: relative; }
.tier::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px; border-radius: 0 4px 4px 0; background: var(--k); }
.tier-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.tier-head .kicker { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.tier-head h3 { margin-bottom: 4px; }
.tier-head .muted { font-size: 14.5px; max-width: 560px; }
.range { flex: none; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--fill); white-space: nowrap; }
input.price-in { max-width: 220px; font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.why { margin-top: 18px; padding: 16px 18px 18px; border-radius: 16px; background: color-mix(in srgb, var(--hl) 13%, var(--sheet)); }
:root[data-theme="dark"] .why { background: color-mix(in srgb, var(--hl) 7%, var(--sheet)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .why { background: color-mix(in srgb, var(--hl) 7%, var(--sheet)); } }
.why .field-label:first-child { margin-top: 0; color: var(--text); font-weight: 600; font-size: 14.5px; }
.why > p.field-label { color: var(--text); font-weight: 600; font-size: 14.5px; }
.why textarea, .why input { background: var(--sheet); }
.real { margin-top: 6px; }
.real .field-label { color: var(--text); font-weight: 600; font-size: 14.5px; }
.align { display: grid; gap: 8px; margin-top: 16px; }
.align:empty { display: none; }
.al { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; font-size: 14.5px; line-height: 1.45; background: var(--sheet); border-radius: 12px; padding: 10px 12px; }
.al span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.al-good span { background: var(--ios-green); } .al-warn span { background: #FF9F0A; } .al-info span { background: var(--ios-blue); }

/* ManyChat: two ways in */
.paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.pathcard { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 18px; background: var(--sheet);
  box-shadow: var(--ios-shadow); transition: box-shadow .15s ease, transform .15s ease; }
.pathcard:hover { transform: translateY(-1px); }
.pathcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pathcard .bullet { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--ios-ink3); margin-top: 2px; display: grid; place-items: center; }
.pathcard[aria-checked=true] { box-shadow: 0 0 0 2px var(--ios-blue), var(--ios-shadow); }
.pathcard[aria-checked=true] .bullet { box-shadow: none; background: var(--ios-blue); }
.pathcard[aria-checked=true] .bullet::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.pathcard strong { display: block; font-size: 16px; font-weight: 600; margin: 8px 0 4px; letter-spacing: -.01em; }
.pathcard .d { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; margin-top: 12px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Room 8 waitlist: an iOS sheet */
.viewer { border: 0; padding: 0; border-radius: 26px; background: var(--sheet); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: auto; }
.viewer::backdrop { background: rgba(0, 0, 0, .4); backdrop-filter: blur(8px); }
.waitlist { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.wl-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1;
  background: rgba(28,28,30,.6); color: #fff; box-shadow: none; backdrop-filter: blur(10px); }
.wl-x:hover { background: rgba(28,28,30,.8); }
.wl-hero { position: relative; aspect-ratio: 16 / 7; overflow: hidden; background: #111; }
.wl-hero img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.wl-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, var(--sheet)); }
.wl-hero .badge { position: absolute; left: 14px; top: 14px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(28,28,30,.82); color: #fff; z-index: 1; }
.wl-body { padding: 4px 28px 26px; }
.wl-k { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.wl-k img { border-radius: 6px; }
.waitlist h2 { font-size: clamp(24px, 3.4vw, 30px); font-weight: 700; letter-spacing: -.03em; line-height: 1.12; margin: 10px 0 12px; }
.wl-lede { color: var(--body); font-size: 15.5px; }
.wl-points { margin: 16px 0 6px; --k: #FFC400; }
.wl-err { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ios-red) 10%, var(--sheet)); color: var(--ios-red); font-size: 14px; font-weight: 500; }
.wl-done { padding: 40px 28px 28px; text-align: center; }
.wl-done p { color: var(--body); max-width: 440px; margin: 0 auto; }
.wl-done .form-foot { justify-content: center; }
.wl-check { width: 60px; height: 60px; border-radius: 50%; background: var(--ios-green); color: #fff; font-size: 30px; font-weight: 800; display: inline-grid; place-items: center; }
button.tcard { text-align: left; font: inherit; color: inherit; }

/* teaser lock: the step title stays sharp, everything under it blurs behind the access-code card */
.locked { position: relative; min-height: 640px; }
.locked-preview { pointer-events: none; user-select: none; }
.locked-preview > :not(.sec-head) { filter: blur(6px) saturate(.8); opacity: .55; }
.locked-preview { max-height: 1100px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.gate-card { position: absolute; left: 50%; top: 170px; transform: translateX(-50%); width: min(480px, calc(100% - 8px)); z-index: 3; text-align: center; padding: 30px 30px 24px;
  box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 24px 60px rgba(0,0,0,.16); }
.gate-card h3 { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 14px 0 8px; }
.gate-card .muted { font-size: 14.5px; }
.lock-ico { width: 54px; height: 54px; border-radius: 16px; background: var(--ios-go); box-shadow: var(--ios-go-shadow); display: inline-grid; place-items: center; }
.lock-ico svg { width: 26px; height: 26px; fill: none; stroke: #1C1C1E; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gate-form { display: flex; gap: 8px; margin-top: 18px; }
.gate-form input { flex: 1; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; text-align: center; }
.gate-form input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.gate-err { margin-top: 10px; font-size: 13.5px; font-weight: 500; color: var(--ios-red); }
.gate-card .help { margin-top: 14px; line-height: 1.5; }
.gate { width: min(500px, calc(100vw - 32px)); }
.gate-card.in-dialog { position: static; transform: none; width: auto; box-shadow: none; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.lockmark { display: none; margin-left: auto; width: 15px; height: 15px; flex: none; fill: none; stroke: var(--ios-ink3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.is-locked .tabs .lockmark { display: block; }
body.is-locked .tabs .tick { display: none !important; }

/* "Go deeper" reads */
.deeper { margin-top: 10px; }
.deeper > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ios-blue); padding: 4px 0; }
.deeper > summary::-webkit-details-marker { display: none; }
.deeper > summary::after { content: "›"; font-size: 17px; line-height: 1; transition: transform .15s; }
.deeper[open] > summary::after { transform: rotate(90deg); }
.deeper > summary:hover { text-decoration: underline; }
.deeper-body { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--sheet); box-shadow: 0 0 0 1px var(--line); display: grid; gap: 10px; }
.deeper-body p { font-size: 14.5px; line-height: 1.55; }
.deeper-body .try { padding-top: 10px; border-top: 1px solid var(--line); }
.diag > .deeper .deeper-body { background: var(--fill); box-shadow: none; }
.diag > .deeper { margin-top: 14px; }

/* library + bookshelf */
.book { text-align: left; }
.book .by { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.book .why-line { font-size: 12.5px; color: var(--body); line-height: 1.4; }
.shelf-tools { display: grid; gap: 10px; margin-top: 16px; }
.shelf-tools .search { margin: 0; }
.shelf { margin-top: 12px; }
.bookdlg { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.bk-top { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 22px; padding: 28px 28px 8px; align-items: end; }
.bk-top .cover { width: 140px; }
.bk-top h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; padding-right: 30px; }
.bk-top .muted { margin-top: 4px; }
.bk-body { padding: 4px 28px 28px; }
.bk-body > p:not(.field-label) { font-size: 15px; line-height: 1.55; color: var(--body); }
.bk-why { position: relative; padding: 10px 14px 10px 18px; border-radius: 12px; background: var(--fill); margin-top: 8px; }
.bk-why::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--k); }
.bk-why strong { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.bk-why p { font-size: 14px; margin-top: 3px; color: var(--body); }
@media (max-width: 860px) { .bk-top { grid-template-columns: 100px minmax(0, 1fr); padding: 22px 18px 6px; gap: 16px; } .bk-top .cover { width: 100px; } .bk-top h2 { font-size: 19px; } .bk-body { padding: 4px 18px 22px; } }

/* links to khadaura.com */
a.avatar-ring { display: block; transition: transform .15s ease; }
a.avatar-ring:hover { transform: scale(1.03); }
.name-link { color: inherit; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); }
.name-link:hover { color: var(--text); border-bottom-color: var(--text); }
.side-by { font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.side-by:hover { color: var(--ios-blue); }
@media (max-width: 860px) { .side-by { display: none; } }

/* site updates */
.update-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 24px); padding: 10px 10px 10px 18px; border-radius: 18px; background: rgba(28, 28, 30, .94); color: #fff; backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25); font-size: 14.5px; }
.update-bar .btn.ghost { color: #fff; }
.update-bar .btn.ghost:hover { background: rgba(255,255,255,.12); }
@media (max-width: 860px) { .update-bar { bottom: 70px; } }
.updating { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.updating h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.updating p { color: var(--muted); }

/* blueprint */
.bp-sec { margin-bottom: 16px; }
.bp-sec h3 { font-size: 17px; }
.bp-k { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 12px; }
.bp-v { font-size: 15px; margin-top: 2px; white-space: pre-wrap; }
.bp-v.empty { color: var(--ios-ink3); font-style: italic; }
.danger-zone { border: 1.5px dashed color-mix(in srgb, var(--ios-red) 40%, transparent); background: transparent; box-shadow: none; }

/* ---------- tablets ---------- */
@media (max-width: 1100px) {
  .journey { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lineages, .tray-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-hero { grid-template-columns: 1fr; }
  .diag .cols { grid-template-columns: 1fr; }
}
/* ---------- phones: top bar and a bottom tab bar, like the app (frosted) ---------- */
@media (max-width: 860px) {
  .side { position: sticky; top: 0; bottom: auto; width: auto; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 8px 14px;
    background: var(--page); border-bottom: 1px solid var(--line); } /* no backdrop-filter here: it would trap the fixed tab bar */
  .side-logo { padding: 0; font-size: 16px; }
  .side-foot { margin: 0 0 0 auto; padding: 0; flex-direction: row; align-items: center; }
  .side-k, .side-foot .save-state span, .tab-sep, .tabs .num, .tabs .tick { display: none !important; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; flex-direction: row; justify-content: space-around; gap: 0; height: 58px;
    padding: 0 4px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--sheet) 82%, transparent); backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
  .tabs [role=tab] { width: auto; flex: 1; justify-content: center; padding: 0; min-height: 56px; border-radius: 0; }
  .tabs [role=tab][aria-selected=true] { background: none; box-shadow: none; }
  .tabs .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .page { margin: 0; padding: 18px 16px 96px; }
  .profile { gap: 16px; padding: 4px 0 20px; }
  .avatar-ring { width: 64px; height: 64px; }
  .masthead { font-size: 20px; }
  .status-line .steps { display: none; }
  .grid2, .grid3, .facts, .tried, .leak, .branches, .offer-body, .paths { grid-template-columns: 1fr; }
  .wl-body { padding: 4px 18px 22px; }
  .hist-grid { grid-template-columns: 1fr 1fr; } .hist-grid > :first-child { grid-column: 1 / -1; }
  .tier-head { flex-direction: column; gap: 8px; }
  input.price-in { max-width: none; }
  .gate-card { top: 120px; padding: 24px 18px 20px; }
  .gate-form { flex-direction: column; }
  body.is-locked .tabs .lockmark { display: none; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 0; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .hero { padding: 24px 20px; }
  .qcard { padding: 22px 18px; }
  .sheet { padding: 18px; }
  .rate { grid-template-columns: 1fr; }
  .track { grid-template-columns: 1fr; }
  .track-art { width: 100%; height: 110px; }
  .offer-head, .offer-body { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 480px) { .lineages, .tray-cards, .journey { grid-template-columns: 1fr; } .side-logo span { display: none; } .bar-row { grid-template-columns: 90px minmax(0,1fr) 34px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- print / PDF: the blueprint only, clean on white ---------- */
@media print {
  :root, :root[data-theme="dark"] { --page: #fff; --sheet: #fff; --text: #111; --muted: #555; --fill: #f4f4f4; --line: #ddd; --body: #222; color-scheme: light; }
  body { background: #fff; font-size: 11pt; }
  .side, .skip, .toast, .profile, .no-print, .tray, .form-foot, .seg, button { display: none !important; }
  .page { margin: 0; padding: 0; }
  main { max-width: none; }
  section[role=tabpanel] { display: none !important; }
  section[role=tabpanel].print-me { display: block !important; }
  .sheet { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .print-head { display: block !important; }
  a { color: #111; text-decoration: none; }
}
.print-head { display: none; }

/* ================= oracle cards (Higgsfield art, frame + title drawn here so the type stays crisp) ================= */
.ocard { --cw: 200px; width: var(--cw); margin: 0; perspective: 1400px; flex: none; }
.ocard.xs { --cw: 92px; } .ocard.sm { --cw: 104px; } .ocard.md { --cw: 190px; } .ocard.lg { --cw: 220px; }
.ocard.fill { --cw: 100%; } .ocard.mini { --cw: 100%; }
.oc-in { position: relative; transform-style: preserve-3d; transition: transform 1.15s cubic-bezier(.2, .75, .2, 1); }
.oc-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: calc(var(--cw) * .07); overflow: hidden; }
.oc-front { background: #F4F0EA; padding: 6.5% 6.5% 0; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 26px rgba(30,25,60,.16); position: relative; }
.oc-art { position: relative; aspect-ratio: 3 / 4; overflow: hidden; outline: 1px solid rgba(40,36,50,.55); outline-offset: -1px; background: #23263B; }
.oc-art::before { content: ""; position: absolute; inset: 3.5%; border: 1px solid rgba(255,255,255,.28); pointer-events: none; z-index: 1; }
.oc-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the title always fits: sized from the card's own width (container units) and the number of letters (--len, set in app.js) */
.oc-front { container-type: inline-size; }
.ocard figcaption { font-family: "Didot", "Bodoni 72", "Cormorant Garamond", Georgia, serif; text-transform: uppercase; letter-spacing: .14em; color: #2A2733;
  text-align: center; white-space: nowrap; height: 17cqi; display: flex; align-items: center; justify-content: center;
  font-size: min(7cqi, calc(80cqi / (var(--len, 8) * .9))); }
.oc-back { position: absolute; inset: 0; transform: rotateY(180deg); background: #F4F0EA; box-shadow: 0 10px 26px rgba(30,25,60,.16); }
.oc-back img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* flip in from the card back, then a light sweep across the art */
.ocard.flip .oc-in { transform: rotateY(180deg) translateY(10px); }
.ocard.flip.in .oc-in { transform: none; }
.ocard.flip .oc-art::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); transform: translateX(-120%); }
.ocard.flip.in .oc-art::after { animation: oc-sweep 1.3s .95s ease-out both; }
@keyframes oc-sweep { to { transform: translateX(120%); } }
.instant, .instant * { transition: none !important; animation-duration: 0s !important; animation-delay: 0s !important; }
.lcard .ocard.fill { margin-bottom: 4px; }
.mini-deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.mini-deck .ocard { transition: transform .25s ease; } .mini-deck .ocard:hover { transform: translateY(-4px) rotate(-1.5deg); }
.arch-card.has-card { display: flex; gap: 22px; align-items: center; }
.arch-card.has-card > div { min-width: 0; }
.arch-card.secondary.has-card { gap: 16px; padding: 18px; }

/* ================= the diagnosis ================= */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .8s cubic-bezier(.2, .75, .2, 1); }
.rv.in { opacity: 1; transform: none; }
.kicker { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: none; margin-bottom: 4px; }
.big-read { font-family: var(--font-serif); font-size: 19px; line-height: 1.5; margin: 10px 0 12px; }
.reading { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; }
.card-pair { display: flex; align-items: center; gap: 4px; }
.card-pair .ocard:first-child { transform: rotate(-4deg); } .card-pair .ocard:last-child { transform: rotate(4deg); }
.card-pair .ocard:last-child .oc-in { transition-delay: .35s; } .card-pair .ocard:last-child.in .oc-art::after { animation-delay: 1.3s; }
.pair-x { font-family: var(--font-serif); font-size: 18px; line-height: 1; color: var(--text); z-index: 3; position: relative; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--sheet); box-shadow: 0 2px 10px rgba(0,0,0,.18); margin: 0 -14px; flex: none; }
.loop { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: center; }
.loop-svg { width: 100%; height: auto; display: block; overflow: visible; }
.lp-ring { fill: none; stroke: var(--line); stroke-width: 10; }
.lp-flow { fill: none; stroke: #FF9F0A; stroke-width: 2.5; stroke-dasharray: 6 10; opacity: .8; stroke-dashoffset: 600; }
.lp-dot { filter: drop-shadow(0 0 4px rgba(255, 159, 10, .9)); }
.lp-cyc { font: 300 44px var(--font-ui); fill: var(--muted); opacity: .5; }
.lp-center { transform-box: fill-box; transform-origin: center; }
.loop.in .lp-center { animation: lp-spin 9s linear infinite; }
@keyframes lp-spin { to { transform: rotate(360deg); } }
.loop.in .lp-flow { animation: lp-flow 6s linear infinite; }
@keyframes lp-flow { to { stroke-dashoffset: 0; } }
.lp-dot { fill: url(#lpg); }
.lp-core { fill: var(--sheet); stroke: #FF3B30; stroke-width: 2.5; }
.lp-halo { fill: #FF3B30; opacity: .12; transform-box: fill-box; transform-origin: center; }
.loop.in .lp-halo { animation: lp-pulse 2.4s var(--d) ease-in-out infinite; }
@keyframes lp-pulse { 50% { transform: scale(1.3); opacity: .03; } }
.lp-node { opacity: 0; transform: scale(.4); transform-box: fill-box; transform-origin: center; transition: opacity .5s var(--d), transform .7s var(--d) cubic-bezier(.3, 1.6, .5, 1); }
.loop.in .lp-node { opacity: 1; transform: none; }
.lp-node text { font: 700 16px var(--font-ui); fill: var(--text); }
.loop-legend { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 13px; }
.loop-legend b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #FF3B30; font-size: 11px; margin-right: 6px; }
.split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--ios-fill); gap: 2px; }
.split i { display: block; width: 0; transition: width 1.2s cubic-bezier(.2, .75, .2, 1) .3s; }
.in .split i { width: var(--w); }
.sp-strategy { --c: #0A84FF; } .sp-price { --c: #FF9F0A; } .sp-inner { --c: #BF5AF2; }
.split i { background: var(--c); }
.split-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.split-key span[class^="sp-"]::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.split-key .leak-kind { margin-left: auto; } .split-key .leak-kind b { color: var(--text); }
.tried-read { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.tried-read li { background: var(--fill); border-radius: 14px; padding: 12px 16px; display: grid; gap: 3px; }
.tried-read b { font-size: 14px; } .tried-read span { font-size: 14px; color: var(--body); line-height: 1.45; }
:root[data-theme="dark"] .tried-read span { color: var(--muted); }
.drain { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 8px; }
.drain .count { display: block; font-size: 40px; font-weight: 700; letter-spacing: -.035em; color: #FF3B30; font-variant-numeric: tabular-nums; }
.drain small { font-size: 13px; color: var(--muted); font-weight: 600; } .drain p { margin-top: 8px; }
.coins { position: relative; height: 90px; border-radius: 0 0 22px 22px; border: 2px solid var(--line); border-top: none; overflow: hidden; }
.coins i { position: absolute; left: 50%; top: -14px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: linear-gradient(#FFDE3B, #FFC400); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.in .coins i { animation: coin 2.6s ease-in infinite; }
.coins i:nth-child(2) { animation-delay: .5s !important; margin-left: -16px; } .coins i:nth-child(3) { animation-delay: 1.1s !important; margin-left: 3px; }
.coins i:nth-child(4) { animation-delay: 1.6s !important; margin-left: -10px; } .coins i:nth-child(5) { animation-delay: 2.1s !important; margin-left: 0; }
@keyframes coin { 0% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(90px); opacity: 1; } 100% { transform: translateY(120px); opacity: 0; } }
.echo { margin-top: 18px; border-left: 3px solid var(--hl, #FFD60A); padding: 2px 0 2px 16px; }
.echo small { font-size: 12px; font-weight: 600; color: var(--muted); }
.echo blockquote { margin: 4px 0 6px; font-family: var(--font-serif); font-style: italic; font-size: 18px; line-height: 1.4; }
.body-map { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 28px; align-items: center; }
.body-svg { width: 120px; height: auto; display: block; }
.body-svg .bd { fill: var(--ios-fill); stroke: var(--line); stroke-width: 1; }
.zone { opacity: 0; transition: opacity .6s calc(.4s + var(--d)); }
.body-map.in .zone { opacity: 1; }
.z-dot { fill: #FF3B30; } .z-ring { fill: none; stroke: #FF3B30; stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.body-map.in .z-ring { animation: z-pulse 1.8s var(--d) ease-out infinite; }
@keyframes z-pulse { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.reset { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 16px; align-items: center; background: var(--fill); border-radius: 16px; padding: 14px 16px; margin-top: 14px; }
.reset small { font-size: 12px; font-weight: 600; color: var(--muted); } .reset p { font-size: 14.5px; line-height: 1.45; margin-top: 2px; }
.breath { position: relative; width: 70px; height: 70px; display: grid; place-items: center; }
.breath i { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(10,132,255,.35), rgba(191,90,242,.15) 70%, transparent 72%); transform: scale(.55); }
.body-map.in .breath i { animation: breathe 12s ease-in-out infinite; }
@keyframes breathe { 0% { transform: scale(.55); } 33% { transform: scale(1); } 100% { transform: scale(.55); } }
.breath span { position: relative; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .06em; }
.path { list-style: none; padding: 0; margin: 18px 0 0; position: relative; display: grid; gap: 18px; }
.path::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(#FFC400, #0A84FF); transform-origin: top; transform: scaleY(0); transition: transform 1.4s cubic-bezier(.4, 0, .2, 1) .2s; }
.in .path::before { transform: none; }
.path li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; position: relative; opacity: 0; transform: translateX(-10px); transition: opacity .5s var(--d), transform .6s var(--d); }
.in .path li { opacity: 1; transform: none; }
.pn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: linear-gradient(180deg, #FFDE3B, #FFC400); color: #1C1C1E; box-shadow: 0 0 0 5px var(--sheet); }
.path b { display: block; font-size: 16px; } .path small { font-size: 12.5px; color: var(--muted); font-weight: 600; } .path p { font-size: 14.5px; margin: 4px 0 2px; }
.diag-top { display: flex; gap: 16px; align-items: flex-start; }
.for-you { margin-top: 6px; font-size: 14.5px; line-height: 1.5; }
@media (max-width: 860px) {
  .reading, .loop, .body-map { grid-template-columns: 1fr; }
  .card-pair { justify-content: center; } .ocard.md { --cw: 150px; } .ocard.lg { --cw: 150px; }
  .loop-vis { max-width: 280px; margin: 0 auto; }
  .body-map { grid-template-columns: 90px minmax(0, 1fr); gap: 16px; } .body-svg { width: 90px; }
  .arch-card.has-card { flex-direction: column; align-items: flex-start; } .arch-card.secondary.has-card { flex-direction: row; align-items: center; }
  .ocard.sm { --cw: 84px; } .split-key .leak-kind { margin-left: 0; }
}
@media (max-width: 480px) { .body-map { grid-template-columns: 1fr; } .body-svg { width: 80px; margin: 0 auto; } .reset { grid-template-columns: 1fr; justify-items: center; text-align: center; } .ocard.md { --cw: 128px; } }
@media (prefers-reduced-motion: reduce) { .rv, .lp-node, .zone, .path li { opacity: 1 !important; transform: none !important; } .ocard.flip .oc-in { transform: none !important; } .path::before { transform: none !important; } .split i { width: var(--w) !important; } }
@media print { .rv { opacity: 1 !important; transform: none !important; } }
.ocard.mini figcaption { letter-spacing: .03em; height: 22cqi; font-size: min(12cqi, calc(96cqi / (var(--len, 8) * .74))); }
.ocard.mini .oc-front { padding: 5% 5% 0; }

/* ================= Your Offers: the shelf of three, door tabs, save bar ================= */
.shelf { background: var(--sheet); border-radius: var(--r); box-shadow: var(--ios-shadow); padding: 20px 22px; margin-bottom: 22px; scroll-margin-top: 16px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shelf-head h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.shelf-n { font-size: 13px; font-weight: 700; color: var(--muted); }
.shelf > .muted { margin: 4px 0 14px; font-size: 14px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.slot { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 132px; padding: 14px 16px; border-radius: 18px;
  background: var(--fill); border: 1.5px solid transparent; transition: transform .2s ease, border-color .2s ease, background .2s ease; position: relative; }
.slot:hover { transform: translateY(-2px); }
.slot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.slot.on { border-color: var(--hl); background: color-mix(in srgb, var(--hl) 12%, var(--sheet)); }
.slot.empty { background: transparent; border: 1.5px dashed var(--edge); }
.slot.empty.on { border-style: solid; border-color: var(--hl); }
.slot-k { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.slot-title { font-size: 15.5px; font-weight: 700; line-height: 1.25; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot-title.muted { color: var(--muted); font-weight: 600; }
.slot-price { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: auto; }
.slot-st { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.slot.saved .slot-st { color: var(--ios-green); }
.slot-plus { position: absolute; right: 14px; top: 10px; font-size: 26px; font-weight: 300; color: var(--muted); }
.slot-cta { margin-top: auto; font-size: 13.5px; font-weight: 700; color: var(--accent); }
.slot.pop { animation: slot-pop .9s cubic-bezier(.2,.8,.2,1); }
@keyframes slot-pop { 0% { transform: scale(.94); box-shadow: 0 0 0 0 rgba(52,199,89,.55); } 40% { transform: scale(1.03); } 100% { transform: none; box-shadow: 0 0 0 16px rgba(52,199,89,0); } }
#writer { scroll-margin-top: 16px; }
.door-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--fill); margin-bottom: 12px; }
.door-tabs > button { border: 0; box-shadow: none; background: transparent; border-radius: 11px; min-height: 52px; padding: 6px 10px; font-size: 14.5px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.door-tabs > button small { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .8; }
.door-tabs > button[aria-selected=true] { background: var(--sheet); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.door-tabs .tick { color: var(--ios-green); }
.save-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 28px; padding: 18px 0 24px; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .save-bar { margin: 0 18px; } }
.save-bar .muted { font-size: 13.5px; flex: 1 1 220px; }
.saved-pill { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(52,199,89,.16); color: #1E8E3E; }
.offer-card.is-saved { outline: 2px solid rgba(52,199,89,.45); outline-offset: -2px; }
.center { text-align: center; }
@media (max-width: 720px) { .slots { grid-template-columns: 1fr; } .slot { min-height: 0; } .slot-price { margin-top: 2px; } .door-tabs > button { font-size: 13px; } }

/* ================= every oracle card is tappable ================= */
[data-card] { cursor: pointer; }
.ocard[data-card] { transition: transform .25s ease, filter .25s ease; }
.ocard[data-card]:hover { transform: translateY(-4px) rotate(-1deg); filter: drop-shadow(0 10px 18px rgba(30,25,60,.18)); }
.ocard[data-card]:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.ocard.xl { --cw: 300px; } .ocard.rel { --cw: 92px; } .ocard.draw { --cw: 100%; }

/* the pop-up: the card flies out of its spot, spins twice, lands; the reading fades in beside it */
.carddlg { width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; background: var(--sheet); }
.carddlg[open] { display: flex; }
.carddlg::backdrop { background: radial-gradient(ellipse at center, rgba(40,30,80,.55), rgba(8,8,20,.78)); backdrop-filter: blur(10px); }
.cd-wrap { display: grid; grid-template-columns: 360px 1fr; width: 100%; min-height: 0; }
.cd-stage { display: grid; place-items: center; padding: 40px 30px; background: radial-gradient(ellipse at 50% 40%, #3B3566 0%, #1B1A33 70%); perspective: 1600px; position: relative; overflow: hidden; }
.cd-stage::before { content: ""; position: absolute; inset: -30%; background: conic-gradient(from 0deg, transparent, rgba(255,214,10,.16), transparent 30%, rgba(142,108,240,.18), transparent 60%); filter: blur(40px); animation: cd-halo 14s linear infinite; }
.cd-stage .ocard { position: relative; z-index: 1; }
.cd-body { overflow: auto; padding: 32px 34px 34px; max-height: calc(100dvh - 32px); }
.cd-body h2 { font-family: "Didot", "Bodoni 72", "Cormorant Garamond", Georgia, serif; font-weight: 400; font-size: clamp(30px, 4vw, 40px); letter-spacing: .01em; margin: 4px 0 8px; line-height: 1.05; }
.cd-ess { font-size: 16.5px; color: var(--body); margin: 0 0 16px; }
.cd-mine { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: var(--hl); color: #1C1C1E; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; text-transform: none; }
.cd-pos { margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; background: var(--fill); font-size: 14px; }
.cd-msg { padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, rgba(255,214,10,.16), rgba(142,108,240,.14)); margin-bottom: 18px; }
.cd-msg p:last-child { margin: 0; font-size: 16.5px; line-height: 1.5; font-family: var(--font-serif); }
.cd-sub { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.cd-sec { padding: 16px 0; border-top: 1px solid var(--line); }
.cd-sec h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 17px; letter-spacing: -.01em; }
.cd-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; background: var(--fill); color: var(--text); flex: none; }
.cd-sec p { margin: 0 0 8px; line-height: 1.55; } .cd-sec p:last-child { margin-bottom: 0; }
.cd-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.cd-pair.gs { padding: 14px 16px; border-radius: 16px; background: var(--fill); margin-bottom: 4px; }
.cd-pair p { margin: 0; line-height: 1.55; }
.cd-ask { font-family: var(--font-serif); font-size: 17px; font-style: italic; }
.cd-code { margin: 16px 0 0; padding: 16px 18px; border-left: 3px solid var(--hl); background: var(--fill); border-radius: 0 14px 14px 0; font-family: var(--font-serif); font-size: 17px; font-style: italic; }
.cd-related { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.carddlg .wl-x { z-index: 5; }
/* motion */
.carddlg.go .cd-card .oc-in { animation: cd-spin 1.25s cubic-bezier(.2,.7,.15,1) both; }
.carddlg.go .cd-body > * { animation: cd-rise .6s ease-out both; animation-delay: calc(.55s + var(--i, 0) * .05s); }
.carddlg.go .cd-stage::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255,236,150,.6), transparent 45%); opacity: 0; animation: cd-flash 1.4s .9s ease-out both; pointer-events: none; }
.carddlg.go::backdrop { animation: cd-fade .4s ease-out both; }
.carddlg.landed .cd-card .oc-in { animation: cd-float 5s ease-in-out infinite; }
@keyframes cd-spin {
  0% { transform: translate(var(--dx, 0), var(--dy, 40px)) scale(var(--s, .6)) rotateY(0deg); }
  55% { transform: translate(0, -14px) scale(1.06) rotateY(540deg); }
  80% { transform: translate(0, 4px) scale(.99) rotateY(700deg); }
  100% { transform: translate(0, 0) scale(1) rotateY(720deg); } }
@keyframes cd-float { 0%, 100% { transform: translateY(0) rotateY(0deg); } 50% { transform: translateY(-8px) rotateY(4deg); } }
@keyframes cd-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes cd-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cd-halo { to { transform: rotate(360deg); } }
@media (max-width: 820px) {
  .carddlg { max-height: calc(100dvh - 20px); width: calc(100vw - 20px); }
  .carddlg[open] { display: block; overflow: auto; }
  .cd-wrap { grid-template-columns: 1fr; }
  .cd-stage { padding: 30px 20px 26px; } .ocard.xl { --cw: 210px; }
  .cd-body { max-height: none; overflow: visible; padding: 22px 20px 28px; }
  .cd-pair { grid-template-columns: 1fr; } }

/* ================= Oracle Deck tab: draw three, the whole deck ================= */
.draw-sheet { overflow: hidden; }
.draw-top { display: flex; gap: 16px 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.draw-top > div { flex: 1 1 360px; } .draw-top h3 { margin: 2px 0 6px; } .draw-top .muted { margin: 0; }
.spread { display: grid; grid-template-columns: repeat(3, minmax(0, 210px)); justify-content: center; gap: 22px; margin: 26px 0 8px; padding: 26px 18px; border-radius: 20px;
  background: radial-gradient(ellipse at 50% 30%, #3B3566 0%, #1B1A33 75%); }
.spot { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.spot-k { margin: 0; color: #F4F0EA; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-align: center; }
.ocard.facedown { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: block; transition: transform .25s ease; }
.ocard.facedown .oc-face { display: block; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 26px rgba(0,0,0,.35); aspect-ratio: 1 / 1.37; }
.ocard.facedown img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ocard.facedown:hover { transform: translateY(-6px); }
.ocard.facedown:focus-visible { outline: 3px solid var(--hl); outline-offset: 4px; border-radius: 14px; }
.spread.shuffling .spot { animation: shuffle .75s ease-in-out both; }
.spread.shuffling .spot:nth-child(1) { --sx: 110%; } .spread.shuffling .spot:nth-child(3) { --sx: -110%; }
@keyframes shuffle { 0% { transform: none; } 45% { transform: translateX(var(--sx, 0)) rotate(6deg) scale(.95); } 70% { transform: translateX(calc(var(--sx, 0) * -.2)) rotate(-4deg); } 100% { transform: none; } }
.spread.dealt .spot { animation: deal .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d); }
.spread.dealt .spot .ocard.flip .oc-in { transition-delay: calc(var(--d) + .35s); }
.spread.dealt .spot .ocard.flip.in .oc-art::after { animation-delay: calc(var(--d) + 1.3s); }
@keyframes deal { from { opacity: 0; transform: translateY(-50px) scale(.85) rotate(-6deg); } to { opacity: 1; transform: none; } }
.draw-read { display: grid; gap: 0; margin-top: 18px; }
.dr-row { padding: 16px 0; border-top: 1px solid var(--line); }
.draw-sheet.fresh .dr-row { animation: cd-rise .6s ease-out both; animation-delay: var(--d); }
.dr-row h4 { margin: 2px 0 6px; font-size: 18px; } .dr-row h4 .muted { font-size: 13px; font-weight: 600; margin-left: 6px; }
.dr-row p { margin: 0 0 6px; line-height: 1.55; }
.deck-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 30px; }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 16px; }
.draw-promo { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 20px; width: 100%; margin: 6px 0 16px; padding: 18px 22px; border-radius: var(--r);
  background: linear-gradient(120deg, #2A2550, #1B1A33); color: #F4F0EA; box-shadow: var(--ios-shadow); transition: transform .2s ease; }
.draw-promo:hover { transform: translateY(-2px); } .draw-promo:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.draw-promo > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.draw-promo .kicker { color: var(--hl); margin: 0; } .draw-promo strong { font-size: 18px; } .draw-promo .muted { color: rgba(244,240,234,.75); font-size: 14px; }
.dp-fan { position: relative; width: 92px; height: 86px; flex: none; }
.dp-fan img { position: absolute; left: 26px; top: 4px; width: 46px; height: 72px; object-fit: cover; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.4); transform-origin: 50% 100%; transition: transform .3s ease; }
.dp-fan img:nth-child(1) { transform: rotate(-16deg); } .dp-fan img:nth-child(3) { transform: rotate(16deg); }
.draw-promo:hover .dp-fan img:nth-child(1) { transform: rotate(-24deg); } .draw-promo:hover .dp-fan img:nth-child(3) { transform: rotate(24deg); }
.dp-arrow { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
@media (max-width: 640px) { .spread { gap: 10px; padding: 18px 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); } .spot-k { font-size: 10px; letter-spacing: .02em; }
  .deck-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; } .draw-promo { padding: 14px 16px; gap: 12px; } .dp-fan { width: 70px; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) {
  .carddlg.go .cd-card .oc-in, .carddlg.landed .cd-card .oc-in, .carddlg.go .cd-body > *, .cd-stage::before, .carddlg.go .cd-stage::after, .spread .spot, .dr-row, .slot.pop { animation: none !important; } }
.cd-code + .cd-sub, .cd-sec + .cd-sub { margin-top: 20px; }

/* ================= the five wealths in the card pop-up ================= */
.w-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--fill); margin: 12px 0 14px; }
.w-tabs > button { position: relative; border: 0; box-shadow: none; background: transparent; border-radius: 10px; min-height: 54px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); }
.w-tabs > button span { font-size: 17px; line-height: 1; }
.w-tabs > button[aria-selected=true] { background: var(--sheet); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.w-first { position: absolute; top: 4px; right: 5px; width: 16px; height: 16px; border-radius: 50%; background: #FF9F0A; color: #fff; font-size: 10px; font-style: normal; font-weight: 800; display: grid; place-items: center; }
.w-def { font-size: 14px; color: var(--muted); margin: 0 0 12px !important; }
.w-def b { color: var(--text); }
.w-panel:not([hidden]) { animation: cd-rise .35s ease-out both; }
.facets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.fc { padding: 12px 14px; border-radius: 14px; border: 1px solid transparent; }
.fc p:last-child { margin: 0; font-size: 14.5px; line-height: 1.5; }
.fc-light { background: linear-gradient(135deg, rgba(255,214,10,.22), rgba(255,214,10,.08)); border-color: rgba(255,196,0,.35); }
.fc-shadow { background: rgba(142,108,240,.12); border-color: rgba(142,108,240,.25); }
.fc-dark { background: #1E1B33; color: #ECE8F7; } .fc-dark .cd-sub { color: #A9A2C9; }
.fc-med { background: rgba(52,199,89,.12); border-color: rgba(52,199,89,.3); }
.cd-pair.one { grid-template-columns: 1fr; margin-top: 4px; }
.w-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 6px; }
.w-chips .cd-sub { margin: 0 4px 0 0; }
.w-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 700; }
.w-chip-def { font-size: 13.5px; margin: 0 0 14px; }
/* the system loop */
.sys { display: grid; place-items: center; margin: 4px 0 8px; }
.sys-svg { width: min(100%, 380px); height: auto; overflow: visible; }
.sys-node .lp-core { fill: var(--sheet); stroke: var(--edge); stroke-width: 1.5; }
.sys-node.first .lp-core { fill: #FF9F0A; stroke: #FF9F0A; }
.sys-node.first .sys-ic { fill: #fff; }
.sys-node .lp-halo { fill: rgba(255,196,0,.14); }
.sys-ic { font-size: 17px; fill: var(--text); }
.sys-lbl { font-size: 11.5px; font-weight: 700; fill: var(--muted); }
.sys-node.first .sys-lbl { fill: #D97706; }
.carddlg.go .sys-node { animation: sys-pop .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.9s + var(--d)); transform-box: fill-box; transform-origin: center; }
@keyframes sys-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.sys-start { padding: 10px 14px; border-radius: 12px; background: rgba(255,159,10,.12); }
@media (max-width: 520px) { .facets { grid-template-columns: 1fr; } .w-tabs > button { font-size: 10.5px; min-height: 50px; } }
@media (prefers-reduced-motion: reduce) { .carddlg.go .sys-node, .w-panel:not([hidden]) { animation: none !important; } }
.sys-svg .lp-dot { fill: #FFC400; }
.sys-svg .lp-flow { animation: lp-flow 6s linear infinite; }
@media (prefers-reduced-motion: reduce) { .sys-svg .lp-flow { animation: none; } }

/* locked cards: a teaser and the access code, inside the pop-up */
.cd-locked { margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: var(--fill); }
.cd-locked ul { margin: 6px 0 10px; padding-left: 20px; } .cd-locked li { margin: 4px 0; line-height: 1.45; }
.cd-locked .muted { margin: 0; font-size: 14px; }
.cd-locked.sample { margin-top: 22px; background: linear-gradient(135deg, rgba(255,214,10,.14), rgba(142,108,240,.12)); }
.cd-locked.sample > p:not(.cd-sub) { margin: 0 0 6px; }
.gate-card.in-card { position: static; transform: none; width: auto; margin-top: 16px; padding: 0; box-shadow: none; background: transparent; text-align: left; }
.gate-card.in-card .lock-ico { display: none; }
.gate-card.in-card h3 { font-size: 17px; margin: 0 0 4px; }
.gate-card.in-card > p.muted:first-of-type { display: none; }
.gate-card.in-card .gate-form { margin-top: 10px; }

/* ================= locked in like an iOS app =================
   no sideways sliding, no rubber-band, no zoom when a field is tapped, and a tab bar that clears the home indicator */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
html, body { overflow-x: hidden; max-width: 100%; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body { touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
@media (max-width: 860px) {
  /* iOS zooms into any field under 16px; 16px stops it */
  input, textarea, select, .price-in, .offer-title { font-size: 16px !important; }
  .offer-title { font-size: 22px !important; }
  .tabs { height: calc(58px + env(safe-area-inset-bottom)); padding: 0 calc(4px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(4px + env(safe-area-inset-left)); }
  .side { padding-top: calc(8px + env(safe-area-inset-top)); padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); }
  .page { padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .update-bar { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
  img, svg, video, canvas { max-width: 100%; }
}

/* ================= My Map: the whole life, mapped (full screen, like the Sorter board) ================= */
body[data-tab=map] .profile { display: none; }
.mapwrap { position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: calc(100dvh - 32px); min-height: 520px; border-radius: 24px; overflow: hidden;
  background: #1B1A33; box-shadow: 0 20px 60px rgba(20, 16, 50, .28); margin-bottom: 28px; isolation: isolate; }
.map-stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); aspect-ratio: 2200 / 1245; min-width: 100%; min-height: 100%; }
.map-bg { position: absolute; inset: 0; background: url(assets/img/map-wide.jpg) center / cover no-repeat; animation: map-drift 40s ease-in-out infinite alternate; }
.map-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 110%, rgba(255, 214, 10, .14), transparent 60%), linear-gradient(180deg, rgba(14, 12, 36, .25), transparent 22%, transparent 78%, rgba(14, 12, 36, .25)); }
@keyframes map-drift { from { transform: scale(1.02); } to { transform: scale(1.07) translate(-1%, -1%); } }
/* the trail between the five stops */
.trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.trail-T { display: none; }
.tr-base { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tr-seg { fill: none; stroke: #FFD60A; stroke-width: 3.5; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0; filter: drop-shadow(0 0 4px rgba(255, 200, 0, .9)); }
.tr-seg.lit { opacity: 1; stroke-dasharray: 400; stroke-dashoffset: 400; animation: tr-draw 1.6s calc(.6s + var(--d)) ease-out forwards; }
@keyframes tr-draw { to { stroke-dashoffset: 0; } }
/* pins */
.map-pins { position: absolute; inset: 0; }
.mpin { all: unset; box-sizing: border-box; position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer;
  animation: pin-in .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.15s + var(--i, 0) * .06s); z-index: 2; }
.mpin:focus-visible .mp-dot { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes pin-in { from { opacity: 0; transform: translate(-50%, -30%) scale(.6); } to { opacity: 1; transform: translate(-50%, -50%); } }
.mp-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 800; color: #1C1C1E;
  background: rgba(255, 255, 255, .92); box-shadow: 0 4px 14px rgba(20, 16, 50, .35), 0 0 0 4px rgba(255, 255, 255, .25); transition: transform .2s ease; }
.mpin:hover .mp-dot, .mpin.on .mp-dot { transform: scale(1.12); }
.mp-lbl { display: flex; flex-direction: column; align-items: center; padding: 4px 10px; border-radius: 10px; background: rgba(28, 26, 51, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; text-align: center; max-width: 180px; }
.mp-lbl small { font-size: 10.5px; font-weight: 600; opacity: .78; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.mpin.on .mp-lbl { background: #1C1C1E; box-shadow: 0 0 0 2px #FFD60A; }
/* journey stops */
.mpin.step .mp-dot { background: rgba(255, 255, 255, .78); color: #6E6E73; }
.mpin.step.done .mp-dot { background: linear-gradient(180deg, #FFDE3B, #FFC400); color: #1C1C1E; }
.mpin.step.next .mp-dot { background: #fff; color: #1C1C1E; animation: pin-pulse 2.2s ease-in-out infinite; }
@keyframes pin-pulse { 0%, 100% { box-shadow: 0 4px 14px rgba(20,16,50,.35), 0 0 0 0 rgba(255, 214, 10, .8); } 50% { box-shadow: 0 4px 14px rgba(20,16,50,.35), 0 0 0 12px rgba(255, 214, 10, 0); } }
/* the five wealth regions: light, shadow, dark */
.mpin.region .mp-dot { width: 46px; height: 46px; font-size: 20px; }
.mpin.region .mp-lbl { font-family: "Didot", "Bodoni 72", Georgia, serif; font-weight: 400; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.mpin.region .mp-lbl small { font-family: var(--font-ui); text-transform: none; letter-spacing: 0; font-weight: 700; }
.st-light .mp-dot { background: radial-gradient(circle at 35% 30%, #FFF7C2, #FFD60A); box-shadow: 0 0 24px 6px rgba(255, 214, 10, .55); }
.st-shadow .mp-dot { background: radial-gradient(circle at 35% 30%, #E7DDFF, #8E6CF0); color: #fff; box-shadow: 0 0 22px 4px rgba(142, 108, 240, .55); }
.st-dark .mp-dot { background: radial-gradient(circle at 35% 30%, #3B3566, #0E0C1E); color: #FFD60A; box-shadow: 0 0 0 2px rgba(255, 214, 10, .6), 0 0 26px 6px rgba(14, 12, 30, .7); }
.st-open .mp-dot { background: rgba(255, 255, 255, .55); color: #6E6E73; }
/* you are here */
.mpin.you { z-index: 3; }
.you-card { width: 62px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; border: 3px solid #F4F0EA; box-shadow: 0 8px 24px rgba(20, 16, 50, .5), 0 0 0 6px rgba(255, 214, 10, .35);
  animation: you-float 4s ease-in-out infinite; }
.you-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes you-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.mpin.you .mp-lbl { background: #FFD60A; color: #1C1C1E; } .mpin.you .mp-lbl small { opacity: .75; }
.mpin.extra .mp-dot { width: 34px; height: 34px; font-size: 15px; background: rgba(255, 255, 255, .8); }
/* the floating card in the corner */
.map-hud { position: absolute; right: 16px; bottom: 16px; z-index: 4; width: 290px; padding: 16px 18px; border-radius: 20px; background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 10px 30px rgba(20, 16, 50, .25); color: #1C1C1E; transition: opacity .25s ease, transform .25s ease; }
.map-hud .kicker { margin: 0; color: #6E6E73; } .map-hud h2 { margin: 2px 0 10px; font-size: 21px; letter-spacing: -.02em; }
.hud-bar { height: 6px; border-radius: 99px; background: rgba(0, 0, 0, .08); overflow: hidden; } .hud-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #FFDE3B, #FFC400); }
.hud-n { margin: 8px 0 10px; font-size: 13px; color: #3A3A3C; } .hud-n .link { font-size: 13px; }
.legend { display: flex; gap: 12px; font-size: 12px; font-weight: 700; color: #3A3A3C; }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.lg.st-light::before { background: #FFD60A; box-shadow: 0 0 6px #FFD60A; } .lg.st-shadow::before { background: #8E6CF0; } .lg.st-dark::before { background: #1B1A33; box-shadow: 0 0 0 1.5px #FFD60A; }
.hud-written { display: block; margin-top: 10px; font-size: 13px; }
.mapwrap.panel-open .map-hud { opacity: 0; transform: translateY(10px); pointer-events: none; }
/* the info panel */
.map-panel { position: absolute; z-index: 5; top: 14px; right: 14px; bottom: 14px; width: min(400px, calc(100% - 28px)); overflow: auto; overscroll-behavior: contain; padding: 22px 22px 26px; border-radius: 22px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 20px 50px rgba(20, 16, 50, .35); color: #1C1C1E; }
.map-panel.in { animation: panel-in .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes panel-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.map-panel .wl-x { top: 12px; right: 12px; }
.map-panel .kicker { margin: 0; color: #6E6E73; } .map-panel h3 { margin: 2px 40px 12px 0; font-size: 22px; letter-spacing: -.02em; font-family: "Didot", "Bodoni 72", Georgia, serif; font-weight: 400; }
.mp-body p { margin: 0 0 10px; line-height: 1.5; font-size: 14.5px; color: #2C2C2E; } .mp-body .muted { color: #6E6E73; }
.mp-k { font-size: 11.5px !important; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6E6E73 !important; margin: 14px 0 4px !important; }
.mp-cards { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; } .mp-cards .ocard.rel { --cw: 86px; }
.mp-state { padding: 10px 12px; border-radius: 12px; margin: 8px 0 12px; font-size: 14px; line-height: 1.45; }
.mp-state.st-light { background: rgba(255, 214, 10, .2); } .mp-state.st-shadow { background: rgba(142, 108, 240, .15); } .mp-state.st-dark { background: #1E1B33; color: #ECE8F7; }
.map-panel .facets { grid-template-columns: 1fr; }
.mp-bars { display: grid; gap: 6px; margin-bottom: 10px; }
.mb { display: grid; grid-template-columns: 82px 1fr 38px; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.mb i { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .07); position: relative; overflow: hidden; }
.mb i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 99px; background: linear-gradient(90deg, #FFDE3B, #FFC400); }
.mb b { text-align: right; font-size: 12.5px; }
.mp-doors { display: grid; gap: 8px; } .mp-door { padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .05); display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.mp-door small { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #6E6E73; } .mp-door b { font-size: 14.5px; } .mp-door span { font-size: 13px; color: #3A3A3C; }
.mp-door.saved { background: rgba(52, 199, 89, .14); }
.map-written { scroll-margin-top: 16px; }
/* phones held upright: the tall painting, full bleed, the card on top, the panel as a sheet */
@media (max-width: 860px) and (orientation: portrait) {
  .mapwrap { aspect-ratio: auto; height: calc(100dvh - 58px - 58px - env(safe-area-inset-bottom) - env(safe-area-inset-top) + 2px); min-height: 480px; max-height: none;
    margin: -18px calc(-16px - env(safe-area-inset-left)) 24px; width: auto; border-radius: 0; }
  .map-stage { aspect-ratio: 960 / 1696; }
  .map-bg { background-image: url(assets/img/map-tall.jpg); }
  .trail-W { display: none; } .trail-T { display: block; }
  .mpin { left: var(--tx); top: var(--ty); }
  .mp-dot { width: 34px; height: 34px; font-size: 15px; } .mpin.region .mp-dot { width: 38px; height: 38px; font-size: 17px; }
  .mp-lbl { font-size: 11px; padding: 3px 8px; max-width: 120px; } .mp-lbl small { font-size: 9.5px; max-width: 112px; }
  .mpin.region .mp-lbl { font-size: 12px; } .you-card { width: 48px; } .mpin.extra .mp-dot { width: 30px; height: 30px; font-size: 13px; }
  .map-hud { left: 10px; right: 10px; top: 10px; bottom: auto; width: auto; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
  .map-hud .kicker { display: none; } .map-hud h2 { margin: 0 0 6px; font-size: 16px; grid-column: 1 / -1; }
  .hud-bar { grid-column: 1 / -1; } .hud-n { margin: 6px 0 0; font-size: 12px; } .legend { display: none; } .hud-written { margin: 6px 0 0; font-size: 12px; text-align: right; }
  .map-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 74%; border-radius: 22px 22px 18px 18px; }
  @keyframes panel-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { .map-bg, .mpin, .mpin.step.next .mp-dot, .you-card, .map-panel.in { animation: none !important; } .tr-seg.lit { animation: none; stroke-dashoffset: 0; } }
@media print { .mapwrap { display: none !important; } }
/* the map gets the whole screen; the written version below keeps the normal reading width */
body[data-tab=map] .page { padding-top: 16px; padding-left: 16px; padding-right: 16px; }
body[data-tab=map] main { max-width: none; }
body[data-tab=map] .map-written { max-width: 975px; margin: 0 auto; }
@media (min-width: 861px), (orientation: landscape) {
  .mapwrap { aspect-ratio: auto; height: min(calc(100dvh - 32px), calc((100vw - var(--side) - 32px) / 1.45)); min-height: 480px; max-height: none; }
}
.map-panel .fc-dark p, .map-panel .mp-state.st-dark, .map-panel .mp-state.st-dark b { color: #ECE8F7; }
.map-panel .fc-dark .cd-sub { color: #A9A2C9; }
/* dark-style cards (from Room 8's black-and-gold look): same frame, inked dark, gold title */
.ocard.dark .oc-front { background: #16151F; }
.ocard.dark figcaption { color: #E9C46A; }
.ocard.dark .oc-art { outline-color: rgba(233, 196, 106, .55); }
.ocard.dark .oc-art::before { border-color: rgba(233, 196, 106, .35); }
