@font-face {
  font-family: "Satoshi";
  font-style: normal;
  src: url("https://michaelashcroft.com/fonts/Satoshi.woff2");
  font-display: swap;
  font-weight: 1 999;
}

@font-face {
  font-family: "Hind";
  font-style: normal;
  src: url("https://michaelashcroft.com/fonts/Hind.woff2");
  font-display: swap;
  font-weight: 1 999;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light palette — matches michaelashcroft.com */
  --bg: #faf8f5;
  --bg-subtle: #f2eeea;
  --surface: #ffffff;
  --surface-hover: #f5f2ef;
  --surface-border: #e2ddd7;
  --text: #555;
  --text-dim: #777;
  --text-muted: #999;

  /* Green accent — matches site theme */
  --gold: #008000;
  --gold-dim: #006600;
  --gold-glow: #33a033;
  --gold-bg: rgba(0, 128, 0, 0.07);

  --success: #008000;
  --danger: #c45c5c;
  --radius: 6px;
  --focus-ring: 0 0 0 2px var(--gold);
  --noise-opacity: 0;
  --glow-opacity: 0.08;
  --toast-text: #fff;

  /* Fonts — matching michaelashcroft.com */
  --font-body: 'Satoshi', system-ui, sans-serif;
  --font-title: 'Hind', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  color-scheme: light;
}

/* Dark mode */
html.dark {
  --bg: #1a1f1a;
  --bg-subtle: #222822;
  --surface: #2a302a;
  --surface-hover: #333a33;
  --surface-border: #3d453d;
  --text: #dde0dd;
  --text-dim: #a0a8a0;
  --text-muted: #6b756b;

  --gold: #4db84d;
  --gold-dim: #3a9a3a;
  --gold-glow: #5cc85c;
  --gold-bg: rgba(77, 184, 77, 0.1);

  --success: #4db84d;
  --danger: #c45c5c;
  --noise-opacity: 0;
  --glow-opacity: 0.1;
  --toast-text: #1a1f1a;

  color-scheme: dark;
}

html.dark .activity-tile,
html.dark .quick-btn,
html.dark .period-toggle {
  box-shadow: none;
}

html.dark .xp-glow {
  background: radial-gradient(ellipse, rgba(77, 184, 77, var(--glow-opacity)) 0%, transparent 70%);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px 20px;
  padding-top: max(16px, env(safe-area-inset-top, 16px));
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.screen.active {
  display: block;
  animation: screenIn 0.25s ease-out;
}

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

/* ── Public Screen ──────────────────────────────────────────────── */
#public-screen {
  padding-bottom: 40px;
}

.public-content {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
}

.public-header {
  text-align: center;
  margin-bottom: 8px;
}

.public-title {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.5px;
}

.public-title a {
  color: inherit;
  text-decoration: none;
}

.public-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.radar-total {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dim);
  margin: 8px 0 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.radar-total .xp-unit {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-left: 2px;
  vertical-align: baseline;
}

.radar-total-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
  margin-left: 4px;
}

#radar-chart {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.radar-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Radar Legend ────────────────────────────────────────────────── */
.radar-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin: 20px auto 0;
}

.radar-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.75rem;
}

.radar-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}

.radar-legend-text {
  flex: 1;
  min-width: 0;
}

.radar-legend-label {
  color: var(--text-dim);
  display: block;
  font-weight: 500;
}

.radar-legend-acts {
  color: var(--text-muted);
  font-size: 0.65rem;
  display: block;
  margin-top: 1px;
}

.radar-legend-value {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Public About ───────────────────────────────────────────────── */
.public-about {
  max-width: 400px;
  margin: 28px auto 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.public-about p {
  margin-bottom: 12px;
}

.public-about p:last-child {
  margin-bottom: 0;
}

/* ── Public Footer ──────────────────────────────────────────────── */
.public-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.sign-in-link {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-decoration: none;
  transition: color 0.15s;
}

.sign-in-link:hover {
  color: var(--text-dim);
}

/* ── Login Screen ───────────────────────────────────────────────── */
#login-screen {
  background: var(--bg);
}

.login-content {
  max-width: 360px;
  margin: 0 auto;
  padding-top: 8px;
}

.login-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 24px 0 24px;
  letter-spacing: -0.02em;
}

#login-form input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.15s;
  margin-bottom: 10px;
}

#login-form input::placeholder {
  color: var(--text-muted);
}

#login-form input:focus-visible {
  border-color: var(--gold-dim);
  outline: none;
}

.login-btn {
  margin-top: 10px;
}

.login-error {
  color: var(--danger);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 12px;
  min-height: 1.2em;
}

/* ── Home ────────────────────────────────────────────────────────── */
#home-screen header {
  text-align: center;
  padding: 16px 0 20px;
  position: relative;
}

