:root {
  /* Core palette supplied for the app */
  --sage: #8DA28C;
  --rust: #A4530C;
  --cream: #EEE9C1;
  --espresso: #3A230A;

  /* Derived interface colours */
  --bg: #F5F1D9;
  --surface: #FFFDF3;
  --surface-soft: #F1ECCA;
  --surface-sage: #E2E8DA;
  --surface-rust: #F2E0CD;
  --text: var(--espresso);
  --muted: #765F45;
  --border: #D7CEAA;
  --border-strong: #BBAF8B;
  --primary: var(--rust);
  --primary-hover: #8E4608;
  --secondary: var(--sage);
  --secondary-hover: #7B917A;
  --success: #526B50;
  --success-bg: #E1E9D9;
  --warning: #874309;
  --warning-bg: #F4E2D0;
  --danger: #8B352D;
  --danger-bg: #F6DEDA;
  --focus: var(--rust);

  --shadow: 0 14px 36px rgba(58, 35, 10, 0.09);
  --shadow-soft: 0 8px 24px rgba(58, 35, 10, 0.06);
  --radius: 22px;
  --radius-small: 14px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0%, rgba(141, 162, 140, 0.16), transparent 28rem),
    linear-gradient(180deg, #F7F3DE 0%, var(--bg) 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(164, 83, 12, 0.24);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: calc(10px + env(safe-area-inset-top)) clamp(14px, 4vw, 30px) 10px;
  border-bottom: 1px solid rgba(58, 35, 10, 0.10);
  background: rgba(245, 241, 217, 0.92);
  backdrop-filter: blur(16px);
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--espresso);
  color: var(--cream);
  font-size: 17px;
  font-weight: 850;
  box-shadow: 0 6px 16px rgba(58, 35, 10, 0.14);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.main-content {
  width: min(calc(100% - 28px), 820px);
  margin: 0 auto;
  padding: 30px 0 calc(76px + env(safe-area-inset-bottom));
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-header-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rust);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(21px, 4.7vw, 25px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.lead,
.muted,
.helper {
  color: var(--muted);
}

.lead {
  max-width: 620px;
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.55;
}

.helper {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
}

.stack {
  display: grid;
  gap: 16px;
}

.card {
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 253, 243, 0.96);
  box-shadow: var(--shadow);
}

.card-flat {
  border-color: rgba(141, 162, 140, 0.46);
  background: var(--surface-sage);
  box-shadow: var(--shadow-soft);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.card-header > :first-child {
  min-width: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(58, 35, 10, 0.07);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--espresso);
  font-size: 11.5px;
  font-weight: 780;
}

.badge-success {
  background: var(--success-bg);
  color: #40553E;
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.button {
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 7px 18px rgba(164, 83, 12, 0.18);
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.button-secondary {
  border-color: rgba(58, 35, 10, 0.14);
  background: var(--secondary);
  color: var(--espresso);
}

.button-secondary:hover:not(:disabled) {
  background: var(--secondary-hover);
}

.button-danger {
  background: var(--danger);
  color: #fff;
}

.button-compact {
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 12px;
  font-size: 12.5px;
}

.button-link {
  min-height: 40px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--espresso);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.button-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.progress-wrap {
  margin: 20px 0 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #DDD5B8;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--rust);
}

.current-exercise-callout {
  margin-top: 20px;
  padding: 17px;
  border: 1px solid rgba(141, 162, 140, 0.62);
  border-radius: var(--radius-small);
  background: var(--surface-sage);
}

.current-exercise-callout span {
  display: block;
  margin-bottom: 5px;
  color: #52644F;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.current-exercise-callout strong {
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.exercise-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.exercise-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 253, 243, 0.86);
}

.exercise-order {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--espresso);
  font-size: 12px;
  font-weight: 850;
}

.exercise-row.is-current {
  border-color: var(--rust);
  background: var(--surface-rust);
  box-shadow: inset 3px 0 0 var(--rust);
}

.exercise-row.is-current .exercise-order {
  background: var(--rust);
  color: #fff;
}

.exercise-row.is-completed {
  opacity: 0.62;
}

.exercise-copy {
  min-width: 0;
}

.exercise-copy strong,
.exercise-copy small {
  display: block;
}

.exercise-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.exercise-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #BDB291;
}

.status-dot.in-progress {
  background: var(--rust);
}

.status-dot.completed {
  background: #617860;
}

