:root {
  --r: 28px;
  --blur: blur(28px) saturate(180%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --good: #5ef0b4;
  --bad: #ff7a9c;
}

/* Escuro (padrão): preto de verdade, vidro grafite, sem cor no fundo */
:root, [data-theme=dark] {
  color-scheme: dark;
  --bg: #000;
  --text: #f5f5f7;
  --ink: 245, 245, 247;              /* traços, trilhos e grades: rgba(var(--ink), a) */
  --muted: rgba(235, 235, 245, .58);
  --edge: rgba(255, 255, 255, .2);
  --edge-soft: rgba(255, 255, 255, .08);
  --well: rgba(255, 255, 255, .06);  /* campos e trilhos "afundados" */
  --well-strong: rgba(255, 255, 255, .1);
  --glass-top: rgba(255, 255, 255, .1);
  --glass-bottom: rgba(255, 255, 255, .035);
  --glass-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  --accent: #0a84ff;
  --them: #64d2ff;
  --blob-1: #2c2c34; --blob-2: #1d2433; --blob-3: #26262c; --blob-alpha: .9;
  --brand-1: #3a3a44; --brand-2: #1c1c21; --brand-3: #55555f;
  --primary-bg: linear-gradient(180deg, #fff, #e6e6ea);
  --primary-fg: #000;
  --primary-glow: rgba(255, 255, 255, .12);
  --toast: rgba(40, 40, 46, .75);
}

/* Claro: vidro branco, manchas em tom pastel */
[data-theme=light] {
  color-scheme: light;
  --bg: #f1eef9;
  --text: #17122b;
  --ink: 23, 18, 43;
  --muted: rgba(23, 18, 43, .56);
  --edge: rgba(23, 18, 43, .18);
  --edge-soft: rgba(23, 18, 43, .08);
  --well: rgba(23, 18, 43, .06);
  --well-strong: rgba(23, 18, 43, .1);
  --glass-top: rgba(255, 255, 255, .72);
  --glass-bottom: rgba(255, 255, 255, .38);
  --glass-shadow: 0 10px 40px rgba(60, 40, 120, .13);
  --accent: #6b4dff;
  --them: #e0409a;
  --blob-1: #b7a0ff; --blob-2: #ffb1d0; --blob-3: #93e6dc; --blob-alpha: .8;
  --brand-1: #7b52ff; --brand-2: #ff5fa2; --brand-3: #14c4b4;
  --primary-bg: linear-gradient(180deg, #2a2148, #17122b);
  --primary-fg: #fff;
  --primary-glow: rgba(90, 60, 200, .3);
  --toast: rgba(255, 255, 255, .85);
}

/* Verde: noite de esmeralda e lima */
[data-theme=green] {
  color-scheme: dark;
  --bg: #04110b;
  --text: #fff;
  --ink: 255, 255, 255;
  --muted: rgba(225, 255, 235, .62);
  --edge: rgba(200, 255, 220, .26);
  --edge-soft: rgba(200, 255, 220, .10);
  --well: rgba(0, 0, 0, .25);
  --well-strong: rgba(0, 0, 0, .33);
  --glass-top: rgba(220, 255, 230, .15);
  --glass-bottom: rgba(220, 255, 230, .04);
  --glass-shadow: 0 10px 40px rgba(0, 0, 0, .3);
  --accent: #9ef0a8;
  --them: #ffcf5c;
  --blob-1: #0f8a4f; --blob-2: #86d13b; --blob-3: #0a6b70; --blob-alpha: .7;
  --brand-1: #0f9a55; --brand-2: #8fd93f; --brand-3: #0fa3a3;
  --primary-bg: linear-gradient(180deg, rgba(240,255,244,.96), rgba(205,245,218,.9));
  --primary-fg: #08261a;
  --primary-glow: rgba(60, 210, 120, .4);
  --toast: rgba(8, 40, 24, .65);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 var(--font);
  transition: background-color .4s, color .4s;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: 30px; margin: 4px 4px 18px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- fundo: manchas de cor que o vidro refrata ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: -1; }
.bg i {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--blob-alpha); transition: background .6s;
  animation: drift 28s ease-in-out infinite alternate;
}
.bg i:nth-child(1) { width: 60vmax; height: 60vmax; left: -20vmax; top: -18vmax; background: var(--blob-1); }
.bg i:nth-child(2) { width: 50vmax; height: 50vmax; right: -18vmax; top: 20vh; background: var(--blob-2); animation-delay: -9s; }
.bg i:nth-child(3) { width: 55vmax; height: 55vmax; left: 10vw; bottom: -30vmax; background: var(--blob-3); animation-delay: -17s; }
@keyframes drift {
  to { transform: translate(6vmax, -5vmax) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) { .bg i { animation: none; } }

/* ---------- vidro ---------- */
.glass {
  position: relative;
  background: linear-gradient(160deg, var(--glass-top), var(--glass-bottom) 60%);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--edge-soft);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),      /* brilho na borda de cima */
    inset 0 -1px 0 rgba(255,255,255,.06),
    var(--glass-shadow);
}
.glass::before { /* reflexo especular */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 60% at 20% 0%, rgba(255,255,255,.22), transparent 50%);
  mix-blend-mode: overlay;
}

