/* Upheld — all visual decisions live in these tokens; restyle by editing them.
   Colour has meaning: chartreuse = goals hit / the main action, lilac = data and calm,
   apricot heat = training, olive = kept, rust = broken, amber = needs attention. */

@font-face { font-family: 'Instrument Serif'; src: url('../fonts/InstrumentSerif-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/InstrumentSerif-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/Manrope-Variable.ttf') format('truetype'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../fonts/DMMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../fonts/DMMono-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  /* ground & ink */
  --bg: #FBFAF6;
  --text: #221D33;
  --text-2: #4A4560;
  --muted: #5C566E;
  /* surfaces: frosted glass over the glow */
  --surface: rgba(255, 255, 255, 0.68);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --surface-2: rgba(34, 29, 51, 0.05);
  --edge: rgba(255, 255, 255, 0.95);
  --border: rgba(34, 29, 51, 0.07);
  --shadow: 0 1px 2px rgba(60, 40, 110, 0.04), 0 14px 34px rgba(110, 82, 224, 0.08);
  /* brand */
  --lime: #E4F070;
  --lime-deep: #C8DB36;
  --violet: #5B41C9;
  --violet-2: #6E52E0;
  --lilac: #DECDFB;
  --lilac-soft: rgba(222, 205, 251, 0.6);
  --accent: var(--violet);
  /* meaning */
  --good: #4C6414;
  --good-bg: rgba(228, 240, 112, 0.5);
  --warning: #8A5A0E;
  --warning-bg: rgba(217, 154, 43, 0.15);
  --critical: #A63E26;
  --critical-bg: rgba(166, 62, 38, 0.09);
  --spark: #9A82EE;
  /* glow colours (screens set --glow 0–1 and data-glow on <html>) */
  --glow: 0.4;
  --glow-lime: #EDF59A;
  --glow-corner: #FFD9C9;
  --glow-lilac: #DECDFB;
  --glow-lilac-low: #E7DCFB;
  /* shape & type */
  --radius: 22px;
  --radius-sm: 16px;
  --serif: 'Instrument Serif', Georgia, serif;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, monospace;
}
/* training heat: chartreuse + apricot (live workout, finish, Train after a session) */
:root[data-glow='heat'] {
  --glow-corner: #FFC79A;
  --glow-lilac: #FFD3AE;
  --glow-lilac-low: #FFDDBF;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  /* the ground warms toward chartreuse as the glow rises */
  background: color-mix(in oklab, #FAF8FD, #FBFCEB calc(var(--glow) * 100%));
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.02; letter-spacing: -0.015em; }
h1 em, .serif em { font-style: italic; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 10px; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 8px; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; word-break: break-all; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }

/* ---------------------------------------------------------------- glow background */
.glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(56px); transition: opacity 1.2s ease, background-color 1.2s ease, transform 1.2s ease; }
.blob-lime      { width: 135vw; height: 78vw; max-width: 760px; max-height: 440px; left: -38vw; top: -24vw; background: var(--glow-lime);
                  opacity: calc(0.3 + 0.7 * var(--glow)); transform: rotate(-24deg) scale(calc(0.75 + 0.5 * var(--glow))); transform-origin: 30% 30%; }
.blob-corner    { width: 66vw; height: 56vw; max-width: 380px; max-height: 320px; right: -18vw; top: -14vw; background: var(--glow-corner); opacity: calc(0.45 + 0.5 * var(--glow)); }
.blob-lilac     { width: 92vw; height: 140vw; max-width: 520px; max-height: 800px; right: -24vw; top: 30vh; background: var(--glow-lilac);
                  opacity: calc(1 - 0.7 * var(--glow)); transform: rotate(28deg); }
.blob-lime-mid  { width: 88vw; height: 66vw; max-width: 500px; max-height: 380px; left: -42vw; top: 44vh; background: var(--glow-lime);
                  opacity: calc(1 * var(--glow)); transform: rotate(-30deg); }
.blob-lilac-low { width: 135vw; height: 66vw; max-width: 760px; max-height: 380px; left: -16vw; bottom: -22vw; background: var(--glow-lilac-low);
                  opacity: calc(1 - 0.7 * var(--glow)); transform: rotate(-12deg); }
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.12; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) { .blob { transition: none; } }

