:root {
  color-scheme: dark;
  --ink: #f2f1ec;
  --ink-dim: #a8a59c;
  --ink-faint: #6b685f;
  --bg: #0a0a0b;
  --bg-elev: #131316;
  --bg-elev-2: #1c1c20;
  --line: #2a2a2f;
  --line-soft: #1f1f23;
  --lime: #d4ff3a;
  --lime-dim: #b8e02f;
  --magenta: #ff2e7a;
  --amber: #ffb547;
  --warn: #ff5a5a;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212, 255, 58, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 46, 122, 0.05), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-feature-settings: "ss01", "ss02", "tnum" 1;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input,
select {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: 50px;
  width: 100%;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus {
  border-color: var(--lime);
  background: #16170d;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hidden {
  display: none !important;
}

/* Grain overlay for texture */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============ AUTH ============ */
.auth-view {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 2;
}

.auth-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(212, 255, 58, 0.5), transparent 40%, rgba(255, 46, 122, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--lime);
  color: #0a0a0b;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  font-feature-settings: "tnum" 1;
  box-shadow: 0 12px 30px -8px rgba(212, 255, 58, 0.5);
}

.logo-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 0.85rem;
  box-shadow: none;
}

.eyebrow {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

h1 em,
h2 em,
.section-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--lime);
}

h2 {
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.stepper-label {
  color: var(--ink-dim);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field span em {
  font-style: normal;
  color: var(--ink-faint);
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-left: 6px;
}

/* ============ APP SHELL ============ */
.app-shell {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: calc(18px + var(--safe-top)) 18px calc(112px + var(--safe-bottom));
  min-height: 100svh;
  animation: shellIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes shellIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ TOPBAR ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-titles .eyebrow {
  font-size: 0.65rem;
}

.date-label {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.person-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px 8px 8px;
  background: var(--bg-elev);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  transition: border-color 0.15s ease, transform 0.1s ease;
  max-width: 180px;
}

.person-pill:active {
  transform: scale(0.97);
}

.person-pill:hover {
  border-color: var(--lime);
}

.person-pill-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--bg);
  font-weight: 800;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.person-pill-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.caret {
  color: var(--ink-dim);
  font-size: 0.75rem;
}

.date-picker {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* ============ HERO CARD ============ */
.hero-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 24px 22px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--bg-elev) 0%, #15151a 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: cardIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 0.05s both;
}

.hero-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 70%;
  height: 140%;
  background: radial-gradient(closest-side, rgba(212, 255, 58, 0.18), transparent 70%);
  pointer-events: none;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.hero-meta h2 {
  font-size: clamp(1.8rem, 7vw, 2.4rem);
}

.hero-ring-wrap {
  position: relative;
  width: min(260px, 70vw);
  margin: 4px auto 8px;
  aspect-ratio: 1 / 1;
}

.hero-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--bg-elev-2);
  stroke-width: 14;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 540;
  stroke-dashoffset: 540;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 0 10px rgba(212, 255, 58, 0.3));
}

.hero-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 2px;
}