.status-dot.skipped {
  background: #AA7A45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field label,
.field legend {
  color: var(--espresso);
  font-size: 12.5px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: #FFFDF4;
  color: var(--text);
  font-size: 16px; /* avoids iOS input zoom */
}

.field input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field-span {
  grid-column: 1 / -1;
}

.fieldset-reset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

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

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: #FFFDF4;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 780;
  text-align: center;
  cursor: pointer;
}

.segmented input:checked + span {
  border-color: var(--espresso);
  background: var(--espresso);
  color: var(--cream);
}

.plan-preview {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.preview-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.preview-summary h3 {
  margin-bottom: 2px;
  font-size: 24px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 17px 0;
}

.metric {
  padding: 14px;
  border: 1px solid rgba(141, 162, 140, 0.26);
  border-radius: 13px;
  background: var(--surface-sage);
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  margin-bottom: 4px;
  color: #586A55;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric strong {
  font-size: 16px;
  line-height: 1.15;
}

.workout-screen {
  width: min(100%, 720px);
  margin: 0 auto;
}

.exercise-hero {
  padding: clamp(22px, 6vw, 34px);
  border-color: rgba(164, 83, 12, 0.20);
  background:
    linear-gradient(145deg, rgba(255, 253, 243, 0.98), rgba(242, 224, 205, 0.78));
}

.exercise-hero h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 8vw, 54px);
  line-height: 0.98;
}

.prescription-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.prescription {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid rgba(141, 162, 140, 0.26);
  border-radius: 13px;
  background: var(--surface-sage);
  text-align: center;
}

.prescription span,
.prescription strong {
  display: block;
}

.prescription span {
  margin-bottom: 5px;
  color: #5C6B58;
  font-size: 10.5px;
  font-weight: 800;
}

