/* Starlit. Class names all start with "sl-" and avoid words that Safari
   content blockers and "Hide Distracting Items" commonly target. */

@font-face { font-family: "Cormorant"; src: url(../fonts/cormorant-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(../fonts/cormorant-600.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(../fonts/cormorant-500-italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(../fonts/figtree-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(../fonts/figtree-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(../fonts/figtree-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #EEF1F7;
  --paper: #F8F9FC;
  --ink: #1D2245;
  --ink-2: #4E5480;
  --ink-3: #7C82A8;
  --line: #D6DAE8;
  --gold: #A97C22;
  --gold-soft: #EADCB4;
  --gold-glow: rgba(201, 158, 60, 0.28);
  --rose: #B3505A;
  --blue: #3C6CAD;
  --ok: #3E7D5A;
  --fire: #C2552F;
  --earth: #5B7D43;
  --air: #A07E16;
  --water: #2D6BA3;
  --wheel-bg: #F8F9FC;
  --wheel-ring: #E6E9F3;
  --scrim: rgba(18, 22, 51, 0.38);
  --shadow: 0 10px 30px rgba(29, 34, 69, 0.14);
  --serif: "Cormorant", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", -apple-system, system-ui, sans-serif;
  --glyph: "Starlit Glyphs", "Apple Symbols", "Segoe UI Symbol", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-h: 62px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121633; --paper: #1A1F45; --ink: #ECE9F7; --ink-2: #AEB0D2; --ink-3: #7F83AE; --line: #2C3263;
    --gold: #E3C278; --gold-soft: #4A4330; --gold-glow: rgba(227, 194, 120, 0.25);
    --rose: #E3808A; --blue: #86ABE6; --ok: #7CC79B;
    --fire: #F08B5E; --earth: #9DC47F; --air: #E3C35C; --water: #72B2EA;
    --wheel-bg: #161B3D; --wheel-ring: #1F2550; --scrim: rgba(5, 7, 20, 0.55); --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121633; --paper: #1A1F45; --ink: #ECE9F7; --ink-2: #AEB0D2; --ink-3: #7F83AE; --line: #2C3263;
  --gold: #E3C278; --gold-soft: #4A4330; --gold-glow: rgba(227, 194, 120, 0.25);
  --rose: #E3808A; --blue: #86ABE6; --ok: #7CC79B;
  --fire: #F08B5E; --earth: #9DC47F; --air: #E3C35C; --water: #72B2EA;
  --wheel-bg: #161B3D; --wheel-ring: #1F2550; --scrim: rgba(5, 7, 20, 0.55); --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  overscroll-behavior-y: none;
  transition: background-color .35s ease, color .35s ease;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.sl-g { font-family: var(--glyph); font-variant-emoji: text; font-weight: 400; line-height: 1; }

/* ---------- layout ---------- */
#sl-root { min-height: 100%; }
.sl-view {
  max-width: 600px; margin: 0 auto;
  padding: calc(var(--safe-top) + 18px) 20px calc(var(--dock-h) + var(--safe-bottom) + 28px);
  animation: sl-in .32s cubic-bezier(.2, .7, .2, 1);
}
.sl-view.sl-noDock { padding-bottom: calc(var(--safe-bottom) + 28px); }
@keyframes sl-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sl-back-anim { animation: sl-inBack .3s cubic-bezier(.2, .7, .2, 1); }
@keyframes sl-inBack { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

.sl-top { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-bottom: 6px; }
.sl-top h1 { flex: 1; margin: 0; }
.sl-iconbtn {
  width: 40px; height: 40px; border-radius: 20px; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--ink-2);
}
.sl-iconbtn:active { background: var(--line); }
.sl-iconbtn svg { width: 22px; height: 22px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: .005em; line-height: 1.15; }
h1 { font-size: 36px; }
h2 { font-size: 26px; margin: 34px 0 10px; }
h3 { font-size: 21px; margin: 24px 0 8px; }
h4 { font-size: 19px; margin: 20px 0 6px; }
h5 { font: 600 12.5px/1.3 var(--sans); color: var(--gold); margin: 0 0 4px; letter-spacing: .02em; }
p { margin: 0 0 12px; }
.sl-lede { font-family: var(--serif); font-size: 21px; line-height: 1.4; color: var(--ink-2); font-style: italic; }
.sl-muted { color: var(--ink-3); font-size: 14px; }
.sl-small { font-size: 14px; color: var(--ink-2); }
.sl-rule { height: 1px; background: var(--line); border: 0; margin: 22px 0; }

.sl-list { padding: 0; margin: 8px 0 14px; list-style: none; }
.sl-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.sl-list li:last-child { border-bottom: 0; }

.sl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 14px; }
.sl-two > div { min-width: 0; }
.sl-two p { font-size: 14.5px; line-height: 1.5; margin: 0; }
.sl-two > div:first-child { padding-right: 14px; border-right: 1px solid var(--line); }
@media (max-width: 340px) { .sl-two { grid-template-columns: 1fr; } .sl-two > div:first-child { border-right: 0; padding-right: 0; } }

/* ---------- buttons ---------- */
.sl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 24px; border: 0;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 16px;
  transition: transform .12s ease, opacity .2s;
}
.sl-btn:active { transform: scale(.97); }
.sl-btn[disabled] { opacity: .35; }
.sl-btn.sl-quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.sl-btn.sl-goldbtn { background: var(--gold); color: #fff; }
:root[data-theme="dark"] .sl-btn.sl-goldbtn { color: #1a1d3b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sl-btn.sl-goldbtn { color: #1a1d3b; } }
.sl-btn.sl-wide { width: 100%; }
.sl-linkbtn { background: none; border: 0; padding: 6px 0; color: var(--gold); font-weight: 600; }

/* ---------- dock (tab bar) ---------- */
.sl-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 6px 8px calc(var(--safe-bottom) + 4px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
}
.sl-dock button {
  flex: 1; max-width: 96px; border: 0; background: none; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px;
  font-size: 11px; font-weight: 500; letter-spacing: .01em;
}
.sl-dock button svg { width: 25px; height: 25px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.sl-dock button[aria-current="page"] { color: var(--ink); }
.sl-dock button[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); color: var(--gold); }
.sl-hidden { display: none !important; }

/* ---------- today ---------- */
.sl-date { color: var(--ink-3); font-size: 14px; margin: 0; }
.sl-sky { display: grid; grid-template-columns: 84px 1fr; gap: 18px; align-items: center; margin: 18px 0 6px; }
.sl-moon { width: 84px; height: 84px; }
.sl-sky h2 { margin: 0 0 4px; font-size: 27px; }
.sl-sky p { margin: 0; color: var(--ink-2); font-size: 15px; }
.sl-events { margin: 14px 0 0; padding: 0; list-style: none; }
.sl-events li { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.sl-events .sl-when { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 13.5px; padding-top: 1px; }
.sl-events .sl-what .sl-g { color: var(--gold); margin: 0 1px; }

.sl-pod {
  margin: 26px -4px 0; padding: 20px 20px 18px; border-radius: 22px;
  background: var(--paper); border: 1px solid var(--line);
}
.sl-pod h3 { margin: 0 0 2px; }
.sl-pod .sl-kicker { color: var(--ink-3); font-size: 13.5px; margin: 0 0 12px; }
.sl-bigglyph { font-family: var(--glyph); font-size: 40px; color: var(--gold); line-height: 1; float: right; margin: -2px 0 6px 12px; }
.sl-prompt { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink-2); margin: 12px 0 0; }

.sl-next { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; background: none; padding: 0; }
.sl-next .sl-ring { flex: none; width: 52px; height: 52px; }
.sl-next .sl-nt { flex: 1; }
.sl-next .sl-nt b { display: block; font-family: var(--serif); font-size: 21px; font-weight: 600; }
.sl-next .sl-nt span { color: var(--ink-3); font-size: 14px; }

/* ---------- learn ---------- */
.sl-unit { margin-top: 28px; }
.sl-unit header { display: flex; align-items: baseline; gap: 10px; }
.sl-unit .sl-un { font-family: var(--serif); font-size: 44px; line-height: .9; color: var(--gold); font-weight: 500; min-width: 30px; }
.sl-unit h2 { margin: 0; font-size: 25px; }
.sl-unit .sl-ub { color: var(--ink-3); font-size: 14px; margin: 4px 0 10px 40px; }
.sl-lessons { list-style: none; margin: 0 0 0 40px; padding: 0; }
.sl-lessons li button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 0; background: none; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.sl-lessons li:last-child button { border-bottom: 0; }
.sl-lessons .sl-dot { width: 22px; height: 22px; flex: none; border-radius: 11px; border: 1.5px solid var(--line); display: grid; place-items: center; }
.sl-lessons .sl-done .sl-dot { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.sl-lessons .sl-current .sl-dot { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-glow); }
.sl-lessons .sl-locked { opacity: .45; }
.sl-lessons .sl-lt { flex: 1; font-size: 16px; }
.sl-future { opacity: .5; }

/* ---------- lesson player ---------- */
.sl-lesson { display: flex; flex-direction: column; min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 46px); }
.sl-progress { display: flex; gap: 5px; margin: 8px 0 18px; }
.sl-progress i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background .3s; }
.sl-progress i.sl-on { background: var(--gold); }
.sl-card { flex: 1; touch-action: pan-y; }
.sl-card.sl-enter { animation: sl-cardIn .34s cubic-bezier(.2, .7, .2, 1); }
.sl-card.sl-enterBack { animation: sl-cardBack .34s cubic-bezier(.2, .7, .2, 1); }
@keyframes sl-cardIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes sl-cardBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.sl-card h2 { margin-top: 4px; }
.sl-card .sl-body { font-size: 17px; line-height: 1.6; }
.sl-card .sl-body .sl-g { color: var(--gold); font-size: 1.15em; }
.sl-cardnav { display: flex; gap: 10px; padding: 18px 0 calc(var(--safe-bottom) + 8px); position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.sl-cardnav .sl-btn { flex: 1; }
.sl-yours { border-top: 2px solid var(--gold); padding-top: 4px; }
.sl-yours .sl-g { color: var(--gold); }
.sl-reveal summary { color: var(--gold); font-weight: 600; cursor: pointer; padding: 8px 0; }

.sl-opts { display: grid; gap: 10px; margin: 16px 0; }
.sl-opt {
  text-align: left; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--paper); font-size: 16px; transition: border-color .2s, background .2s, transform .12s;
}
.sl-opt:active { transform: scale(.985); }
.sl-opt.sl-glyphopt { font-family: var(--glyph); font-size: 32px; text-align: center; padding: 10px; }
.sl-opts.sl-glyphs { grid-template-columns: repeat(4, 1fr); }
.sl-opt.sl-right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--paper)); }
.sl-opt.sl-wrong { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 10%, var(--paper)); animation: sl-shake .35s; }
@keyframes sl-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.sl-why { padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--paper); border-radius: 0 12px 12px 0; font-size: 15px; animation: sl-in .3s; }
.sl-promptglyph { font-family: var(--glyph); font-size: 64px; text-align: center; color: var(--gold); margin: 10px 0; }