.header-actions {
  position: absolute;
  top: 16px;
  right: 0;
  display: flex;
  gap: 4px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  touch-action: manipulation;
  transition: color 0.15s;
}

.icon-btn:hover {
  color: var(--text-dim);
}

/* Show moon in light mode (to switch to dark), sun in dark mode (to switch to light) */
html.light .icon-sun { display: none; }
html.light .icon-moon { display: block; }
html.dark .icon-sun { display: block; }
html.dark .icon-moon { display: none; }

.xp-display {
  position: relative;
  display: inline-block;
}

.xp-glow {
  position: absolute;
  inset: -20px -40px;
  background: radial-gradient(ellipse, rgba(212, 168, 67, var(--glow-opacity)) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#daily-total {
  font-family: var(--font-mono);
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}

.xp-unit {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--gold-dim);
  margin-left: 6px;
  vertical-align: super;
}

#daily-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Activity Grid ───────────────────────────────────────────────── */
#activity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.area-label {
  grid-column: 1 / -1;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 10px 0 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.area-label::before {
  content: '';
  width: 12px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
  background: var(--area-color, var(--text-muted));
}

.area-label:first-child {
  padding-top: 0;
}

.activity-tile {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 12px 6px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  color: var(--text);
  font-family: var(--font-body);
  touch-action: manipulation;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.activity-tile::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.5;
  background: var(--area-color, transparent);
}

.activity-tile:active {
  transform: scale(0.95);
  background: var(--surface-hover);
}

.activity-tile:hover {
  border-color: var(--text-muted);
}

.activity-tile .icon {
  font-size: 1.3rem;
  margin-bottom: 3px;
  line-height: 1;
}

.activity-tile .label {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.3;
}

.activity-tile .tile-xp {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--gold);
  margin-top: 3px;
  min-height: 0.9em;
  font-variant-numeric: tabular-nums;
}

/* ── Log Screen ──────────────────────────────────────────────────── */
#log-screen {
  background: var(--bg);
}

.log-content {
  max-width: 400px;
  margin: 0 auto;
  padding-top: 8px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 10px;
  margin: -10px;
  border-radius: 8px;
  touch-action: manipulation;
  transition: color 0.15s;
}

.back-btn:hover {
  color: var(--text-dim);
}

#log-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 20px 0 8px;
  letter-spacing: -0.02em;
}

.area-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
}

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

.quick-btn {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text);
  padding: 14px 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  touch-action: manipulation;
}

.quick-btn:active {
  transform: scale(0.95);
}

.quick-btn:hover {
  border-color: var(--text-muted);
}

.quick-btn.selected {
  border-color: var(--gold);
  background: var(--gold-bg);
  color: var(--gold);
}

.manual-input {
  margin-bottom: 10px;
}

.manual-input input, .note-row input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.15s;
}

.manual-input input::placeholder, .note-row input::placeholder {
  color: var(--text-muted);
}

.manual-input input:focus-visible, .note-row input:focus-visible {
  border-color: var(--gold-dim);
  outline: none;
}

.note-row {
  margin-bottom: 20px;
}

.log-btn {
  width: 100%;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 15px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  touch-action: manipulation;
}

.log-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.log-btn:not(:disabled):active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* ── Stats ───────────────────────────────────────────────────────── */

.period-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 24px;
}

.period-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 7px 4px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
}

.period-btn.active {
  background: var(--gold);
  color: var(--bg);
}

/* ── Weekly Targets ──────────────────────────────────────────────── */
.targets-header {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}


.target-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.target-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.target-label {
  font-size: 0.82rem;
  font-weight: 500;
}

.target-progress {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.target-progress.target-done {
  color: var(--success);
}

.target-slash {
  color: var(--text-muted);
  font-weight: 400;
}

.target-bar {
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.target-bar-fill {
  height: 100%;
  border-radius: 2px;
  opacity: 0.7;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.target-chart {
  margin-top: 4px;
}

.target-chart svg {
  display: block;
}


/* ── Tile Progress ──────────────────────────────────────────────── */
.tile-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bg-subtle);
}

.tile-progress-fill {
  height: 100%;
  width: calc(var(--progress) * 100%);
  background: var(--gold);
  border-radius: 0 1px 1px 0;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* When progress bar present, hide the area-color bottom border */
.activity-tile:has(.tile-progress)::after {
  display: none;
}

.sort-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
  max-width: 140px;
}

.sort-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 5px 8px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
}

.sort-btn.active {
  background: var(--gold);
  color: var(--bg);
}

.stats-total {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 28px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
}

.stats-total .xp-unit {
  font-size: 0.85rem;
}

.stat-bar {
  margin-bottom: 14px;
}

.stat-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}

.stat-bar-label span:first-child {
  font-weight: 400;
  color: var(--text-dim);
}