/* ---------------------------------------------------------------- layout */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(128px + env(safe-area-inset-bottom));
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.page-head .head-actions { display: flex; align-items: center; gap: 8px; }
.eyebrow, .section-title {
  font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.eyebrow { margin: 0 0 6px; }
.section-title { margin: 26px 4px 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* round icon button used for the profile / settings entry */
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.6); border: 1px solid var(--edge); color: var(--text);
  text-decoration: none; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- cards */
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 12px;
  color: inherit;
  text-decoration: none;
}
.card.highlight { border: 1.5px solid rgba(110, 82, 224, 0.45); background: var(--surface-strong); }
.card.banner { background: linear-gradient(135deg, rgba(237, 245, 154, 0.75), rgba(255, 255, 255, 0.72)); display: flex; flex-direction: column; gap: 2px; }
.card.banner span { color: var(--text-2); font-size: 14px; }
.card.error { background: var(--critical-bg); color: var(--critical); border-color: transparent; box-shadow: none; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.row + .row { border-top: 1px solid var(--border); }
.card > .row:first-child h2 { margin-bottom: 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  appearance: none;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: 14px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible, .chip:focus-visible, .tabbar a:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; }
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: default; }
.btn.primary {
  background: var(--lime); border-color: rgba(255, 255, 255, 0.9); color: var(--text);
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(160, 175, 40, 0.22);
}
.btn.danger { color: var(--critical); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn.primary.small { font-size: 11px; }
.btn.block { width: 100%; margin-bottom: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row.end { justify-content: flex-end; }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin-left: auto; }
.file-btn { position: relative; }
.sticky-actions {
  position: sticky;
  bottom: calc(104px + env(safe-area-inset-bottom));
  justify-content: flex-end;
  padding: 12px 0;
}

/* ---------------------------------------------------------------- badges */
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); color: var(--text-2); white-space: nowrap; }
.badge.tone-good { background: var(--good-bg); color: var(--good); }
.badge.tone-warning { background: var(--warning-bg); color: var(--warning); }
.badge.tone-critical { background: var(--critical-bg); color: var(--critical); }

