@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* —— TOKENS —— */
:root {
  --bg:           #0a0a0f;
  --surface:      #14141f;
  --surface2:     #1c1c2e;
  --border:       #2a2a40;
  --text:         #e8e8f0;
  --text-dim:     #b0b0cc;
  --text-muted:   #9999bb;
  --accent:       #00e4a0;
  --accent-dim:   #00e4a020;
  --accent-glow:  #00e4a040;
  --warn:         #ffaa40;
  --warn-dim:     #ffaa4020;
  --blue:         #5588ff;
  --blue-dim:     #5588ff18;
  --red:          #ff6b6b;
  --red-dim:      #ff6b6b18;
  --purple:       #dd88ff;
  --purple-dim:   #dd88ff18;
  --radius:       12px;
  --tab-height:   60px;
  --safe-top:     env(safe-area-inset-top, 0px);
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
}

/* —— RESET —— */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { font-size: 15px; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* Prevent author display rules from overriding the hidden attribute */
[hidden] { display: none !important; }

/* —— LAYOUT —— */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom));
  padding-top: var(--safe-top);
}

.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

/* —— PROGRESS BAR —— */
.progress-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 300;
  background: transparent;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* —— SCREEN HEADER —— */
.screen-header {
  padding: calc(var(--safe-top) + 16px) 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.screen-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.screen-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

/* —— BOTTOM TAB BAR —— */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}
.tab-btn.active { color: var(--accent); }
.tab-icon {
  font-size: 1.2rem;
  line-height: 1;
}
.tab-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* —— EMPTY STATE —— */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  min-height: 50vh;
  gap: 12px;
}
.empty-icon {
  font-size: 3rem;
  opacity: 0.5;
  margin-bottom: 4px;
}
.empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.empty-desc {
  font-size: 0.875rem;
  color: var(--text-dim);
  max-width: 260px;
  line-height: 1.6;
}
.btn-primary {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--bg);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:active { opacity: 0.8; }

/* —— IMPORT SCREEN —— */
/* —— HOME SCREEN —— */
.home-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  padding: 0;
  gap: 12px;
}
.home-logo {
  width: 100%;
  max-width: 100vw;
  border-radius: 0;
  margin-bottom: 8px;
}
.home-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.home-subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.home-cta {
  padding: 14px 32px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 99px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 24px;
}

