/* Tempo — built to be read from a few feet away, sweaty, mid-set.
   Dark surfaces (less glare in a garage, easier on the eyes at 6am),
   oversized numerals, and one warm accent doing all the signalling. */

:root {
  /* Surfaces — the warm charcoal-brown from the Rhode Island Golf Fitness card,
     rather than a neutral grey. Sampled from the printed original. */
  --bg:            #1A1715;
  --surface:       #241F1C;
  --surface-2:     #2E2825;
  --surface-3:     #3A332F;
  --line:          #403936;
  --line-soft:     #2E2825;

  /* Text */
  --text:          #F2F0EC;
  --text-2:        #B0A79F;
  --text-3:        #7A716A;

  /* Accents. `--amber` keeps its name because it is referenced in a hundred
     places; it now carries the brand lime. Renaming it would be a rename with
     no behaviour change and a large diff. */
  --amber:         #A9CD60;
  --amber-dim:     #68863B;
  --green:         #A9CD60;
  --green-dim:     #4E6A2C;
  --clay:          #E0705C;
  --clay-dim:      #7A3A2F;

  /* Brand, for the places that should say it out loud */
  --brand-lime:    #A9CD60;
  --brand-olive:   #68863B;
  --brand-brown:   #332D29;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;

  --f-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --f-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, monospace;

  --tab-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100dvh; overscroll-behavior-y: none; }
.hidden { display: none !important; }

.app {
  max-width: 520px; margin: 0 auto;
  min-height: 100dvh; display: flex; flex-direction: column;
}

/* ============================= Topbar ============================= */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(15,19,16,0.88);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px; gap: 12px;
}
.brand-name {
  font-family: var(--f-display);
  font-size: 21px; font-weight: 800;
  letter-spacing: -0.03em;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text-2); cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:active { background: var(--surface-3); color: var(--text); }
.icon-btn.light { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.14); color: #fff; }

.profile-switch {
  display: flex; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px;
}
.profile-btn {
  border: none; background: none; color: var(--text-3);
  font-family: var(--f-body); font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 9px; cursor: pointer;
  transition: background .15s, color .15s;
}
.profile-btn.active { background: var(--amber); color: #14170F; }

.block-strip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 0 16px 11px;
}
.pill {
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 9px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
}
.pill.accent { background: rgba(232,184,75,0.13); border-color: var(--amber-dim); color: var(--amber); }
.pill.done   { background: rgba(224,112,92,0.14); border-color: var(--clay-dim); color: var(--clay); }
.strip-note { font-size: 11px; color: var(--text-3); }

/* ============================= Layout ============================= */
.screen {
  flex: 1; padding: 16px 14px calc(var(--tab-h) + 40px);
  display: flex; flex-direction: column; gap: 14px;
}
.screen-head { padding: 2px 2px 0; }
.screen-title {
  font-family: var(--f-display); font-size: 27px; font-weight: 700;
  letter-spacing: -0.03em; margin: 0;
}
.screen-sub { font-size: 13.5px; color: var(--text-2); margin: 6px 0 0; line-height: 1.5; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 18px 16px;
}
.card-title {
  font-family: var(--f-display); font-size: 16px; font-weight: 700;
  letter-spacing: -0.02em; margin: 0 0 12px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.card-head .card-title { margin: 0; }
.muted { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin: 0 0 12px; }
.hint { font-size: 12px; color: var(--text-3); line-height: 1.5; margin: 8px 0 0; }
.divider { height: 1px; background: var(--line-soft); margin: 20px 0 16px; }

/* ============================= Day header ============================= */
.day-header {
  background: linear-gradient(155deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  position: relative; overflow: hidden;
}
.day-header::after {
  content: ""; position: absolute; right: -50px; top: -50px;
  width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,184,75,0.10), transparent 68%);
  pointer-events: none;
}
.day-eyebrow {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 8px;
}
.day-title {
  font-family: var(--f-display); font-size: 30px; font-weight: 700;
  letter-spacing: -0.035em; line-height: 1.08; margin: 0;
}
.day-focus { font-size: 13.5px; color: var(--text-2); margin: 10px 0 0; line-height: 1.5; }
.override-note {
  margin-top: 12px; padding: 9px 11px;
  background: rgba(232,184,75,0.12); border: 1px solid var(--amber-dim);
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--amber); line-height: 1.4;
}

/* ============================= Forms ============================= */
form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
label {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em;
}
input, select, textarea {
  font-family: var(--f-body); font-size: 16px;
  padding: 12px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232,184,75,0.15);
}
textarea { resize: vertical; font-family: var(--f-body); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8B2A6' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 17px;
  padding-right: 34px;
}
input[type="date"] { min-height: 46px; }

.btn {
  font-family: var(--f-body); font-size: 15px; font-weight: 600;
  padding: 14px; border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; width: 100%; transition: transform .1s, background .15s;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--amber); color: #14170F; }