.sl-finish { text-align: center; padding-top: 12vh; }
.sl-finish .sl-burst { width: 160px; height: 160px; margin: 0 auto 10px; display: block; }
.sl-finish h1 { font-size: 38px; }

/* ---------- wheel ---------- */
.sl-wheelwrap { position: relative; margin: 6px -10px 0; }
.sl-wheel { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.sl-wheel text { font-family: var(--sans); }
.sl-wheel .sl-wg { font-family: var(--glyph); }
.sl-wheel .sl-hit { fill: transparent; cursor: pointer; }
.sl-wheel .sl-seg { cursor: pointer; transition: fill-opacity .2s; }
.sl-wheel .sl-asp { pointer-events: none; transition: stroke-width .2s, opacity .2s; }
.sl-wheel .sl-asphit { stroke: transparent; stroke-width: 12; cursor: pointer; }
.sl-wheel .sl-pt text { transition: transform .2s; }
.sl-wheel .sl-mark circle.sl-halo { fill: var(--gold-glow); stroke: var(--gold); stroke-width: 1.2; }
.sl-wheel .sl-pulse { animation: sl-pulse 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sl-pulse { 50% { opacity: .45; } }
.sl-wheel.sl-draw .sl-zring { animation: sl-spin 1.1s cubic-bezier(.2, .8, .2, 1); transform-origin: 200px 200px; }
.sl-wheel.sl-draw .sl-pts { animation: sl-fade .9s .45s both; }
.sl-wheel.sl-draw .sl-asps { animation: sl-fade .8s .9s both; }
@keyframes sl-spin { from { transform: rotate(-70deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sl-fade { from { opacity: 0; } to { opacity: 1; } }

.sl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.sl-chip {
  border: 1.5px solid var(--line); background: transparent; border-radius: 18px; padding: 6px 12px; font-size: 14px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.sl-chip[aria-pressed="true"] { border-color: var(--gold); color: var(--ink); background: var(--gold-glow); }
.sl-chip .sl-g { font-size: 16px; color: var(--gold); }

.sl-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sl-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sl-table tr { cursor: pointer; }
.sl-table td.sl-gc { width: 30px; font-family: var(--glyph); font-size: 20px; color: var(--gold); text-align: center; }
.sl-table td.sl-num { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sl-switcher { display: flex; gap: 8px; overflow-x: auto; margin: 4px -20px 6px; padding: 2px 20px 6px; scrollbar-width: none; }
.sl-switcher::-webkit-scrollbar { display: none; }
.sl-switcher .sl-chip { flex: none; }
.sl-note { font-size: 14px; color: var(--ink-2); padding: 10px 14px; border: 1px dashed var(--line); border-radius: 14px; margin: 10px 0; }

/* ---------- drawer (bottom sheet) ---------- */
.sl-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; opacity: 0; transition: opacity .28s; }
.sl-scrim.sl-open { opacity: 1; }
.sl-drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 26px 26px 0 0; box-shadow: var(--shadow);
  padding: 10px 22px calc(var(--safe-bottom) + 26px);
  transform: translateY(105%); transition: transform .36s cubic-bezier(.2, .8, .2, 1);
  max-width: 640px; margin: 0 auto;
}
.sl-drawer.sl-open { transform: none; }
.sl-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sl-drawer h2 { margin: 6px 0 4px; }
.sl-drawer .sl-head { display: flex; gap: 14px; align-items: center; }
.sl-drawer .sl-head .sl-hg { font-family: var(--glyph); font-size: 44px; color: var(--gold); line-height: 1; min-width: 44px; text-align: center; }
.sl-drawer .sl-head .sl-hg.sl-txt { font-family: var(--serif); font-size: 34px; }
.sl-kw { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.sl-kw span { font-size: 13px; color: var(--ink-2); padding: 3px 10px; border-radius: 12px; background: var(--bg); }
.sl-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; margin: 14px 0; }
.sl-facts dt { color: var(--ink-3); }
.sl-facts dd { margin: 0; }
.sl-related { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- library ---------- */
.sl-search { width: 100%; padding: 12px 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--paper); font-size: 16px; margin: 6px 0 4px; }
.sl-search:focus { border-color: var(--gold); outline: none; }
.sl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 10px 0; }
.sl-tile {
  border: 1px solid var(--line); background: var(--paper); border-radius: 18px; padding: 12px 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13.5px;
  transition: transform .12s;
}
.sl-tile:active { transform: scale(.96); }
.sl-tile .sl-tg { font-family: var(--glyph); font-size: 28px; color: var(--gold); line-height: 1.1; height: 32px; display: grid; place-items: center; }
.sl-tile .sl-tg.sl-txt { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.sl-entry-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 4px; }
.sl-entry-head .sl-eg { font-family: var(--glyph); font-size: 58px; color: var(--gold); line-height: 1; }
.sl-entry-head .sl-eg.sl-txt { font-family: var(--serif); font-size: 46px; font-weight: 600; }
.sl-entry-head h1 { margin: 0; }
.sl-concepts { list-style: none; padding: 0; margin: 8px 0; }
.sl-concepts button { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 0; font-size: 16px; display: flex; justify-content: space-between; }
.sl-concepts button span { color: var(--ink-3); font-size: 14px; }

/* ---------- practice ---------- */
.sl-q { font-family: var(--serif); font-size: 25px; line-height: 1.25; font-weight: 600; margin: 8px 0 4px; min-height: 64px; }
.sl-score { display: flex; gap: 4px; margin: 4px 0 8px; }
.sl-score i { width: 9px; height: 9px; border-radius: 5px; background: var(--line); }
.sl-score i.sl-y { background: var(--ok); }
.sl-score i.sl-n { background: var(--rose); }
.sl-score i.sl-now { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.sl-feedback { min-height: 56px; font-size: 15px; }
.sl-feedback .sl-ok { color: var(--ok); font-weight: 600; }
.sl-feedback .sl-no { color: var(--rose); font-weight: 600; }

/* ---------- mastery map ---------- */
.sl-mgroup h3 { display: flex; justify-content: space-between; align-items: baseline; }
.sl-mgroup h3 span { font: 500 14px var(--sans); color: var(--ink-3); }
.sl-mgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sl-mtile { position: relative; aspect-ratio: 1; display: grid; place-items: center; border: 0; background: none; padding: 0; }
.sl-mtile svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sl-mtile .sl-mg { position: relative; font-family: var(--glyph); font-size: 21px; color: var(--ink-2); }
.sl-mtile .sl-mg.sl-txt { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.sl-mtile.sl-full .sl-mg { color: var(--gold); }
.sl-mtile.sl-lockd { opacity: .32; }
.sl-techs { list-style: none; padding: 0; margin: 0; }
.sl-techs li { display: grid; grid-template-columns: 1fr 90px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.sl-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sl-bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }

/* ---------- forms ---------- */
.sl-field { margin: 16px 0; }
.sl-field label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.sl-input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--paper); font-size: 17px;
}
.sl-input:focus { border-color: var(--gold); outline: none; }
.sl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sl-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.sl-results { list-style: none; margin: 6px 0 0; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.sl-results:empty { display: none; }
.sl-results button { width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.sl-results li:last-child button { border-bottom: 0; }
.sl-results button small { display: block; color: var(--ink-3); font-size: 13px; }
.sl-check { padding: 14px 16px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); font-size: 15px; margin: 14px 0; }
.sl-check b { font-variant-numeric: tabular-nums; }
.sl-check.sl-warn { border-color: var(--gold); }
.sl-err { color: var(--rose); font-size: 14px; margin-top: 6px; }

/* ---------- settings ---------- */
.sl-set { list-style: none; padding: 0; margin: 6px 0 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.sl-set li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.sl-set li:last-child { border-bottom: 0; }
.sl-set li > button.sl-rowbtn { all: unset; flex: 1; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.sl-seg-ctl { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 3px; }
.sl-seg-ctl button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; font-size: 14px; color: var(--ink-2); }
.sl-seg-ctl button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.sl-toggle { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; transition: background .2s; border: 0; margin: 0; }
.sl-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.sl-toggle:checked { background: var(--gold); }
.sl-toggle:checked::after { transform: translateX(20px); }

.sl-diag { font-size: 14px; }
.sl-diag li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sl-diag .sl-st-ok { color: var(--ok); }
.sl-diag .sl-st-bad { color: var(--rose); }
.sl-diag .sl-st-warn { color: var(--gold); }
.sl-diag code { font-size: 12.5px; color: var(--ink-2); word-break: break-all; }

.sl-toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + var(--safe-bottom) + 18px); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 20px; font-size: 14.5px; z-index: 60;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: 86vw; text-align: center;
}
.sl-toast.sl-open { opacity: 1; transform: translate(-50%, 0); }

/* ---------- setup ---------- */
.sl-welcome { text-align: left; padding-top: 10vh; }
.sl-welcome .sl-star { font-size: 54px; line-height: 1; display: block; margin-bottom: 18px; }
.sl-welcome h1 { font-size: 46px; margin: 0 0 12px; }
.sl-loading { display: grid; place-items: center; min-height: 70vh; color: var(--ink-3); }
.sl-loading svg { width: 64px; height: 64px; animation: sl-turn 2.4s linear infinite; color: var(--gold); }
@keyframes sl-turn { to { transform: rotate(360deg); } }

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