.prescription strong {
  overflow: hidden;
  font-size: clamp(20px, 5.2vw, 25px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-form {
  margin-top: 16px;
}

.feel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.feel-grid label {
  position: relative;
}

.feel-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feel-option {
  display: grid;
  place-items: center;
  min-height: 62px;
  padding: 9px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: #FFFDF4;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 820;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}

.feel-grid input:checked + .feel-option {
  border-color: var(--espresso);
  background: var(--espresso);
  color: var(--cream);
  box-shadow: 0 5px 14px rgba(58, 35, 10, 0.14);
}

.notice {
  padding: 14px 16px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.45;
}

.notice-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.notice-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.empty-state {
  padding: clamp(30px, 8vw, 52px) 22px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--sage);
  color: var(--espresso);
  font-size: 24px;
  font-weight: 850;
}

.loading {
  display: grid;
  place-items: center;
  min-height: 300px;
  color: var(--muted);
  font-weight: 750;
}

.spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border: 3px solid #D7CEAA;
  border-top-color: var(--rust);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(238, 233, 193, 0.10);
  border-radius: 14px;
  background: var(--espresso);
  color: var(--cream);
  box-shadow: 0 16px 44px rgba(58, 35, 10, 0.28);
  font-size: 13.5px;
  line-height: 1.45;
}

/* Mobile is the primary usage mode. Keep the interface compact, thumb-friendly,
   and avoid vertically stacking metrics that are easier to scan side-by-side. */
@media (max-width: 720px) {
  .main-content {
    width: calc(100% - 24px);
    padding-top: 22px;
  }

  .topbar {
    min-height: 62px;
    padding-inline: 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .brand-copy small {
    display: none;
  }

  .topbar .button-compact {
    min-height: 40px;
    padding-inline: 12px;
  }

  .page-header {
    display: block;
    margin-bottom: 19px;
  }

  .page-header h1 {
    font-size: 34px;
  }

  .card {
    padding: 18px;
    border-radius: 20px;
  }

  .card-header {
    margin-bottom: 17px;
  }

  .stack {
    gap: 13px;
  }

  /* Planning fields should be comfortably full-width on a phone. */
  #planForm .form-grid,
  #completeWorkoutForm .form-grid {
    grid-template-columns: 1fr;
  }

  /* Actual weight/reps/sets remain a compact three-column logger. */
  .exercise-form .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .exercise-form .field label {
    min-height: 30px;
    display: flex;
    align-items: flex-end;
    font-size: 11px;
    line-height: 1.15;
  }

  .exercise-form .field input {
    min-height: 50px;
    padding-inline: 8px;
    text-align: center;
  }

  .exercise-form .field-span {
    grid-column: 1 / -1;
  }

  .metric-grid,
  .prescription-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric {
    padding: 11px 8px;
    text-align: center;
  }

  .metric strong {
    font-size: 14px;
  }

  .segmented,
  .feel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-summary {
    align-items: center;
  }

  .exercise-row {
    grid-template-columns: 32px minmax(0, 1fr) 10px;
    min-height: 56px;
    padding: 9px 10px;
  }

  .exercise-copy strong {
    font-size: 13.5px;
  }

  .exercise-copy small {
    font-size: 11px;
  }

  .exercise-hero {
    padding: 21px 18px;
  }

  .exercise-hero h1 {
    font-size: clamp(34px, 10vw, 44px);
  }

  .prescription {
    padding: 12px 7px;
  }

  .prescription span {
    font-size: 10px;
  }

  .prescription strong {
    font-size: clamp(18px, 5.5vw, 22px);
  }

  .button-row {
    gap: 8px;
  }

  .button-row .button {
    flex: 1 1 100%;
    min-height: 50px;
  }

  .feel-option {
    min-height: 56px;
  }

  .toast {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 380px) {
  .main-content {
    width: calc(100% - 18px);
  }

  .topbar {
    padding-inline: 9px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .topbar .button-compact {
    padding-inline: 10px;
    font-size: 12px;
  }

  .card {
    padding: 16px;
  }

  .exercise-form .form-grid {
    gap: 6px;
  }

  .exercise-form .field input {
    padding-inline: 5px;
  }
}

/* ============================================================
   v0.1.2 — MOBILE WORKOUT PLAYER
   The active exercise gets the screen. Logging is a separate step.
   ============================================================ */

body[data-view="workout"] .topbar {
  display: none;
}

body[data-view="workout"] .main-content {
  width: min(100%, 560px);
  padding: max(14px, env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
}

.workout-player {
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 28px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.workout-mini-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(58, 35, 10, 0.12);
  border-radius: 14px;
  background: rgba(255, 253, 243, 0.78);
  color: var(--espresso);
  font-size: 21px;
  font-weight: 800;
  cursor: pointer;
}

.workout-step {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--espresso);
  color: var(--cream);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.current-exercise-header {
  padding: 2px 2px 0;
}

.current-exercise-header .eyebrow,
.log-stage-header .eyebrow {
  margin-bottom: 6px;
}

.current-exercise-header h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.log-stage-header h1 {
  margin: 0;
  font-size: clamp(32px, 10vw, 46px);
  line-height: 0.98;
  letter-spacing: -0.048em;
}

.equipment-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* v0.1.5 compact prescription layout:
   weight + primary equipment, reps + sets, then full-width rest. */
.prescription-layout {
  display: grid;
  gap: 8px;
}

.prescription-weight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.prescription-weight-row.no-equipment-photo {
  grid-template-columns: minmax(0, 1fr);
}

.prescription-pair-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.prescription-tile {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 9px 14px 9px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 253, 243, 0.96);
  box-shadow: 0 4px 14px rgba(58, 35, 10, 0.04);
}

.prescription-pair-row .prescription-tile {
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value";
  column-gap: 7px;
  row-gap: 1px;
  padding-right: 10px;
}

.prescription-pair-row .prescription-icon {
  grid-area: icon;
  width: 30px;
  height: 30px;
}

.prescription-pair-row .prescription-label {
  grid-area: label;
  padding-left: 0;
  align-self: end;
}

.prescription-pair-row .prescription-tile strong {
  grid-area: value;
  padding-left: 0;
  align-self: start;
  text-align: left;
}

.prescription-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: var(--surface-sage);
  font-size: 16px;
}

.prescription-label {
  padding-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.prescription-tile strong {
  padding-left: 12px;
  color: var(--espresso);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.035em;
  text-align: right;
}

.exercise-media {
  overflow: hidden;
  width: 100%;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-soft);
}

.exercise-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.technique-stack {
  display: grid;
  gap: 8px;
}

.technique-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-sage);
}

.technique-item.technique-tip {
  background: var(--surface-rust);
}

.technique-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: rgba(255, 253, 243, 0.72);
  font-weight: 900;
}

.technique-label {
  display: block;
  margin: 1px 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.technique-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.42;
  font-weight: 650;
}

.instructions-disclosure,
.note-disclosure {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 253, 243, 0.86);
}

.instructions-disclosure summary,
.note-disclosure summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 13px;
  list-style: none;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.instructions-disclosure summary::-webkit-details-marker,
