/* One style for every mantra; each mantra sets the variables below. */
@font-face { font-family: 'Jomolhari'; src: url('fonts/Jomolhari-Regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'EB Garamond'; font-weight: 500; font-display: swap; src: url('fonts/EBGaramond-Medium-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-weight: 500; font-display: swap; src: url('fonts/EBGaramond-Medium-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'EB Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url('fonts/EBGaramond-MediumItalic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url('fonts/EBGaramond-MediumItalic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --accent: #d4a55a;
  --muted: #a89a7a;
  --text: #f0ead6;
  --glow: #f0ead6;
  --bg0: #182136; --bg1: #0d1424; --bg2: #0a0f1a;
  --panel: rgba(13, 19, 33, 0.72);
  --line: color-mix(in srgb, var(--accent) 18%, transparent);
  --ui: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg2); color: var(--text);
  font-family: var(--ui); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button { font: inherit; color: inherit; }
.bo { font-family: 'Jomolhari', serif; }

/* ── the night behind the garland ─────────────────────────────────────── */
#bg { position: fixed; inset: 0; background: radial-gradient(circle at 50% 44%, var(--bg0) 0%, var(--bg1) 48%, var(--bg2) 78%); }
body[data-bg="black"] #bg { background: #000; }
body[data-bg="stars"] #bg { background: radial-gradient(circle at 50% 44%, var(--bg1) 0%, #05070d 70%); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* the canvas is opaque and draws the sky itself; #bg shows only while it loads */
body:not(.ready) #scene { visibility: hidden; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; font: 64px 'Jomolhari', serif;
  color: var(--text); opacity: 0.35; transition: opacity 0.6s; pointer-events: none; }
body.ready #loading { opacity: 0; }

/* ── bars ─────────────────────────────────────────────────────────────── */
.chrome { position: fixed; left: 0; right: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding-left: calc(12px + var(--safe-l)); padding-right: calc(12px + var(--safe-r));
  transition: opacity 0.35s, transform 0.35s; }
.chrome.top { top: 0; padding-top: calc(12px + var(--safe-t)); gap: 6px; }
.chrome.bottom { bottom: 0; padding-bottom: calc(14px + var(--safe-b)); justify-content: center; flex-wrap: nowrap; gap: 8px; }
body.bare .chrome { opacity: 0; pointer-events: none; }
body.bare .chrome.top { transform: translateY(-8px); }
body.bare .chrome.bottom { transform: translateY(8px); }
.spacer { flex: 1; min-width: 0; }

.icon, .pill { height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.icon { flex: none; width: 44px; padding: 0; display: inline-grid; place-items: center; font-size: 20px; line-height: 1; }
.icon.text { font-size: 12px; letter-spacing: 0.12em; font-weight: 600; width: auto; padding: 0 14px; }
.icon svg, .pill svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon circle { fill: var(--panel); }

/* the syllable at the front, at the side of the screen (as in the Ngöndro app) */
.readout { position: fixed; z-index: 9; left: calc(14px + var(--safe-l)); top: 50%; transform: translateY(-50%);
  min-width: 96px; max-width: 34vw; padding: 10px 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; pointer-events: none; text-align: center; }
#readTib { font-size: 30px; line-height: 1.5; color: var(--accent); min-height: 1.5em; }
#readPho { font-family: 'EB Garamond', Georgia, serif; font-style: italic; font-weight: 500; font-size: 22px; letter-spacing: 0.02em; color: var(--text); min-height: 1.2em; }
@media (max-width: 520px) and (orientation: portrait) {
  .readout { top: auto; bottom: calc(140px + var(--safe-b)); transform: none; padding: 6px 12px 8px; }
  #readTib { font-size: 24px; }
  #readPho { font-size: 19px; }
}
body.bare .readout { opacity: 0.85; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 14px; color: var(--text); }
#pickerBtn { padding-left: 12px; max-width: calc(100% - 64px); min-width: 0; flex: 0 1 auto; flex-shrink: 1; }
#pickerBtn #seedBtn { font-size: 22px; color: var(--accent); line-height: 1; transform: translateY(2px); }
#pickerBtn #nameBtn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pickerBtn svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.round { width: 52px; height: 52px; border-radius: 26px; color: var(--accent); }
#playBtn .play, #playBtn[aria-pressed="true"] .pause { display: none; }
#playBtn[aria-pressed="true"] .play { display: block; fill: currentColor; stroke: none; }
#periodBtn { color: var(--text); font-variant-numeric: tabular-nums; font-size: 15px; cursor: pointer; }
.pace-button { min-width: 82px; justify-content: center; font-variant-numeric: tabular-nums; }
#periodBtn.pace-button { height: 44px; background: var(--panel); border: 1px solid var(--line); }
.count { font-variant-numeric: tabular-nums; gap: 5px; min-width: 0; font-size: 13px; }
.count .sep { color: var(--muted); }
.count #countMala { color: var(--accent); }
.count.manual { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
#countBtn, #tapBtn { padding: 0 12px; }
.flash { animation: flash 0.35s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 45%, var(--panel)); } }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── sheets: from the bottom on a phone, from the side when there is room ─ */
#scrim { position: fixed; inset: 0; z-index: 19; background: rgba(4, 6, 12, 0.35); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
body.sheet-open #scrim { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; max-height: 84dvh; display: flex; flex-direction: column;
  background: rgba(10, 15, 26, 0.94); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding-bottom: var(--safe-b); }
@media (min-width: 760px) {
  .sheet { left: auto; top: 0; bottom: 0; width: 380px; max-height: none; border-top: 0; border-left: 1px solid var(--line);
    border-radius: 0; padding-top: var(--safe-t); padding-right: var(--safe-r); }
}
/* the mantra menu opens on the left, under its button; the settings keep the right */
#picker { left: 0; right: auto; top: 0; bottom: 0; width: min(360px, 88vw); max-height: none; border-top: 0;
  border-right: 1px solid var(--line); border-radius: 0 16px 16px 0; padding-top: var(--safe-t); padding-left: var(--safe-l); }