/* ---------- layout ---------- */
#app { max-width: 480px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); }
.view { animation: rise .45s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.card { border-radius: var(--r); padding: 20px; margin-bottom: 14px; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

/* ---------- botões ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--text);
  border-radius: 999px; padding: 14px 22px;
  transition: transform .18s cubic-bezier(.3,1.6,.5,1), filter .2s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; }
.btn.primary {
  width: 100%;
  background: var(--primary-bg);
  color: var(--primary-fg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 8px 30px var(--primary-glow);
}
.btn.big { padding: 18px; font-size: 17px; margin: 6px 0 16px; }
.btn.leafy { display: flex; align-items: center; justify-content: center; gap: 9px; }
.btn.leafy::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url(leaf.svg) center / contain no-repeat; mask: url(leaf.svg) center / contain no-repeat;
}
.btn.icon { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }
.btn.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back { background: none; border: 0; color: var(--accent); font: inherit; font-size: 17px; padding: 6px 4px; cursor: pointer; margin-bottom: 6px; }

/* ---------- segmented control ---------- */
.seg {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--well); border-radius: 999px; padding: 3px; margin-bottom: 16px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.18);
}
.seg button {
  position: relative; z-index: 1; background: none; border: 0; color: var(--muted);
  font: inherit; font-weight: 600; font-size: 15px; padding: 9px; cursor: pointer; transition: color .25s;
}
.seg button.on { color: var(--text); }
.seg .thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2)); border-radius: 999px;
  background: var(--glass-top); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 10px rgba(0,0,0,.15);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .35s cubic-bezier(.3,1.3,.5,1);
}

/* ---------- campos ---------- */
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin: 0 4px 6px; }
input:not([type=range]):not([type=file]) {
  width: 100%; font: inherit; font-size: 17px; color: var(--text);
  background: var(--well); border: 1px solid var(--edge-soft); border-radius: 16px;
  padding: 13px 16px; outline: none; transition: border-color .2s, background .2s;
}
input:focus { border-color: var(--edge); background: var(--well-strong); }
input::placeholder { color: rgba(var(--ink), .35); }
.err { color: var(--bad); min-height: 1.2em; margin: 2px 4px 10px; font-size: 14px; }

.slider { display: flex; align-items: center; gap: 14px; margin: 0 4px 16px; }
.slider output { font-size: 28px; font-weight: 700; width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; background: rgba(var(--ink), .16); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; }

/* ---------- auth ---------- */
.brand { text-align: center; margin: 9vh 0 28px; }
.brand h1 { font-size: 44px; margin-top: 14px; }
.brand p { margin: 6px 0 0; }
.logo {
  width: 108px; height: 108px; margin: 0 auto; border-radius: 32px;
  background: conic-gradient(from 200deg, var(--brand-1), var(--brand-2), var(--brand-3), var(--brand-1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 12px 40px var(--primary-glow);
  position: relative; overflow: hidden;
}
.logo svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 6px rgba(40,0,80,.35)); }

