/* ═══════════════ VIVOS — TRAINING LOG ═══════════════ */
/* Inspired by Slate + Ash / Orchestral Tools           */
/* Deep navy, warm muted accents, generous space        */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg: #050911;
  --surface: #0a1018;
  --surface-2: #101723;
  --surface-3: #161f2d;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.10);
  --text: #cdc7be;
  --text-light: #e2ddd6;
  --text-dim: #7a8a9e;
  --text-muted: #4e5f74;

  /* Warm muted accents */
  --rose: #c4917b;
  --rose-dim: rgba(196, 145, 123, 0.12);
  --rust: #a24e2b;
  --rust-dim: rgba(162, 78, 43, 0.18);
  --copper: #c47a3a;
  --copper-dim: rgba(196, 122, 58, 0.12);
  --sage: #7ab08a;
  --sage-dim: rgba(122, 176, 138, 0.10);
  --slate-blue: #7a8fa8;
  --slate-blue-dim: rgba(122, 143, 168, 0.12);
  --lavender: #9b8abf;
  --lavender-dim: rgba(155, 138, 191, 0.12);
  --warm-white: #e8e0d4;

  --radius: 8px;
  --radius-sm: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html { overflow-x: hidden; }

/* ═══════════════ RADIUM FIELD DOCTRINE — LAW 1 (universal) ═══════════════ */
input, select, textarea {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* ═══════════════ SHELL LAYOUT ═══════════════ */

:root {
  --topbar-h: 56px;
  --sidebar-w: 240px;
  --mode-rust: #a24e2b;
  --mode-sage: #7a8a6a;
  --mode-rose: #c4917b;
}

/* Top bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}
.topbar-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--warm-white);
}

/* Mode tabs (Train / Body / Vivos) */
.mode-tabs {
  display: flex;
  gap: 4px;
  justify-self: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 4px;
}
.mode-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.mode-tab:hover { color: var(--text-light); }
.mode-tab.active {
  color: var(--warm-white);
  background: var(--surface-3);
}
.mode-tab.active[data-mode="train"]  { box-shadow: inset 0 -2px 0 var(--mode-rust); }
.mode-tab.active[data-mode="body"]   { box-shadow: inset 0 -2px 0 var(--mode-sage); }
.mode-tab.active[data-mode="vivos"]  { box-shadow: inset 0 -2px 0 var(--mode-rose); }

/* Topbar icon buttons (sidebar toggle, chat history) */
.topbar-icon-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.topbar-icon-btn:hover {
  color: var(--rose);
  border-color: rgba(196, 145, 123, 0.4);
  background: rgba(196, 145, 123, 0.06);
}
.sidebar-toggle-btn { color: var(--text-dim); }

/* Shell — body area below the topbar */
.shell {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
}

/* Sidebar — slide-out drawer at all sizes (toggle from topbar hamburger) */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 60;
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.5);
}
.sidebar.open { transform: translateX(0); }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px 8px;
}
.sidebar-section {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 14px 12px 6px;
  user-select: none;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
}
.sidebar-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--warm-white);
  font-weight: 500;
}
.sidebar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
  transition: box-shadow 0.2s;
}
.sidebar-item.active .sidebar-dot {
  box-shadow: 0 0 8px currentColor;
}
/* Mode-specific dot colors */
.mode-train .sidebar-item .sidebar-dot { background: var(--mode-rust); }
.mode-train .sidebar-item.active        { color: #d97a4d; }
.mode-body  .sidebar-item .sidebar-dot { background: var(--mode-sage); }
.mode-body  .sidebar-item.active        { color: #9bb087; }
.mode-vivos .sidebar-item .sidebar-dot { background: var(--mode-rose); }
.mode-vivos .sidebar-item.active        { color: var(--rose); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mode-sage);
  box-shadow: 0 0 8px rgba(122, 138, 106, 0.4);
}

/* Sidebar mobile backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s;
}
.sidebar-backdrop.open {
  display: block;
  opacity: 1;
}

/* Main content area */
.content {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 28px 24px;
}
.content > .panel {
  max-width: 820px;
  margin: 0 auto;
}

.panel { display: none; }
.panel.active { display: block; }

/* ═══════════════ CARDS ═══════════════ */

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

.card h2 {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

/* ═══════════════ STREAKS ═══════════════ */

.streaks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.streak-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}

.streak-item:hover { border-color: var(--border-strong); }

.streak-days {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 6px;
}

.streak-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

.streak-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.5px;
}

.streak-nicotine .streak-days { color: var(--sage); }
.streak-thc .streak-days { color: var(--lavender); }
.streak-alcohol .streak-days { color: var(--slate-blue); }

/* ═══════════════ WEEKLY VOLUME ═══════════════ */

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.weekly-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
}

.weekly-count {
  font-size: 28px;
  font-weight: 300;
  color: var(--rose);
}

.weekly-type {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.weekly-mins {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 300;
}

.weekly-total {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--rose-dim);
  border: 1px solid rgba(196, 145, 123, 0.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 400;
  color: var(--rose);
  letter-spacing: 0.5px;
}

/* ═══════════════ TODAY ═══════════════ */

.today-text {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-light);
  line-height: 1.6;
}

.today-text strong {
  font-weight: 500;
  color: var(--warm-white);
}

.today-rest {
  color: var(--text-dim);
  font-style: italic;
  font-weight: 300;
}

/* ═══════════════ SESSIONS LIST ═══════════════ */

.session-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.session-item:last-child { border-bottom: none; }

.session-type-badge {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.badge-climb { background: var(--sage-dim); color: var(--sage); border: 1px solid rgba(122, 176, 138, 0.15); }
.badge-strength { background: var(--copper-dim); color: var(--copper); border: 1px solid rgba(196, 122, 58, 0.15); }
.badge-cardio { background: var(--rose-dim); color: var(--rose); border: 1px solid rgba(196, 145, 123, 0.15); }
.badge-mobility { background: var(--slate-blue-dim); color: var(--slate-blue); border: 1px solid rgba(122, 143, 168, 0.15); }
.badge-rest { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

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

.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-item.collapsible .session-header { cursor: pointer; }

.session-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.session-item.expanded .session-chevron {
  transform: rotate(90deg);
}

.session-detail {
  display: none;
}

.session-item.expanded .session-detail {
  display: block;
}

.session-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 4px;
}

.session-meta {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-weight: 300;
}

.session-meta span {
  position: relative;
}

.session-meta span + span::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  width: 2px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 50%;
}