@media (min-width: 760px) { #picker { border-left: 0; border-radius: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.sheet-head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sheet-close { width: 44px; height: 44px; font-size: 24px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 24px; -webkit-overflow-scrolling: touch; }

.group { padding: 0; border-bottom: 1px solid color-mix(in srgb, var(--accent) 10%, transparent); }
.group:last-child { border-bottom: 0; }
.group > summary { min-height: 52px; padding: 16px 4px; color: var(--text); cursor: pointer; font-size: 14px; }
.group-body { padding: 6px 2px 12px; }
.group summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.conditional { border: 0; padding: 0; margin: 0; min-width: 0; }
.row { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.row.disabled { opacity: 0.4; pointer-events: none; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.value { font-size: 13px; color: var(--text); opacity: 0.85; font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; line-height: 1.45; color: var(--muted); opacity: 0.85; }
.row-head .hint { font-size: 12px; }
.num { width: 92px; height: 44px; padding: 0 8px; text-align: right; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04); color: var(--text); font: 16px var(--ui); font-variant-numeric: tabular-nums; }
.toggle { flex-direction: row; justify-content: space-between; align-items: center; min-height: 44px; gap: 12px; cursor: pointer; }
.toggle .label { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--text); }
.toggle input { appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 24px; border-radius: 12px; margin: 0;
  background: rgba(255, 255, 255, 0.12); position: relative; cursor: pointer; transition: background 0.2s; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text); transition: transform 0.2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); background: var(--bg2); }

.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-height: 44px; padding: 6px 4px; border-radius: 8px; cursor: pointer; font-size: 13px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); }
.seg button.bo { font-size: 16px; }
.seg button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); }
.steps { display: flex; gap: 6px; }
.step, .wide { flex: 1; min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  color: var(--text); cursor: pointer; font-size: 13px; font-variant-numeric: tabular-nums; touch-action: manipulation; }
.wide { width: 100%; margin: 2px 0 10px; }
.wide.quiet { color: var(--muted); }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: color-mix(in srgb, var(--text) 22%, transparent); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); margin-top: -8px; border: none; }
input[type=range]::-moz-range-track { height: 2px; background: color-mix(in srgb, var(--text) 22%, transparent); border-radius: 2px; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: none; }
input:disabled, button:disabled { cursor: default; }

