/* Gym app styles.
   Colours come from the gym: steel and chalk, with the two competition plate colours.
   Plate blue = actions and today's plan. Plate yellow = personal bests, and nothing else. */

:root {
  --bg: #e8ebef;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --ink: #12161d;
  --muted: #667085;
  --line: #dde2e8;
  --blue: #1f4bff;
  --blue-ink: #ffffff;
  --blue-soft: #e4eaff;
  --yellow: #ffc61a;
  --yellow-ink: #1f1600;
  --danger: #d92d20;
  --shadow: 0 1px 2px rgb(18 22 29 / 0.04), 0 8px 24px rgb(18 22 29 / 0.06);
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --tabbar: 76px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #171b22;
    --surface-2: #1f242d;
    --ink: #eef1f5;
    --muted: #8b95a5;
    --line: #262c36;
    --blue: #4a6cff;
    --blue-ink: #ffffff;
    --blue-soft: #1b2347;
    --yellow: #ffd23f;
    --yellow-ink: #1f1600;
    --danger: #ff6b5e;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(var(--tabbar) + env(safe-area-inset-bottom) + 32px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
body.editing .app { padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }

section { display: flex; flex-direction: column; gap: 10px; }
h1, h2, p { margin: 0; }
a { color: var(--blue); }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.loading, .empty { color: var(--muted); text-align: center; padding: 24px 12px; }
.empty { font-size: 0.95rem; }
.error-text { color: var(--danger); text-align: center; }

/* ---------- headings ---------- */
.head { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.head-date { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.section-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; padding: 0 4px; }

.back {
  align-self: flex-start;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.back::before {
  content: "";
  width: 9px;
  height: 9px;
  border-left: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
  margin-right: 2px;
}

/* ---------- grouped lists ---------- */
.group {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.group-note { color: var(--muted); font-size: 0.9rem; padding: 0 4px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  color: inherit;
  text-decoration: none;
  position: relative;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
}
.row + .row, .row-field + .row-field, .row + .row-field, .row-field + .row { box-shadow: inset 0 1px 0 var(--line); }
a.row:active, button.row:active { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.row-sub { color: var(--muted); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-value.big { font-size: 1.25rem; letter-spacing: -0.03em; }
.row-value small { font-size: 0.8rem; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.row.action { color: var(--blue); font-weight: 600; cursor: pointer; }
.row.action.strong { justify-content: center; }
.row.action.danger { color: var(--danger); }

.chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-top: 2px solid var(--muted);
  transform: rotate(45deg);
  opacity: 0.6;
  flex: none;
}

.row-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 16px;
}
.row-field > span { flex: 1; font-weight: 600; }
.row-field > span em { font-style: normal; color: var(--blue); font-weight: 600; font-size: 0.85rem; margin-left: 6px; }
.row-field.col { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 16px; }
.row-field input, .row-field select, .row-field textarea {
  border: 0;
  background: transparent;
  text-align: right;
  font: inherit;
  color: var(--muted);
  padding: 8px 0;
  min-width: 0;
  max-width: 62%;
}
.row-field select { appearance: none; -webkit-appearance: none; color: var(--blue); font-weight: 600; text-align-last: right; padding-right: 2px; cursor: pointer; }
.row-field.col textarea { text-align: left; max-width: none; color: var(--ink); resize: vertical; }
.row-field input:focus, .row-field textarea:focus, .row-field select:focus { outline: none; color: var(--ink); }
.login .row-field input { color: var(--ink); max-width: 60%; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  letter-spacing: -0.01em;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--blue); color: var(--blue-ink); }
.btn.secondary { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.ghost.quiet { color: var(--muted); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.dark { background: var(--yellow-ink); color: var(--yellow); }
.btn.wide { width: 100%; display: block; }
.btn.big { padding: 17px 22px; font-size: 1.1rem; }
.btn.small { padding: 8px 14px; font-size: 0.925rem; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.link {
  appearance: none;
  background: none;
  border: 0;
  padding: 2px 0;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  align-self: flex-start;
}

.icon-btn {
  appearance: none;
  border: 0;
  background: var(--surface-2);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }

.notice { background: var(--blue-soft); border-radius: var(--r-sm); padding: 12px 16px; font-size: 0.95rem; }
.state-msg { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; padding: 48px 16px; }

/* ---------- login ---------- */
.login { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 12vh; }
.login-mark { border-radius: 18px; }
.login form { width: 100%; margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- today: the plan panel (the one loud thing) ---------- */
.hero {
  background: var(--blue);
  color: var(--blue-ink);
  border-radius: var(--r-lg);
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  /* a barbell plate, seen side-on, in the corner */
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 34px solid rgb(255 255 255 / 0.08);
  box-shadow: inset 0 0 0 22px rgb(255 255 255 / 0.04);
  pointer-events: none;
}
.hero.rest, .hero.done { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.hero.rest::after, .hero.done::after { border-color: rgb(127 137 155 / 0.08); box-shadow: none; }
.hero-kicker { font-weight: 650; opacity: 0.75; font-size: 0.95rem; }
.hero-title { font-size: 2.6rem; font-weight: 850; letter-spacing: -0.045em; line-height: 1; max-width: 85%; }
.hero-sub { opacity: 0.85; max-width: 40ch; }
.hero.done .hero-kicker { color: var(--blue); opacity: 1; }

.hero-list { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-direction: column; }
.hero-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgb(255 255 255 / 0.18);
}
.hl-name { font-weight: 600; }
.hl-target { opacity: 0.75; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.hl-weight { text-align: right; white-space: nowrap; min-width: 64px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hl-weight small { font-size: 0.75rem; font-weight: 600; opacity: 0.75; margin-left: 1px; }
.hl-weight .up {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-size: 0.75rem;
  margin-right: 6px;
  vertical-align: 2px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.hero-actions .btn { white-space: nowrap; padding-left: 18px; padding-right: 18px; }
.btn.on-hero { background: var(--blue-ink); color: var(--blue); flex: 1; }
.btn.on-hero-ghost { background: rgb(255 255 255 / 0.14); color: var(--blue-ink); flex: 1; }
.hero.rest .btn.on-hero, .hero.done .btn.on-hero { background: var(--blue); color: var(--blue-ink); }
.hero.rest .btn.on-hero-ghost, .hero.done .btn.on-hero-ghost { background: var(--surface-2); color: var(--ink); }

/* ---------- week strip ---------- */
.week-head { display: flex; justify-content: space-between; align-items: baseline; padding-right: 4px; }
.week-head .muted { font-size: 0.9rem; font-weight: 600; }
.days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day {
  background: var(--surface);
  border-radius: 16px;
  padding: 10px 0 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: var(--shadow);
}
.day-l { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.day-n { font-weight: 750; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.day-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 3px; }
.day.planned .day-dot { box-shadow: inset 0 0 0 1.5px var(--blue); }
.day.done .day-dot { background: var(--blue); box-shadow: none; }
.day.today { background: var(--ink); color: var(--bg); }
.day.today .day-l { color: inherit; opacity: 0.7; }
.day.today.done .day-dot { background: var(--yellow); }

/* ---------- PB marker: always plate yellow ---------- */
.pb-tag {
  display: inline-grid;
  place-items: center;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 7px;
  padding: 3px 6px;
  letter-spacing: 0.02em;
  flex: none;
}
.row > .pb-tag { width: 34px; height: 34px; border-radius: 50%; font-size: 0.75rem; }

/* ---------- workout logging ---------- */
.editor-head { gap: 4px; }
.exercises { display: flex; flex-direction: column; gap: 12px; }
.ex {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 16px;
  gap: 10px;
}
.ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ex-name { font-size: 1.3rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; }
.ex-goal { color: var(--muted); font-size: 0.9rem; font-weight: 600; margin-top: 2px; }
.ex-tools { display: flex; gap: 6px; flex: none; }
.ex-foot { display: flex; justify-content: space-between; margin: 0 -8px -6px; }
.hint { color: var(--muted); font-size: 0.9rem; }
.hint strong { color: var(--ink); font-weight: 600; }
[data-hint]:empty { display: none; }
[data-hint] { display: flex; flex-direction: column; gap: 8px; }

.nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--blue-soft);
  border-radius: var(--r-sm);
  padding: 10px 10px 10px 14px;
  font-size: 0.9rem;
}
.nudge.solo { padding: 14px 16px; }
.nudge-text { flex: 1; }
.nudge-text strong { color: var(--blue); }
.nudge-btn {
  appearance: none;
  border: 0;
  background: var(--blue);
  color: var(--blue-ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 650;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
}

.sets { display: flex; flex-direction: column; gap: 6px; }
.set {
  display: grid;
  grid-template-columns: 30px 1fr 1fr 48px;
  gap: 8px;
  align-items: center;
  border-radius: 14px;
  transition: background 0.15s;
}
.set-labels { font-size: 0.8rem; color: var(--muted); font-weight: 600; text-align: center; }
.set-n { text-align: center; font-weight: 750; color: var(--muted); font-variant-numeric: tabular-nums; }
.num {
  font: inherit;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--ink);
  background: var(--surface-2);
  border: 0;
  border-radius: 12px;
  padding: 11px 4px;
  width: 100%;
  min-width: 0;
}
.num::placeholder { color: var(--muted); opacity: 0.55; }
.num:focus { outline: 2.5px solid var(--blue); outline-offset: -2.5px; }
.tick {
  appearance: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.tick svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.75; stroke-linecap: round; stroke-linejoin: round; }
.tick[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.tick:active { transform: scale(0.92); }
.set.is-done .num { background: var(--blue-soft); }
.set.is-done .set-n { color: var(--blue); }

.cardio { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-field { display: flex; flex-direction: column; gap: 4px; align-items: center; color: var(--muted); font-size: 0.85rem; font-weight: 600; }

.savebar {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  z-index: 5;
}
.savebar .btn { box-shadow: 0 10px 30px rgb(31 75 255 / 0.35); }

/* ---------- routine editor ---------- */
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 4px;
}
.stepper button {
  appearance: none;
  border: 0;
  height: 44px;
  border-radius: 11px;
  background: var(--surface);
  font-size: 1.4rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper-v { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.stepper-v b { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stepper-v small { color: var(--muted); font-size: 0.75rem; font-weight: 600; }

/* ---------- sheets (picker, PB) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgb(8 10 14 / 0.45); z-index: 40; animation: fade 0.2s ease-out; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  max-width: 560px;
  margin: 0 auto;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-head { display: flex; gap: 12px; align-items: center; padding: 16px; }
.sheet-head input {
  flex: 1;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 0;
}
.sheet-head input:focus { outline: 2.5px solid var(--blue); outline-offset: -2.5px; }
.pick-list { list-style: none; margin: 0; padding: 0 12px 16px; overflow-y: auto; }
.pick {
  appearance: none;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}
.pick:active { background: var(--surface); }
.kind { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.create-row { display: flex; flex-direction: column; gap: 10px; padding: 14px 10px; }
.create-btns { display: flex; gap: 8px; }

.pb-sheet {
  background: var(--yellow);
  color: var(--yellow-ink);
  padding: 30px 22px calc(env(safe-area-inset-bottom) + 22px);
  gap: 14px;
}
.pb-kicker { font-weight: 700; opacity: 0.7; }
.pb-title { font-size: 2.6rem; font-weight: 850; letter-spacing: -0.045em; line-height: 1; }
.pb-list { list-style: none; margin: 6px 0 10px; padding: 0; }
.pb-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1.5px solid rgb(31 22 0 / 0.14); }
.pb-list li span:first-child { display: flex; flex-direction: column; }
.pb-list small { opacity: 0.7; font-size: 0.85rem; }
.pb-value { font-size: 1.5rem; font-weight: 850; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- invites and account sheets ---------- */
.invite-sheet { padding: 26px 16px calc(env(safe-area-inset-bottom) + 16px); gap: 14px; margin-bottom: 0; }
.sheet-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.04em; }
.link-box {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: var(--r-sm);
  padding: 14px;
  width: 100%;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 750;
  flex: none;
}
.avatar.pending { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.center-text { text-align: center; max-width: 34ch; align-self: center; }
.wide-stack { width: 100%; margin-top: 8px; }

/* ---------- progress ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-v { font-size: 1.6rem; font-weight: 850; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-v small { font-size: 0.8rem; color: var(--muted); font-weight: 650; margin-left: 2px; letter-spacing: 0; }
.stat-k { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

.chart-card {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 12px 12px 14px;
}
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 11px; padding: 3px; }
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 7px 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(18 22 29 / 0.12); }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.chart .base { stroke: var(--line); stroke-width: 1; }
.chart .area { fill: var(--blue); opacity: 0.08; }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--surface); stroke: var(--blue); stroke-width: 2.5; }
.chart .dot.pb { fill: var(--yellow); stroke: var(--yellow-ink); stroke-width: 1.5; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .axis.strong { fill: var(--ink); font-weight: 700; font-size: 12px; }
.chart-empty { color: var(--muted); text-align: center; padding: 36px 0; }
.legend { display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); box-shadow: inset 0 0 0 1.5px var(--yellow-ink); }

.hidden-list summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 8px 4px; }
.hidden-list .group { margin-top: 8px; }

/* ---------- floating tab bar ---------- */
.tabs {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  transform: translateX(-50%);
  z-index: 20;
  width: min(calc(100% - 32px), 420px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  backdrop-filter: saturate(1.8) blur(18px);
  -webkit-backdrop-filter: saturate(1.8) blur(18px);
  box-shadow: 0 8px 30px rgb(18 22 29 / 0.14), inset 0 0 0 1px rgb(18 22 29 / 0.05);
}
@media (prefers-color-scheme: dark) {
  .tabs { background: rgb(28 33 41 / 0.8); box-shadow: 0 8px 30px rgb(0 0 0 / 0.5), inset 0 0 0 1px rgb(255 255 255 / 0.06); }
}
.tabs[hidden] { display: none; }
.tabs a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 0 6px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 650;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 18px);
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.925rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
  max-width: calc(100% - 32px);
  text-align: center;
}
body.editing .toast { bottom: calc(env(safe-area-inset-bottom) + 92px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }

@keyframes rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
