/* ──────────────────────────────────────────────────────────────
   Components. Everything is a card, a row, a pill or a control.
   Sizes step up once there is room; nothing is phone-only.
   ────────────────────────────────────────────────────────────── */

/* ── buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid transparent;
  transition: transform 0.12s, background 0.15s, opacity 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn--primary:hover { filter: brightness(1.07); }
.btn--ghost { background: var(--surface-1); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger-ghost { background: transparent; border-color: var(--line-strong); color: var(--danger); }
.btn--danger-ghost:hover { background: color-mix(in oklab, var(--danger) 12%, transparent); }
.btn--block { width: 100%; }

/* A full-width button looks stretched across a desktop, and a capped one
   looks like it was cut off. Once there is room, let it size to its own
   label. (The rail's call to action lives outside .view and is unaffected.) */
@media (min-width: 700px) {
  .view .btn--block { width: auto; align-self: flex-start; }
}

/* "Show more" sits under the results, centred. */
.more-row { display: flex; justify-content: center; padding: 6px 0 2px; }
.more-row .btn { min-width: 210px; }
.btn--big { padding: 14px 20px; font-size: 15px; }
.btn--sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn--danger:hover { color: var(--danger); }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 650;
  align-self: flex-start;
}
.back-btn:hover { color: var(--text); }

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cta-row .btn { flex: 1; min-width: 150px; }
@media (min-width: 700px) { .cta-row { max-width: 560px; } }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.row-actions { display: flex; gap: 8px; align-items: center; }
.row-actions--wrap { flex-wrap: wrap; }

/* ── cards ──────────────────────────────────────────────────── */

.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 900px) { .card { padding: 20px; } }

.card--tap { width: 100%; text-align: left; transition: background 0.15s, transform 0.12s, border-color 0.15s; }
.card--tap:hover { border-color: var(--line-strong); }
.card--tap:active { transform: scale(0.995); }
.card--accent { border-color: var(--accent-line); background: var(--accent-soft); }

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 750;
  letter-spacing: -0.015em;
}
.card-note { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-dim); }
.card-sub { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }
.card-label { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.11em; color: var(--text-dim); }

/* ── home ───────────────────────────────────────────────────── */

.greeting h1 {
  font-size: clamp(24px, 5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.greeting p { font-size: 14.5px; margin-top: 5px; }

.live-card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 16px 17px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.live-card:hover { background: color-mix(in oklab, var(--accent) 22%, transparent); }
.live-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.live-body strong { font-size: 15.5px; }
.live-body span { font-size: 12.5px; }

.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s infinite;
  flex: none;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.live-clock {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.goal-card { gap: 10px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; }
.goal-track { display: flex; gap: 5px; }
.goal-pip { flex: 1; height: 8px; border-radius: 5px; background: var(--surface-3); transition: background 0.2s; }
.goal-pip.is-on { background: var(--accent); }
.goal-streak { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent-text); font-weight: 650; }

/* Always three across — they stay a readable row inside a narrow card
   as well as across a wide one, because the values scale with the box. */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 15px 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.stat-value {
  font-size: clamp(21px, 3.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.stat-value small { font-size: 0.45em; font-weight: 650; opacity: 0.6; }
.stat-label { font-size: 11.5px; color: var(--text-dim); font-weight: 650; }
.stat-sub {
  font-size: 11.5px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.session-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.session-row > div { display: flex; flex-direction: column; min-width: 0; }
.session-row strong { font-size: 15px; }
.session-row span { font-size: 12.5px; }
.session-row-right { display: flex; align-items: center; gap: 10px; flex: none; }

.project-row { flex-direction: row; align-items: center; justify-content: space-between; }
.project-row > div { display: flex; flex-direction: column; min-width: 0; }
.project-row span { font-size: 12.5px; }

.pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-dim);
  white-space: nowrap;
}
.pill--good { background: color-mix(in oklab, var(--good) 22%, transparent); color: var(--good); }
.pill--warn { background: color-mix(in oklab, #fab219 24%, transparent); color: #c98500; }
html[data-mode="dark"] .pill--warn { color: #fab219; }

/* ── quote ──────────────────────────────────────────────────── */

.quote {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}
.quote blockquote {
  font-size: clamp(15px, 1.8vw, 19px);
  font-style: italic;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.quote-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quote figcaption { font-size: 12.5px; color: var(--text-dim); }

/* An empty state carries its own call to action, centred inside the box,
   rather than leaving a button stranded underneath it. */
.empty {
  padding: 28px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
}
.empty p { max-width: 46ch; margin-inline: auto; }
.empty .btn { margin-top: 16px; }
.empty .btn--ghost { color: var(--text); }

/* ── session ────────────────────────────────────────────────── */

.session-head { gap: 13px; }
.session-head.is-live { border-color: var(--accent-line); background: var(--accent-soft); }
.session-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.session-head-top h1 { font-size: clamp(19px, 2.6vw, 26px); font-weight: 800; letter-spacing: -0.025em; }
.session-head-top p { font-size: 12.5px; }

.session-head-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-dim);
}
.session-head-stats strong { color: var(--text); font-size: 16px; font-weight: 800; margin-right: 4px; }

.session-notes { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }

/* ── climb rows ─────────────────────────────────────────────── */

.climb-list { display: grid; gap: 8px; }

@media (min-width: 700px) {
  .climb-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
}

.climb-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-1);
}
.climb-row--tap { transition: background 0.15s, border-color 0.15s; }
.climb-row--tap:hover { background: var(--surface-2); border-color: var(--line-strong); }
.climb-row.is-attempt { border-style: dashed; }
.climb-row.is-attempt .grade-badge { background: var(--surface-3); color: var(--text-dim); }

.grade-badge {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 48px;
  padding: 8px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.grade-badge small { font-size: 9px; font-weight: 700; opacity: 0.75; }
.grade-badge.is-warmup { background: var(--surface-3); color: var(--text-dim); }
.grade-badge--alt { background: var(--surface-3); color: var(--text); }

.climb-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.climb-body strong { font-size: 14.5px; font-weight: 700; letter-spacing: -0.012em; }
.climb-body > span { font-size: 12px; }
.climb-note { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin-top: 4px; }

.climb-actions { display: flex; gap: 2px; flex: none; }

.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag {
  font-size: 10.5px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-dim);
}

.day-group { margin-bottom: 18px; }
.day-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.result-count { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }

/* ── search & filters ───────────────────────────────────────── */

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text-dim);
}
.search-row:focus-within { border-color: var(--accent); }
.input--search { border: none !important; background: none !important; padding-left: 0; box-shadow: none !important; }

.filter-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.chip {
  font-size: 12px;
  font-weight: 650;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--text-dim);
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip--clear { border-style: dashed; }

/* ── projects ───────────────────────────────────────────────── */

.project-card { gap: 12px; }
.project-top { display: flex; align-items: flex-start; gap: 12px; }
.project-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.project-stats strong { color: var(--text); font-weight: 800; }

/* ── stats & charts ─────────────────────────────────────────── */

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-empty { font-size: 13px; color: var(--text-dim); padding: 14px 0; text-align: center; }

.legend { display: flex; flex-wrap: wrap; gap: 15px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-dim); }
.legend-item i { width: 11px; height: 11px; border-radius: 3px; flex: none; }