/* ── the mantra menu ──────────────────────────────────────────────────── */
.mantra { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; margin: 0 0 6px; text-align: left; cursor: pointer;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); background: rgba(255, 255, 255, 0.02); }
.mantra[aria-current="true"] { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.mantra .seed { font-size: 30px; color: var(--accent); width: 42px; text-align: center; line-height: 1.2; flex: none; }
.mantra .names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mantra .name { font-size: 15px; color: var(--text); }
.mantra .tib { font-size: 14px; color: var(--accent); opacity: 0.85; }
.mantra .sub { font-size: 12px; color: var(--muted); }
.mantra:not([aria-current=true]) .sub { display: none; }

#toast { position: fixed; left: 50%; bottom: calc(136px + var(--safe-b)); transform: translate(-50%, 8px); z-index: 30;
  max-width: calc(100vw - 32px); text-align: center; padding: 10px 16px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .chrome { gap: 6px; }
  .chrome.bottom { gap: 6px; }
  .pill { padding: 0 12px; }
  #periodBtn { min-width: 66px; font-size: 14px; }
}

/* the phase of the offering lights, under the top bar */
.phase { position: fixed; z-index: 9; left: 50%; top: calc(66px + var(--safe-t)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 14px 8px; min-width: 200px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; pointer-events: none; text-align: center; }
#phaseName { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
#phaseName::before { content: '↑ '; }
.phase[data-phase="return"] #phaseName::before, .phase[data-phase="beings"] #phaseName::before { content: '↓ '; }
#phaseHint { font-size: 12px; color: var(--muted); }
.phase-track { width: 100%; height: 2px; margin-top: 4px; background: color-mix(in srgb, var(--text) 14%, transparent); border-radius: 1px; overflow: hidden; }
#phaseBar { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
body.bare .phase { opacity: 0.7; }

[hidden] { display: none !important; }
.settings-tabs { display: flex; gap: 4px; position: sticky; top: -4px; z-index: 2;
  background: #0a0f1a; padding: 8px 0 14px; margin-bottom: 10px; }
.settings-tabs button { flex: 1; min-height: 44px; padding: 8px 5px; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.settings-tabs button[aria-selected=true] { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--text); border-color: var(--accent); }
.vajra-views { top: calc(66px + var(--safe-t)); left: 50%; right: auto; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 24px); padding: 4px; gap: 2px; border: 1px solid var(--line);
  background: var(--panel); border-radius: 24px; }
.vajra-views button { min-height: 40px; border: 0; border-radius: 20px; padding: 0 14px; background: transparent;
  color: var(--muted); font-size: 13px; cursor: pointer; }
.vajra-views button[aria-pressed=true] { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }
body.has-vajra .phase { top: calc(122px + var(--safe-t)); }
body.bare .vajra-views { opacity: 0; pointer-events: none; }
@media (max-width: 360px) {
  .chrome.bottom { gap: 5px; padding-left: calc(8px + var(--safe-l)); padding-right: calc(8px + var(--safe-r)); }
  .round { width: 44px; height: 44px; }
  .pace-button { padding: 0 10px; }
  #countBtn, #tapBtn { padding: 0 9px; }
}
@media (max-height: 500px) { .sheet { max-height: 96dvh; } }
@media (orientation: landscape) and (min-width: 480px) {
  .vajra-views { top: calc(12px + var(--safe-t)); }
  body.has-vajra .top #pickerBtn { max-width: calc((100vw - 290px) / 2); }
  body.has-vajra .phase { top: calc(66px + var(--safe-t)); }
}

/* Welcome: the live Vajra Guru scene sits between a quiet title and one way in. */
a:focus-visible, summary:focus-visible, [role=tab]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
a { color: inherit; }
.donate-link { text-decoration: none; }
.donate-link:hover { color: var(--text); }
body.welcome .chrome, body.welcome #readout, body.welcome #phase { visibility: hidden; pointer-events: none; }
#welcome { position: fixed; inset: 0; z-index: 12; overflow-y: auto; overscroll-behavior: contain; padding: calc(20px + var(--safe-t)) calc(24px + var(--safe-r)) calc(20px + var(--safe-b)) calc(24px + var(--safe-l)); }
.welcome-tabs { display: flex; justify-content: center; gap: 30px; }
.welcome-tabs button { background: none; border: 0; border-bottom: 1px solid transparent; padding: 12px 2px; min-height: 44px; font: 12px var(--ui); letter-spacing: .08em; color: var(--muted); cursor: pointer; }
.welcome-tabs button[aria-selected=true] { color: var(--text); border-color: var(--accent); }
#explorePanel { min-height: 580px; height: calc(100svh - 154px - var(--safe-t) - var(--safe-b)); display: flex; flex-direction: column; justify-content: space-between; text-align: center; pointer-events: none; }
.welcome-heading { padding-top: clamp(20px, 4vh, 52px); }
.eyebrow { font: 10px/1.6 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.welcome-heading h1 { font: 500 clamp(48px, 7vw, 82px)/.95 'EB Garamond', Georgia, serif; margin: 18px 0; letter-spacing: -.025em; color: #f6e8ea; }
.welcome-heading h1 span { display: block; font-size: .36em; letter-spacing: .16em; line-height: 1.9; text-transform: uppercase; }
.welcome-lede { font: 500 clamp(17px, 2vw, 21px)/1.5 'EB Garamond', Georgia, serif; color: #c99aa4; margin: 0; }
.welcome-entry { pointer-events: auto; margin: 0 auto; max-width: 520px; padding-top: 12px; }
.preview-caption { font: 9px/1.6 var(--ui); letter-spacing: .22em; color: #c99aa4; margin: 0 0 7px; }
.preview-caption span { padding: 0 6px; }
.welcome-mantra { font: 500 clamp(18px, 2.5vw, 24px)/1.45 'EB Garamond', Georgia, serif; color: #f6e8ea; margin: 0 0 18px; }
.enter-button { display: block; min-height: 48px; min-width: 208px; max-width: 100%; margin: 0 auto; padding: 12px 28px; border: 1px solid #ef7f9666; border-radius: 28px; background: linear-gradient(130deg, #ef7f961c, #ef7f9608); color: #f6e8ea; font: 13px/1.5 var(--ui); letter-spacing: .07em; cursor: pointer; transition: background .2s, border-color .2s; }
.enter-button:hover { background: #ef7f9628; border-color: #ef7f96; }
.enter-button:disabled { cursor: wait; opacity: .65; }
.text-button { min-height: 44px; border: 0; background: none; color: var(--muted); padding: 8px 12px; font: 11px/1.5 var(--ui); cursor: pointer; }
.text-button:hover { color: var(--text); }
.small-note { font: 10px/1.6 var(--ui); color: #c99aa4; margin: 0; }
.welcome-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 22px; padding-top: 14px; font: 10px/1.5 var(--ui); color: var(--muted); }
.welcome-foot a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; }
.welcome-foot a span { font-size: 20px; }
#offlineStatus { display: inline-flex; align-items: center; min-height: 30px; }
#installInvite { display: flex; align-items: center; gap: 12px; max-width: 590px; margin: 12px auto 0; padding: 12px 14px; background: #111a2b; border: 1px solid var(--line); border-radius: 16px; }
#installInvite strong { font: 500 18px 'EB Garamond', Georgia, serif; }
#installInvite p { font: 11px/1.5 var(--ui); color: var(--muted); margin: 4px 0 0; }
#installInvite .pill { white-space: nowrap; font-size: 12px; }
#installInvite > div { flex: 1; }
#guidePanel { max-width: 640px; margin: 20px auto 0; padding: 24px clamp(16px, 4vw, 40px); border: 1px solid var(--line); border-radius: 20px; background: #0a0f1af5; }
.guide-content { font: 500 18px/1.6 'EB Garamond', Georgia, serif; color: var(--text); }
.guide-content h2 { font-weight: 500; font-size: 34px; line-height: 1.15; margin: 10px 0 20px; }
.guide-content h3 { font: 600 11px/1.5 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 28px 0 10px; }
.guide-content p { margin: 10px 0 16px; }
.guide-content strong { font-weight: 500; color: var(--accent); }
#guidePanel .guide-enter { margin-top: 28px; }
.shortcut-list { display: grid; grid-template-columns: 70px 1fr; gap: 10px 14px; font: 12px/1.6 var(--ui); }
.shortcut-list dt { color: var(--accent); }
.shortcut-list dd { margin: 0; }
body.welcome-guide #scene { filter: blur(5px); opacity: .35; }
body.scene-failed #loading { opacity: .15; }
body.scene-failed #loadStatus { max-width: 360px; margin: 16px auto; color: var(--text); }
/* The sheet controller keeps the labelled controls inert while help is open. */
body.help-open #scene { filter: blur(5px); opacity: .45; }
body.help-open #scrim { background: #05091175; }
#controlHelp { inset: 0; width: auto; max-height: none; padding: 0; border: 0; border-radius: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#helpLabels { pointer-events: none; }
.help-chip { position: absolute; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #0a0f1a; color: var(--text); font: 10px/14px var(--ui); white-space: nowrap; }
.help-line { position: absolute; width: 1px; background: color-mix(in srgb, var(--accent) 50%, transparent); }
.help-center { margin: auto; padding: 16px; text-align: center; max-width: 440px; }
.help-center h2 { font: 500 32px/1.2 'EB Garamond', Georgia, serif; margin: 14px 0; }
.help-center p:not(.eyebrow) { color: var(--muted); font: 13px/1.7 var(--ui); margin: 0 0 24px; }
.help-center .pill { width: auto; min-width: 110px; font-size: 12px; margin: 4px; }
@media (min-width: 760px) { #guide { width: min(540px, 65vw); } }
@media (max-width: 520px) {
  .chrome.top { gap: 4px; }
  #pickerBtn { padding: 0 9px; gap: 5px; }
  #pickerBtn #seedBtn { display: none; }
  .chrome.top .spacer { display: none; }
  #pickerBtn { flex: 1; }
  #welcome { padding-left: calc(18px + var(--safe-l)); padding-right: calc(18px + var(--safe-r)); }
  #explorePanel { min-height: 530px; }
  .welcome-heading { padding-top: 24px; }
  .welcome-lede { max-width: 260px; margin: auto; }
  .welcome-foot { gap: 0 12px; }
  #installInvite { gap: 6px; flex-wrap: wrap; }
  #installInvite > div { flex-basis: calc(100% - 56px); }
  #installInvite .pill { order: 3; width: 100%; justify-content: center; }
}
@media (max-height: 650px) and (min-width: 600px) {
  #explorePanel { min-height: 270px; height: calc(100svh - 142px); flex-direction: row; align-items: center; gap: 40%; }
  .welcome-heading, .welcome-entry { flex: 1; min-width: 0; padding-top: 0; }
  .welcome-heading h1 { font-size: 48px; }
  .welcome-heading .eyebrow, .welcome-lede, .welcome-entry .small-note { display: none; }
  .welcome-mantra { font-size: 17px; }
  .enter-button { min-width: 0; width: 100%; padding: 12px; }
  .help-center { max-width: 440px; }
  .help-center .eyebrow { display: none; }
  .help-center h2 { font-size: 24px; margin: 4px 0 10px; }
  .help-center p:not(.eyebrow) { font-size: 12px; margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .enter-button, .chrome, #loading, #toast, #scrim { transition: none; }
}
#installInvite { position: fixed; z-index: 16; bottom: calc(136px + var(--safe-b)); left: calc(16px + var(--safe-l)); right: calc(16px + var(--safe-r)); box-shadow: 0 12px 48px #0006; }
body.welcome #installInvite { display: none; }
body.sheet-open #installInvite { visibility: hidden; }
@media (max-height: 700px) and (max-width: 599px) {
  .welcome-lede { display: none; }
  .welcome-heading { padding-top: 14px; }
}

/* Two frequently used choices, available without opening a sheet. */
.quick-controls { bottom: calc(78px + var(--safe-b)); justify-content: center; gap: 10px; }
#phoneticsBtn { font-size: 12px; padding: 0 12px; }
#phoneticsBtn > span { font: 500 19px 'EB Garamond', Georgia, serif; }
#phoneticsBtn[aria-pressed=true] { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.camera-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 23px; padding: 2px; background: var(--panel); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.camera-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 62px; border: 0; border-radius: 20px; padding: 0 12px; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.camera-switch button[aria-pressed=true] { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }
.camera-switch svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
@media (orientation: landscape) and (max-height: 500px) and (min-width: 480px) {
  .quick-controls { left: 0; right: auto; bottom: calc(14px + var(--safe-b)); }
  .chrome.bottom { left: auto; right: 0; }
}

@media (orientation: landscape) and (max-height: 500px) and (min-width: 480px) and (max-width: 699px) {
  .quick-controls { flex-direction: column; align-items: stretch; gap: 6px; }
  .camera-switch { justify-content: center; }
  #phoneticsBtn { justify-content: center; }
}
@media (max-height: 500px) {
  .help-center h2, .help-center p { display: none; }
}