.session-notes {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.5;
  font-weight: 300;
}

.session-exercises {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 300;
}

.session-exercises li {
  margin-left: 16px;
  margin-bottom: 3px;
  list-style-type: none;
  position: relative;
}

.session-exercises li::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 7px;
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.3px;
}

/* ═══════════════ GOALS ═══════════════ */

.goal-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.goal-item:last-child { border-bottom: none; }

.goal-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 10px;
}

.goal-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.progress-bar {
  flex: 1;
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--rose);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 300;
}

.goal-target {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ═══════════════ FORM ═══════════════ */

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

/* Two independent fields side by side — table layout forces equal widths */
.dual-field {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-spacing: 12px 0;
  margin: 0 -12px;
  margin-bottom: 24px;
}

.dual-field-item {
  display: table-cell;
  vertical-align: top;
}

.dual-field-label {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.dual-field-input {
  display: block;
  width: 100%;
  height: 48px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 300;
  color: var(--text-light);
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  outline: none;
  transition: border-color 0.3s;
}

.dual-field-input:focus {
  border-color: var(--rose);
}

.dual-field-input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

.form-row .form-group { margin-bottom: 24px; }

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 300;
  outline: none;
  overflow: hidden;
  transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--rose);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

/* Date input styling */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
}

/* Type selector */
.type-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.type-btn {
  padding: 8px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
}

.type-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.type-btn.active {
  background: var(--rose-dim);
  border-color: rgba(196, 145, 123, 0.25);
  color: var(--rose);
}