.note-disclosure summary::-webkit-details-marker {
  display: none;
}

.instructions-copy {
  padding: 0 14px 14px;
  color: var(--espresso);
  font-size: 13px;
  line-height: 1.55;
}

.technique-empty {
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.exercise-bottom-actions,
.post-exercise-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.button-large {
  min-height: 56px;
  border-radius: 17px;
  font-size: 15px;
}

.button-quiet {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.button-quiet:hover:not(:disabled) {
  background: rgba(58, 35, 10, 0.05);
}

/* Post-exercise logging is intentionally a separate screen. */
.workout-log-stage {
  gap: 18px;
}

.log-stage-header {
  padding: 10px 2px 4px;
  text-align: center;
}

.stage-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: var(--sage);
  color: var(--espresso);
  font-size: 24px;
  font-weight: 900;
}

.log-stage-header h1 {
  font-size: clamp(27px, 8vw, 38px);
}

.post-exercise-form {
  display: grid;
  gap: 20px;
  flex: 1;
}

.actual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.actual-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 253, 243, 0.96);
  text-align: center;
}

.actual-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.actual-field input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--espresso);
  font-size: clamp(24px, 8vw, 32px);
  font-weight: 850;
  text-align: center;
  outline: 0;
}

.actual-field small {
  min-height: 13px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.feel-fieldset legend {
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 850;
}

.compact-feel-grid {
  gap: 8px;
}

.compact-feel-grid .feel-option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 68px;
  padding: 8px;
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
}

.compact-feel-grid .feel-option b {
  font-size: 20px;
  line-height: 1;
}

.note-disclosure textarea {
  width: calc(100% - 24px);
  min-height: 84px;
  margin: 0 12px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  resize: vertical;
}

@media (min-width: 721px) {
  body[data-view="workout"] .main-content {
    padding-inline: 0;
  }
}

@media (max-width: 380px) {
  body[data-view="workout"] .main-content {
    padding-inline: 10px;
  }

  .workout-player {
    gap: 13px;
  }

  .current-exercise-header h1 {
    font-size: 32px;
  }

  .prescription-tile {
    min-height: 54px;
  }

  .prescription-tile strong {
    font-size: 20px;
  }

  .actual-grid {
    gap: 6px;
  }

  .actual-field {
    padding-inline: 5px;
  }
}


/* v0.1.5 — primary Equipment Type 1 photo sits beside Weight. */
.equipment-visuals {
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin: 0;
}

.equipment-photo {
  position: relative;
  width: 78px;
  min-height: 58px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 253, 243, 0.96);
  box-shadow: 0 4px 14px rgba(58, 35, 10, 0.04);
}

.equipment-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 58px;
  object-fit: contain;
  padding: 5px;
}

.equipment-quantity {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--espresso);
  color: var(--cream);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

@media (max-width: 380px) {
  .current-exercise-header h1 {
    font-size: 20px;
  }

  .prescription-tile {
    min-height: 54px;
  }

  .prescription-tile strong {
    font-size: 20px;
  }

  .prescription-pair-row {
    gap: 6px;
  }

  .prescription-pair-row .prescription-tile {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 7px 8px;
  }

  .prescription-pair-row .prescription-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .equipment-photo,
  .equipment-photo img {
    min-height: 54px;
  }

  .equipment-photo {
    width: 70px;
    border-radius: 15px;
  }
}

/* ============================================================
   v0.1.6 — SIMPLE HOME + DISTINCT EXERCISE OVERVIEW
   Fast, icon-led home screen for pre-workout use.
   ============================================================ */

/* Keep every prescription row aligned to exactly the same outer width. */
.prescription-layout,
.prescription-weight-row,
.prescription-pair-row,
.prescription-layout > .prescription-tile {
  width: 100%;
  min-width: 0;
}

.prescription-weight-row {
  grid-template-columns: minmax(0, 1fr) 82px;
}

.prescription-weight-row .equipment-visuals {
  width: 82px;
  min-width: 82px;
}

.prescription-weight-row .equipment-photo {
  width: 100%;
}

/* The home screen intentionally avoids cards-on-cards, tags and descriptive copy. */
body[data-view="home"] .main-content {
  width: min(calc(100% - 28px), 620px);
  padding-top: 28px;
}

.home-screen {
  display: grid;
  gap: 18px;
}