.hero-percent {
  font-size: clamp(4rem, 18vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.85;
  font-feature-settings: "tnum" 1;
}

.hero-pct-sign {
  color: var(--lime);
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: -8px;
}

.hero-rank {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(212, 255, 58, 0.12);
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(212, 255, 58, 0.25);
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.stat {
  display: grid;
  gap: 3px;
}

.stat-label {
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.stat strong {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-goal {
  color: var(--ink-dim);
  font-size: 0.78rem;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--line);
}

/* ============ LOG FORM ============ */
.log-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  animation: cardIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 0.12s both;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 4px;
}

.stepper-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stepper {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.stepper-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
}

.stepper-row input {
  background: transparent;
  border: none;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  padding: 0;
  min-height: 56px;
  letter-spacing: -0.04em;
  -moz-appearance: textfield;
}

.stepper-row input::-webkit-outer-spin-button,
.stepper-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-row input:focus {
  background: transparent;
  color: var(--lime);
}

.step-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.step-btn:active {
  transform: scale(0.9);
  background: var(--lime);
  color: var(--bg);
  border-color: var(--lime);
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.chip {
  padding: 12px 6px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.chip:active,
.chip.is-flash {
  transform: scale(0.94);
  background: var(--lime);
  color: var(--bg);
  border-color: var(--lime);
}

.note-field input {
  font-family: var(--font-display);
  font-size: 1rem;
}

/* PRIMARY CTA */
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 18px 22px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  box-shadow: 0 16px 40px -12px rgba(212, 255, 58, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
  background: var(--lime-dim);
}

.primary-button:active {
  transform: translateY(2px) scale(0.99);
  box-shadow: 0 6px 18px -8px rgba(212, 255, 58, 0.5), inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.cta-sum {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(10, 10, 11, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, transform 0.08s ease;
}

.secondary-button:hover {
  border-color: var(--lime);
}

.secondary-button:active {
  transform: scale(0.98);
}

.ghost-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 1rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ghost-button:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.form-message {
  min-height: 20px;
  margin: 0;
  text-align: center;
  color: var(--lime);
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.form-message[data-state="error"] {
  color: var(--warn);
}

/* ============ ENTRIES ============ */
.entries-section {
  margin-top: 28px;
  animation: cardIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 0.18s both;
}

.entry-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.entry-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  transition: border-color 0.15s ease;
}

.entry-row:hover {
  border-color: var(--line);
}

.entry-row.empty {
  grid-template-columns: 1fr;
  text-align: center;
  padding: 28px 16px;
  color: var(--ink-dim);
  border-style: dashed;
}

.entry-time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-faint);
  min-width: 52px;
}

.entry-main strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.entry-main span {
  display: block;
  color: var(--ink-dim);
  font-size: 0.85rem;
  margin-top: 2px;
}

.entry-actions {
  display: flex;
  gap: 6px;
}

.entry-actions button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 0.95rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.entry-actions button:hover {
  color: var(--lime);
  border-color: var(--lime);
}

.entry-actions button[data-delete]:hover {
  color: var(--warn);
  border-color: var(--warn);
}

/* ============ BOARD / LEADERBOARD ============ */
.view-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.view-header .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -2px;
}

.view-header h2 {
  font-size: clamp(2.4rem, 9vw, 3.2rem);
}

.leaderboard-list {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  padding: 16px 16px 16px 12px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: rowIn 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.leaderboard-row.is-leader {
  background: linear-gradient(110deg, var(--lime), #b8e02f);
  color: #0a0a0b;
  border-color: var(--lime);
  box-shadow: 0 20px 50px -20px rgba(212, 255, 58, 0.55);
}

.leaderboard-row.is-leader .lb-name,
.leaderboard-row.is-leader .lb-meta,
.leaderboard-row.is-leader .lb-score {
  color: #0a0a0b;
}

.lb-rank {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-elev-2);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.is-leader .lb-rank {
  background: rgba(10, 10, 11, 0.18);
  color: #0a0a0b;
}

.lb-main {
  min-width: 0;
}

.lb-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-meta {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-meta span {
  white-space: nowrap;
  flex-shrink: 0;
}

.lb-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--lime);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.is-leader .lb-bar {
  display: none;
}

.lb-score {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

.lb-score em {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--lime);
  margin-left: 2px;
}

.is-leader .lb-score em {
  color: rgba(10, 10, 11, 0.7);
}

/* ============ HISTORY ============ */
.trend-panel {
  padding: 16px 14px 8px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.trend-panel canvas {
  display: block;
  width: 100%;
  height: 240px;
}

.history-days {
  display: grid;
  gap: 10px;
}

.history-day {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
}

.history-day h3 {
  margin-bottom: 10px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.history-line {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.92rem;
}

.history-line:first-of-type {
  border-top: none;
}

.history-line .h-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-faint);
}

.history-line .h-pct {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============ BOTTOM NAV ============ */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: min(420px, calc(100% - 28px));
  padding: 6px;
  border-radius: 999px;
  background: rgba(19, 19, 22, 0.78);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line);
  z-index: 50;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 999px;
  color: var(--ink-dim);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  transition: color 0.18s ease, background 0.18s ease, transform 0.1s ease;
}

.nav-btn .nav-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.nav-btn .nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-btn.active {
  background: var(--lime);
  color: var(--bg);
}

.nav-btn:active {
  transform: scale(0.96);
}

/* ============ SHEETS / DIALOGS ============ */
.sheet {
  width: min(440px, calc(100% - 24px));
  max-height: 80svh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.sheet::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.sheet[open] {
  animation: sheetIn 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sheet-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.person-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 50svh;
  overflow-y: auto;
}

.person-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s ease, transform 0.08s ease;
}

.person-list li.active {
  border-color: var(--lime);
  color: var(--lime);
}

.person-list li:active {
  transform: scale(0.98);
}

.person-list li .avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--bg);
  font-size: 0.82rem;
  font-weight: 800;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.dialog-actions .primary-button {
  min-height: 50px;
  font-size: 1rem;
}

/* ============ DESKTOP REFINEMENTS ============ */
@media (min-width: 720px) {
  .app-shell {
    padding-top: 28px;
  }
  .stepper-grid {
    gap: 14px;
  }
  .stepper-row input {
    font-size: 2.4rem;
  }
}

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

/* ============ PUSH NOTIFICATIONS TOGGLE ============ */
/* Notifications bell (topbar) */
.push-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink-dim);
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.push-bell svg {
  width: 20px;
  height: 20px;
}

/* Only tint on real hover. On touch, a tap leaves :hover stuck, which falsely lit the bell lime. */
@media (hover: hover) {
  .push-bell:hover {
    border-color: var(--lime);
    color: var(--lime);
  }
}

.push-bell:active {
  transform: scale(0.94);
}

.push-bell.is-on {
  color: var(--lime);
  border-color: var(--lime);
  background: rgba(212, 255, 58, 0.12);
}

/* Nudge dot: shown only while notifications are available but off. */
.push-bell-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  border: 2px solid var(--bg);
  display: none;
}

.push-bell:not(.is-on) .push-bell-dot {
  display: block;
}

/* Blocked: permission was denied at the OS level — the app cannot re-prompt. Show a muted, slashed
   bell that is clearly neither on nor "tap me", so a dead tap never looks like success. */
.push-bell.is-blocked {
  color: var(--ink-faint);
  border-color: var(--line);
  background: var(--bg-elev);
}

.push-bell.is-blocked .push-bell-dot {
  display: none;
}

.push-bell.is-blocked::after {
  content: '';
  position: absolute;
  left: 9px;
  right: 9px;
  top: 50%;
  height: 2px;
  border-radius: 2px;
  background: var(--warn);
  transform: rotate(-45deg);
}

.push-blocked-hint {
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--ink-dim);
  font-size: 0.85rem;
  line-height: 1.45;
}

.push-blocked-hint strong {
  color: var(--ink);
  font-weight: 700;
}