/* RPE Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  outline: none;
  border: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--rose);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(196, 145, 123, 0.3);
}

.rpe-value {
  font-size: 14px;
  font-weight: 400;
  color: var(--rose);
  margin-left: 8px;
}

/* Conditional fields */
.conditional-fields {
  padding: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.conditional-fields .form-row {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Exercise entry */
.exercise-entry {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: end;
}

.exercise-entry input {
  padding: 8px 10px;
  font-size: 13px;
}

.exercise-entry .remove-exercise {
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all 0.2s;
}

.exercise-entry .remove-exercise:hover {
  color: var(--rose);
  border-color: rgba(196, 145, 123, 0.3);
}

.exercise-labels {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--rose);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.feedback {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 300;
  min-height: 20px;
  letter-spacing: 0.3px;
}

.feedback.success { color: var(--sage); }
.feedback.error { color: var(--rose); }

/* ═══════════════ HISTORY ═══════════════ */

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

.history-header h2 { margin-bottom: 0; }

.history-header select {
  width: auto;
  padding: 6px 12px;
  font-size: 11px;
  background: var(--surface-2);
  letter-spacing: 0.5px;
}

/* ═══════════════ SCHEDULE ═══════════════ */

.schedule-day {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.schedule-day:last-child { border-bottom: none; }
.schedule-day:hover { background: var(--surface-2); }

.schedule-day.is-today {
  background: var(--surface-2);
  border-left: 2px solid var(--rose);
  padding-left: 22px;
}

.sched-day-name {
  width: 36px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.is-today .sched-day-name { color: var(--rose); }

.sched-modules {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sched-module-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sched-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-light);
}

.sched-rest {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  font-weight: 300;
}

.sched-exercises {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 300;
  line-height: 1.4;
  margin-top: 4px;
}

.sched-edit-icon {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.schedule-day:hover .sched-edit-icon { opacity: 1; }

/* Override indicators — template vs modified */
.sched-template-dimmed {
  opacity: 0.4;
  text-decoration: line-through;
}
.sched-override {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.override-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--copper);
  background: rgba(196, 145, 123, 0.12);
  border: 1px solid rgba(196, 145, 123, 0.25);
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}
.sched-reason {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
}
.today-template-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
  margin-top: 4px;
}
.schedule-day.has-override {
  border-left: 2px solid var(--copper);
}

/* Quick-swap bar on Today's Session page */
.swap-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.swap-chip {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.swap-chip:hover {
  border-color: var(--rose);
  color: var(--rose);
}
.swap-chip.swap-active {
  background: rgba(196, 145, 123, 0.12);
  border-color: rgba(196, 145, 123, 0.4);
  color: var(--rose);
  font-weight: 500;
}
.swap-chip.swap-revert {
  border-color: rgba(196, 145, 123, 0.3);
  color: var(--copper);
  font-weight: 500;
  font-style: italic;
}

/* Drag handle for reordering days */
.sched-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 28px;
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: -2px;
  cursor: grab;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.schedule-day:hover .sched-drag-handle { opacity: 0.8; }
.sched-drag-handle:hover { color: var(--rust); }
.sched-drag-handle:active { cursor: grabbing; }

/* Sortable drag states */
.sched-drag-ghost {
  opacity: 0.25;
  background: var(--surface-3);
}
.sched-drag-chosen {
  background: var(--surface-2);
}
.sched-dragging {
  background: var(--surface-3);
  border: 1px solid var(--rust);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0.95;
}

/* Schedule modal slot picker */
.sched-slot-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.sched-module-select {
  flex: 1;
}

.remove-slot {
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.remove-slot:hover { color: var(--rose); border-color: rgba(196, 145, 123, 0.3); }

/* ═══════════════ MODULES TAB ═══════════════ */

.module-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.module-card:last-child { border-bottom: none; }
.module-card:hover { background: var(--surface-2); }

.module-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-card-name {
  flex: 1;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
}

.module-card-preview {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 300;
  margin-top: 6px;
  line-height: 1.4;
  padding-left: 0;
}

.btn-new {
  padding: 6px 14px;
  background: var(--rose-dim);
  border: 1px solid rgba(196, 145, 123, 0.2);
  border-radius: 20px;
  color: var(--rose);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-new:hover { border-color: var(--rose); }

.btn-delete {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(196, 145, 123, 0.2);
  border-radius: var(--radius-sm);
  color: var(--rose);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete:hover { background: var(--rose-dim); }

/* ═══════════════ EXERCISE LIBRARY ═══════════════ */

.exercise-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover { border-color: rgba(255,255,255,0.15); color: var(--text-dim); }

.filter-btn.active {
  background: var(--rose-dim);
  border-color: rgba(196, 145, 123, 0.25);
  color: var(--rose);
}

.lib-exercise {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.lib-exercise:last-child { border-bottom: none; }
.lib-exercise:hover { background: var(--surface-2); }

.lib-exercise-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lib-cat-badge {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  flex-shrink: 0;
}

.lib-exercise-name {
  flex: 1;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
}

.lib-exercise-detail {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 300;
  margin-top: 4px;
}

/* ═══════════════ DAY EXERCISE CHIPS ═══════════════ */

.day-exercise-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.day-ex-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.day-ex-name {
  flex: 1;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-light);
}

.day-ex-detail {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 300;
}

.day-ex-remove {
  padding: 2px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s;
}

.day-ex-remove:hover { color: var(--rose); }

.exercise-picker { margin-top: 4px; }

.exercise-picker-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
  transition: border-color 0.2s;
}

.exercise-picker-select:hover { border-color: var(--rose); }

/* ═══════════════ EXERCISE BLOCKS (per-set logging) ═══════════════ */

.ex-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}

.ex-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.ex-block-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
}

.ex-block-add-set {
  padding: 3px 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.ex-block-add-set:hover { border-color: var(--sage); color: var(--sage); }

.ex-block-remove {
  padding: 3px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s;
}

.ex-block-remove:hover { color: var(--rose); }

.ex-block-sets {
  padding: 6px 12px 8px;
}

.set-row {
  display: grid;
  grid-template-columns: 28px 64px 1fr auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.set-num {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

.set-row input[type="number"] {
  padding: 8px 6px;
  font-size: 13px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  text-align: center;
  -moz-appearance: textfield;
}

.set-row input[type="number"]::-webkit-inner-spin-button,
.set-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Weight stepper */
.weight-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-3);
}

.weight-stepper input {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  width: 56px;
  padding: 8px 4px !important;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}

.weight-stepper input:disabled {
  opacity: 0.3;
}

.ws-btn {
  padding: 8px 10px;
  background: var(--surface-2);
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.ws-btn:hover { background: var(--surface); color: var(--text-light); }
.ws-btn:active { background: var(--rose-dim); color: var(--rose); }

.ws-bw {
  padding: 8px 10px;
  background: var(--surface-2);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.ws-bw:hover { color: var(--text-dim); }

.ws-bw.active {
  background: var(--sage-dim);
  color: var(--sage);
}

.set-remove {
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s;
}

.set-remove:hover { color: var(--rose); }

@media (max-width: 440px) {
  .set-row { grid-template-columns: 24px 52px 1fr auto; gap: 4px; }
  .ws-btn { padding: 8px 8px; font-size: 13px; }
  .weight-stepper input { width: 44px; }
}

/* ═══════════════ FINGERBOARD ═══════════════ */

/* ── Fingerboard ── Endo form-group pattern: label above, input full-width, unit below ── */

.fb-hang-labels { display: none; }

.fb-hang-row {
  padding: 14px;
  margin-bottom: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.fb-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

/* Sets display: "done / target" */
.fb-sets-display {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 40px;
}
.fb-sets-done {
  font-size: 14px;
  font-weight: 500;
  color: var(--rust);
  min-width: 12px;
  text-align: center;
}
.fb-sets-target {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  width: 30px !important;
  min-width: 30px;
  text-align: center !important;
  font-size: 14px;
  color: var(--text-light);
}

/* Timer bar — hang/rest countdown with auto-cycling */
.fb-timer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
/* (fb-timer-start uses .timer-btn from the tape-deck transport system) */
.fb-timer-state {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
}
.fb-timer-state.fb-timer-hanging { color: var(--rust); }
.fb-timer-state.fb-timer-resting { color: #6b8a9c; }
.fb-timer-state.fb-timer-paused { color: var(--text-dim); }
.fb-timer-state.fb-timer-done { color: #7a8a6a; }
.fb-timer-display {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 300;
  color: var(--text-light);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* (master pause/reset buttons now use the shared .timer-btn system) */

/* Fingerboard rest input with preset buttons */
.fb-rest-wrap {
  display: flex;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}
.fb-rest-wrap .fb-rest {
  flex: 1;
  min-width: 0;
}
.fb-rest-presets {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.fb-rest-preset {
  background: rgba(162, 78, 43, 0.1);
  border: 1px solid rgba(162, 78, 43, 0.28);
  color: var(--rust);
  border-radius: 6px;
  padding: 0 10px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-width: 34px;
  height: 38px;
  line-height: 1;
}
.fb-rest-preset:hover {
  background: rgba(162, 78, 43, 0.2);
}
.fb-rest-preset.active {
  background: rgba(162, 78, 43, 0.28);
  border-color: var(--rust);
}

/* GET READY state — 3-second positioning buffer */
.fb-timer-state.fb-timer-ready { color: #c4917b; }

/* Cardio block — duration / distance / calories */
.ex-block-cardio .cardio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.cardio-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cardio-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.cardio-field input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-family: var(--font);
  font-size: 14px;
  text-align: center;
}
@media (max-width: 440px) {
  .ex-block-cardio .cardio-grid { grid-template-columns: 1fr; }
}

/* Time-based set row (isometric holds) */
.set-row-timed {
  display: block !important;
  padding: 12px !important;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.timed-row-top {
  display: grid;
  grid-template-columns: auto 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  min-width: 0;
}
.timed-row-top .set-num {
  font-size: 14px;
  color: var(--text-muted);
  padding-bottom: 12px;
}
.timed-field {
  min-width: 0;
  max-width: 100%;
}
.timed-field-label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.timed-field .set-duration {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-family: var(--font);
  font-size: 14px;
  text-align: center;
}
.set-row-timed .set-remove {
  align-self: center;
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}
.set-row-timed .set-remove:hover { color: var(--rose); }
.set-row-timed .fb-timer-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.fb-group {
  min-width: 0;
  max-width: 100%;
}

.fb-group.fb-group-full { grid-column: 1 / -1; }

.fb-label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.fb-hang-row select,
.fb-hang-row input[type="number"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
  -moz-appearance: textfield;
  overflow: hidden;
}

.fb-hang-row input::-webkit-inner-spin-button,
.fb-hang-row input::-webkit-outer-spin-button { -webkit-appearance: none; }

.fb-hang-row select:focus,
.fb-hang-row input:focus { border-color: var(--rose); outline: none; }

.fb-unit {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.fb-weight-inner {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.fb-weight-inner input {
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
  padding: 10px !important;
  text-align: center;
}

.fb-weight-inner input:disabled { opacity: 0.3; }

.fb-bw {
  padding: 10px 14px;
  background: var(--surface);
  border: none;
  border-left: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.fb-bw.active { background: var(--sage-dim); color: var(--sage); }

.fb-remove {
  grid-column: 1 / -1;
  justify-self: end;
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s;
}

.fb-remove:hover { color: var(--rose); }

/* Desktop: compact single-row, hide labels */
@media (min-width: 640px) {
  .fb-row-grid {
    grid-template-columns: 1fr 1fr 80px 80px 1fr 1.4fr auto;
    gap: 8px;
    align-items: end;
  }
  .fb-hang-row { padding: 10px 12px; }
  .fb-label { display: none; }
  .fb-unit { display: none; }
  .fb-group.fb-group-full { grid-column: auto; }
  .fb-remove { padding: 10px 6px; }
}

/* Session exercise display — detailed */
.session-exercises {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-ex-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.session-ex-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 6px;
}

.session-ex-set {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 300;
  padding: 2px 0;
}

.se-label {
  color: var(--text-muted);
  min-width: 40px;
}

.se-value {
  color: var(--text);
  font-weight: 400;
}

.se-weight {
  color: var(--rose);
  font-weight: 400;
}

.se-rest {
  color: var(--text-muted);
  font-style: italic;
}

/* ═══════════════ LOG SESSION TABS ═══════════════ */

.log-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.log-tab {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
}

.log-tab:hover { border-color: var(--border-strong); color: var(--text); }

.log-tab.active {
  background: var(--rose-dim);
  border-color: rgba(196, 145, 123, 0.25);
  color: var(--rose);
}

.log-tab-manual {
  font-size: 11px;
  color: var(--text-muted);
  border-style: dashed;
}

/* ═══════════════ BOULDER ENTRY ═══════════════ */

.boulder-entry {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.boulder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.boulder-number {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.boulder-title {
  flex: 1;
  padding: 4px 8px !important;
  font-size: 12px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--text-light) !important;
  border-radius: 4px !important;
  min-width: 0;
}

.boulder-title:focus {
  border-color: var(--border-strong) !important;
  background: var(--surface-3) !important;
}

.boulder-title::placeholder { color: var(--text-muted); font-weight: 300; }

.boulder-pumped-btn {
  padding: 3px 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.boulder-pumped-btn.active {
  background: var(--copper-dim);
  border-color: rgba(196, 122, 58, 0.3);
  color: var(--copper);
}

.boulder-remove {
  padding: 2px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.boulder-remove:hover { color: var(--rose); }

.boulder-fields {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.boulder-field {
  flex: 1;
  min-width: 0;
}

.boulder-field-sent {
  flex: 0 0 auto;
}

.boulder-label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.boulder-grade,
.boulder-attempts,
.boulder-rpe {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 9px 8px;
  font-size: 14px;
  text-align: center;
}

.boulder-sent-toggle {
  padding: 9px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.boulder-sent-toggle.active {
  background: var(--sage-dim);
  border-color: rgba(122, 176, 138, 0.3);
  color: var(--sage);
}

/* Progress pips */
.boulder-progress {
  margin-bottom: 10px;
}

.progress-pips {
  display: flex;
  gap: 6px;
}

.progress-pip {
  flex: 1;
  padding: 6px 0;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.progress-pip:hover { border-color: rgba(196, 145, 123, 0.3); color: var(--text-dim); }

.progress-pip.active {
  background: var(--copper-dim);
  border-color: rgba(196, 122, 58, 0.3);
  color: var(--copper);
}

.progress-pip[data-val="4"].active {
  background: var(--sage-dim);
  border-color: rgba(122, 176, 138, 0.3);
  color: var(--sage);
}

/* Rest timer */
.boulder-rest-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.rest-presets {
  display: flex;
  gap: 6px;
  align-items: center;
}

.rest-preset-btn {
  padding: 6px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.rest-preset-btn:hover { border-color: var(--rose); color: var(--rose); }

.rest-custom-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.rest-custom-btn:hover { border-color: var(--text-dim); color: var(--text-dim); }

.rest-timer-display {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rest-countdown-text {
  font-size: 24px;
  font-weight: 300;
  color: var(--rose);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.rest-stop-btn {
  padding: 6px 14px;
  background: var(--rose-dim);
  border: 1px solid rgba(196, 145, 123, 0.3);
  border-radius: 16px;
  color: var(--rose);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.rest-done-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 300;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Session timer */
.session-timer-wrap {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.session-timer-wrap .dual-field-input {
  flex: 1;
  min-width: 0;
}

/* Rust pill — master session duration timer start/stop (kept from original) */
.session-timer-btn,
.session-timer-stop-btn {
  background: rgba(162, 78, 43, 0.12);
  border: 1px solid rgba(162, 78, 43, 0.3);
  color: var(--rust);
  border-radius: 6px;
  padding: 0 14px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.session-timer-btn:hover,
.session-timer-stop-btn:hover {
  background: rgba(162, 78, 43, 0.22);
}
.session-timer-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ═══════════════ TAPE-DECK TIMER BUTTONS ═══════════════ */
/* Unified transport controls for fingerboard + isometric timers.
   Translucent rectangles with clean SVG icon glyphs. */
.timer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  padding: 0 12px;
  background: rgba(162, 78, 43, 0.12);
  border: 1px solid rgba(162, 78, 43, 0.3);
  border-radius: 6px;
  color: var(--rust);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.timer-btn:hover { background: rgba(162, 78, 43, 0.22); }
.timer-btn:active { transform: scale(0.96); }
.timer-btn .timer-icon {
  width: 16px;
  height: 16px;
  display: block;
}

/* Start — rust (default) */
.timer-btn-start { /* inherits defaults */ }

/* Pause — same rust pill, different icon */
.timer-btn-pause {
  background: rgba(162, 78, 43, 0.12);
  border-color: rgba(162, 78, 43, 0.3);
  color: var(--rust);
}
.timer-btn-pause:hover { background: rgba(162, 78, 43, 0.22); }

/* Reset — rose tint for the nuke action */
.timer-btn-reset {
  background: rgba(196, 145, 123, 0.14);
  border-color: rgba(196, 145, 123, 0.4);
  color: var(--rose);
}
.timer-btn-reset:hover {
  background: rgba(196, 145, 123, 0.26);
  border-color: var(--rose);
}

/* Header variants sit slightly smaller and tighter */
.ex-block-header .timer-btn {
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  margin-right: 4px;
}
.ex-block-header .timer-btn .timer-icon {
  width: 14px;
  height: 14px;
}

.session-timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.session-timer-text {
  font-size: 32px;
  font-weight: 300;
  color: var(--rose);
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.session-timer-text.timer-done {
  color: var(--sage);
  animation: pulse 1s ease-in-out infinite;
}

.session-timer-stop-btn { padding: 8px 16px; }

/* Cool down */
.boulder-actions {
  display: flex;
  gap: 8px;
}

.boulder-actions .btn-secondary { flex: 1; }

.btn-cooldown {
  flex: 0 0 auto;
  padding: 10px 16px;
  background: var(--slate-blue-dim);
  border: 1px solid rgba(122, 143, 168, 0.2);
  border-radius: var(--radius-sm);
  color: var(--slate-blue);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cooldown:hover { border-color: var(--slate-blue); }
.btn-cooldown:disabled { opacity: 0.4; cursor: default; }

.cooldown-separator {
  text-align: center;
  padding: 12px 0 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--slate-blue);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.cooldown-separator span {
  background: var(--bg);
  padding: 0 12px;
  position: relative;
}

/* History boulder detail */
.session-boulders {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-boulder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 300;
  padding: 4px 0;
  flex-wrap: wrap;
}

.session-boulder-item.pumped {
  border-left: 2px solid var(--copper);
  padding-left: 8px;
}

.sb-grade {
  font-weight: 500;
  color: var(--text-light);
  min-width: 24px;
}

.sb-title {
  color: var(--text);
  font-weight: 400;
}

.sb-detail {
  color: var(--text-dim);
}

.sb-tags {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
}

/* Session title input */
.log-title-input {
  font-size: 16px !important;
  font-weight: 500 !important;
  color: var(--text-light) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  padding: 8px 0 !important;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.log-title-input:focus {
  border-bottom-color: var(--rose) !important;
  background: transparent !important;
}

.remove-btn {
  padding: 9px 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.remove-btn:hover { color: var(--rose); border-color: rgba(196, 145, 123, 0.3); }

@media (max-width: 440px) {
  .boulder-fields { flex-wrap: wrap; }
  .boulder-field { flex: 1 1 calc(33% - 6px); }
}

.style-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.style-tag {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.style-tag:hover { border-color: rgba(122, 176, 138, 0.3); color: var(--text-dim); }

.style-tag.active {
  background: var(--sage-dim);
  border-color: rgba(122, 176, 138, 0.3);
  color: var(--sage);
}

.boulder-summary {
  padding: 10px 14px;
  background: var(--sage-dim);
  border: 1px solid rgba(122, 176, 138, 0.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--sage);
  margin-bottom: 16px;
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* ═══════════════ TODAY'S FOCUS (multi-module) ═══════════════ */

.today-module {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.today-module:last-child { border-bottom: none; }

.today-module strong {
  font-weight: 500;
  color: var(--text-light);
  font-size: 14px;
}

.today-exercises {
  width: 100%;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 300;
  line-height: 1.5;
  margin-top: 2px;
}

/* ═══════════════ MODAL ═══════════════ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 22, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 85dvh;
  overflow-y: auto;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  width: 100%;
}

/* Day modal — override/template tabs */
.day-modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
}
.day-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.day-tab.active {
  background: rgba(196, 145, 123, 0.12);
  color: var(--rose);
}
.day-tab:not(.active):hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
.day-override-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: rgba(196, 145, 123, 0.08);
  border: 1px solid rgba(196, 145, 123, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--copper);
}
.day-clear-override {
  background: transparent;
  border: 1px solid rgba(196, 145, 123, 0.3);
  color: var(--copper);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.day-clear-override:hover {
  background: rgba(196, 145, 123, 0.15);
  border-color: var(--copper);
}

/* ═══════════════ CHAT ═══════════════ */

.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar-h) - 56px);
  max-height: calc(100dvh - var(--topbar-h) - 56px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-welcome {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 300;
  padding: 40px 20px;
  font-style: italic;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-user {
  align-self: flex-end;
  background: var(--rose-dim);
  border: 1px solid rgba(196, 145, 123, 0.2);
  color: var(--text-light);
  border-bottom-right-radius: 4px;
}

.chat-assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-assistant strong {
  color: var(--text-light);
  font-weight: 500;
}

.chat-typing {
  color: var(--text-muted);
  animation: pulse 1.5s ease-in-out infinite;
}

/* While streaming, the bubble holds raw text in a single text node —
   preserve newlines so paragraphs render naturally before the final
   markdown formatting kicks in. */
.chat-streaming {
  white-space: pre-wrap;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
}

/* The chat input is a contenteditable <div>, not an <input>. This is
   deliberate: iOS Safari / Chrome show the AutoFill assistant bar
   (key/card/location icons) above the keyboard whenever a real form
   field gains focus, and there is no web-platform way to suppress it
   via attributes (autocomplete=off, type=search, etc. all fail).
   contenteditable divs bypass the form-field heuristic entirely, so
   the only keyboard accessory that remains is the native QuickType
   predictive bar (which is a keyboard feature, not ours to hide). */
.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  color: var(--text-light);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.3s;
  min-width: 0;
  min-height: 20px;
  max-height: 120px;
  overflow-y: auto;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  -webkit-user-select: text;
  user-select: text;
}

.chat-input:focus { border-color: var(--rose); }

/* Contenteditable has no native placeholder — fake it with ::before on
   an empty element. The :empty pseudo-class works because we clear via
   textContent = '' (no stray <br> or whitespace text nodes). */
.chat-input[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  font-weight: 300;
  pointer-events: none;
}

.chat-mic {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-mic:hover { border-color: var(--rose); color: var(--rose); }

.chat-mic.recording {
  background: var(--rose-dim);
  border-color: rgba(196, 145, 123, 0.4);
  color: var(--rose);
  animation: pulse 1.5s ease-in-out infinite;
}

.chat-mic:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-send {
  padding: 10px 20px;
  background: var(--rose);
  border: none;
  border-radius: 24px;
  color: var(--bg);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.chat-send:hover { opacity: 0.9; }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ═══════════════ BIOMARKERS ═══════════════ */

.bio-latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.bio-latest-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}

.bio-latest-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.bio-latest-value {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-light);
  letter-spacing: -0.3px;
}

.bio-latest-unit {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 2px;
  font-weight: 400;
}

.bio-latest-date {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
}

.bio-add-section { margin-bottom: 14px; }

.bio-add-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 6px;
}

.bio-select,
.bio-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.bio-select:focus,
.bio-input:focus { border-color: var(--rust); }

.bio-add-btn {
  padding: 8px 16px;
  background: var(--rust);
  border: none;
  border-radius: 8px;
  color: var(--bg);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.bio-add-btn:hover { opacity: 0.9; }

.bio-feedback {
  font-size: 10px;
  margin-top: 4px;
  letter-spacing: 0.3px;
  min-height: 12px;
}
.bio-feedback.err { color: #c4595a; }

.bio-recent-list {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.bio-recent-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.bio-recent-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 300;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.bio-recent-row:last-child { border-bottom: none; }

.bio-recent-metric { color: var(--text-light); }
.bio-recent-val { color: var(--rust); font-weight: 500; }
.bio-recent-time { color: var(--text-muted); font-size: 11px; }

/* ═══════════════ DAILY HABITS ═══════════════ */

.habits-form { display: flex; flex-direction: column; gap: 12px; }

.habit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.habit-row > * {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.habit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.habit-field label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 14px;
  line-height: 14px;
}

.habit-val {
  color: var(--rust);
  font-weight: 500;
  font-size: 10px;
  line-height: 14px;
}

.habit-field input[type="number"],
.habit-field input[type="time"],
.habit-field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  padding: 0 10px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  height: 38px;
  line-height: 38px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  color-scheme: dark;
  text-align: left;
}
.habit-field input[type="time"] {
  /* iOS centers empty time input — force consistent rendering */
  min-height: 38px;
}

.habit-field input:focus,
.habit-field textarea:focus { border-color: var(--rust); }

.habit-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  height: 38px;
  background: transparent;
  border-radius: 2px;
  outline: none;
  margin: 0;
  padding: 0;
}
.habit-field input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
}
.habit-field input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
}
.habit-field input[type="range"]::-webkit-slider-thumb {
  margin-top: -6px;
}
.habit-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--rust);
  cursor: pointer;
  border: none;
}
.habit-field input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--rust);
  cursor: pointer;
  border: none;
}

.habit-intoxicants label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.intox-row { display: flex; gap: 6px; }

.intox-pill {
  flex: 1;
  padding: 8px 6px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
}
.intox-clean {
  background: var(--surface-2);
  color: var(--text-dim);
}
.intox-clean:hover { border-color: var(--rust); color: var(--text-light); }
.intox-active {
  background: var(--rust-dim);
  border-color: var(--rust);
  color: var(--rust);
}

/* Save indicator — lives inside a card h2 */
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  vertical-align: middle;
}
.save-indicator:empty { display: none; }
.save-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.save-indicator.saved {
  color: #7a8a6a;
  background: rgba(122, 138, 106, 0.1);
  border-color: rgba(122, 138, 106, 0.3);
}
.save-indicator.unsaved {
  color: #c4917b;
  background: rgba(196, 145, 123, 0.1);
  border-color: rgba(196, 145, 123, 0.3);
}
.save-indicator.saving {
  color: var(--rust);
  background: rgba(162, 78, 43, 0.1);
  border-color: rgba(162, 78, 43, 0.3);
}
.save-indicator.saving::before {
  animation: savePulse 1s ease-in-out infinite;
}
@keyframes savePulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.save-indicator.error {
  color: #c4595a;
  background: rgba(196, 89, 90, 0.1);
  border-color: rgba(196, 89, 90, 0.3);
}

/* ═══════════════ CALENDAR ═══════════════ */

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-header h2 { margin: 0; font-size: 16px; }
.cal-nav {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}
.cal-nav:hover { border-color: var(--rose); color: var(--rose); }

.cal-grid { margin-bottom: 12px; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.cal-weekdays > div {
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 2px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-dim);
  transition: all 0.2s;
  min-height: 0;
}
.cal-day:hover { border-color: var(--rose); color: var(--text-light); }
.cal-day-empty {
  background: transparent;
  border: none;
  cursor: default;
}
.cal-day-today {
  border-color: var(--rust);
  background: var(--rust-dim);
  color: var(--text-light);
  box-shadow: 0 0 0 1px var(--rust);
}
.cal-day-has-events {
  color: var(--text-light);
}
.cal-day-num { font-size: 12px; font-weight: 400; position: relative; z-index: 1; }

.cal-day { position: relative; }
.cal-habit-mark {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 1px var(--bg);
}
.cal-day-logged { background: var(--rust-dim); }
.cal-dots {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}
.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  display: inline-block;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 500;
}
.cal-legend-item .cal-dot {
  width: 6px;
  height: 6px;
}

.cal-day-detail {
  margin-top: 8px;
}
.cal-detail-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  padding: 12px 0;
}
.cal-detail-date {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.cal-detail-event {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.cal-detail-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.cal-detail-type {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cal-detail-notes {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.4;
}
.cal-event-delete {
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 10px;
  padding: 4px 8px;
  cursor: pointer;
}
.cal-event-delete:hover { color: var(--rose); border-color: var(--rose); }

.cal-add-btn { width: 100%; margin-top: 8px; }
.cal-add-form {
  margin-top: 12px;
  padding: 14px;
  background: rgba(162, 78, 43, 0.06);
  border: 1px solid rgba(162, 78, 43, 0.2);
  border-radius: 8px;
  animation: slideDown 0.2s ease-out;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.cal-add-form > * { min-width: 0; max-width: 100%; }
.cal-add-form .form-group { margin-bottom: 10px; }
.cal-add-form .modal-actions { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.cal-add-form .modal-actions > * { flex: 1 1 auto; min-width: 0; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); max-height: 0; }
  to { opacity: 1; transform: translateY(0); max-height: 800px; }
}

/* ═══════════════ SIDEBAR CONVERSATIONS (Vivos mode) ═══════════════ */

.sidebar-section-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.sidebar-section-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.sidebar-section-action {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.sidebar-section-action:hover {
  border-color: rgba(196, 145, 123, 0.4);
  color: var(--rose);
  background: rgba(196, 145, 123, 0.08);
}

.sidebar-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
}

/* Category groups */
.sidebar-cat-group {
  margin-top: 4px;
}
.sidebar-cat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.sidebar-cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-cat-pin-icon {
  color: var(--copper);
  font-size: 11px;
}
.sidebar-cat-name {
  cursor: default;
  border-radius: 3px;
  padding: 0 2px;
  transition: background 0.15s;
}
.sidebar-cat-name.editing {
  background: rgba(255, 255, 255, 0.08);
  outline: 1px solid var(--border-strong);
  cursor: text;
  color: var(--text-light);
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
.sidebar-cat-count {
  font-weight: 400;
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.6;
}
.sidebar-cat-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  margin-left: auto;
}
.sidebar-cat-header:hover .sidebar-cat-delete { opacity: 0.6; }
.sidebar-cat-delete:hover { color: var(--rose); opacity: 1 !important; }

/* Conversation item — single row, long-press for actions */
.sidebar-conv-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  padding: 8px 14px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin: 1px 0;
}
.sidebar-conv-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
}
.sidebar-conv-item.active {
  background: rgba(196, 145, 123, 0.12);
  color: var(--warm-white);
  font-weight: 500;
  border-left: 2px solid var(--rose);
  padding-left: 12px;
}
.sidebar-conv-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 3px;
  padding: 0 1px;
  transition: background 0.15s;
}
.sidebar-conv-title.editing {
  background: rgba(255, 255, 255, 0.08);
  outline: 1px solid var(--border-strong);
  white-space: normal;
  cursor: text;
  color: var(--text-light);
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Inline indicators on conv items (pin star, category tag) */
.sidebar-conv-pin-dot {
  color: var(--copper);
  font-size: 9px;
  flex-shrink: 0;
  margin-right: -2px;
}
.sidebar-conv-cat-tag {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 3px;
  padding: 1px 4px;
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0.7;
}

/* Temporary conversation indicators */
.sidebar-conv-temp {
  opacity: 0.7;
}
.sidebar-conv-temp:hover {
  opacity: 1;
}
.sidebar-cat-temp-icon {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
}

/* Chats page: temp items + section label */
.chats-page-temp {
  opacity: 0.7;
}
.chats-page-section-temp {
  color: var(--text-muted);
}
.chats-page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ─── Context menu (long-press / right-click on conversation) ─── */
.conv-context-menu {
  position: fixed;
  z-index: 200;
  min-width: 160px;
  max-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  padding: 6px 0;
  overflow: hidden;
}
.ctx-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 14px 3px;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.ctx-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
}
.ctx-item.ctx-active {
  color: var(--rose);
}
.ctx-item.ctx-delete {
  color: #c55;
}
.ctx-item.ctx-delete:hover {
  background: rgba(200, 80, 80, 0.1);
}
.ctx-cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ctx-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ═══════════════ CHATS PAGE (expanded list) ═══════════════ */
.chats-page-container { padding: 0; }
.chats-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.chats-page-header h2 { margin: 0; }
.chats-page-search { margin-bottom: 14px; }
.chats-search {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.chats-search:focus { border-color: var(--rose); }
.chats-search::placeholder { color: var(--text-muted); font-weight: 300; }
.chats-page-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 4px 4px;
}
.chats-page-section-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chats-page-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.chats-page-item:hover { background: rgba(255, 255, 255, 0.04); }
.chats-page-item.active {
  background: rgba(196, 145, 123, 0.1);
  border-left: 2px solid var(--rose);
  padding-left: 10px;
}
.chats-page-item-main {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chats-page-pin {
  color: var(--copper);
  font-size: 10px;
  flex-shrink: 0;
}
.chats-page-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chats-page-item.active .chats-page-title { font-weight: 500; }
.chats-page-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
}
.chats-page-cat {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.chats-page-time { font-weight: 300; }

/* ═══════════════ PROJECTS PAGE ═══════════════ */
.projects-container { padding: 0; }
.projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.projects-header h2 { margin: 0; }
.project-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.project-card:hover { border-color: var(--border-strong); }
.project-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.project-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  border-radius: 3px;
  padding: 0 2px;
}
.project-name.editing {
  background: rgba(255, 255, 255, 0.08);
  outline: 1px solid var(--border-strong);
  -webkit-user-select: text;
  user-select: text;
}
.project-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
  margin-left: auto;
}
.project-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.project-card:hover .project-actions { opacity: 1; }
.project-rename-btn,
.project-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.project-rename-btn:hover { color: var(--rose); background: rgba(196, 145, 123, 0.1); }
.project-delete-btn:hover { color: #c55; background: rgba(200, 80, 80, 0.1); }
.project-conv-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.project-conv-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.project-conv-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
}
.project-conv-item.active {
  background: rgba(196, 145, 123, 0.1);
  color: var(--warm-white);
  font-weight: 500;
}
.project-empty {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

/* ═══════════════ PLACEHOLDER ═══════════════ */

.streak-placeholder {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 20px;
  font-weight: 300;
  letter-spacing: 0.3px;
}

/* ═══════════════ RESPONSIVE ═══════════════ */

/* Tablet + below: tighten the topbar */
@media (max-width: 1024px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .mode-tabs { padding: 3px; }
  .mode-tab { padding: 7px 12px; font-size: 11px; letter-spacing: 0.5px; }
  .content { padding: 20px 18px; }
}

@media (max-width: 540px) {
  .topbar-name { display: none; }
  .mode-tab { padding: 7px 10px; }
  .content > .panel { max-width: none; }
}

@media (max-width: 440px) {
  .content { padding: 16px 14px; }
  .card { padding: 20px 16px; }
  .streaks-grid { gap: 8px; }
  .streak-item { padding: 16px 10px; }
  .streak-days { font-size: 26px; }
  .exercise-entry { grid-template-columns: 1fr; }
  .exercise-labels { display: none; }
  .mode-tab { padding: 6px 9px; font-size: 10px; }
}

/* ═══════════════ ASK VIVOS PILL + POPOVER ═══════════════ */
.ask-pill {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(196, 145, 123, 0.18);
  border: 1px solid rgba(196, 145, 123, 0.4);
  color: var(--rose);
  cursor: pointer;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s, background 0.18s, border-color 0.18s;
}
.ask-pill:hover {
  background: rgba(196, 145, 123, 0.3);
  border-color: var(--rose);
  transform: translateY(-1px);
}
.ask-pill.hidden { display: none; }

.ask-popover {
  position: fixed;
  bottom: 72px;
  right: 14px;
  /* Compact floating card at all viewports — same behavior on desktop
     and mobile. Strobi-style restrained overlay, never edge-to-edge. */
  width: min(340px, calc(100vw - 28px));
  height: min(460px, calc(100vh - 100px));
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  z-index: 79;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.ask-popover.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.ask-popover-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.ask-popover-title {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.ask-popover-icon {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ask-popover-icon:hover {
  color: var(--rose);
  border-color: rgba(196, 145, 123, 0.4);
  background: rgba(196, 145, 123, 0.06);
}
.ask-popover-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.ask-popover-close:hover { color: var(--rose); }
.ask-messages {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}
.ask-popover .chat-input-bar {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  margin: 0;
}
@media (max-width: 540px) {
  /* Keep the same compact floating card on mobile — never edge-to-edge.
     The width/height clamps in .ask-popover already handle small viewports. */
  .ask-popover {
    right: 12px;
    bottom: 68px;
  }
  .ask-pill { bottom: 16px; right: 14px; }
}

/* ═══════════════ COLLAPSIBLE DASHBOARD CARDS ═══════════════ */
.card-collapsible .card-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-collapsible h2.card-toggle { padding-right: 4px; }
.card-caret {
  font-size: 14px;
  color: var(--rust);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.card-collapsible.card-collapsed .card-caret { transform: rotate(-90deg); }
.card-collapsible.card-collapsed > *:not(h2):not(.cal-header) { display: none !important; }
.card-collapsible.card-collapsed { padding-bottom: 14px; }

/* ═══════════════ RADIUM FIELD DOCTRINE — LAW 5 (containers) ═══════════════ */
/* All grid/flex containers and their children must be constrained */
.card, .card > *, .card form, .card form > * {
  min-width: 0;
  max-width: 100%;
}
.habits-form, .bio-add-row, .bio-latest-grid, .bio-recent-list,
.bio-latest-item, .form-row, .form-group {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.bio-latest-grid > *, .bio-add-row > *, .form-row > * {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* ═══════════════ PROGRESS ═══════════════ */

.progress-summary,
.progress-weeks,
.progress-climb,
.progress-exercises { min-width: 0; }

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

.progress-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  min-width: 0;
}

.ps-val {
  font-size: 22px;
  font-weight: 300;
  color: var(--rose);
  line-height: 1.1;
  letter-spacing: -0.2px;
}

.ps-unit {
  font-size: 13px;
  color: var(--text-dim);
  margin-left: 2px;
  font-weight: 300;
}

.ps-label {
  font-size: 9.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.3px;
  margin-top: 6px;
}

.progress-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.progress-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.ps-chip-n {
  color: var(--text-light);
  font-weight: 500;
}

/* ─── Weekly bar chart ─── */

.progress-week-row {
  display: grid;
  grid-template-columns: 56px 1fr 64px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 11px;
}

.progress-week-row.empty { opacity: 0.45; }

.pw-label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}

.pw-bar-wrap {
  height: 18px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.pw-bar {
  height: 100%;
  display: flex;
  gap: 1px;
  min-width: 2px;
  border-radius: 4px;
  overflow: hidden;
  transition: width 0.3s ease;
}

.pw-seg {
  display: block;
  height: 100%;
}

.pw-bar .pw-seg.badge-climb    { background: var(--sage);       border: none; }
.pw-bar .pw-seg.badge-strength { background: var(--copper);     border: none; }
.pw-bar .pw-seg.badge-cardio   { background: var(--rose);       border: none; }
.pw-bar .pw-seg.badge-mobility { background: var(--slate-blue); border: none; }
.pw-bar .pw-seg.badge-rest     { background: var(--text-muted); border: none; opacity: 0.5; }

.pw-meta {
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ─── Climbing card ─── */

.climb-spark {
  margin-top: 16px;
  height: 56px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--sage);
}

.climb-spark-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.climb-spark-axis {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 6px;
}

/* ─── Per-exercise list ─── */

.ex-progress-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  overflow: hidden;
}

.ex-progress-item.expanded {
  border-color: var(--border-strong);
}

.ex-progress-header {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  min-width: 0;
}

.ex-progress-main { min-width: 0; }

.ex-progress-name {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-progress-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ex-trend {
  color: var(--rose);
  font-weight: 500;
  margin-left: 2px;
}

.ex-spark {
  width: 72px;
  height: 24px;
  color: var(--rose);
  opacity: 0.7;
  flex-shrink: 0;
}

.ex-progress-chevron {
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
}

.ex-history {
  border-top: 1px solid var(--border);
  padding: 6px 0;
}

.ex-history-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ex-history-row:last-child { border-bottom: none; }

.ex-history-date {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ex-history-detail {
  color: var(--text-light);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex-history-vol {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
}

/* Narrow phones: collapse the stat grid to 2 columns */
@media (max-width: 480px) {
  .progress-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .ps-val { font-size: 20px; }
  .ex-spark { width: 56px; }
}

/* ═══════════════ SESSION TIMER MODE BUTTON ═══════════════ */
.session-timer-mode {
  background: rgba(162, 78, 43, 0.12);
  border: 1px solid rgba(162, 78, 43, 0.3);
  color: var(--rust);
  border-radius: 6px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.session-timer-mode:hover { background: rgba(162, 78, 43, 0.22); }
