/* =====================================================================
   FAM FITNESS — 14-Day Circuit Planner styles
   ===================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

:root {
  --primary: #C41E24;
  --primary-light: #FF3B3B;
  --primary-dark: #8B1519;
  --gold: #caa45d;
  --surface: #0D0D0D;
  --surface-2: #161616;
  --surface-3: #1F1F1F;
  --surface-4: #2A2A2A;
  --accent: #333333;
  --line: #2c2c2c;
  --text: #FFFFFF;
  --text-dim: #A6A6A6;
  --text-muted: #6b6b6b;
  --glass-bg: rgba(22, 22, 22, .9);
  --glass-border: rgba(196, 30, 36, .25);
  --radius: 12px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
  --shadow-card: 0 8px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  scroll-behavior: smooth
}

body {
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55
}

h1,
h2,
h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -.01em
}

button,
input,
select,
textarea {
  font: inherit
}

button {
  cursor: pointer
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 20px 60px
}

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px 22px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit
}

.brand-logo-img {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 16px rgba(196, 30, 36, .25);
}

.brand-text strong {
  display: block;
  font-size: 1.05rem
}

.brand-text small {
  display: block;
  color: var(--text-dim);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em
}

.step-indicator {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.step-indicator span {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.step-indicator span.active {
  color: #fff;
  border-color: var(--primary);
  background: rgba(196, 30, 36, .18)
}

/* ---------- VIEW PANELS ---------- */
.view-panel {
  display: none
}

.view-panel.active {
  display: block
}

/* ---------- PANEL / GRID PRIMITIVES ---------- */
.panel {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.panel:hover {
  border-color: rgba(196, 30, 36, .4)
}

.panel.wide {
  grid-column: 1/-1
}

.panel h3 {
  margin: 0 0 16px;
  font-size: .85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel h3 .icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
}

#setupView.active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px
}

.field-grid.thirds {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.field-row-compact {
  display: grid;
  grid-template-columns: 140px 140px 1fr;
  gap: 14px;
  margin-top: 14px;
}

.field-row-coach {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-dim);
  font-size: .83rem;
  font-weight: 600
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition: var(--transition);
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196, 30, 36, .15)
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A6A6A6' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.bmi-readout {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px dashed var(--accent);
  display: flex;
  align-items: baseline;
  gap: 10px
}

.bmi-readout strong {
  font-family: 'Outfit', sans-serif;
  color: var(--gold);
  font-size: 1.1rem
}

.bmi-readout span {
  color: var(--text-dim);
  font-size: .85rem
}

.bmi-readout.empty {
  color: var(--text-muted)
}

.section-note {
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 6px
}

.section-note.left {
  text-align: left
}

/* ---------- CHOICE CARDS ---------- */
.choice-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px
}

.choice-card {
  text-align: left;
  background: var(--surface-3);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text);
  transition: var(--transition);
  cursor: pointer;
}

.choice-card:hover {
  border-color: rgba(196, 30, 36, .5)
}

.choice-card.selected {
  border-color: var(--primary);
  background: rgba(196, 30, 36, .12)
}

.choice-card strong {
  display: block;
  font-size: .92rem
}

.choice-card span {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: .76rem
}

.finisher-toggle {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-direction: row;
  font-weight: 500;
  color: var(--text-dim);
  font-size: .85rem;
}

.finisher-toggle input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 18px
}

/* ---------- TOGGLE GRID (conditions) ---------- */
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px
}

.toggle-grid label {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  cursor: pointer;
}

.toggle-grid label:hover {
  border-color: var(--glass-border)
}

.toggle-grid input {
  width: 17px;
  min-height: 17px;
  flex: 0 0 17px
}

/* ---------- BUTTONS ---------- */
.primary-btn,
.ghost-btn {
  border-radius: var(--radius-sm);
  min-height: 42px;
  font-weight: 600;
  font-size: .86rem;
  padding: 0 18px;
  transition: var(--transition);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: 0;
  box-shadow: 0 4px 14px rgba(196, 30, 36, .3)
}

.primary-btn:hover {
  box-shadow: 0 6px 18px rgba(196, 30, 36, .38)
}

.ghost-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text)
}

.ghost-btn:hover {
  border-color: rgba(196, 30, 36, .5)
}

.ghost-btn.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: .78rem
}

.setup-actions {
  grid-column: 1/-1;
  display: flex;
  justify-content: flex-end;
  margin-top: 4px
}

/* ---------- BUILDER TOOLBAR ---------- */
.builder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.builder-toolbar h2 {
  font-size: 1.3rem
}

.eyebrow {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  margin-bottom: 4px
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

/* ---------- DAY GRID ---------- */
.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px
}

.day-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-card.is-rest {
  background: var(--surface-2);
  border-style: dashed
}