/* ---------- home ---------- */
.top { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.who { flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.who strong { font-size: 20px; letter-spacing: -.02em; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; overflow: hidden; cursor: pointer; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 20px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.35), 0 6px 20px rgba(0,0,0,.3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero { display: flex; align-items: center; gap: 18px; padding: 22px; overflow: hidden; }
.hero::after { /* marca d'água */
  content: ""; position: absolute; right: -34px; bottom: -44px; width: 170px; height: 170px;
  background: var(--text); -webkit-mask: url(leaf.svg) center / contain no-repeat; mask: url(leaf.svg) center / contain no-repeat;
  opacity: .08; transform: rotate(-18deg); pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero .txt { flex: 1; min-width: 0; }
.hero .lbl { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hero .big-lvl { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin: 2px 0; }
.progress { height: 8px; border-radius: 99px; background: var(--well); overflow: hidden; margin-top: 12px; }
.progress b { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-1), var(--good)); transition: width .6s; }

.ring { position: relative; width: 108px; height: 108px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring .track { stroke: rgba(var(--ink), .12); }
.ring .val { transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 8px currentColor); }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.ring.lg { width: 200px; height: 200px; margin: 10px auto 18px; }
.ring.lg .num { font-size: 60px; }
.ring.lg circle { stroke-width: 14; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { border-radius: 22px; padding: 14px 12px; text-align: center; }
.stat b { display: block; font-size: 24px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12px; }

#chart svg { width: 100%; height: 150px; display: block; margin-top: 12px; overflow: visible; }
#chart .line { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
#chart .area { fill: url(#g); }
#chart .grid { stroke: rgba(var(--ink), .12); stroke-dasharray: 3 4; }
#chart .dot { fill: var(--text); }
#chart .line.them { stroke: var(--them); }
#chart .dot.them { fill: var(--them); }
#chart .guess { fill: none; stroke: rgba(var(--ink), .45); stroke-width: 1.5; stroke-dasharray: 4 4; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 0; border-top: 2.5px solid var(--text); vertical-align: middle; margin-right: 6px; }
.legend i.d { border-top: 1.5px dashed rgba(var(--ink), .6); }
.legend i.p { border-top-color: var(--them); }

.list-card h3 { margin-bottom: 6px; }
#list { list-style: none; margin: 0; padding: 0; }
#list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--edge-soft); }
#list li:first-child { border-top: 0; }
#list .pill {
  min-width: 48px; height: 36px; border-radius: 12px; display: grid; place-items: center; padding: 0 8px;
  font-weight: 700; font-variant-numeric: tabular-nums; color: #140b2b;
}
#list .pill.sober { background: rgba(var(--ink), .1); color: var(--muted); font-size: 12px; font-weight: 600; }
#list .meta { flex: 1; min-width: 0; }
#list .meta div { font-weight: 600; font-size: 15px; }
#list .meta small { color: var(--muted); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#list .del { background: none; border: 0; color: rgba(var(--ink), .35); font-size: 20px; cursor: pointer; padding: 4px 6px; }
#list .del:hover { color: var(--bad); }
.empty { color: var(--muted); padding: 10px 0 2px; font-size: 15px; }

/* ---------- tema ---------- */
.theme-card h3 { margin-bottom: 12px; }
.theme-card .seg { margin-bottom: 0; }
.theme-card .seg button { display: flex; align-items: center; justify-content: center; gap: 7px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.swatch.dark { background: linear-gradient(135deg, #3a3a44, #000); }
.swatch.light { background: linear-gradient(135deg, #fff, #c9b8ff); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.swatch.green { background: linear-gradient(135deg, #0f8a4f, #b6ec5c); }
[data-theme=light] .res-lvl { filter: brightness(.72) saturate(1.4); }
[data-theme=light] .ring .val { filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 50%, transparent)); }
[data-theme=light] .pad.wait, [data-theme=light] .pad.early { color: var(--text); }

/* ---------- modo casal ---------- */
#couple h3 { margin-bottom: 4px; }
#couple p { margin: 6px 0 14px; }
.center { text-align: center; }
.link { background: none; border: 0; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; padding: 4px 0; }
.pair-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-btns .btn { padding: 13px 10px; font-size: 15px; }
.code { text-align: center; font-size: 44px; font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; margin: 8px 0 2px; }
.code-input { text-align: center; font-size: 30px !important; letter-spacing: .2em; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.duo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; margin: 14px 0 10px; }
.vs { align-self: center; color: var(--muted); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.duo-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.duo-col strong { font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duo-col small { color: var(--muted); font-size: 13px; }
.duo-av {
  position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); box-shadow: 0 0 0 2px rgba(255,255,255,.3);
}
.duo-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.crown { position: absolute; top: -15px; right: -8px; font-size: 20px; transform: rotate(18deg); filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.ring.sm { width: 92px; height: 92px; margin: 6px 0 2px; }
.ring.sm .num { font-size: 28px; }
.ring.sm.empty { display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 9px rgba(var(--ink), .12); }
.ring.sm.empty .num { color: var(--muted); }
.duo-col.lead .ring { transform: scale(1.06); }
.wins { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 12px; border-radius: 18px; background: var(--well); }
.wins span { color: var(--muted); font-size: 14px; }
.wins b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.wins small { color: var(--muted); font-size: 12px; }

/* ---------- teste ---------- */
.steps { display: flex; gap: 6px; margin: 6px 0 22px; }
.steps i { flex: 1; height: 5px; border-radius: 99px; background: rgba(var(--ink), .15); transition: background .3s; }
.steps i.on { background: var(--text); }
.steps i.done { background: rgba(var(--ink), .5); }
.stage-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 4px 6px; }
.stage-h { font-size: 28px; margin: 0 4px 8px; }
.stage-p { color: var(--muted); margin: 0 4px 20px; }

.pad {
  width: 100%; aspect-ratio: 1 / 1; max-height: 58vh; border-radius: 40px; margin: 0 auto 16px;
  display: grid; place-items: center; text-align: center; font-size: 22px; font-weight: 600;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: background .08s, transform .15s;
}
.pad:active { transform: scale(.985); }
.pad.wait { background: linear-gradient(160deg, rgba(255,90,130,.30), rgba(255,90,130,.12)); }
.pad.go { background: linear-gradient(160deg, rgba(60,240,160,.85), rgba(40,200,140,.7)); color: #06291a; transition: none; }
.pad.early { background: linear-gradient(160deg, rgba(255,190,60,.4), rgba(255,160,40,.2)); }
.pad small { display: block; font-size: 15px; font-weight: 500; opacity: .75; margin-top: 6px; }

.problem { text-align: center; font-size: 56px; font-weight: 700; letter-spacing: -.03em; margin: 24px 0 8px; font-variant-numeric: tabular-nums; }
.answer { text-align: center; font-size: 40px; font-weight: 600; min-height: 56px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.answer.wrong { color: var(--bad); animation: shake .3s; }
.answer.right { color: var(--good); }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.keys button {
  height: 64px; border-radius: 22px; border: 1px solid var(--edge-soft); color: var(--text);
  font: inherit; font-size: 26px; font-weight: 500; cursor: pointer;
  background: linear-gradient(160deg, var(--glass-top), var(--glass-bottom)); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25); transition: background .1s, transform .1s;
}
.keys button:active { background: rgba(var(--ink), .2); transform: scale(.95); }
.keys .ghost { visibility: hidden; }
.counter { text-align: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Genius */
.genius-status { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: -.02em; min-height: 30px; margin: 4px 0 16px; }
.genius { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 360px; margin: 0 auto 14px; touch-action: manipulation; }
.gpad {
  aspect-ratio: 1 / 1; border-radius: 32px; border: 1px solid var(--edge-soft); cursor: pointer;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), var(--glass-shadow);
  filter: brightness(.5) saturate(.85); transition: transform .12s, box-shadow .12s, filter .12s;
  user-select: none; -webkit-user-select: none;
}
.gpad.green  { --c: #34c759; background: linear-gradient(160deg, #5be27c, #1fa647); }
.gpad.red    { --c: #ff3b30; background: linear-gradient(160deg, #ff6b61, #d9261c); }
.gpad.yellow { --c: #ffcc00; background: linear-gradient(160deg, #ffdc4d, #e0a800); }
.gpad.blue   { --c: #0a84ff; background: linear-gradient(160deg, #4aa6ff, #0466d1); }
.gpad.lit { transform: scale(1.04); filter: brightness(1.2) saturate(1.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 40px var(--c), 0 0 12px var(--c); }
.genius.watch .gpad { pointer-events: none; }
[data-theme=light] .gpad:not(.lit) { filter: brightness(.8) saturate(.55); }
.genius.good .gpad { box-shadow: 0 0 0 3px var(--good); }
.genius.bad { animation: shake .35s; }
.genius.bad .gpad { box-shadow: 0 0 0 3px var(--bad); }

/* ---------- resultado ---------- */
.res-lvl { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.res-sub { text-align: center; color: var(--muted); margin: 4px 0 20px; }
.metric { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--edge-soft); }
.metric:first-child { border-top: 0; }
.metric > span { color: var(--muted); }
.metric b { font-variant-numeric: tabular-nums; }
.metric .d { font-size: 13px; margin-left: 8px; font-weight: 600; }
.up { color: var(--bad); } .down { color: var(--good); }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: 12px 20px; border-radius: 999px; font-size: 15px; z-index: 10; animation: rise .3s;
  background: var(--toast);
}

@media (min-width: 700px) {
  #app { padding-top: 40px; }
}