/* —— PROGRAM CARDS —— */
.program-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 24px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}
.program-card {
  display: block;
  width: 100%;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
}
.program-card:active {
  background: var(--surface2);
}
.program-card-name {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.program-card-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 12px;
}
.program-card-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.program-card-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stage-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent-dim);
  color: var(--accent);
}
.stage-chip.deload {
  background: var(--warn-dim);
  color: var(--warn);
}
.program-card-stats {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* —— ACTIVE PROGRAM HOME —— */
.active-program {
  text-align: center;
  padding: 0 16px;
}
.active-program-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.active-program-stage {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* —— PROGRAM PREVIEW —— */
.preview-detail {
  padding: 0 16px 24px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}
.preview-back {
  background: none;
  border: none;
  color: var(--accent);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 12px;
}
.preview-name {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.preview-notes {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
}
.preview-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.preview-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.preview-sessions, .preview-stages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.preview-session, .preview-stage {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.preview-session-label, .preview-stage-name {
  font-weight: 600;
  font-size: 0.92rem;
}
.preview-session-focus {
  font-size: 0.82rem;
  color: var(--text-dim);
  flex: 1;
}
.preview-session-count, .preview-stage-weeks {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}
.program-load-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 99px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.program-load-btn:active {
  opacity: 0.85;
}

/* —— IMPORT SCREEN —— */
.import-hero {
  padding: 32px 0 24px;
  text-align: center;
}
.import-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.import-tagline {
  font-size: 0.875rem;
  color: var(--text-dim);
}
.import-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.import-step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.import-step-text strong {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.import-step-text span {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.import-cta {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.import-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 200px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.import-textarea:focus { border-color: var(--accent); }
.import-textarea::placeholder { color: var(--text-muted); }
.import-textarea.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
  outline: 2px dashed var(--accent);
  outline-offset: -3px;
}
.import-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-file:hover { border-color: var(--accent); color: var(--accent); }
.import-error {
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--red);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* —— IMPORT: LLM Prompt Guide —— */
.import-guide-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.import-guide-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.import-guide-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
}
.import-guide-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.import-guide-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.import-guide-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 8px;
}

/* —— Guide Toast —— */
.guide-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 99px;
  z-index: 100;
  animation: toast-fade 2s ease forwards;
}
@keyframes toast-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* —— WORKOUT SCREEN —— */
.workout-header-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
  position: sticky;
  top: 0;
  z-index: 10;
}
.workout-header-bar.below-timer-strip { top: 44px; }
.workout-header-bar.below-timer-15    { top: 120px; }
.workout-header-bar.below-timer-25    { top: 200px; }
/* —— WEEK INDICATOR —— */
.week-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 0;
}
.week-indicator-arrow {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 1rem;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 99px;
  transition: all 0.2s;
}
.week-indicator-arrow:hover:not([disabled]) { background: var(--surface); }
.week-indicator-arrow[disabled] { color: var(--text-muted); opacity: 0.3; cursor: default; }
.week-indicator-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.week-indicator-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.week-indicator-stage {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  color: var(--text-dim);
}
.day-strip {
  display: flex;
  gap: 2px;
  padding: 6px 10px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-btn {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
}
.day-btn:hover { background: var(--surface); }
.day-btn.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  box-shadow: 0 0 20px var(--accent-glow);
}
.day-btn.rest { color: var(--warn); opacity: 0.5; }
.day-btn.rest.active {
  background: var(--warn-dim);
  color: var(--warn);
  border: 1px solid var(--warn);
  box-shadow: none;
  opacity: 1;
}
.day-btn.rest .today-dot { background: var(--warn); }
.day-btn.rest.active .today-dot { background: var(--bg); }
.today-dot {
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.day-btn.active .today-dot { background: var(--bg); }
.done-dot {
  position: absolute;
  top: 3px; right: 5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}
.day-btn.active .done-dot { background: var(--bg); opacity: 0.7; }
.status-dot {
  position: absolute;
  top: 3px; right: 5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}
.status-dot.completed { opacity: 1; }
.day-btn.active .status-dot { background: var(--bg); opacity: 0.7; }

/* Workout body padding: header is sticky so compensate */
.workout-body {
  padding: 16px 14px calc(20px + var(--tab-height) + var(--safe-bottom));
  max-width: 600px;
  margin: 0 auto;
}
.workout-body.timer-bottom-strip { padding-bottom: calc(20px + var(--tab-height) + var(--safe-bottom) + 44px); }
.workout-body.timer-bottom-15    { padding-bottom: calc(20px + var(--tab-height) + var(--safe-bottom) + 120px); }
.workout-body.timer-bottom-25    { padding-bottom: calc(20px + var(--tab-height) + var(--safe-bottom) + 200px); }

/* —— DAY HEADER —— */
.day-header {
  margin-bottom: 24px;
  padding: 20px 0 0;
}
.day-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.day-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.day-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}
.day-guidance {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--warn);
  font-style: italic;
}

/* —— DELOAD BANNER —— */
.deload-banner {
  background: var(--warn-dim);
  border: 1px dashed var(--warn);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--warn);
  text-align: center;
  font-weight: 500;
}

/* —— SECTION HEADER —— */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 36px 0 16px;
  cursor: pointer;
}
.section-density-icon {
  font-size: 0.6rem;
  color: var(--text-dim);
  opacity: 0.4;
  transition: transform 0.15s ease;
}
.section-header.collapsed .section-density-icon {
  opacity: 0.6;
}
.section-header.full .section-density-icon {
  opacity: 0.7;
  color: var(--accent);
}
.section-header.hidden {
  margin-bottom: 4px;
}
.section-header.hidden .section-density-icon {
  opacity: 0.5;
}
.section-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.section-duration {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 7px;
  border-radius: 99px;
}
.section-rule {
  display: none;
}