.home-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.home-kicker {
  margin: 0 0 5px;
  color: var(--rust);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-heading-row h1 {
  margin: 0;
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.home-date {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.home-workout-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(58, 35, 10, 0.11);
  border-radius: 24px;
  background: rgba(255, 253, 243, 0.95);
  box-shadow: 0 12px 32px rgba(58, 35, 10, 0.07);
}

.home-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.home-status-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--espresso);
  font-size: 11px;
}

.home-status.is-active .home-status-icon {
  background: var(--rust);
  color: #fff;
}

.home-status.is-complete .home-status-icon {
  background: var(--sage);
  color: var(--espresso);
}

.home-percent {
  color: var(--rust);
  font-size: 14px;
}

.home-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px 0;
}

.home-fact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 0 10px;
  border-right: 1px solid var(--border);
}

.home-fact:last-child {
  border-right: 0;
}

.home-fact-icon {
  flex: 0 0 auto;
  color: var(--rust);
  font-size: 17px;
  font-weight: 900;
}

.home-fact div {
  min-width: 0;
}

.home-fact strong,
.home-fact small {
  display: block;
}

.home-fact strong {
  color: var(--espresso);
  font-size: 18px;
  line-height: 1;
}

.home-fact small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #E1DABF;
}

.home-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--rust);
}

.home-current-exercise {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-sage);
}

.home-current-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--espresso);
  color: var(--cream);
  font-size: 12px;
}

.home-current-exercise small,
.home-current-exercise strong {
  display: block;
}

.home-current-exercise small {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-current-exercise strong {
  overflow: hidden;
  color: var(--espresso);
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.home-primary-action,
.home-secondary-action {
  min-height: 54px;
  border: 0;
  border-radius: 17px;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}

.home-primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  background: var(--rust);
  color: #fff;
  box-shadow: 0 8px 18px rgba(164, 83, 12, 0.17);
}

.home-secondary-action {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 112px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--espresso);
}

.home-empty-card,
.home-error-card {
  place-items: center;
  min-height: 260px;
  text-align: center;
}

.home-empty-card h2,
.home-error-card h2 {
  margin: -4px 0 2px;
  font-size: 20px;
}

.home-empty-symbol {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 19px;
  background: var(--surface-sage);
  color: var(--espresso);
  font-size: 25px;
  font-weight: 850;
}

.home-empty-card .home-primary-action,
.home-error-card .home-primary-action {
  min-width: 180px;
}

/* A real exercise-list destination, separate from Resume Workout. */
body[data-view="overview"] .main-content {
  width: min(calc(100% - 28px), 620px);
  padding-top: 20px;
}

.workout-overview-screen {
  display: grid;
  gap: 16px;
}

.overview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.overview-nav > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.overview-header {
  padding: 0 2px;
}

.overview-header h1 {
  margin: 0;
  font-size: 29px;
}

.overview-list-card {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 253, 243, 0.88);
  box-shadow: var(--shadow-soft);
}

.overview-list-card .exercise-list {
  margin-top: 0;
  gap: 4px;
}

.overview-list-card .exercise-row {
  border: 0;
  border-bottom: 1px solid rgba(58, 35, 10, 0.08);
  border-radius: 13px;
  background: transparent;
}

.overview-list-card .exercise-row:last-child {
  border-bottom: 0;
}

.overview-list-card .exercise-row.is-current {
  background: var(--surface-rust);
  box-shadow: none;
}

.overview-actions {
  position: sticky;
  bottom: calc(10px + env(safe-area-inset-bottom));
  padding-top: 2px;
}

.overview-actions .button {
  width: 100%;
  min-height: 54px;
}

@media (max-width: 480px) {
  body[data-view="home"] .main-content,
  body[data-view="overview"] .main-content {
    width: calc(100% - 22px);
  }

  .home-workout-card {
    padding: 17px;
    border-radius: 21px;
  }

  .home-fact {
    gap: 6px;
    padding-inline: 6px;
  }

  .home-fact-icon {
    font-size: 15px;
  }

  .home-fact strong {
    font-size: 17px;
  }

  .home-secondary-action {
    min-width: 104px;
    padding-inline: 11px;
  }

  .prescription-weight-row {
    grid-template-columns: minmax(0, 1fr) 78px;
  }

  .prescription-weight-row .equipment-visuals {
    width: 78px;
    min-width: 78px;
  }
}

@media (max-width: 360px) {
  .home-actions {
    grid-template-columns: 1fr;
  }

  .home-secondary-action {
    width: 100%;
  }
}

.home-actions.single-action {
  grid-template-columns: 1fr;
}