.day-card-head {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.day-num {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  display: block
}

.day-date {
  color: var(--text-muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .06em
}

.day-type-select {
  min-height: 38px;
  font-size: .82rem
}

.rest-note {
  color: var(--text-dim);
  font-size: .82rem;
  font-style: italic
}

.exercise-list {
  list-style: none;
  display: grid;
  gap: 6px
}

.exercise-row {
  display: grid;
  grid-template-columns: 1fr 46px 60px 44px 26px;
  gap: 6px;
  align-items: center;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}

.exercise-row.cardio {
  grid-template-columns: 1fr 74px 44px 26px
}

.exercise-row .ex-name {
  font-size: .78rem;
  color: var(--text)
}

.exercise-row .ex-name em {
  color: var(--gold);
  font-style: normal;
  font-size: .7rem
}

.ex-field {
  min-height: 30px;
  padding: 4px 6px;
  font-size: .75rem;
  text-align: center
}

.ex-field.rpe {
  color: var(--gold);
  font-weight: 700
}

.row-remove {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: .85rem;
  min-height: auto;
  padding: 2px;
}

.row-remove:hover {
  color: var(--primary-light)
}

.empty-row {
  color: var(--text-muted);
  font-size: .8rem;
  font-style: italic;
  padding: 6px 0
}

.add-exercise-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px
}

.add-exercise-select {
  min-height: 34px;
  font-size: .76rem;
  flex: 1;
  min-width: 140px
}

.caution-note {
  font-size: .74rem;
  color: var(--gold);
  line-height: 1.4;
  background: rgba(202, 164, 93, .08);
  border: 1px solid rgba(202, 164, 93, .25);
  border-radius: var(--radius-sm);
  padding: 8px 10px
}

/* ---------- CHECKLIST SHEET (screen preview) ---------- */
.checklist-sheet {
  background: #111;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-sizing: border-box;
}

.sheet-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: 20px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 16px;
  margin-bottom: 18px
}

.sheet-eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  margin-bottom: 4px
}

.sheet-meta {
  border-collapse: collapse;
  font-size: .82rem;
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}

.sheet-meta td {
  padding: 2px 10px 2px 0;
  color: var(--text-dim);
  word-break: break-word;
  overflow-wrap: break-word;
}

.sheet-meta td:first-child {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: .68rem;
  letter-spacing: .06em
}

.sheet-day {
  margin-bottom: 18px;
  page-break-inside: avoid;
}

.sheet-day h2 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #fff;
  margin-bottom: 8px
}

.sheet-day .tag {
  margin-left: auto;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 2px 9px
}

.sheet-day.rest h2 {
  color: var(--text-muted)
}

.rest-line {
  color: var(--text-muted);
  font-size: .85rem;
  font-style: italic
}

.sheet-check-list {
  list-style: none;
  display: grid;
  gap: 8px
}

.sheet-check-list li {
  display: flex;
  align-items: baseline;
  gap: 10px
}

.sheet-check-list .box {
  color: var(--gold)
}

.ex-line {
  display: flex;
  flex-direction: column
}

.ex-line strong {
  font-size: .88rem
}

.ex-line span {
  color: var(--text-muted);
  font-size: .76rem
}

.sheet-footer {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: .72rem;
  text-align: center
}

/* ---------- RESPONSIVE ---------- */
@media (max-width:860px) {
  #setupView.active {
    grid-template-columns: 1fr
  }

  .field-grid,
  .field-grid.thirds {
    grid-template-columns: 1fr
  }

  .field-row-compact {
    grid-template-columns: 1fr 1fr 1fr
  }

  .choice-list {
    grid-template-columns: 1fr
  }

  .toggle-grid {
    grid-template-columns: 1fr 1fr
  }
}

@media (max-width:520px) {
  .sheet-header {
    grid-template-columns: 1fr
  }

  .sheet-day .tag {
    margin-left: 0
  }

  .toggle-grid {
    grid-template-columns: 1fr
  }

  .field-row-compact {
    grid-template-columns: 1fr
  }

  .exercise-row {
    grid-template-columns: 1fr 40px 52px 40px 22px;
    font-size: .7rem
  }
}

