/* The Leap Upgrade app.
   Layout: phone-first single column (max 520px), a scrolling screen above a fixed bottom tab bar.
   Two looks: Guide mode uses the LEAP brand (brand blue #072B4D + orange, light/dark); Systems mode is a fixed dark console. */

:root {
    --bg: #f6f8fa;
    --surface: #ffffff;
    --field: #f8fafc;
    --ink: #0e2236;
    --muted: #4f6275;
    --line: #dbe3ea;
    --accent: #072b4d;
    --accent-tint: #e6eef5;
    --on-accent: #ffffff;
    --orange: #f57c3b;
    --orange-2: #f99a3e;
    --orange-ink: #b8501a;
    --warm: #fff3ea;
    --good: #072b4d;
    --before: #c5d1dc;
    --display: "Marcellus", "Optima", "Candara", Georgia, serif;
    --body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --radius: 14px;
    --tabbar-h: 64px;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #072b4d; --surface: #0c3560; --field: #05223d; --ink: #eef3f8; --muted: #a9bccd; --line: #1d4a74;
        --accent: #f99a3e; --accent-tint: #0f3a66; --on-accent: #072b4d; --orange-ink: #f99a3e; --warm: #0f3a66;
        --good: #f99a3e; --before: #2a5784;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #072b4d; --surface: #0c3560; --field: #05223d; --ink: #eef3f8; --muted: #a9bccd; --line: #1d4a74;
    --accent: #f99a3e; --accent-tint: #0f3a66; --on-accent: #072b4d; --orange-ink: #f99a3e; --warm: #0f3a66;
    --good: #f99a3e; --before: #2a5784;
    color-scheme: dark;
}

/* Systems mode: a committed dark console look in every theme, on the brand blue */
body.mode-systems {
    --bg: #041d35; --surface: #072b4d; --field: #03172b; --ink: #e2e8f0; --muted: #9fb4c8; --line: #164168;
    --accent: #00f0ff; --accent-tint: rgba(0, 240, 255, 0.13); --on-accent: #000000; --orange-ink: #00f0ff;
    --warm: rgba(0, 240, 255, 0.08); --orange: #00f0ff; --orange-2: #00f0ff; --good: #00f0ff; --before: #1f4d78;
    --display: var(--mono);
    color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol { margin: 0; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.screen {
    flex: 1; display: flex; flex-direction: column; gap: 18px;
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px));
    padding-left: max(18px, env(safe-area-inset-left, 0px));
    padding-right: max(18px, env(safe-area-inset-right, 0px));
    animation: rise 0.3s ease both;
}
.screen.no-tabs { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Top bar */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; }
.topbar .logo { height: 30px; width: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: block; } }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
body.mode-systems .logo-light { display: none !important; }
body.mode-systems .logo-dark { display: none !important; }
.sys-brand { display: none; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.16em; color: var(--accent); font-weight: 600; }
.sys-brand img { height: 26px; width: auto; }
body.mode-systems .sys-brand { display: flex; }
.session-top { display: grid; grid-template-columns: 1fr auto 1fr; }
.session-top > :first-child { justify-self: start; }
.session-top > :last-child { justify-self: end; }
.step-count { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; font-family: var(--mono); letter-spacing: 0.04em; }
.icon-btn { background: none; border: none; padding: 8px; margin: -8px; cursor: pointer; color: var(--muted); font-size: 0.9rem; }

/* iLEAP letter track: the five steps of the method */
.ileap { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ileap li { display: grid; justify-items: center; gap: 4px; }
.ileap .l { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 1.15rem; line-height: 1; border: 1.5px solid var(--line); color: var(--muted); background: var(--surface); transition: background 0.3s, color 0.3s, border-color 0.3s; }
.ileap .w { font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); }
.ileap li.done .l { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent); }
.ileap li.now .l { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ileap li.now .w { color: var(--accent); font-weight: 600; }
body.mode-guide .ileap li.now .l { background: linear-gradient(135deg, var(--orange), var(--orange-2)); border-color: transparent; color: #1a0b02; }
body.mode-systems .ileap .l { border-radius: 6px; font-size: 0.9rem; font-weight: 600; }
.step-letter { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange-ink); margin-bottom: -10px; }
.flow-letters { list-style: none; padding: 0; display: grid; gap: 10px; }
.flow-letters li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; color: var(--muted); }
.flow-letters .l { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 1.15rem; background: var(--accent-tint); color: var(--accent); }
.flow-letters b { color: var(--ink); }
.progress { height: 4px; background: var(--accent-tint); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-2)); transition: width 0.4s ease; }
body.mode-systems .progress span { background: var(--accent); }