.chart-tip {
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  max-width: 240px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 650;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.chart-tip.is-visible { opacity: 1; }

.rate-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 12.5px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.rate-list dt { color: var(--text-dim); }
.rate-list dd { margin: 0; font-weight: 650; }

.style-bars { display: flex; flex-direction: column; gap: 8px; }
.style-row { display: grid; grid-template-columns: 86px 1fr 30px; align-items: center; gap: 10px; font-size: 12.5px; }
.style-name { color: var(--text-dim); }
.style-track { height: 9px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.style-track i { display: block; height: 100%; background: var(--viz-seq); border-radius: 5px; }
.style-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.insight-list { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; line-height: 1.55; padding-left: 1.1em; }

/* ── hangboard ──────────────────────────────────────────────── */

.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 11px; margin-bottom: 11px; }
.preset { gap: 5px; padding: 15px; }
.preset strong { font-size: 14.5px; }
.preset span { font-size: 11.5px; line-height: 1.45; }

.best-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 11px; }

/* ── timer overlay ──────────────────────────────────────────── */

.timer-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: var(--bg-0);
  opacity: 0;
  transition: opacity 0.18s, background 0.3s;
  padding: 24px;
}
.timer-overlay.is-open { opacity: 1; }
.timer-overlay[data-phase="hang"] { background: color-mix(in oklab, var(--accent) 16%, var(--bg-0)); }
.timer-overlay[data-phase="setRest"] { background: color-mix(in oklab, var(--viz-2) 12%, var(--bg-0)); }

.timer-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; text-align: center; width: 100%; max-width: 420px;
}
.timer-title { font-size: 16px; font-weight: 800; letter-spacing: -0.015em; }
.timer-sub { font-size: 12.5px; color: var(--text-dim); }
.timer-phase { font-size: 18px; font-weight: 750; color: var(--accent-text); margin-top: 6px; }
.timer-overlay[data-phase="rest"] .timer-phase,
.timer-overlay[data-phase="setRest"] .timer-phase { color: var(--text-dim); }

.timer-ring { position: relative; width: min(300px, 68vw, 46vh); aspect-ratio: 1; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 7; }
.ring-fg {
  fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}
.timer-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(48px, 18vw, 86px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}
.timer-progress { font-size: 12px; color: var(--text-dim); }
.timer-controls { display: flex; gap: 10px; margin-top: 12px; }