/* ---------- MODALS ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  padding: 24px;
  transition: none;
}

.modal-content.wide {
  max-width: 800px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1.15rem;
  color: var(--text);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: 0;
  font-size: 1.7rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--primary-light);
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* Settings modal styles */
.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.connection-status {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.connection-status.success {
  background: rgba(46, 204, 113, 0.12);
  border-color: #2ecc71;
  color: #2ecc71;
}

.connection-status.error {
  background: rgba(231, 76, 60, 0.12);
  border-color: #e74c3c;
  color: #e74c3c;
}

.modal-instructions {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 14px;
}

.modal-instructions h4 {
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.modal-instructions ol {
  padding-left: 18px;
  font-size: 0.76rem;
  color: var(--text-dim);
  display: grid;
  gap: 4px;
}

/* Coach manager layout */
.coach-manager-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

.coach-form {
  display: grid;
  gap: 12px;
  background: var(--surface-3);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  align-self: start;
}

.coach-form h4,
.coach-list-container h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin: 0 0 10px 0;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.coach-list-container {
  display: flex;
  flex-direction: column;
}

.modal-coaches-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.coach-item-card {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.coach-item-card:hover {
  border-color: var(--glass-border);
}

.coach-item-info {
  display: flex;
  flex-direction: column;
}

.coach-item-info strong {
  font-size: 0.88rem;
  color: #fff;
}

.coach-item-info span {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.coach-item-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.coach-item-actions {
  display: flex;
  gap: 6px;
}

.coach-item-actions button {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 6px;
  border-radius: 4px;
  transition: var(--transition);
}

.coach-item-actions button.edit-btn:hover {
  color: var(--gold);
  background: rgba(202, 164, 93, 0.1);
}

.coach-item-actions button.delete-btn:hover {
  color: var(--primary-light);
  background: rgba(196, 30, 36, 0.1);
}

/* Header settings button */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-icon-btn {
  background: var(--surface-3);
  border: 1px solid var(--line);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.settings-icon-btn:hover {
  border-color: var(--primary);
  background: rgba(196, 30, 36, 0.1);
}

/* Manage Coaches link in setup select */
.coach-select-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.manage-coaches-btn {
  background: transparent;
  border: 0;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.manage-coaches-btn:hover {
  color: var(--primary-light);
}

/* Sync/Upload checklist actions */
.sync-sheet-btn {
  background: linear-gradient(135deg, #27ae60, #1e8449);
  color: #fff;
  border: 0;
  box-shadow: 0 4px 14px rgba(39, 174, 96, 0.25);
  border-radius: var(--radius-sm);
  min-height: 42px;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0 18px;
  transition: var(--transition);
}

.sync-sheet-btn:hover {
  box-shadow: 0 6px 18px rgba(39, 174, 96, 0.35);
}

.pdf-export-host {
  position: fixed;
  top: 0;
  left: -100000px;
  width: 900px;
  background: #fff;
  pointer-events: none;
  z-index: -1;
}

.pdf-export-sheet,
.pdf-export-sheet * {
  animation: none !important;
  transition: none !important;
}

.pdf-export-sheet {
  width: 900px !important;
  max-width: 900px !important;
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #111 !important;
}

.pdf-export-sheet .sheet-header {
  grid-template-columns: minmax(0, 1fr) 340px !important;
  border-bottom-color: #C41E24 !important;
  background: #fff !important;
}

.pdf-export-sheet .sheet-logo-img {
  border: 0 !important;
}

.pdf-export-sheet .sheet-eyebrow,
.pdf-export-sheet .rpe-legend-card h4 {
  color: #C41E24 !important;
}

.pdf-export-sheet h1,
.pdf-export-sheet .sheet-day h2,
.pdf-export-sheet .ex-line strong,
.pdf-export-sheet .sig-label {
  color: #111 !important;
}

.pdf-export-sheet .sheet-meta td {
  color: #333 !important;
}

.pdf-export-sheet .sheet-meta td:first-child,
.pdf-export-sheet .rest-line,
.pdf-export-sheet .ex-line span,
.pdf-export-sheet .rpe-item span,
.pdf-export-sheet .sheet-footer {
  color: #555 !important;
}

.pdf-export-sheet .sheet-day .tag,
.pdf-export-sheet .box,
.pdf-export-sheet .rpe-item strong {
  color: #8B1519 !important;
  border-color: #8B1519 !important;
}

.pdf-export-sheet .sheet-day h2 {
  border-bottom: 1px solid #ddd !important;
}

.pdf-export-sheet .rpe-legend-card {
  background: #fff !important;
  border: 1px solid #ccc !important;
}

.pdf-export-sheet .rpe-legend-card h4 {
  border-bottom-color: #C41E24 !important;
}

.pdf-export-sheet .rpe-item {
  background: #f8f9fa !important;
  border: 1px solid #ddd !important;
  color: #111 !important;
}

.pdf-export-sheet .signature-section {
  border-top: 2px dashed #888 !important;
}

.pdf-export-sheet .sig-line {
  border-bottom: 1.5px solid #111 !important;
}

.pdf-export-sheet .sig-title {
  color: #444 !important;
}

.pdf-export-sheet .sheet-footer {
  border-top: 1px solid #ddd !important;
}

.pdf-export-sheet .sheet-day,
.pdf-export-sheet .rpe-legend-card,
.pdf-export-sheet .signature-section,
.pdf-export-sheet .sheet-footer {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* RPE scale legend style */
.rpe-legend-card {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 24px;
}

.rpe-legend-card h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.rpe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.rpe-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rpe-item strong {
  font-size: 0.85rem;
  color: var(--gold);
  font-family: 'Outfit', sans-serif;
}

.rpe-item span {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Physical signature blocks */
.signature-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  page-break-inside: avoid;
}

.sig-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sig-line {
  border-bottom: 1.5px solid var(--text-muted);
  height: 48px;
}

.sig-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.sig-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 1px;
}

@media (max-width: 768px) {
  .signature-section {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ---------- DATA ENTRY ENHANCEMENTS & WORKOUT PRESETS ---------- */
.day-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.day-action-btn {
  background: var(--surface-3);
  border: 1px solid var(--accent);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
  cursor: pointer;
}

.day-action-btn:hover {
  color: #fff;
  border-color: var(--primary);
  background: rgba(196, 30, 36, 0.1);
}

.day-preset-select {
  min-height: 34px;
  font-size: 0.76rem;
  margin-top: 4px;
  border-color: var(--accent);
}

.exercise-row {
  grid-template-columns: 1fr 46px 60px 44px 22px 22px 22px !important;
}

.exercise-row.cardio {
  grid-template-columns: 1fr 74px 44px 22px 22px 22px !important;
}

.row-move-up,
.row-move-down,
.row-remove {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  min-height: auto;
  padding: 2px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-move-up:hover,
.row-move-down:hover {
  color: var(--gold);
}

.row-remove:hover {
  color: var(--primary-light);
}

.quick-fill-row {
  display: grid;
  grid-template-columns: 46px 60px 44px 1fr;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.quick-fill-row input {
  min-height: 30px;
  padding: 4px 6px;
  font-size: 0.72rem;
  text-align: center;
}

.add-exercise-input {
  min-height: 34px;
  font-size: 0.76rem;
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--accent);
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 10px;
}

.add-exercise-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196, 30, 36, .15);
  outline: none;
}

.sheet-header-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sheet-logo-img {
  height: 40px;
  max-width: 120px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid var(--line);
}

/* ---------- PRINT: checklist only ---------- */
@media print {
  body {
    background: #fff;
    color: #111;
    font-family: 'Inter', Arial, sans-serif;
  }

  .no-print,
  .topbar,
  .step-indicator,
  .settings-icon-btn,
  .settings-actions {
    display: none !important;
  }

  #setupView,
  #builderView,
  #settingsModal,
  #coachesModal {
    display: none !important;
  }

  .app-shell {
    max-width: 100%;
    padding: 0;
  }

  .checklist-sheet {
    background: #fff;
    border: 0;
    border-radius: 0;
    padding: 10mm;
    color: #111;
  }

  .sheet-header {
    border-bottom: 3px solid #C41E24;
  }

  .sheet-logo-img {
    border: 0 !important;
    max-height: 44px;
  }

  .sheet-eyebrow {
    color: #C41E24;
  }

  h1 {
    color: #111;
    font-size: 22px;
  }

  .sheet-meta td {
    color: #333;
  }

  .sheet-meta td:first-child {
    color: #777;
  }

  .sheet-day {
    page-break-inside: avoid;
  }

  .pdf-print-page-break {
    break-after: page;
    page-break-after: always;
  }

  .sheet-day h2 {
    color: #111;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
  }

  .sheet-day .tag {
    color: #8B1519;
    border-color: #8B1519;
  }

  .sheet-day.rest h2 {
    color: #777;
  }

  .rest-line {
    color: #555;
  }

  .box {
    color: #8B1519;
  }

  .ex-line strong {
    color: #111;
  }

  .ex-line span {
    color: #555;
  }

  .sheet-footer {
    color: #888;
    border-top: 1px solid #ddd;
    padding-top: 12px;
    margin-top: 30px;
  }

  /* Print RPE Legend */
  .rpe-legend-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #111 !important;
    margin-top: 30px !important;
    page-break-inside: avoid;
  }

  .rpe-legend-card h4 {
    color: #C41E24 !important;
    border-bottom: 1.5px solid #C41E24 !important;
  }

  .rpe-item {
    background: #f8f9fa !important;
    border: 1px solid #ddd !important;
    color: #111 !important;
  }

  .rpe-item strong {
    color: #8B1519 !important;
  }

  .rpe-item span {
    color: #555 !important;
  }

  /* Print Signature blocks */
  .signature-section {
    border-top: 2px dashed #888 !important;
    margin-top: 40px !important;
    padding-top: 24px !important;
    grid-template-columns: 1fr 1fr !important;
    display: grid !important;
    gap: 50px !important;
    page-break-inside: avoid !important;
  }

  .sig-line {
    border-bottom: 1.5px solid #111 !important;
  }

  .sig-label {
    color: #111 !important;
  }

  .sig-title {
    color: #444 !important;
  }
}