.btn-ghost {
  background: var(--surface-2); border-color: var(--line); color: var(--text);
  margin-top: 4px;
}
.btn-ghost.danger { color: var(--clay); border-color: var(--clay-dim); }
.btn-row { display: flex; gap: 7px; }
.chip-btn {
  background: rgba(232,184,75,0.12); border: 1px solid var(--amber-dim);
  color: var(--amber); font-family: var(--f-body);
  font-size: 12.5px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.chip-btn.ghost { background: var(--surface-2); border-color: var(--line); color: var(--text-2); }
.status { font-size: 13px; color: var(--green); text-align: center; min-height: 17px; }
.status.error { color: var(--clay); }

.switch-row {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  text-transform: none; letter-spacing: 0;
}
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 44px; height: 26px; border-radius: 999px; flex-shrink: 0;
  background: var(--surface-3); border: 1px solid var(--line);
  position: relative; transition: background .18s;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-3); transition: transform .18s, background .18s;
}
.switch-row input:checked + .switch-track { background: var(--amber); border-color: var(--amber); }
.switch-row input:checked + .switch-track .switch-thumb { transform: translateX(18px); background: #14170F; }
.switch-label { font-size: 13.5px; color: var(--text-2); font-weight: 400; line-height: 1.4; }
.switch-row.compact .switch-label { font-size: 13px; color: rgba(255,255,255,0.7); }

.option-stack { display: flex; flex-direction: column; gap: 8px; }
.option {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 13px; text-align: left;
  cursor: pointer; font-family: var(--f-body);
  display: flex; flex-direction: column; gap: 3px;
}
.option.active { background: rgba(232,184,75,0.11); border-color: var(--amber); }
.option-name { font-size: 14px; font-weight: 600; color: var(--text); }
.option-desc { font-size: 12px; color: var(--text-3); }

/* ============================= Prescribed session ============================= */
.exercise {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 15px 15px 13px;
}
.exercise.skipped { opacity: 0.45; }
.exercise-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 3px;
}
.exercise-name {
  font-family: var(--f-display); font-size: 16.5px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.25;
}
.exercise-target {
  font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3);
  margin-top: 3px; line-height: 1.45;
}
.skip-toggle {
  background: none; border: 1px solid var(--line); color: var(--text-3);
  border-radius: 999px; font-size: 11px; font-weight: 600; font-family: var(--f-body);
  padding: 5px 10px; cursor: pointer; flex-shrink: 0;
}
.exercise.skipped .skip-toggle { background: var(--surface-3); color: var(--text-2); }

.sets { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.set-line {
  display: grid; grid-template-columns: 22px 1fr 14px 1.25fr 42px;
  gap: 7px; align-items: center;
}
.set-num {
  font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3); text-align: center;
}
.set-line input {
  padding: 11px 6px; font-size: 16px; text-align: center;
  font-family: var(--f-mono); font-weight: 500;
}
.set-x { color: var(--text-3); font-size: 13px; text-align: center; }
.set-done {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-3); cursor: pointer; display: grid; place-items: center;
}
.set-done svg { width: 17px; height: 17px; }
.set-line.logged input { color: var(--text-3); border-color: var(--line-soft); }
.set-line.logged .set-done { background: var(--green); border-color: var(--green); color: #10160E; }

.exercise-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 11px;
}
.text-btn {
  background: none; border: none; color: var(--amber);
  font-family: var(--f-body); font-size: 12.5px; font-weight: 600;
  cursor: pointer; padding: 4px 0;
}
.note-input {
  margin-top: 9px; font-size: 13.5px; padding: 10px 11px;
  background: var(--surface-2);
}

.cardio-line { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cardio-line input { font-family: var(--f-mono); text-align: center; }

.check-list { display: flex; flex-direction: column; gap: 2px; }
.check-item {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 11px 2px; text-transform: none; letter-spacing: 0;
  font-size: 14.5px; color: var(--text); font-weight: 400;
  border-bottom: 1px solid var(--line-soft);
}
.check-item:last-child { border-bottom: none; }
.check-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  width: 23px; height: 23px; border-radius: 7px; flex-shrink: 0;
  border: 1.5px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.check-box svg { width: 14px; height: 14px; opacity: 0; color: #10160E; }
.check-item input:checked + .check-box { background: var(--green); border-color: var(--green); }
.check-item input:checked + .check-box svg { opacity: 1; }
.check-meta { font-family: var(--f-mono); font-size: 12px; color: var(--text-3); margin-left: auto; }

.section-label {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-3);
  padding: 6px 2px 0;
}

.cooldown { background: var(--surface-2); border-color: var(--line); }
.cooldown-list {
  display: flex; flex-direction: column; gap: 7px;
  font-size: 13.5px; color: var(--text-2);
}
.cooldown-list div { padding-left: 14px; position: relative; }
.cooldown-list div::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--green-dim);
}

.switcher { border: 1px dashed var(--line); background: transparent; }
.switcher-row { display: flex; gap: 8px; margin-top: 10px; }
.switcher-row select { flex: 1; }