/* ---------------------------------------------------------------- Today */
.today-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-top: 6px; }
.today-head > div { display: flex; flex-direction: column; gap: 3px; }
.dateline { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.wordmark { font-family: var(--serif); font-size: 22px; line-height: 1; letter-spacing: -0.01em; }
.wordmark em { font-style: italic; }
.headline { margin: 28px 0 0; font-size: 42px; line-height: 1; letter-spacing: -0.015em; }
.headline-sub { margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.today-actions:empty { display: none; }
.today-actions { margin: 18px 0 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn.go { min-height: 46px; padding: 0 20px 0 18px; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.btn.go.white { background: #fff; box-shadow: 0 8px 22px rgba(140, 150, 30, 0.18); }
.btn .arrow { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.quiet-link { background: none; border: 0; padding: 10px 0; font: inherit; font-size: 14px; font-weight: 650; color: var(--violet); text-decoration: none; cursor: pointer; }
.goal-dots { display: flex; align-items: center; gap: 5px; }
.goal-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(34, 29, 51, 0.18); }
.goal-dots i.on { background: var(--lime); }
.goal-dots span { margin-left: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }

.steps-card { margin: 26px 0 12px; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.steps-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.steps-num { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.steps-num .big { font-size: 46px; font-weight: 300; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.steps-num .of { font-size: 14px; color: var(--muted); }
.pace-chip { margin-top: 2px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); font-size: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
button.pace-chip { border: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--violet); cursor: pointer; }
.pace-chip.good { background: var(--lime); color: #3E5A12; }
.pace-chip.behind { color: var(--critical); }
.pace-track { position: relative; height: 26px; }
.pace-track .rail, .pace-track .fill { position: absolute; left: 0; top: 0; height: 8px; border-radius: 4px; }
.pace-track .rail { right: 0; background: rgba(34, 29, 51, 0.07); }
.pace-track .fill { background: linear-gradient(90deg, #C9B5F7 0%, #D9E86A 100%); }
.pace-track .fill.done { background: linear-gradient(90deg, #D9E86A 0%, var(--lime-deep) 100%); }
.pace-track .marker { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; border-radius: 1px; background: var(--text); }
.pace-track .marker-label { position: absolute; top: 15px; transform: translateX(-50%); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { min-height: 104px; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--edge); display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; }
.stat-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 400; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value .unit { margin-left: 4px; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.stat-side { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.stat-side.up { color: var(--violet); }
.stat-side.muted { font-weight: 500; }
.stat-foot { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.stat-foot svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat.stale .stat-value { opacity: 0.45; }
.stat .spark { width: 100%; height: 22px; }

.notice { width: 100%; font: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; margin: 18px 0 0; padding: 12px 14px; border-radius: 18px; background: var(--surface-strong); border: 1px solid var(--edge); color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.notice > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--text-2); min-width: 0; }
.notice strong { font-size: 14px; color: var(--text); }
.notice .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--violet-2); }
.notice .dot.lime { background: var(--lime-deep); }
.notice.warn .dot { background: #D99A2B; }
.notice-cta { flex: none; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet); }
.notice + .notice { margin-top: 8px; }

.week-link { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 14px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--edge); color: var(--text); text-decoration: none; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------------------------------------------------------------- tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--edge); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-value { font-size: 28px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .spark { margin-top: 6px; width: 100%; }
.delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.up-good { color: var(--violet); }
.up-bad { color: var(--critical); }

/* ---------------------------------------------------------------- meters */
.progress-item { padding: 4px 0 10px; }
.progress-item .row { padding: 0 0 6px; border: 0; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #C9B5F7 0%, #D9E86A 100%); }
.meter-fill.tone-good { background: var(--lime-deep); }
.meter-fill.tone-warning { background: #D99A2B; }

/* ---------------------------------------------------------------- review */
.verdict { display: flex; align-items: center; gap: 16px; }
.verdict h2 { margin: 0 0 2px; }
.verdict p { margin: 0; color: var(--text-2); }
.verdict-score { font-family: var(--serif); font-size: 52px; line-height: 1; letter-spacing: -0.02em; }
.verdict-score span { font-size: 24px; color: var(--muted); }
.verdict.tone-good { background: linear-gradient(135deg, rgba(237, 245, 154, 0.8), rgba(255, 255, 255, 0.7)); }
.verdict.tone-good h2 { color: var(--good); }
.verdict.tone-warning h2 { color: var(--warning); }
.verdict.tone-critical h2 { color: var(--critical); }

.statements { list-style: none; margin: 0; padding: 0; }
.statements li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.statements li + li { border-top: 1px solid var(--border); }
.statements .icon {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; margin-top: 1px;
  background: var(--surface-2); color: var(--text-2);
}
.statements .tone-good .icon { background: var(--lime); color: var(--text); }
.statements .tone-warning .icon { background: var(--warning-bg); color: var(--warning); }
.statements .tone-critical .icon { background: transparent; color: var(--critical); box-shadow: inset 0 0 0 1.5px var(--critical); }
.coach { white-space: normal; color: var(--text); margin: 0; }
.suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.suggestion { justify-content: flex-start; white-space: normal; text-align: left; border-radius: var(--radius-sm); }
.plan { list-style: none; margin: 0 0 8px; padding: 0; }
.plan li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; }
.plan li + li { border-top: 1px solid var(--border); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: right; padding: 8px 4px; border-top: 1px solid var(--border); }
.table thead th { border-top: 0; font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.table th[scope='row'] { text-align: left; font-weight: 600; }

/* ---------------------------------------------------------------- training */
.ex-list { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.history-item { padding: 8px 0; }
.history-item + .history-item { border-top: 1px solid var(--border); }
.history-item summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.history-item summary::-webkit-details-marker { display: none; }
.history-item[open] { padding-bottom: 12px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  appearance: none; border: 1px solid rgba(34, 29, 51, 0.14); background: rgba(255, 255, 255, 0.5); color: var(--muted);
  border-radius: 999px; min-width: 44px; min-height: 44px; font-family: var(--mono); font-size: 12px; cursor: pointer;
}
.chip.on { background: var(--lime); border-color: transparent; color: var(--text); font-weight: 500; }

input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(34, 29, 51, 0.12); border-radius: 14px; padding: 10px 14px; width: 100%; min-height: 44px;
}
input::placeholder, textarea::placeholder { color: #8A8499; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violet-2); outline-offset: 1px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field.inline input, .field.inline select { width: 140px; flex: none; }
details summary { cursor: pointer; color: var(--text-2); font-weight: 650; font-size: 14px; margin: 12px 0 8px; }

.ex-edit .ex-name { font-weight: 650; margin-bottom: 10px; }
.ex-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ex-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 650; }

.set-head, .set-row { display: grid; grid-template-columns: 28px 1fr 1fr 48px; gap: 8px; align-items: center; }
.set-head { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 8px 0 4px; }
.set-row { margin-bottom: 8px; }
.set-row input { text-align: center; font-weight: 650; }
.set-row.done input { background: rgba(228, 240, 112, 0.45); border-color: transparent; }
.check { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(34, 29, 51, 0.25); background: transparent; color: var(--muted); font-size: 16px; font-weight: 800; cursor: pointer; }
.check.on { background: var(--lime); border-color: transparent; color: var(--text); }

.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin-bottom: 6px; }

/* ---------------------------------------------------------------- chrome */
.tabbar {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 10;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  height: 64px; padding: 0 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.72); border: 1px solid var(--edge);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 1px 2px rgba(60, 40, 110, 0.05), 0 16px 40px rgba(110, 82, 224, 0.14);
}
.tabbar a {
  width: 56px; height: 48px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none;
  transition: background-color 0.2s ease;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { background: var(--lime); color: var(--text); }
.tabbar a.active svg { stroke-width: 2.1; }
body.no-tabbar .tabbar { display: none; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--surface-strong); color: var(--text); border: 1px solid var(--edge);
  padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 650; max-width: calc(100% - 32px);
  box-shadow: 0 12px 30px rgba(60, 40, 110, 0.18);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