/* —— EXERCISE CARD —— */
.exercise-card {
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: opacity 0.3s;
}
.exercise-card.completed {
  opacity: 0.45;
}
.ex-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.ex-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
  transition: all 0.2s;
}
.ex-check.checked {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}
.exercise-card.collapsed .ex-body { display: none; }
.exercise-card.completed .ex-check { opacity: 0.7; }
.exercise-card.completed .ex-header { opacity: 0.7; }

.ex-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.ex-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}
.ex-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
/* Group badge (superset / circuit) */
.group-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--purple-dim);
  color: var(--purple);
}

.ex-body {
  padding: 0 14px 14px;
}
.ex-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 10px;
}
.stat {
  padding: 8px 10px;
  text-align: center;
}
.ex-stats > .stat + .stat {
  border-left: 1px solid var(--border);
}
.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
}
.ex-tip-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
  opacity: 0.5;
  cursor: pointer;
  padding: 0 2px;
}
.ex-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding: 0 14px 10px;
  display: none;
}
.exercise-card.tip-open .ex-tip { display: block; }
.tip-list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.tip-list li {
  margin-bottom: 2px;
}

/* —— SUPERSET GROUP —— */
.superset-group {
  border-left: 3px solid var(--purple-dim);
  margin-left: 4px;
  margin-bottom: 10px;
  border-radius: 3px 0 0 3px;
}
.superset-group .exercise-card {
  margin-bottom: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: none;
}
.superset-group .exercise-card:first-child { border-radius: 0 var(--radius) 0 0; }
.superset-group .exercise-card:last-child  { border-radius: 0 0 var(--radius) 0; }
.superset-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--purple);
  padding: 4px 0 4px 8px;
  opacity: 0.7;
}