/* ============================= Program ============================= */
.week-tabs { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.week-tabs::-webkit-scrollbar { display: none; }
.week-tab {
  flex: 1 0 auto; min-width: 74px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 10px 8px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  font-family: var(--f-body);
}
.week-tab.active { background: var(--amber); border-color: var(--amber); }
.week-num { font-size: 12.5px; font-weight: 700; color: var(--text); }
.week-name { font-size: 10.5px; color: var(--text-3); }
.week-tab.active .week-num, .week-tab.active .week-name { color: #14170F; }

.program-day {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 3px solid var(--amber-dim);
  border-radius: var(--r); padding: 14px 15px; text-align: left; width: 100%;
  cursor: pointer; font-family: var(--f-body);
  display: flex; flex-direction: column; gap: 4px;
}
.program-day.readonly { border-left-color: var(--green-dim); cursor: default; opacity: 0.75; }
.program-day-top { display: flex; justify-content: space-between; align-items: center; }
.program-weekday {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
}
.edit-hint { font-size: 11.5px; color: var(--amber); font-weight: 600; }
.program-day.readonly .edit-hint { display: none; }
.program-day-type {
  font-family: var(--f-display); font-size: 15.5px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text);
}
.program-day-items { font-size: 11.5px; color: var(--text-3); line-height: 1.55; }
.deload-notice {
  border: 1px dashed var(--green-dim); background: rgba(127,196,106,0.05);
  border-radius: var(--r); padding: 13px 15px; margin-bottom: 2px;
}
.deload-notice p { margin: 0; }

/* ============================= History ============================= */
.history-item {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 3px solid var(--amber-dim);
  border-radius: var(--r); padding: 15px;
}
.history-item.source-apple_watch { border-left-color: var(--clay); }
.history-item.is-rest { border-left-color: var(--green-dim); opacity: 0.8; }
.history-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.history-type {
  font-family: var(--f-display); font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em;
}
.history-date { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); margin-top: 3px; }
.history-meta {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px;
}
.history-meta span {
  font-family: var(--f-mono); font-size: 11px; color: var(--text-2);
  background: var(--surface-2); padding: 3px 8px; border-radius: 6px;
}
.history-detail {
  margin-top: 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.65;
}
.history-detail em { color: var(--text-3); font-style: normal; }
.history-notes {
  margin-top: 9px; font-size: 13px; color: var(--text-2);
  padding-left: 11px; border-left: 2px solid var(--line);
}
.tag {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 3px 7px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-3); white-space: nowrap;
}
.tag.watch { background: rgba(224,112,92,0.15); color: var(--clay); }
.tag.bonus { background: rgba(232,184,75,0.15); color: var(--amber); }
.history-actions { display: flex; gap: 8px; margin-top: 12px; }
.mini-btn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  font-family: var(--f-body); font-size: 12px; font-weight: 600;
  padding: 7px 13px; border-radius: 8px; cursor: pointer;
}
.mini-btn.danger { color: var(--clay); }

.empty {
  text-align: center; padding: 40px 24px; color: var(--text-3);
  font-size: 13.5px; line-height: 1.6;
}

/* ============================= Tiles ============================= */
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 15px;
}
.tile.wide { grid-column: 1 / -1; }
.tile-label {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 7px;
}
.tile-value {
  font-family: var(--f-display); font-size: 30px; font-weight: 700;
  letter-spacing: -0.04em; line-height: 1; color: var(--text);
}
.tile-value .unit {
  font-family: var(--f-body); font-size: 13px; font-weight: 500;
  color: var(--text-3); letter-spacing: 0;
}
.tile-sub { font-size: 12px; color: var(--text-2); margin-top: 7px; line-height: 1.45; }
.tile-sub.up { color: var(--green); }
.tile-sub.down { color: var(--clay); }

.pr-list { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.pr-item {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13.5px; padding: 8px 10px;
  background: var(--surface-2); border-radius: 8px;
}
.pr-item .w { font-family: var(--f-mono); font-size: 13px; color: var(--amber); }

.stall-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.stall-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 11px 12px; background: var(--surface-2);
  border-left: 2px solid var(--clay-dim); border-radius: 8px;
}
.stall-name { font-size: 13.5px; font-weight: 600; }
.stall-weight { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3); }

.inline-select {
  width: auto; max-width: 165px; font-size: 12.5px;
  padding: 8px 30px 8px 11px; border-radius: 999px;
}

.entry {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 13px 14px;
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
}
.entry-date { font-family: var(--f-mono); font-size: 12.5px; color: var(--text); }
.entry-note { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.entry-values { display: flex; gap: 10px; align-items: baseline; }
.entry-values span { font-family: var(--f-mono); font-size: 13px; color: var(--text-2); }
.entry-values .score { font-size: 17px; font-weight: 700; color: var(--amber); }
.holes-tag {
  font-family: var(--f-mono); font-size: 9.5px; text-transform: uppercase;
  background: var(--surface-3); color: var(--text-3); padding: 2px 6px; border-radius: 5px;
}

/* ============================= Tabbar ============================= */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 520px; margin: 0 auto;
  background: rgba(15,19,16,0.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid var(--line-soft);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 2px 9px; font-size: 10.5px; font-weight: 500;
  color: var(--text-3); font-family: var(--f-body);
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--amber); }

