/* ==========================================================================
   THEME TOKENS — INTERIM LOOK (dark, premium, athletic)
   --------------------------------------------------------------------------
   Brandon rejected the Owned brand book styling for this app ("looks like
   a google form") and wants a clean high-performance look. This interim
   theme is dark near-black / white type / one volt accent, in the register
   of Whoop / Nike Training / Apple Fitness.
   STANDING DIRECTION: the app must eventually match Brandon's new website
   (Framer redesign, in progress — not done yet). When that reference lands,
   swap ONLY the values in this :root block (and the display font stack) —
   every component below reads from these tokens, so the whole app re-skins
   from here. Do not hard-code colors elsewhere.
   ========================================================================== */
:root {
  --bg: #0a0a0b;
  --bg-2: #121214;
  --surface: #17171a;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #fafafa;
  --muted: #9a9aa2;
  --faint: #66666e;
  --accent: #d7ff3e;          /* the one minimal accent — volt */
  --accent-ink: #0a0a0b;
  --danger: #ff5a5a;
  --display: "Arial Narrow", "HelveticaNeue-CondensedBold", "Impact", "Haettenschweiler", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 2px;
  --pad: 20px;
  --max-w: 560px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: var(--max-w); margin: 0 auto; padding: 28px var(--pad) 96px; }
h1, h2, h3 { margin: 0; font-weight: 700; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input { font-family: inherit; }
a { color: var(--accent); }

/* --- Header --- */
.top { padding: 8px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.brand {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
.app-title {
  font-family: var(--display);
  font-size: 52px; line-height: 0.95; letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* --- Sections --- */
.screen { display: none; }
.screen.active { display: block; }
.section-label {
  margin: 0 0 14px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.flex1 { flex: 1; }
.row { display: flex; gap: 12px; align-items: center; }

/* --- Home --- */
.feature { padding: 8px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.feature-kicker {
  margin: 0 0 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent);
}
.feature-title {
  font-family: var(--display);
  font-size: 34px; line-height: 1.02; text-transform: uppercase;
  margin: 0 0 6px;
}
.feature-meta { margin: 0 0 18px; }
.listen-row { display: flex; gap: 12px; margin: 0 0 28px; }
.listen-cell { flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); }
.listen-label { margin: 0; font-size: 14px; font-weight: 600; }
.check {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.week { display: flex; gap: 6px; margin: 0 0 28px; }
.week-day { flex: 1; text-align: center; }
.week-day span { display: block; font-size: 11px; letter-spacing: 0.12em; color: var(--faint); text-transform: uppercase; margin-bottom: 8px; }
.week-day i {
  display: block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-strong); margin: 0 auto;
}
.week-day.done i { background: var(--accent); border-color: var(--accent); }
.week-day.today span { color: var(--text); }

/* --- Buttons (no boxed form look: flat, full-width, strong type) --- */
.btn-accent, .btn-ghost {
  display: block; width: 100%;
  padding: 17px 20px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: center; border-radius: var(--radius);
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:disabled { opacity: 0.45; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:disabled { opacity: 0.45; }

/* --- Inputs: underline only, never a box --- */
.field-label {
  display: block; margin: 22px 0 2px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
}
.line-input {
  display: block; width: 100%;
  background: transparent; border: none;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 22px; font-weight: 600; font-family: var(--display);
  letter-spacing: 0.02em; text-transform: uppercase;
  padding: 8px 0 10px; outline: none;
}
.line-input::placeholder { color: var(--faint); }
.line-input:focus { border-bottom-color: var(--accent); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* --- Record --- */
.recorder { text-align: center; padding: 28px 0 8px; }
.rec-btn {
  width: 104px; height: 104px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.rec-btn.recording { background: var(--danger); color: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.45); } 50% { box-shadow: 0 0 0 14px rgba(255, 90, 90, 0); } }
.rec-timer {
  font-family: var(--display);
  font-size: 54px; line-height: 1; margin: 0 0 10px;
  font-variant-numeric: tabular-nums;
}
.meter { height: 3px; background: var(--surface); margin: 0 0 14px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0%; background: var(--accent); }
.preview { margin-top: 20px; }
.preview audio { width: 100%; margin: 6px 0 16px; filter: invert(1) hue-rotate(180deg); }
.status { margin-top: 16px; font-size: 14px; color: var(--accent); }
.status.error { color: var(--danger); }
.divider { display: flex; align-items: center; gap: 14px; margin: 28px 0 18px; color: var(--faint); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.upload {
  display: block; text-align: center; cursor: pointer;
  padding: 17px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.upload.small { padding: 12px 16px; font-size: 13px; }

/* --- Lists --- */
.list { margin-bottom: 8px; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.list-row .grow { flex: 1; min-width: 0; }
.list-title {
  font-family: var(--display); font-size: 21px; line-height: 1.05;
  text-transform: uppercase; margin: 0 0 3px; overflow-wrap: break-word;
}
.list-meta { margin: 0; font-size: 13px; color: var(--muted); }
.list-play {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.list-play:hover { border-color: var(--accent); color: var(--accent); }
.list-del { color: var(--faint); font-size: 20px; padding: 6px; flex-shrink: 0; }
.list-del:hover { color: var(--danger); }

/* --- Library --- */
.chips { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0 8px; }
.chip {
  padding: 8px 2px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.chip.on { color: var(--text); border-bottom-color: var(--accent); }
.add-med { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 20px; }
.add-med summary {
  cursor: pointer; font-family: var(--display); font-size: 21px;
  text-transform: uppercase; letter-spacing: 0.02em; list-style: none;
}
.add-med summary::-webkit-details-marker { display: none; }
.add-med summary::after { content: " +"; color: var(--accent); }

/* --- Tabs --- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; gap: 4px;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
}
.tab {
  flex: 1; max-width: 130px; padding: 10px 0;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint);
}
.tab.active { color: var(--text); }
.tab.active::after {
  content: ""; display: block; width: 22px; height: 2px;
  background: var(--accent); margin: 5px auto 0;
}

/* --- Player --- */
.player {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg);
  padding: 28px var(--pad) calc(28px + env(safe-area-inset-bottom));
  max-width: var(--max-w); margin: 0 auto;
  overflow-y: auto;
}
.player-close { position: absolute; top: 22px; right: 20px; font-size: 22px; color: var(--muted); padding: 8px; }
.player-title {
  font-family: var(--display); font-size: 44px; line-height: 0.98;
  text-transform: uppercase; margin: 0 0 8px;
}
.player-time {
  font-family: var(--display); font-size: 64px; line-height: 1;
  margin: 26px 0 12px; font-variant-numeric: tabular-nums;
}
.player-time span:last-child { color: var(--faint); font-size: 34px; }
.seek { height: 3px; background: var(--surface); margin-bottom: 26px; cursor: pointer; }
.seek span { display: block; height: 100%; width: 0%; background: var(--accent); }
.player-controls { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.play-btn {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 26px; display: flex; align-items: center; justify-content: center;
}
.chips.center { justify-content: center; margin-bottom: 24px; }

/* --- Login --- */
.login {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  padding: 25vh var(--pad) 40px; max-width: var(--max-w); margin: 0 auto;
}
.login .app-title { margin-bottom: 10px; }
.login .btn-accent { margin-top: 22px; }

@media (min-width: 640px) {
  .app-title { font-size: 64px; }
}