/* —— SET TRACKER —— */
.set-tracker {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.set-dot {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.set-dot.done {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
  opacity: 1;
}
.set-dot.next {
  border-color: var(--accent);
  background: var(--surface2);
  color: var(--text-muted);
}
.set-dot.skipped {
  border-color: var(--text-muted);
  background: var(--surface2);
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.6;
}
.set-dot:active { transform: scale(0.9); }
/* Timed exercise: Done button (legacy, replaced by header checkbox) */
.timed-done-btn {
  display: none;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: var(--surface2);
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.timed-done-btn.done {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  opacity: 0.6;
}
.timed-done-btn.next {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.timed-done-btn:active { transform: scale(0.98); }

/* —— DAY ACTION BUTTONS —— */
.reset-btn-wrap {
  text-align: center;
  margin: 32px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.reset-btn {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 1px;
  padding: 9px 22px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.reset-btn:hover, .reset-btn.has-sets:hover { border-color: var(--red); color: var(--red); }
.complete-btn {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 1px;
  padding: 9px 22px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.complete-btn:hover, .complete-btn.has-remaining:hover { border-color: var(--accent); color: var(--accent); }

/* —— REST DAY —— */
.rest-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  text-align: center;
  padding: 40px 20px;
  gap: 10px;
}
.rest-icon { font-size: 3.5rem; opacity: 0.6; }
.rest-title { font-size: 1.3rem; font-weight: 700; }
.rest-desc { color: var(--text-dim); font-size: 0.875rem; max-width: 260px; line-height: 1.6; }

/* —— START SESSION PROMPT —— */
.start-session-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30vh;
}
.start-session-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
}
.start-session-btn:hover { box-shadow: 0 0 20px var(--accent-glow); }

/* —— DAY GUIDANCE —— */
.day-guidance {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 4px;
}

/* —— JOINT RISK BADGE —— */
.joint-risk-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 4px;
}
.joint-risk-badge.jr-low  { background: rgba(80, 200, 120, 0.15); color: #50c878; }
.joint-risk-badge.jr-mid  { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.joint-risk-badge.jr-high { background: rgba(255, 107, 107, 0.15); color: #ff6b6b; }

/* —— SETTINGS SCREEN —— */
.settings-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 24px 0 10px;
}
.settings-section-title:first-of-type { margin-top: 4px; }
.settings-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.settings-row-label { font-weight: 500; font-size: 0.925rem; }
.settings-row-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.settings-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.settings-value:active { opacity: 0.7; }
.settings-value.off { color: var(--text-muted); background: var(--surface2); border-color: var(--border); }

.settings-danger {
  margin-top: 48px;
  padding-top: 0;
}
.btn-danger {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--red);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.btn-danger:hover { border-color: var(--red); background: var(--red-dim); }

.settings-about {
  margin-top: 32px;
  padding-bottom: 8px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* —— TIMER CARD —— */
.timer-card {
  background: var(--surface);
  border: 1px solid transparent;
  margin: 0;
  padding: 0;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: height 0.25s ease;
}
.timer-card.size-strip { height: 44px; }
.timer-card.size-15    { height: 120px; }
.timer-card.size-25    { height: 200px; }

/* Common inner layout: chips left/right, digits centered */
.timer-card .timer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 12px;
  position: relative;
}
.timer-card .timer-time {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.timer-card .timer-time.show-clock {
  width: 100%;
  justify-content: space-between;
  padding: 0 12px;
}
/* Strip + clock: constrain to center area between chips */
.timer-card.size-strip .timer-time.show-clock {
  width: auto;
  max-width: calc(100% - 160px);
  justify-content: center;
  gap: 12px;
  padding: 0;
}
/* 15/25 + clock: stack vertically — elapsed centered above, clock bottom-right */
.timer-card.size-15 .timer-time.show-clock,
.timer-card.size-25 .timer-time.show-clock {
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 0;
  gap: 0;
  justify-content: center;
  align-items: center;
}
.timer-card.size-15 .timer-time.show-clock > .timer-clock,
.timer-card.size-25 .timer-time.show-clock > .timer-clock {
  margin-left: 0;
}
.timer-clock {
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}
.timer-card .chip-left  { position: absolute; left: 12px; }
.timer-card .chip-right { position: absolute; right: 12px; }

/* Strip: single row */
.timer-card.size-strip .timer-time { font-size: 1rem; }
.timer-card.size-strip .timer-clock { font-size: 0.75rem; }

/* Expanded (15/25): chips pinned to bottom corners */
.timer-card.size-15 .chip-left,
.timer-card.size-25 .chip-left  { bottom: 8px; left: 12px; }
.timer-card.size-15 .chip-right,
.timer-card.size-25 .chip-right { bottom: 8px; right: 12px; }

.timer-card.size-15 .timer-time { font-size: 3.5rem; }
.timer-card.size-15 .timer-clock { font-size: 1rem; }
.timer-card.size-25 .timer-time { font-size: 5rem; }
.timer-card.size-25 .timer-clock { font-size: 1.25rem; }

/* Running state */
.timer-card.running .timer-time { color: var(--accent); }
.timer-card.running { border-color: var(--accent); }
/* Paused state */
.timer-card.paused .timer-time { color: var(--warn); }
.timer-card.paused { border-color: var(--warn); }

@keyframes beep-flash { 0% { background: #fff; } 100% { background: var(--surface); } }
.timer-card.beep-flash { animation: beep-flash 120ms ease-out; }


.timer-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border-radius: 99px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.timer-chip:hover { background: var(--surface); }
.timer-chip:active { opacity: 0.7; }
.timer-chip.active { color: var(--accent); background: var(--accent-dim); }

/* Bottom slot: fixed above tab bar */
#timerCardBottom {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom));
  left: 0; right: 0;
  z-index: 100;
}
#timerCardBottom:empty { display: none; }
/* Top slot: sticky above header */
#timerCardTop {
  position: sticky;
  top: 0;
  z-index: 11;
}
#timerCardTop:empty { display: none; }

/* —— SET COUNTER —— */
.set-count-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.set-count-chip .done { color: var(--accent); font-weight: 700; }

/* —— RESPONSIVE —— */
@media (max-width: 380px) {
  html { font-size: 14px; }
  .ex-stats { gap: 4px; }
}