/* ============================= Timer ============================= */
.timer-screen {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
}
.timer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timer-modes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.timer-modes::-webkit-scrollbar { display: none; }
.mode-chip {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3);
  font-family: var(--f-body); font-size: 12.5px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.mode-chip.active { background: var(--amber); border-color: var(--amber); color: #14170F; }

.timer-stage {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  min-height: 0;
}
.timer-phase {
  font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-3);
  transition: color .2s;
}
.timer-clock {
  font-family: var(--f-display);
  font-size: clamp(76px, 26vw, 132px);
  font-weight: 800; letter-spacing: -0.05em; line-height: 0.95;
  font-variant-numeric: tabular-nums;
  color: var(--text); transition: color .2s;
}
.timer-round {
  font-family: var(--f-mono); font-size: 14px; color: var(--text-2);
  min-height: 20px;
}
.timer-progress {
  width: 100%; max-width: 300px; height: 5px; margin-top: 18px;
  background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.timer-progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--amber); transition: width .25s linear, background .2s;
}

/* Phase colour carries the state — readable across a garage */
.timer-screen.work  .timer-phase { color: var(--green); }
.timer-screen.work  .timer-clock { color: var(--green); }
.timer-screen.work  .timer-progress-fill { background: var(--green); }
.timer-screen.rest  .timer-phase { color: var(--amber); }
.timer-screen.rest  .timer-clock { color: var(--amber); }
.timer-screen.prep  .timer-phase { color: var(--text-2); }
.timer-screen.done  .timer-clock { color: var(--clay); }
.timer-screen.done  .timer-phase { color: var(--clay); }
.timer-screen.ending .timer-clock { animation: pulse .5s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.timer-config { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.config-row { display: flex; gap: 10px; }
.config-item { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.config-item label {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--text-3); text-align: center;
}
.stepper {
  display: grid; grid-template-columns: 40px 1fr 40px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); overflow: hidden; align-items: stretch;
}
.stepper button {
  background: none; border: none; color: var(--text-2);
  font-size: 20px; cursor: pointer; font-family: var(--f-body); line-height: 1;
}
.stepper button:active { background: var(--surface-3); color: var(--text); }
.stepper .val {
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 17px; font-weight: 500;
  padding: 11px 0; color: var(--text);
}
.config-note { font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.5; }

.timer-controls { display: flex; gap: 10px; align-items: stretch; }
.timer-ctl {
  border-radius: var(--r); cursor: pointer; font-family: var(--f-body);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-size: 11.5px; font-weight: 600; padding: 15px 8px;
  transition: transform .1s;
}
.timer-ctl:active { transform: scale(0.97); }
.timer-ctl svg { width: 22px; height: 22px; }
.timer-ctl.primary {
  flex: 2; background: var(--amber); border: none; color: #14170F; font-size: 14px;
}
.timer-ctl.primary svg { width: 26px; height: 26px; }
.timer-ctl.secondary {
  flex: 1; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
}
.ctl-plus { font-family: var(--f-mono); font-size: 17px; font-weight: 700; color: var(--text); }
.timer-mute { display: flex; justify-content: center; margin-top: 14px; }

/* Mini bar shown when the timer runs behind the app */
.mini-timer {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 10px);
  z-index: 40; max-width: 496px; margin: 0 auto;
  background: var(--amber); color: #14170F; border: none;
  border-radius: var(--r); padding: 13px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  font-family: var(--f-body);
}
.mini-timer.work { background: var(--green); }
.mini-timer.done { background: var(--clay); color: #fff; }
.mini-phase {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; opacity: 0.75;
}
.mini-clock {
  font-family: var(--f-display); font-size: 22px; font-weight: 800;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.mini-open { margin-left: auto; font-size: 12px; font-weight: 600; opacity: 0.75; }

/* ============================= Sheets ============================= */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--surface); width: 100%; max-width: 520px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 90dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  animation: sheet-up .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes sheet-up { from { transform: translateY(18px); opacity: 0.6; } }
.sheet-grip {
  width: 38px; height: 4px; border-radius: 999px;
  background: var(--line); margin: 0 auto 4px; flex-shrink: 0;
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-eyebrow {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 5px;
}
.sheet-title {
  font-family: var(--f-display); font-size: 21px; font-weight: 700;
  letter-spacing: -0.03em; margin: 0;
}
.sheet-section {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.sheet-section > span {
  font-family: var(--f-display); font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em;
}

.editor-row {
  display: grid; grid-template-columns: 1.6fr 0.95fr 0.55fr 0.55fr 0.55fr 32px;
  gap: 5px; align-items: center;
}
.editor-row input, .editor-row select {
  padding: 9px 7px; font-size: 13px; border-radius: 8px;
}
.editor-row select { background-size: 14px; padding-right: 22px; background-position: right 5px center; }
.row-x {
  background: none; border: none; color: var(--clay);
  font-size: 19px; cursor: pointer; line-height: 1; padding: 4px;
}

.wedit-ex {
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 8px;
}
.wedit-name { font-size: 14px; font-weight: 600; }
.wedit-ex .set-line { grid-template-columns: 22px 1fr 14px 1.25fr; }
.wedit-cardio {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 7px;
  align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}

.chip-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 3px; }
.chip-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  font-family: var(--f-body); font-size: 12.5px; font-weight: 600;
  padding: 8px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.cat-chip.active { background: var(--amber); border-color: var(--amber); color: #14170F; }

.picker-results {
  overflow-y: auto; display: flex; flex-direction: column; gap: 15px;
  min-height: 150px; padding-bottom: 4px;
}
.picker-group { display: flex; flex-direction: column; gap: 5px; }
.picker-cat {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3);
  position: sticky; top: 0; background: var(--surface); padding: 4px 0 6px;
}
.picker-item {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 12px 13px; text-align: left; width: 100%;
  cursor: pointer; font-family: var(--f-body);
  display: flex; flex-direction: column; gap: 3px;
}
.picker-item:active { background: rgba(232,184,75,0.12); border-color: var(--amber); }
.picker-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.picker-meta { font-size: 11.5px; color: var(--text-3); line-height: 1.4; }

/* ============================= Toasts ============================= */
.toast-host {
  position: fixed; left: 0; right: 0; top: 0; z-index: 100;
  max-width: 520px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 14px 0;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 13px 15px;
  font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 10px 34px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  pointer-events: auto;
  animation: toast-in .2s cubic-bezier(.2,.8,.3,1);
}
@keyframes toast-in { from { transform: translateY(-10px); opacity: 0; } }
.toast-pr {
  background: var(--amber); color: #14170F; border-color: var(--amber); font-weight: 600;
}
.toast-warn { background: var(--clay-dim); border-color: var(--clay); color: #FFE8E2; }
.toast-action {
  background: rgba(0,0,0,0.22); border: none; color: inherit;
  font-family: var(--f-body); font-size: 12px; font-weight: 700;
  padding: 7px 13px; border-radius: 8px; cursor: pointer; flex-shrink: 0;
}

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================= Practice block ============================= */
.practice {
  border: 1px solid var(--green-dim);
  background: linear-gradient(160deg, rgba(127,196,106,0.05), var(--surface) 55%);
}
.practice-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.practice-eyebrow {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--green); margin-bottom: 5px;
}
#practiceCollapse { transition: transform .2s; }

.practice-drill { align-items: flex-start; padding: 12px 2px; }
.practice-drill .check-box { margin-top: 1px; }
.drill-text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.drill-name { font-size: 14.5px; font-weight: 500; }
.drill-cue { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.practice-drill .check-meta { align-self: flex-start; margin-top: 2px; }

.practice-note {
  margin-top: 14px; padding: 12px 13px;
  background: var(--surface-2); border-left: 2px solid var(--green-dim);
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}

.sim-tips { margin-top: 12px; }
.sim-tips summary {
  font-size: 13px; font-weight: 600; color: var(--amber);
  cursor: pointer; padding: 8px 0; list-style: none;
}
.sim-tips summary::-webkit-details-marker { display: none; }
.sim-tips summary::before { content: "▸ "; color: var(--text-3); }
.sim-tips[open] summary::before { content: "▾ "; }
.sim-tips ul {
  margin: 4px 0 0; padding-left: 18px;
  font-size: 12.5px; color: var(--text-2); line-height: 1.65;
}
.sim-tips li { margin-bottom: 5px; }

.practice-actions { margin-top: 14px; }
.practice #practiceLengths { margin: 14px 0 6px; }

/* ============================= Schedule conflicts ============================= */
.conflict {
  background: var(--surface-2); border-radius: var(--r-sm);
  border-left: 3px solid var(--text-3); padding: 13px 14px;
  display: flex; flex-direction: column; gap: 7px;
}
.conflict.sev-high { border-left-color: var(--clay); }
.conflict.sev-moderate { border-left-color: var(--amber); }
.conflict.sev-low { border-left-color: var(--text-3); }
.conflict-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; flex-wrap: wrap;
}
.conflict-day { font-size: 14px; font-weight: 600; }
.conflict-when { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); }
.conflict.sev-high .conflict-when { color: var(--clay); }
.conflict-why { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.conflict-hint { font-size: 12px; color: var(--text-3); font-style: italic; }
.conflict-swap { align-self: flex-start; margin-top: 2px; }

/* ============================= How-to guides ============================= */
button.exercise-name {
  background: none; border: none; padding: 0; text-align: left;
  font-family: var(--f-display); font-size: 16.5px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.25; color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.howto-mark {
  width: 17px; height: 17px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-3); color: var(--text-3);
  font-family: var(--f-body); font-size: 10.5px; font-weight: 700;
  display: inline-grid; place-items: center; line-height: 1;
}
button.exercise-name:active .howto-mark { background: var(--amber); color: #14170F; }
.howto-mark.standalone {
  border: none; cursor: pointer; width: 20px; height: 20px; font-size: 11px;
}
.howto-mark.standalone:active { background: var(--amber); color: #14170F; }
.mob-name { flex: 1; }
.check-item .howto-mark.standalone { margin-left: 8px; }

.picker-row { display: flex; align-items: stretch; gap: 7px; }
.picker-row .picker-item { flex: 1; }
.picker-howto { align-self: center; flex-shrink: 0; }

.howto-step {
  padding: 13px 14px; background: var(--surface-2);
  border-radius: var(--r-sm); border-left: 3px solid var(--line);
  margin-bottom: 9px;
}
.howto-step.watch { border-left-color: var(--amber); }
.howto-step.danger { border-left-color: var(--clay); }
.howto-label {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 6px;
}
.howto-step.watch .howto-label { color: var(--amber); }
.howto-step.danger .howto-label { color: var(--clay); }
.howto-step p {
  margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-2);
}
.howto-link { /* tappable exercise title — styling comes from button.exercise-name */ }

/* ============================= Desktop ============================= */
/* The app is phone-first, but it gets used on a PC too. On a wide screen a
   bottom-anchored sheet reads as an accident, so centre it as a dialog. */
@media (min-width: 640px) and (min-height: 620px) {
  .sheet-backdrop { align-items: center; }
  .sheet {
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    max-height: 82dvh;
    padding-bottom: 20px;
    animation: sheet-in .2s cubic-bezier(.2,.8,.3,1);
  }
  .sheet-grip { display: none; }
  @keyframes sheet-in { from { transform: translateY(10px) scale(.99); opacity: 0; } }

  .mini-timer { bottom: calc(var(--tab-h) + 14px); }
}

/* Hover states only where there's a real pointer */
@media (hover: hover) {
  .picker-item:hover { background: rgba(232,184,75,0.10); border-color: var(--amber); }
  .program-day:not(.readonly):hover { border-color: var(--amber-dim); }
  .btn-primary:hover { filter: brightness(1.06); }
  .btn-ghost:hover, .mini-btn:hover { background: var(--surface-3); }
  .howto-mark:hover, button.exercise-name:hover .howto-mark { background: var(--amber); color: #14170F; }
  .set-done:hover { border-color: var(--amber); color: var(--amber); }
  .set-line.logged .set-done:hover { background: var(--green); color: #10160E; }
  .tab:hover { color: var(--text-2); }
  .tab.active:hover { color: var(--amber); }
  .icon-btn:hover { color: var(--text); border-color: var(--line); }
}

/* Exercise titles read as tappable on a desktop pointer */
@media (hover: hover) {
  button.exercise-name:hover { color: var(--amber); }
}


/* ---------------------------------------------------------------------------
   Sign-in gate
   Sits above everything until there's a session. Same dark surface as the app
   so signing in doesn't feel like a different product.
--------------------------------------------------------------------------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.gate[hidden] { display: none; }

.gate-card {
  width: 100%;
  max-width: 380px;
}

.gate-brand {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  color: var(--amber);
}

.gate-panel[hidden] { display: none; }

.gate-title {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
}

.gate-hint {
  font-size: 13px;
  opacity: 0.6;
  margin: 0 0 16px;
}

.gate-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin: 16px 0 6px;
}

.gate-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px; /* 16px stops iOS zooming the page on focus */
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
}
.gate-input:focus {
  outline: none;
  border-color: var(--amber);
}

.gate-btn {
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  background: var(--amber);
  color: #14100A;
  cursor: pointer;
}
.gate-btn:disabled { opacity: 0.5; cursor: default; }

.gate-error {
  margin: 14px 0 0;
  font-size: 14px;
  color: #FF6B6B;
}
.gate-error[hidden] { display: none; }

/* A coach viewing a client — makes it obvious whose data is on screen. */
.viewing-as {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
  margin-right: 8px;
}


/* Google sign-in. White button per Google's branding requirements — it has to
   look like their button, not like ours. */
.gate-google {
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #1F1F1F;
  background: #FFFFFF;
  border: 1px solid #DADCE0;
  border-radius: 10px;
  cursor: pointer;
}
.gate-google[hidden] { display: none; }
@media (hover: hover) {
  .gate-google:hover { background: #F5F5F5; }
}

.gate-or {
  position: relative;
  text-align: center;
  margin: 20px 0 4px;
}
.gate-or[hidden] { display: none; }
.gate-or::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}
.gate-or span {
  position: relative;
  padding: 0 12px;
  background: var(--bg);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
}


/* ---------------------------------------------------------------------------
   Coach: roster, intake, review
--------------------------------------------------------------------------- */
.roster-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  background: var(--surface, rgba(255,255,255,0.03));
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}
.roster-main { flex: 1; min-width: 0; }
.roster-name { font-size: 16px; font-weight: 600; }
.roster-meta { font-size: 13px; opacity: 0.55; margin-top: 3px; }
.roster-chevron { opacity: 0.35; }

.field-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.6;
  margin: 14px 0 6px;
}
.field-hint { font-size: 12px; opacity: 0.5; margin: 4px 0 0; }
.field-input, .field-select, .field-textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
  padding: 12px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: inherit;
}
.field-textarea { min-height: 74px; resize: vertical; }
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--amber, #E8B84B);
}
.field-unit { font-size: 12px; opacity: 0.5; margin-left: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.chip {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.chip.on {
  background: rgba(232,184,75,0.15);
  border-color: var(--amber-dim, rgba(232,184,75,0.4));
  color: var(--amber, #E8B84B);
}
.chip .rank-num { font-family: var(--f-mono, monospace); opacity: 0.7; margin-right: 5px; }

/* A generated program that needed patching. Never hidden — a program the app
   had to correct is one to read more carefully, not less. */
.warn-box {
  border: 1px solid var(--clay-dim, rgba(224,112,92,0.4));
  background: rgba(224,112,92,0.09);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
}
.warn-box .warn-title { font-weight: 600; color: var(--clay, #E0705C); margin-bottom: 6px; }
.warn-box ul { margin: 0; padding-left: 18px; font-size: 13px; opacity: 0.85; }

.review-day { margin-bottom: 14px; }
.review-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}
.review-day-name { font-weight: 600; }
.review-weekday { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; opacity: 0.5; }
.review-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.review-item-main { flex: 1; min-width: 0; }
.review-item-name { font-size: 15px; }
.review-item-note { font-size: 12px; opacity: 0.5; margin-top: 2px; }
.review-item-dose { font-family: var(--f-mono, monospace); font-size: 13px; opacity: 0.75; }
.review-drop {
  border: 0;
  background: transparent;
  color: var(--clay, #E0705C);
  font-size: 19px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.copy-row { display: flex; gap: 7px; align-items: center; margin-top: 8px; }
.copy-row input {
  flex: 1;
  font-family: var(--f-mono, monospace);
  font-size: 12px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: inherit;
}
.status-line { font-size: 13px; margin-top: 10px; min-height: 18px; }
.status-line.ok { color: var(--amber, #E8B84B); }
.status-line.bad { color: var(--clay, #E0705C); }


/* ---------------------------------------------------------------------------
   Ask — the coaching assistant
--------------------------------------------------------------------------- */
.chat-log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.chat-msg {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 13px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-msg.user {
  align-self: flex-end;
  background: rgba(232,184,75,0.14);
  border: 1px solid var(--amber-dim, rgba(232,184,75,0.35));
}
.chat-msg.assistant {
  align-self: flex-start;
  background: var(--surface, rgba(255,255,255,0.04));
  border: 1px solid var(--line, rgba(255,255,255,0.1));
}
.chat-msg.pending { opacity: 0.55; font-style: italic; }
.chat-msg.error {
  align-self: flex-start;
  border-color: var(--clay-dim, rgba(224,112,92,0.4));
  background: rgba(224,112,92,0.1);
  color: var(--clay, #E0705C);
}

.chat-composer { display: flex; gap: 8px; align-items: flex-end; }
.chat-input {
  flex: 1;
  font-family: inherit;
  font-size: 16px;
  padding: 12px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: inherit;
  resize: none;
  max-height: 140px;
}
.chat-input:focus { outline: none; border-color: var(--amber, #E8B84B); }
.chat-send { white-space: nowrap; }

.chat-suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 14px; }
.chat-suggestion {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px dashed rgba(255,255,255,0.18);
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}


/* ---------------------------------------------------------------------------
   Assistant dock
   Persistent across screens. Sits in the same band as the rest timer, so when
   that appears the launcher steps up out of its way rather than under it.
--------------------------------------------------------------------------- */
.ask-fab {
  position: fixed; right: 12px;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 10px);
  z-index: 35;
  display: flex; align-items: center; gap: 7px;
  padding: 11px 16px;
  border: 1px solid var(--amber-dim, rgba(232,184,75,0.4));
  border-radius: 999px;
  background: rgba(15,19,16,0.94);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: var(--amber, #E8B84B);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.ask-fab[hidden] { display: none; }
.ask-fab svg { width: 18px; height: 18px; }
/* Set by showMini()/hideMini() so the two never stack on each other */
body.timer-docked .ask-fab {
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 72px);
}

.ask-panel {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  z-index: 45;
  max-width: 520px; margin: 0 auto;
  max-height: min(72vh, 620px);
  display: flex; flex-direction: column;
  background: rgba(15,19,16,0.98);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  padding: 14px 14px 12px;
}
.ask-panel.hidden { display: none; }

.ask-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft, rgba(255,255,255,0.07));
}
.ask-title {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 19px; font-weight: 700;
}
.ask-sub { font-size: 12px; opacity: 0.55; margin-top: 2px; max-width: 34ch; }

.ask-panel .chat-log {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 2px; margin-bottom: 10px;
}


/* ---------------------------------------------------------------------------
   The plan document
--------------------------------------------------------------------------- */
.plan-section { margin-top: 16px; }
.plan-heading {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em;
  opacity: 0.55; margin-bottom: 5px;
}
.plan-body { font-size: 14.5px; line-height: 1.55; margin: 0 0 4px; }
.plan-goal {
  border-left: 2px solid var(--amber-dim, rgba(232,184,75,0.4));
  padding-left: 12px; margin: 12px 0;
}
.plan-goal-name { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.plan-toggle {
  background: none; border: 0; color: var(--amber, #E8B84B);
  font-family: inherit; font-size: 14px; cursor: pointer; padding: 8px 0;
}


/* ---------------------------------------------------------------------------
   The `hidden` attribute only sets display:none in the UA stylesheet, so any
   component rule with its own `display` silently wins and the element stays on
   screen. That's how a coach-only tab ended up visible to clients. This makes
   `hidden` mean hidden, whatever a component sets.
--------------------------------------------------------------------------- */
[hidden] { display: none !important; }


/* --- Note of the day, above today's session --- */
.motd {
  border: 1px solid var(--amber-dim, rgba(232,184,75,0.35));
  background: rgba(232,184,75,0.07);
  border-radius: var(--r, 12px);
  padding: 15px 17px;
  margin-bottom: 14px;
}
.motd-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--amber, #E8B84B); margin-bottom: 6px;
}
.motd-text { font-size: 15.5px; line-height: 1.5; margin: 0; }

/* --- Help sheet --- */
.help-group { margin-top: 4px; }
.help-group + .help-group { margin-top: 18px; }
.help-group h4 {
  font-family: var(--f-display, inherit);
  font-size: 15px; font-weight: 700; margin: 0 0 8px;
}
.help-item { display: flex; gap: 10px; padding: 7px 0; align-items: baseline; }
.help-where {
  flex: 0 0 96px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--amber, #E8B84B); padding-top: 2px;
}
.help-what { flex: 1; font-size: 14.5px; line-height: 1.5; }
.help-what b { font-weight: 600; }
.help-intro { font-size: 14.5px; line-height: 1.55; opacity: 0.75; margin: 0 0 6px; }
@media (max-width: 460px) {
  .help-item { flex-direction: column; gap: 2px; }
  .help-where { flex: none; }
}


/* --- Messages between coach and client, inside the Ask panel --- */
.dm-block {
  border-bottom: 1px solid var(--line-soft, rgba(255,255,255,0.08));
  padding-bottom: 12px; margin-bottom: 4px;
  display: flex; flex-direction: column; gap: 8px;
}
.dm-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  opacity: 0.5;
}
.chat-msg.dm { border-style: dashed; }
.dm-from {
  display: block; font-size: 11px; opacity: 0.6;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px;
}
.chat-msg.dm-sent { font-size: 13px; opacity: 0.7; font-style: italic; }


/* --- Brand marks --- */
/* The header carries the mark, three controls and the profile switch. On a
   phone that is already full, so the wordmark only appears once there is room
   for it — a clipped brand reads worse than no brand. */
.brand-lockup { display: flex; align-items: center; gap: 9px; min-width: 0; flex-shrink: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line);
}
.brand-words { display: none; flex-direction: column; line-height: 1.05; }
.brand-ri, .brand-gf { white-space: nowrap; }
.brand-ri {
  font-family: var(--f-display);
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brand-lime);
}
.brand-gf {
  font-family: var(--f-display);
  font-size: 14px; font-weight: 800; letter-spacing: -0.015em;
  color: var(--text);
}
@media (min-width: 430px) {
  .brand-words { display: flex; }
}

/* The card itself, on the way in */
.gate-card-image {
  display: block; width: 100%; max-width: 168px;
  margin: 0 auto 18px; border-radius: 10px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}
.gate-tagline {
  text-align: center; font-size: 11.5px; line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--brand-lime); margin: 0 0 18px;
}


.toggle-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--amber); }
.settings-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row .grow { flex: 1; min-width: 0; }
.settings-row .sub { font-size: 12px; opacity: 0.55; }


/* --- Booking --- */
.book-day { margin-top: 16px; }
.book-day-head {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-2); margin-bottom: 7px;
}
.book-slots { display: flex; flex-wrap: wrap; gap: 7px; }
.book-slot {
  padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: inherit; font-family: var(--f-mono); font-size: 14px; cursor: pointer;
}
.book-slot:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) { .book-slot:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); } }

.session-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.session-row:last-child { border-bottom: none; }
.session-when { font-family: var(--f-mono); font-size: 14px; color: var(--amber); min-width: 108px; }
.session-what { flex: 1; font-size: 14.5px; }

.avail-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.avail-day { flex: 0 0 46px; font-size: 13px; }
.avail-row input[type="number"] {
  width: 66px; font-family: var(--f-mono); text-align: center;
  padding: 8px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04); color: inherit;
}
.avail-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--amber); }

/* Unread/awaiting-reply count on the Ask launcher */
.ask-badge {
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--clay); color: #fff;
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.ask-badge[hidden] { display: none; }


/* --- Goals --- */
.goal { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.goal:last-child { border-bottom: none; }
.goal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.goal-name { font-size: 15.5px; font-weight: 600; }
.goal-now { font-family: var(--f-mono); font-size: 15px; color: var(--amber); }
.goal-bar { height: 5px; border-radius: 999px; background: var(--surface-3); margin: 9px 0 6px; overflow: hidden; }
.goal-fill { height: 100%; background: var(--amber); border-radius: 999px; }
.goal-meta { font-size: 12px; opacity: 0.55; }
.goal-log { display: flex; gap: 7px; margin-top: 10px; }
.goal-log input {
  flex: 1; font-family: var(--f-mono); text-align: center; font-size: 16px;
  padding: 10px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04); color: inherit;
}
.goal-locked { font-size: 12.5px; opacity: 0.5; margin-top: 8px; }