/* Type */
h1 { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.15; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.2; text-wrap: balance; }
h3 { font-family: var(--display); font-weight: 400; font-size: 1.15rem; line-height: 1.3; }
body.mode-systems h1, body.mode-systems h2 { font-size: 1.3rem; font-weight: 600; color: #ffffff; letter-spacing: -0.01em; }
body.mode-systems h3 { font-size: 0.95rem; font-weight: 600; }
.lead { color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange-ink); }
body.mode-systems .eyebrow { color: var(--accent); }
.small { font-size: 0.86rem; color: var(--muted); }

/* Blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.guide { background: var(--accent-tint); border-radius: 12px; padding: 14px 16px; }
.guide ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
body.mode-systems .guide { border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; color: #ffffff; font-size: 0.92rem; }
.nudge { background: var(--warm); border-left: 3px solid var(--orange); border-radius: 0 10px 10px 0; padding: 10px 14px; font-size: 0.93rem; }
body.mode-systems .nudge { border-left-color: var(--orange-ink); font-family: var(--mono); font-size: 0.84rem; color: #ffffff; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange-ink); background: var(--warm); padding: 4px 9px; border-radius: 999px; align-self: flex-start; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 8px; }
label { font-weight: 600; font-size: 0.95rem; }
body.mode-systems label { font-family: var(--mono); font-weight: 400; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
textarea, input[type="text"], input[type="email"], input[type="time"] {
    width: 100%; background: var(--field); border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink);
    padding: 12px 14px; font: inherit; resize: vertical; transition: border-color 0.2s;
}
body.mode-systems textarea, body.mode-systems input { font-family: var(--mono); font-size: 0.9rem; border-width: 1px; }
textarea:focus, input:focus { outline: none; border-color: var(--accent); }
::placeholder { color: var(--muted); opacity: 0.75; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.92rem; color: var(--muted); }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
body.mode-systems .check { text-transform: none; letter-spacing: 0; font-size: 0.85rem; }

/* Sliders */
.rating { display: flex; flex-direction: column; gap: 6px; }
.rating-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rating-q { display: block; margin-top: 4px; font-family: var(--body); font-size: 0.98rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.rating-val { font-family: var(--display); font-size: 1.25rem; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
body.mode-systems .rating-val { font-size: 0.9rem; }
.rating-ends { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 2px 0 0; height: 28px; }

/* Buttons */
.btn {
    width: 100%; background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent); border-radius: 12px;
    padding: 15px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: opacity 0.2s, transform 0.1s;
}
body.mode-systems .btn { font-family: var(--mono); font-size: 0.86rem; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 8px; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.75; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.warm { background: linear-gradient(90deg, var(--orange), var(--orange-2)); border-color: transparent; color: #1a0b02; }
.btn.done { background: var(--good); border-color: var(--good); color: var(--on-accent); }
.btn.danger { background: transparent; color: #d04a2a; border-color: #d04a2a; }
.btn.small { width: auto; padding: 9px 14px; font-size: 0.9rem; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* Choices */
.choices { display: grid; gap: 10px; }
.choice {
    text-align: left; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer;
    display: grid; gap: 3px; transition: border-color 0.2s, background 0.2s;
}
.choice:hover, .choice.selected { border-color: var(--accent); background: var(--accent-tint); }
.choice b { font-weight: 700; }
.choice small { color: var(--muted); font-size: 0.88rem; }

/* Thinking style check */
.quiz-dots { display: flex; gap: 6px; }
.quiz-dots span { flex: 1; height: 4px; border-radius: 4px; background: var(--accent-tint); }
.quiz-dots span.done, .quiz-dots span.now { background: var(--orange); }
.quiz-dots span.now { opacity: 0.6; }
body.mode-systems .quiz-dots span.done, body.mode-systems .quiz-dots span.now { background: var(--accent); }

/* Info bubble (Systems mode): plain-language meaning */
.h-tip { display: flex; align-items: flex-start; gap: 10px; }
.h-tip h1 { flex: 1; min-width: 0; }
.tip-btn { flex: none; width: 26px; height: 26px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--accent); background: transparent; color: var(--accent); font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 0.95rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.tip-btn[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); }
.tip-text { background: var(--accent-tint); border-radius: 10px; padding: 12px 14px; font-family: var(--body); font-size: 0.98rem; line-height: 1.5; color: var(--ink); margin-top: -6px; }
.tip-text b { font-weight: 700; }

/* Rating buttons: a number plus a description */
.scale-label { font-weight: 600; font-size: 0.95rem; }
body.mode-systems .scale-label { font-family: var(--mono); font-weight: 400; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.scale { display: grid; gap: 8px; }
.scale-opt { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 10px; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.scale-opt:hover { border-color: var(--accent); }
.scale-opt .n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 1.3rem; background: var(--accent-tint); color: var(--accent); font-variant-numeric: tabular-nums; }
.scale-opt .tx { display: grid; gap: 1px; min-width: 0; }
.scale-opt .tx b { font-weight: 700; }
.scale-opt .tx small { color: var(--muted); font-size: 0.86rem; line-height: 1.35; }
.num-strip { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; margin-top: 4px; }
.num { min-width: 0; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--line); background: var(--field); color: var(--ink); font-family: var(--display); font-size: 1.05rem; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0; display: grid; place-items: center; }
.num.odd { font-size: 0.85rem; color: var(--muted); transform: scale(0.86); }
.num:hover { border-color: var(--accent); }
.num.selected { border-color: var(--accent); background: var(--accent); color: var(--on-accent); transform: none; }
body.mode-guide .num.selected { background: linear-gradient(135deg, var(--orange), var(--orange-2)); color: #1a0b02; border-color: var(--orange); }
body.mode-systems .num { border-radius: 6px; font-family: var(--mono); font-size: 0.85rem; }
.num-ends { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
.num-read { min-height: 1.3em; font-weight: 700; color: var(--accent); }
.anchors .scale-opt { padding: 6px 12px 6px 8px; grid-template-columns: 34px 1fr; }
.anchors .scale-opt .n { width: 34px; height: 34px; font-size: 1.05rem; }
.anchors { gap: 6px; }
.scale-opt.selected { border-color: var(--accent); background: var(--accent-tint); }
.scale-opt.selected .n { background: var(--accent); color: var(--on-accent); }
body.mode-guide .scale-opt.selected .n { background: linear-gradient(135deg, var(--orange), var(--orange-2)); color: #1a0b02; }
body.mode-systems .scale-opt { border-radius: 8px; }
body.mode-systems .scale-opt .n { border-radius: 8px; font-size: 1rem; font-weight: 600; }

/* Breathing pulse while choosing the new belief */
.align-breath { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.align-breath .orb-wrap { width: 84px; height: 84px; }
.align-breath .orb { width: 84px; height: 84px; }
.align-echo { font-family: var(--display); font-size: 1.05rem; line-height: 1.35; color: var(--accent); overflow-wrap: anywhere; }
body.mode-systems .align-echo { font-size: 0.9rem; }
.align-breath .btn { justify-self: start; }

/* Finding the belief */
.area-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.area-grid .choice { min-height: 64px; align-content: center; }
.belief-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 0 12px 12px 0; padding: 12px 16px; display: grid; gap: 4px; }
.belief-card p { font-family: var(--display); font-size: 1.15rem; line-height: 1.3; overflow-wrap: anywhere; }
.belief-card.big { padding: 16px 18px; gap: 6px; }
.belief-card.big p { font-size: 1.45rem; }
.belief-card.big p.surface { font-size: 1.1rem; color: var(--muted); }
body.mode-systems .belief-card { border-left-color: var(--accent); }
body.mode-systems .belief-card p { font-size: 0.98rem; color: #ffffff; }
body.mode-systems .belief-card.big p { font-size: 1.1rem; }
body.mode-systems .belief-card.big p.surface { font-size: 0.92rem; color: var(--muted); }
.choice.selected b::before { content: "✓ "; color: var(--accent); }

/* Mode cards (onboarding) */
.mode-card { text-align: left; border-radius: 16px; padding: 18px; cursor: default; display: grid; gap: 8px; border: 2px solid transparent; }
.mode-card.sys { background: #041d35; color: #e2e8f0; font-family: var(--mono); font-size: 0.82rem; }
.mode-card.sys .k { color: #00f0ff; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; }
.mode-card.sys .t { color: #ffffff; font-size: 1rem; font-weight: 600; }
.mode-card.sys .sample { color: #8fa6bd; }
.mode-card.hum { background: var(--surface); border-color: var(--line); }
.mode-card.hum .k { font-family: var(--mono); color: var(--orange-ink); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; }
.mode-card.hum .t { font-family: "Marcellus", Georgia, serif; font-size: 1.3rem; }
.mode-card.hum .sample { color: var(--muted); font-style: italic; }
.mode-card:hover { border-color: var(--orange); }

/* Breathing */
.breath { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.orb-wrap { width: 96px; height: 96px; display: grid; place-items: center; }
.orb { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--orange-2), var(--orange)); transform: scale(0.5); transition-property: transform; transition-timing-function: ease-in-out; }
body.mode-systems .orb { background: transparent; border: 2px solid var(--accent); box-shadow: 0 0 22px var(--accent-tint), inset 0 0 18px var(--accent-tint); }
.breath-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.breath-cue { font-family: var(--display); font-size: 1.25rem; line-height: 1.25; }
body.mode-systems .breath-cue { font-size: 0.95rem; color: #ffffff; }
.breath-time { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* Action timer */
.timer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.clock { font-family: var(--display); font-size: 1.6rem; color: var(--accent); font-variant-numeric: tabular-nums; }
body.mode-systems .clock { font-size: 1.1rem; }
.clock.finished { color: var(--good); }
.plan-row { display: grid; grid-template-columns: 4.4em 1fr; gap: 10px; align-items: center; }
.plan-row span { font-weight: 700; color: var(--accent); }
body.mode-systems .plan-row span { font-family: var(--mono); font-weight: 400; font-size: 0.85rem; }

/* Summary */
.summary { display: grid; gap: 14px; }
.s-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.s-old { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.s-new { font-family: var(--display); font-size: 1.2rem; color: var(--accent); line-height: 1.3; overflow-wrap: anywhere; }
body.mode-systems .s-new { font-size: 0.98rem; }
.s-val { overflow-wrap: anywhere; }
.delta { font-weight: 600; }
.live-card { border-left: 3px solid var(--orange); }
.live-card h3 { margin: 0; }
.live-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.live-channels { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 0.93rem; }
body.mode-systems .live-card { border-left-color: var(--accent); }

/* Home */
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
body.mode-guide .hero-card { background: linear-gradient(160deg, var(--surface), var(--accent-tint)); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.stat b { font-family: var(--display); font-size: 1.5rem; font-weight: 400; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
body.mode-systems .stat b { font-size: 1.15rem; font-weight: 600; }
.stat span { font-size: 0.76rem; color: var(--muted); line-height: 1.3; }
.recent { display: grid; gap: 4px; }

/* History */
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px 10px; }
.chart-card svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; padding-left: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hist-list { display: grid; gap: 10px; }
.hist-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; text-align: left; cursor: pointer; width: 100%; }
.hist-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.8rem; color: var(--muted); font-family: var(--mono); }
.hist-new { font-family: var(--display); font-size: 1.05rem; overflow-wrap: anywhere; }
body.mode-systems .hist-new { font-size: 0.9rem; color: var(--accent); }
.hist-detail { display: grid; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.hist-detail > span { display: grid; gap: 2px; }
.hist-detail .s-label { display: block; }
.empty { text-align: center; padding: 30px 18px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

/* Sessions (booking) */
.price-list { display: grid; gap: 10px; }
.price { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.price { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; border-width: 2px; transition: border-color 0.2s; }
.price:hover { border-color: var(--orange-2); }
.price.selected { border-color: var(--orange); background: var(--warm); }
body.mode-systems .price.selected { border-color: var(--accent); }
.price b { font-family: var(--display); font-weight: 400; font-size: 1.5rem; color: var(--accent); font-variant-numeric: tabular-nums; }
body.mode-systems .price b { font-size: 1.05rem; font-weight: 600; }
.price span { font-size: 0.82rem; color: var(--muted); display: block; }
.price .pkg-bonus { color: var(--ink); margin-top: 4px; font-size: 0.8rem; }
.email-line { font-family: var(--mono); font-size: 0.92rem; user-select: all; overflow-wrap: anywhere; }
.flow { display: grid; gap: 8px; padding-left: 20px; color: var(--muted); }
.flow b { color: var(--ink); font-weight: 700; }

/* Settings */
.set-group { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.row-sub { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; font-family: var(--body); text-transform: none; letter-spacing: 0; }
.set-row .v { color: var(--muted); font-size: 0.9rem; text-align: right; }
.set-row .chev { color: var(--muted); }
.toggle { position: relative; width: 50px; height: 30px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background 0.2s; pointer-events: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #ffffff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.toggle input:checked + span { background: var(--good); }
.toggle input:checked + span::after { transform: translateX(20px); }
.set-title { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0 4px; margin-bottom: -8px; }
.crisis { border: 2px solid var(--orange); }
.phone { font-weight: 700; white-space: nowrap; color: var(--ink); }

/* Tab bar */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tabbar-inner { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tabbar-h); }
.tab { background: none; border: none; cursor: pointer; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--accent); }
body.mode-systems .tab { font-family: var(--mono); font-weight: 400; font-size: 0.66rem; letter-spacing: 0.04em; text-transform: uppercase; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Watermark: the butterfly mark, faint and fixed behind the screens */
.watermark { position: fixed; left: 50%; top: calc(50% - (var(--tabbar-h) + env(safe-area-inset-bottom, 0px)) / 2); transform: translate(-50%, -50%); width: min(78vw, 420px); height: auto; opacity: 0.06; pointer-events: none; user-select: none; z-index: 5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .watermark { opacity: 0.08; } }
:root[data-theme="dark"] .watermark { opacity: 0.08; }
body.mode-systems .watermark { opacity: 0.07; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 0.9rem; z-index: 30; max-width: calc(100% - 32px); text-align: center; }

@media (prefers-reduced-motion: reduce) {
    .screen { animation: none; }
    .orb { transition: none !important; }
    .progress span { transition: none; }
}

/* Body rating colours: each number carries its own colour (--c) and text colour (--t).
   The number someone chooses fills with its colour and gets an orange ring. */
body .body-rating .num { border-color: var(--c); border-width: 2px; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--ink); }
body .body-rating .num.odd { background: color-mix(in srgb, var(--c) 12%, transparent); }
body .body-rating .num.selected { background: var(--c); border-color: var(--c); color: var(--t); transform: scale(1.08); box-shadow: 0 0 0 3px var(--bg, #072b4d), 0 0 0 6px #f57c3b; }
body .body-rating .num-read { display: flex; align-items: center; gap: 8px; color: var(--ink); }
body .body-rating .num-read:not(:empty)::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #f57c3b; flex: none; }
body .body-rating .scale-opt { border-left: 6px solid var(--c); }
body .body-rating .scale-opt .n { background: color-mix(in srgb, var(--c) 22%, transparent); border: 2px solid var(--c); color: var(--ink); }
body .body-rating .scale-opt.selected { border-color: #f57c3b; border-left-color: var(--c); background: color-mix(in srgb, #f57c3b 10%, var(--field)); box-shadow: 0 0 0 1px #f57c3b; }
body .body-rating .scale-opt.selected .n { background: var(--c); color: var(--t); }

/* Optional "where did I learn this?" box on the Examine step: closed by default */
.src-box { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 8px; }
.src-box summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.src-box[open] summary { margin-bottom: 4px; }
.src-care { border-left: 3px solid var(--line); padding-left: 10px; }
.src-help { opacity: 0.85; }
body.mode-systems .src-box { border-radius: 8px; }
.src-own { font-weight: 600; color: var(--accent); margin: 0; }