/* ── sheets ─────────────────────────────────────────────────── */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.2s;
}

/* The blur is a desktop luxury — see the note on .topbar. */
@media (min-width: 900px) {
  .sheet-backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); }
}
.sheet-backdrop.is-open { opacity: 1; }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--line-strong);
  border-bottom: none;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-backdrop.is-open .sheet { transform: translateY(0); }

@media (min-width: 620px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line-strong); max-height: 86dvh; }
}
@media (min-width: 900px) { .sheet { max-width: 620px; } }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 14px 12px 20px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.025em; }

.sheet-body {
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-foot {
  display: flex;
  gap: 10px;
  padding: 13px 20px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.sheet-foot .btn { flex: 1; }

.sheet-text { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }

.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13.5px; }
.detail-list dt { color: var(--text-dim); }
.detail-list dd { margin: 0; font-weight: 650; }

/* ── form controls ──────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 8px; }

.field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
}
.field-label small { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: 0.85; }

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-dim); opacity: 0.75; }
textarea.input { resize: vertical; line-height: 1.5; }

.segment {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 13px;
  overflow-x: auto;
  scrollbar-width: none;
}
.segment::-webkit-scrollbar { display: none; }
.segment--wide { width: 100%; }

.segment-opt {
  flex: 1;
  min-width: max-content;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background 0.14s, color 0.14s;
}
.segment-opt:hover { color: var(--text); }
.segment-opt .muted { font-size: 11px; }
.segment-opt.is-on { background: var(--surface-1); color: var(--text); box-shadow: var(--shadow-sm); }
.segment-opt.is-on .muted { color: var(--text-dim); }

.chips, .choice { display: flex; flex-wrap: wrap; gap: 7px; }

.grade-rail {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 3px 0 8px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.grade-opt {
  flex: none;
  min-width: 52px;
  padding: 11px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 700;
  scroll-snap-align: center;
  transition: background 0.14s, color 0.14s;
}
.grade-opt:hover { color: var(--text); }
.grade-opt.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 13px;
  padding: 4px;
  width: max-content;
}
.stepper--inline { background: none; padding: 0; }
.stepper-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.stepper-btn:hover { background: var(--surface-3); }
.stepper-value {
  min-width: 58px;
  text-align: center;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper-value::-webkit-outer-spin-button,
.stepper-value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── profile ────────────────────────────────────────────────── */

.profile-card { flex-direction: row; align-items: center; gap: 14px; }
.profile-card > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.profile-card strong { font-size: 17px; }
.profile-card span { font-size: 12px; }

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 650;
}

/* theme gallery */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 11px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 7px 7px 9px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--surface-1);
  transition: border-color 0.15s, transform 0.14s;
}
.theme-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.theme-card.is-on { border-color: var(--accent); }

.theme-swatch {
  height: 52px;
  border-radius: 9px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}
.theme-swatch i {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.theme-name { font-size: 12px; font-weight: 700; text-align: center; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.admin-row strong { display: flex; align-items: center; gap: 7px; font-size: 14.5px; }
.admin-row .pill { font-size: 10px; padding: 1px 7px; }

.pb-line { font-size: 15px; }
.pb-line strong { font-size: 19px; font-weight: 800; letter-spacing: -0.025em; }

.version { font-size: 12px; color: var(--text-dim); text-align: center; padding-bottom: 10px; }

/* ── auth ───────────────────────────────────────────────────── */

/* Pinned like the app shell, and padded off the status bar and the home
   indicator. Centring inside a box that ignores the safe areas is what
   pushed this card off-centre on an installed iOS app. */
.auth {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding:
    calc(env(safe-area-inset-top) + 24px)
    calc(env(safe-area-inset-right) + 20px)
    calc(env(safe-area-inset-bottom) + 24px)
    calc(env(safe-area-inset-left) + 20px);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface-1);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.auth-brand h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.045em; }
.auth-brand p { font-size: 13px; color: var(--text-dim); }

.auth-form { display: flex; flex-direction: column; gap: 11px; }
.auth-error {
  font-size: 13px;
  font-weight: 650;
  color: var(--danger);
  background: color-mix(in oklab, var(--danger) 14%, transparent);
  padding: 10px 13px;
  border-radius: 11px;
}
.auth-switch { text-align: center; font-size: 13px; color: var(--text-dim); }
.auth-legal { text-align: center; font-size: 11.5px; line-height: 1.55; color: var(--text-dim); opacity: 0.85; }
.auth-notice {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 10px 13px;
  border-radius: 11px;
  line-height: 1.5;
}

/* ── toast ──────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px);
  z-index: 150;
  transform: translate(-50%, 12px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100vw - 32px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast--bad { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 45%, transparent); }

@media (min-width: 900px) {
  .toast { bottom: 26px; left: calc(50% + var(--rail-w) / 2); }
}