.stat-bar-label .stat-xp {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-bar-track {
  background: var(--bg-subtle);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.recent-header {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 28px 0 12px;
}

.recent-entry {
  display: flex;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.82rem;
  gap: 10px;
}

.entry-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.recent-entry .entry-info {
  flex: 1;
  min-width: 0;
}

.recent-entry .entry-activity {
  color: var(--text);
  font-weight: 400;
}

.recent-entry .entry-note {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-entry .entry-time {
  color: var(--text-muted);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.recent-entry .entry-xp {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}


/* ── Toast ───────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  background: var(--gold);
  color: var(--toast-text);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.5px;
  pointer-events: none;
  z-index: 100;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.hidden {
  display: none;
}

/* ── Tile entry animation ────────────────────────────────────────── */
@keyframes tileIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.activity-tile {
  animation: tileIn 0.3s ease-out both;
}

/* ── Focus ───────────────────────────────────────────────────────── */
button:focus-visible,
.activity-tile:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

input:focus-visible {
  outline: none;
}

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

/* ── Desktop (MacBook Pro ~1440px) ────────────────────────────────── */
@media (min-width: 768px) {
  .screen {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 40px;
  }

  #activity-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 100%;
    gap: 10px;
  }

  .activity-tile {
    padding: 16px 8px 14px;
  }

  .activity-tile .icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }

  .activity-tile .label {
    font-size: 0.82rem;
  }

  .activity-tile .tile-xp {
    font-size: 0.72rem;
  }

  #daily-total {
    font-size: 4rem;
  }

  #daily-label {
    font-size: 0.9rem;
  }

  .area-label {
    font-size: 0.72rem;
  }

  .log-content {
    max-width: 480px;
  }

  #log-title {
    font-size: 1.8rem;
  }

  .area-badge {
    font-size: 0.7rem;
  }

  .quick-buttons {
    gap: 10px;
  }

  .quick-btn {
    padding: 16px 0;
    font-size: 1.15rem;
  }

  .manual-input input, .note-row input {
    font-size: 1.05rem;
    padding: 14px 16px;
  }

  .log-btn {
    font-size: 1.1rem;
    padding: 16px;
  }

  /* Stats */
  #stats-screen header h1 {
    font-size: 1.6rem;
  }

  .period-btn {
    font-size: 0.9rem;
    padding: 9px 4px;
  }

  .stats-total {
    font-size: 3rem;
  }

  .stat-bar-label {
    font-size: 0.9rem;
  }

  .stat-bar-label .stat-xp {
    font-size: 0.82rem;
  }

  .stat-bar-track {
    height: 8px;
  }

  .recent-header {
    font-size: 0.78rem;
  }

  .recent-entry {
    font-size: 0.92rem;
    padding: 11px 0;
  }

  .recent-entry .entry-xp {
    font-size: 0.82rem;
  }

  .recent-entry .entry-time {
    font-size: 0.78rem;
  }

  .recent-entry .entry-note {
    font-size: 0.82rem;
  }

  /* Dashboard targets */
  #dashboard-targets {
    max-width: 100%;
  }

  .targets-header {
    font-size: 0.78rem;
  }

  .target-label {
    font-size: 0.92rem;
  }

  .target-progress {
    font-size: 0.88rem;
  }

  .target-card {
    padding: 16px 20px;
  }

  #tab-bar {
    max-width: 720px;
    left: 0;
    right: 0;
    margin: 0 auto;
  }

  .screen {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  /* Public screen desktop */
  .public-title {
    font-size: 2.6rem;
  }

  .radar-total {
    font-size: 1.2rem;
  }

  #radar-chart {
    max-width: 420px;
  }

  .radar-legend {
    max-width: 420px;
  }

  .radar-legend-item {
    font-size: 0.82rem;
  }

  .radar-legend-value {
    font-size: 0.75rem;
  }

  .public-about {
    max-width: 460px;
    font-size: 0.85rem;
  }
}

/* ── Bottom Tab Bar ─────────────────────────────────────────────── */
#tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--surface-border);
  padding: 6px 0;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
}

#tab-bar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 0;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  touch-action: manipulation;
  transition: color 0.15s;
}

#tab-bar .tab.active {
  color: var(--gold);
}

#tab-bar .tab svg {
  transition: color 0.15s;
}

/* ── Dashboard Screen ───────────────────────────────────────────── */
#dashboard-screen header {
  padding-bottom: 16px;
}

#dashboard-screen header h1 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

#dashboard-radar-section {
  margin-bottom: 24px;
}

#dashboard-targets {
  max-width: 600px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--surface-border);
}

/* ── Stats Screen (remove back button, now tab-driven) ──────────── */
#stats-screen header {
  padding-bottom: 20px;
}

#stats-screen header h1 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
