:root {
  color-scheme: dark;
  --safe-bottom: env(safe-area-inset-bottom);
  --page-pad: clamp(0.75rem, 3.8vw, 1.2rem);
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #0b1120;
}

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

.touch-target {
  min-height: 52px;
}

.screen-stack,
.exercise-stack {
  display: grid;
  gap: clamp(0.85rem, 3vw, 1.15rem);
}

.hero-panel,
.exercise-card {
  padding: clamp(0.9rem, 3.4vw, 1.1rem);
}

.text-fluid-title {
  font-size: clamp(1.35rem, 6vw, 2rem);
}

.ui-icon {
  display: inline-flex;
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid #273244;
  border-radius: 1rem;
  background: #111827;
  color: #94a3b8;
  font-weight: 800;
  font-size: 0.86rem;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.nav-btn.is-active {
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(52, 211, 153, 0.16);
  color: #ecfdf5;
}

.nav-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel {
  border: 1px solid #273244;
  border-radius: 0.5rem;
  background: rgba(17, 24, 39, 0.92);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.program-card {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
  border: 1px solid #273244;
  border-radius: 0.5rem;
  background: #111827;
  padding: 0.8rem;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.program-card.is-selected {
  transform: translateY(-1px);
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.program-badge {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #08111f;
  font-size: 0.86rem;
  font-weight: 950;
}

.program-title {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(0.78rem, 3.6vw, 0.96rem);
  font-weight: 950;
  line-height: 1.18;
}

.program-subtitle {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 800;
}

.accent-emerald .program-badge,
.accent-emerald.history-badge {
  background: #34d399;
}

.accent-emerald.is-selected {
  border-color: rgba(52, 211, 153, 0.78);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.18), rgba(17, 24, 39, 0.96));
}

.accent-sky .program-badge,
.accent-sky.history-badge {
  background: #38bdf8;
}

.accent-sky.is-selected {
  border-color: rgba(56, 189, 248, 0.78);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(17, 24, 39, 0.96));
}

.accent-rose .program-badge,
.accent-rose.history-badge {
  background: #fb7185;
}

.accent-rose.is-selected {
  border-color: rgba(251, 113, 133, 0.78);
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.18), rgba(17, 24, 39, 0.96));
}

.field {
  width: 100%;
  min-height: 52px;
  border: 1px solid #334155;
  border-radius: 0.9rem;
  background: #0f172a;
  padding: 0.75rem 0.85rem;
  color: #f8fafc;
  outline: none;
  font-weight: 900;
}

.field:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.set-row {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr) minmax(0, 1fr) 3.25rem;
  gap: 0.55rem;
  align-items: center;
}

.set-head {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr) minmax(0, 1fr) 3.25rem;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.set-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.set-list {
  display: grid;
  gap: 0.55rem;
}

.set-index {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  border: 1px solid #273244;
  border-radius: 0.9rem;
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 950;
}

.input-shell {
  position: relative;
  display: block;
  min-width: 0;
}

.input-shell .field {
  padding-left: 2.25rem;
  text-align: center;
  tab-size: 4;
}

.input-icon {
  position: absolute;
  left: 0.72rem;
  top: 50%;
  z-index: 1;
  display: inline-flex;
  color: #64748b;
  transform: translateY(-50%);
  pointer-events: none;
}

.done-shell {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid #273244;
  border-radius: 0.9rem;
  background: #0f172a;
}

.set-check {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-content: center;
  appearance: none;
  border: 1px solid #475569;
  border-radius: 0.85rem;
  background: #1e293b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.set-check::before {
  width: 1.1rem;
  height: 1.1rem;
  background: #08111f;
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 16%, 84% 0, 35% 64%);
  content: "";
  transform: scale(0);
  transition: transform 120ms ease;
}

.set-check:checked {
  border-color: #34d399;
  background: #34d399;
}

.set-check:checked::before {
  transform: scale(1);
}

.set-check:focus-visible {
  outline: 3px solid rgba(52, 211, 153, 0.28);
  outline-offset: 3px;
}

.set-row.is-done .field {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.08);
}

.set-row.is-done .set-index,
.set-row.is-done .done-shell {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.08);
  color: #a7f3d0;
}

.exercise-head {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.exercise-title {
  font-size: clamp(1rem, 4.3vw, 1.18rem);
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.exercise-note {
  margin-top: 0.28rem;
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.55;
}

.exercise-rest {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 850;
}

.exercise-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.exercise-labels,
.exercise-actions,
.filter-row,
.choice-meta,
.library-row-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.exercise-labels {
  min-width: 0;
  flex-wrap: wrap;
}

.exercise-actions {
  flex: 0 0 auto;
}

.exercise-action {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #0f172a;
  padding: 0.55rem;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 900;
}

.exercise-action.replace-exercise {
  border-color: rgba(56, 189, 248, 0.42);
  color: #bae6fd;
}

.exercise-action.remove-exercise {
  color: #fecdd3;
}

.exercise-copy {
  margin-bottom: 1rem;
}

.exercise-meta,
.history-exercise-meta {
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
}

.superset-badge,
.origin-badge,
.built-in-label {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 950;
}

.superset-badge {
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

.origin-badge {
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.exercise-card.is-superset {
  border-left: 3px solid #f59e0b;
}

.add-exercise-command {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px dashed rgba(52, 211, 153, 0.55);
  border-radius: 0.5rem;
  background: rgba(52, 211, 153, 0.07);
  color: #a7f3d0;
  font-weight: 950;
}

.icon-btn,
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  border-radius: 1rem;
  font-weight: 950;
}

.planner-hero,
.today-plan-banner,
.today-plan-banner > div,
.today-readiness,
.week-toolbar,
.week-summary,
.plan-program-line,
.plan-day-actions,
.readiness-inline,
.sheet-command-row,
.conflict-actions {
  display: flex;
  align-items: center;
}

.planner-hero {
  min-height: 5rem;
  justify-content: space-between;
  gap: 1rem;
}

.planner-hero > div {
  min-width: 0;
}

.planner-hero p:last-child {
  margin-top: 0.35rem;
  max-width: 34rem;
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.5;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  border: 1px solid #273244;
  border-radius: 0.6rem;
  background: #0f172a;
  padding: 0.25rem;
}

.segment-btn {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.4rem;
  color: #64748b;
  font-weight: 900;
}

.segment-btn.is-active {
  background: #1e293b;
  color: #f8fafc;
}

.planner-week {
  min-width: 0;
}

.week-toolbar {
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.25rem 0.7rem;
}

.week-nav-btn {
  display: inline-flex;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  border-radius: 0.55rem;
  background: #111827;
  color: #e2e8f0;
}

.week-title {
  min-width: 0;
  text-align: center;
}

.week-title strong,
.week-title button {
  display: block;
}

.week-title strong {
  font-size: 1rem;
  font-weight: 950;
}

.week-title button {
  margin: 0.15rem auto 0;
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 900;
}

.week-summary {
  min-height: 38px;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  border-block: 1px solid #273244;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 850;
}

.week-summary span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.week-summary .is-overdue,
.plan-status.status-overdue {
  color: #fbbf24;
}

.week-days {
  min-width: 0;
}

.plan-day {
  display: grid;
  min-height: 112px;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  gap: 0.45rem 0.7rem;
  align-items: center;
  border-bottom: 1px solid #273244;
  padding: 0.75rem 0.1rem;
}

.plan-day.is-today {
  background: rgba(52, 211, 153, 0.045);
  box-shadow: inset 3px 0 #34d399;
}

.plan-day.status-overdue {
  box-shadow: inset 3px 0 #f59e0b;
}

.plan-day.status-completed {
  opacity: 0.78;
}

.plan-date {
  display: grid;
  align-self: start;
  gap: 0.12rem;
  padding-top: 0.25rem;
}

.plan-date strong {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 950;
}

.plan-date span,
.plan-date small {
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 850;
}

.plan-date small {
  color: #6ee7b7;
}

.plan-day-main {
  min-width: 0;
}

.plan-program-line {
  min-width: 0;
  gap: 0.6rem;
}

.plan-program-line > div {
  min-width: 0;
}

.program-dot {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #07111f;
  font-weight: 950;
}

.program-dot.accent-emerald { background: #34d399; }
.program-dot.accent-sky { background: #38bdf8; }
.program-dot.accent-rose { background: #fb7185; }

.plan-program-line h3 {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1.25;
}

.plan-status,
.plan-session-meta {
  display: block;
  margin-top: 0.15rem;
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 850;
}

.plan-status.status-completed { color: #6ee7b7; }
.plan-status.status-skipped { color: #fda4af; }

.plan-day-actions {
  grid-column: 2;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.plan-action {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 900;
}

.plan-action.plan-start,
.plan-action.plan-history {
  padding-inline: 0.7rem;
  border-color: rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
}

.plan-action.plan-skip {
  color: #fda4af;
}

.plan-empty-command {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  border: 1px dashed #334155;
  border-radius: 0.55rem;
  padding-inline: 0.8rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
}

.history-list {
  display: grid;
  gap: 0.85rem;
}

.readiness-inline {
  flex-wrap: wrap;
  gap: 0.25rem 0.55rem;
  margin-top: 0.45rem;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 800;
}

.readiness-inline .ui-icon {
  color: #34d399;
}

.today-plan-banner {
  min-height: 64px;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 0.6rem;
  background: rgba(56, 189, 248, 0.08);
  padding: 0.65rem 0.75rem;
}

.today-plan-banner > div {
  min-width: 0;
  gap: 0.6rem;
}

.today-plan-banner > div > .ui-icon {
  color: #7dd3fc;
}

.today-plan-banner small,
.today-plan-banner strong {
  display: block;
}

.today-plan-banner small {
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 850;
}

.today-plan-banner strong {
  margin-top: 0.1rem;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 950;
}

.plan-start-command,
.active-plan-label {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 0.5rem;
  padding-inline: 0.7rem;
  background: #38bdf8;
  color: #07111f;
  font-size: 0.76rem;
  font-weight: 950;
}

.active-plan-label {
  min-height: 32px;
  background: rgba(52, 211, 153, 0.14);
  color: #a7f3d0;
}

.today-plan-banner.is-completed,
.today-plan-banner.is-active {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.07);
}

.today-plan-banner.is-skipped {
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.07);
}

.today-readiness {
  min-height: 42px;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 0.75rem;
  border-top: 1px solid #273244;
  padding-top: 0.65rem;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 850;
}

.today-readiness > span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.today-readiness .readiness-inline {
  margin: 0;
}

.today-readiness button {
  flex: 0 0 auto;
  color: #6ee7b7;
  font-weight: 950;
}

.compact-sheet {
  max-width: 40rem;
}

.sheet-copy {
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.55;
}

.program-choice-field,
.readiness-field {
  display: grid;
  gap: 0.4rem;
}

.program-choice-field legend,
.readiness-field legend {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 900;
}

.plan-program-options,
.readiness-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.plan-program-option,
.readiness-options label {
  position: relative;
  min-width: 0;
}

.plan-program-option input,
.readiness-options input {
  position: absolute;
  opacity: 0;
}

.plan-program-option {
  display: grid;
  min-height: 82px;
  place-items: center;
  gap: 0.25rem;
  border: 1px solid #334155;
  border-radius: 0.55rem;
  padding: 0.55rem;
  text-align: center;
}

.plan-program-option strong {
  overflow-wrap: anywhere;
  font-size: 0.7rem;
  font-weight: 900;
}

.plan-program-option:has(input:checked) {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.08);
}

.week-fill-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.week-fill-day {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 66px;
  place-content: center;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  text-align: center;
}

.week-fill-day input {
  position: absolute;
  opacity: 0;
}

.week-fill-day strong,
.week-fill-day span {
  overflow-wrap: anywhere;
  font-size: 0.62rem;
}

.week-fill-day strong {
  text-transform: uppercase;
  font-weight: 950;
}

.week-fill-day span {
  color: #64748b;
}

.week-fill-day:has(input:checked) {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  color: #ecfdf5;
}

.week-fill-day.is-disabled {
  opacity: 0.35;
}

.selection-count {
  color: #94a3b8;
  font-size: 0.75rem;
}

.readiness-options label span {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.45rem;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.readiness-options input:checked + span {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  color: #ecfdf5;
}

.sheet-command-row,
.conflict-actions {
  gap: 0.55rem;
}

.sheet-command-row > *,
.conflict-actions > * {
  flex: 1;
}

.secondary-command,
.danger-command {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  border-radius: 0.65rem;
  padding: 0.75rem;
  color: #e2e8f0;
  font-weight: 900;
  text-align: center;
}

.danger-command {
  border-color: rgba(251, 113, 133, 0.5);
  color: #fda4af;
}

.primary-command:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.primary-command {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  background: #34d399;
  padding: 1rem 1.25rem;
  color: #07111f;
  font-size: 1.05rem;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(52, 211, 153, 0.15);
}

.timer-active .primary-command {
  margin-bottom: 7rem;
}

.edit-banner {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 0.6rem;
  background: rgba(245, 158, 11, 0.1);
  padding: 0.65rem 0.8rem;
  color: #fde68a;
  font-size: 0.85rem;
  font-weight: 900;
}

.edit-banner > div,
.compact-btn,
.set-control,
.section-title,
.selector-label,
.history-meta,
.action-outline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.compact-btn {
  min-height: 40px;
  flex: 0 0 auto;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 0.5rem;
  padding: 0.5rem 0.7rem;
  color: #fef3c7;
  font-weight: 900;
}

.set-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.set-control {
  min-height: 44px;
  justify-content: center;
  border: 1px solid #334155;
  border-radius: 0.55rem;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 900;
}

.set-control.add-set {
  border-color: rgba(52, 211, 153, 0.42);
  color: #a7f3d0;
}

.timer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.4rem;
}

.timer-btn {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid #334155;
  border-radius: 0.55rem;
  background: #111827;
  padding: 0.55rem;
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 950;
}

.timer-stop {
  border-color: rgba(251, 113, 133, 0.42);
  color: #fecdd3;
}

.timer-source {
  max-width: 18rem;
  overflow: hidden;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.summary-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(4.1rem, 1fr));
  gap: 0.45rem;
}

.summary-pair div,
.stat-box {
  border: 1px solid #273244;
  border-radius: 0.5rem;
  background: #0f172a;
  padding: 0.6rem;
}

.summary-pair strong,
.summary-pair span {
  display: block;
  text-align: center;
}

.summary-pair strong {
  font-size: 1.2rem;
}

.summary-pair span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
}

.selector-panel,
.trend-panel,
.recent-panel,
.settings-panel {
  padding: 1rem;
}

.selector-label,
.section-title {
  margin-bottom: 0.7rem;
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 950;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.record-card {
  min-width: 0;
  border: 1px solid #273244;
  border-radius: 0.5rem;
  background: #111827;
  padding: 0.9rem;
}

.record-card > span {
  color: #34d399;
}

.record-card p {
  margin-top: 0.65rem;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 850;
}

.record-card strong {
  display: block;
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
  font-size: 1.28rem;
}

.record-card small {
  color: #64748b;
  font-size: 0.68rem;
}

.trend-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.8rem;
}

.trend-head h3 {
  font-size: 1rem;
  font-weight: 950;
}

.section-kicker {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.delta-badge {
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 950;
}

.delta-badge.positive {
  border-color: rgba(52, 211, 153, 0.48);
  color: #6ee7b7;
}

.delta-badge.negative {
  border-color: rgba(251, 113, 133, 0.48);
  color: #fda4af;
}

.trend-chart {
  display: grid;
  height: 13rem;
  grid-auto-columns: minmax(2.4rem, 4rem);
  grid-auto-flow: column;
  gap: 0.45rem;
  justify-content: start;
  margin-top: 1rem;
  overflow-x: auto;
}

.trend-column {
  display: grid;
  min-width: 2.2rem;
  grid-template-rows: 1.2rem 1fr 1.2rem;
  gap: 0.35rem;
  text-align: center;
}

.trend-value,
.trend-date {
  color: #94a3b8;
  font-size: 0.64rem;
  font-weight: 850;
}

.trend-track {
  position: relative;
  min-height: 0;
  border-radius: 0.35rem;
  background: #0f172a;
  overflow: hidden;
}

.trend-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  background: #34d399;
}

.recent-list {
  display: grid;
  gap: 0.55rem;
}

.recent-row {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  border-top: 1px solid #273244;
  padding-top: 0.65rem;
  font-size: 0.78rem;
}

.recent-row time {
  color: #64748b;
}

.recent-row span {
  min-width: 0;
  color: #cbd5e1;
}

.recent-row strong {
  color: #6ee7b7;
  text-align: right;
}

.empty-state {
  padding: 2rem 1.2rem;
  text-align: center;
}

.empty-state > .ui-icon {
  width: 2.2rem;
  height: 2.2rem;
  color: #34d399;
}

.empty-state h3 {
  margin-top: 0.8rem;
  font-size: 1.05rem;
  font-weight: 950;
}

.empty-state p {
  margin: 0.55rem auto 0;
  max-width: 30rem;
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1.6;
}

.history-meta {
  margin-top: 0.3rem;
  flex-wrap: wrap;
  color: #94a3b8;
  font-size: 0.78rem;
}

.history-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  margin-top: 1rem;
}

.action-outline,
.action-danger {
  min-height: 48px;
  justify-content: center;
  border-radius: 0.55rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 950;
}

.action-outline {
  border: 1px solid #334155;
  color: #e2e8f0;
}

.action-danger {
  border: 1px solid rgba(251, 113, 133, 0.42);
  color: #fecdd3;
}

.session-note {
  margin-top: 1rem;
  border-radius: 0.5rem;
  background: #0f172a;
  padding: 0.8rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.55;
}

.setting-row {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #273244;
  padding-block: 0.7rem;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong {
  font-size: 0.88rem;
}

.setting-row small {
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.72rem;
}

.toggle-input {
  position: relative;
  width: 3.2rem;
  height: 1.8rem;
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid #475569;
  border-radius: 999px;
  background: #1e293b;
  cursor: pointer;
}

.toggle-input::before {
  position: absolute;
  top: 0.2rem;
  left: 0.22rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #94a3b8;
  content: "";
  transition: transform 140ms ease;
}

.toggle-input:checked {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.25);
}

.toggle-input:checked::before {
  background: #34d399;
  transform: translateX(1.35rem);
}

.stat-box dt {
  color: #64748b;
}

.stat-box dd {
  margin-top: 0.2rem;
  font-size: 1.25rem;
  font-weight: 950;
}

.library-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}

.library-hero p:last-child {
  margin-top: 0.35rem;
  color: #94a3b8;
  font-size: 0.82rem;
}

.search-field {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #0f172a;
  padding: 0 0.85rem;
  color: #64748b;
}

.search-field:focus-within {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: #f8fafc;
  font-weight: 850;
  outline: 0;
}

.library-filters {
  display: grid;
  gap: 0.65rem;
}

.filter-chips {
  display: flex;
  margin-inline: calc(var(--page-pad) * -1);
  overflow-x: auto;
  padding-inline: var(--page-pad);
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 42px;
  flex: 0 0 auto;
  border: 1px solid #334155;
  border-radius: 999px;
  background: #0f172a;
  padding: 0.55rem 0.75rem;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 900;
}

.filter-chip + .filter-chip {
  margin-left: 0.4rem;
}

.filter-chip.is-active {
  border-color: rgba(52, 211, 153, 0.58);
  background: rgba(52, 211, 153, 0.13);
  color: #d1fae5;
}

.region-chips .filter-chip.is-active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
}

.compact-select {
  min-height: 48px;
  padding-block: 0.55rem;
  font-size: 0.82rem;
}

.filter-row {
  align-items: stretch;
}

.filter-row .compact-select {
  flex: 1;
}

.favorite-filter {
  display: flex;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #0f172a;
  padding: 0.55rem 0.7rem;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 900;
}

.favorite-filter input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: #f59e0b;
}

.library-list {
  overflow: hidden;
  border: 1px solid #273244;
  border-radius: 0.5rem;
}

.library-row {
  display: grid;
  min-height: 82px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  background: rgba(17, 24, 39, 0.86);
  padding: 0.75rem;
}

.library-row + .library-row {
  border-top: 1px solid #273244;
}

.favorite-btn,
.library-row-actions button,
.sheet-close {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #64748b;
}

.favorite-btn.is-favorite {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.favorite-btn.is-favorite svg {
  fill: currentColor;
}

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

.library-copy h3 {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 950;
}

.library-copy p,
.library-copy small {
  display: block;
  margin-top: 0.18rem;
  color: #64748b;
  font-size: 0.69rem;
  font-weight: 800;
}

.library-copy small {
  color: #94a3b8;
}

.built-in-label {
  color: #64748b;
}

.library-row-actions {
  flex-direction: column;
}

.library-row-actions button:last-child {
  color: #fda4af;
}

.compact-empty {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

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

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
}

.bottom-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  max-width: 48rem;
  max-height: 90dvh;
  gap: 0.8rem;
  overflow-y: auto;
  border: 1px solid #334155;
  border-bottom: 0;
  border-radius: 0.75rem 0.75rem 0 0;
  background: #0b1120;
  padding: 0.65rem var(--page-pad) calc(env(safe-area-inset-bottom) + 1rem);
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.5);
}

.sheet-handle {
  width: 2.7rem;
  height: 0.25rem;
  justify-self: center;
  border-radius: 999px;
  background: #475569;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sheet-head h2 {
  margin-top: 0.1rem;
  font-size: 1.25rem;
  font-weight: 950;
}

.picker-results {
  display: grid;
  overflow: hidden;
  border: 1px solid #273244;
  border-radius: 0.5rem;
}

.exercise-choice {
  display: grid;
  min-height: 70px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.75rem;
  text-align: left;
}

.exercise-choice + .exercise-choice {
  border-top: 1px solid #273244;
}

.exercise-choice:active {
  background: rgba(52, 211, 153, 0.08);
}

.choice-main,
.choice-main strong,
.choice-main small,
.choice-meta small,
.choice-meta strong {
  display: block;
}

.choice-main {
  min-width: 0;
}

.choice-main strong {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  font-weight: 950;
}

.choice-main small,
.choice-meta small {
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.67rem;
  font-weight: 800;
}

.choice-meta {
  justify-content: flex-end;
  color: #fbbf24;
  text-align: right;
}

.choice-meta strong {
  color: #cbd5e1;
  font-size: 0.72rem;
}

.empty-inline {
  padding: 1.4rem 1rem;
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.55;
  text-align: center;
}

.form-sheet {
  gap: 0.75rem;
}

.form-field {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
}

.form-field > span {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 900;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

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

.database-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.icon-btn {
  border: 1px solid #273244;
  background: #0f172a;
  padding: 0.7rem 0.9rem;
  color: #f8fafc;
  font-size: 0.9rem;
}

.action-btn {
  width: 100%;
  min-height: 58px;
  padding: 0.95rem 1.15rem;
  font-size: 1.05rem;
}

.history-summary {
  display: flex;
  min-height: 72px;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1rem;
}

.history-badge {
  display: inline-flex;
  min-width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #08111f;
  font-weight: 950;
}

.pill {
  border: 1px solid #334155;
  border-radius: 999px;
  background: #0f172a;
  padding: 0.35rem 0.7rem;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 800;
}

details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 520px) {
  .nav-btn {
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.61rem;
  }

  .nav-icon svg {
    width: 1.05rem;
    height: 1.05rem;
  }
}

@media (max-width: 380px) {

  .timer-actions {
    gap: 0.25rem;
  }

  .timer-btn {
    min-width: 42px;
    min-height: 44px;
    padding: 0.4rem;
    font-size: 0.72rem;
  }

  .timer-source {
    max-width: 8rem;
  }

  .progress-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-pair {
    grid-template-columns: repeat(2, 1fr);
  }

  .program-grid {
    display: flex;
    margin-inline: calc(var(--page-pad) * -1);
    overflow-x: auto;
    padding-inline: var(--page-pad);
    scroll-snap-type: x mandatory;
  }

  .program-card {
    min-width: 8.7rem;
    scroll-snap-align: start;
  }

  .set-row {
    grid-template-columns: 2.35rem minmax(0, 1fr) minmax(0, 1fr) 2.75rem;
    gap: 0.38rem;
  }

  .set-head {
    grid-template-columns: 2.35rem minmax(0, 1fr) minmax(0, 1fr) 2.75rem;
    gap: 0.38rem;
    font-size: 0.62rem;
  }

  .field,
  .set-index,
  .done-shell {
    min-height: 48px;
  }

  .field {
    padding-left: 0.62rem;
    padding-right: 0.62rem;
  }

  .input-shell .field {
    padding-left: 1.95rem;
  }

  .input-icon {
    left: 0.55rem;
  }

  .set-check {
    width: 2.35rem;
    height: 2.35rem;
  }

  .exercise-action span {
    display: none;
  }

  .exercise-toolbar {
    gap: 0.4rem;
  }

  .library-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding-inline: 0.6rem;
  }

  .favorite-btn,
  .library-row-actions button {
    width: 40px;
    height: 40px;
  }

  .form-grid-three {
    grid-template-columns: 0.75fr 1fr 1fr;
    gap: 0.4rem;
  }

  .form-grid-three .field {
    padding-inline: 0.5rem;
  }
}

@media (min-width: 680px) {
  .filter-chips {
    margin-inline: 0;
    padding-inline: 0;
  }

  .program-grid {
    gap: 0.75rem;
  }

  .program-card {
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 0.75rem;
  }

  .program-subtitle {
    grid-column: 2;
  }

  .set-row,
  .set-head {
    grid-template-columns: 3.1rem minmax(0, 1fr) minmax(0, 1fr) 3.6rem;
  }

  .record-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .week-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-block: 1px solid #273244;
  }

  .plan-day {
    min-height: 250px;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    border-right: 1px solid #273244;
    border-bottom: 0;
    padding: 0.65rem 0.5rem;
  }

  .plan-day:last-child {
    border-right: 0;
  }

  .plan-day.is-today,
  .plan-day.status-overdue {
    box-shadow: inset 0 3px #34d399;
  }

  .plan-day.status-overdue {
    box-shadow: inset 0 3px #f59e0b;
  }

  .plan-date {
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: space-between;
  }

  .plan-date small {
    grid-column: 1 / -1;
  }

  .plan-program-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .plan-day-actions {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: auto;
  }

  .plan-action {
    width: 100%;
    min-width: 0;
  }

  .plan-action span {
    display: none;
  }

  .plan-empty-command {
    min-height: 92px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 0.45rem;
    text-align: center;
  }
}

/* v1.3.1 calm, task-first interface */
:root {
  --ux-bg: #0d1017;
  --ux-surface: #151a22;
  --ux-surface-2: #1b222c;
  --ux-line: #2a313d;
  --ux-text: #f5f7fa;
  --ux-muted: #9aa4b2;
  --ux-mint: #36d399;
}

body {
  background: var(--ux-bg);
  color: var(--ux-text);
}

.hidden {
  display: none !important;
}

button,
input,
textarea,
select,
.section-kicker,
.set-head {
  letter-spacing: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  min-height: 56px;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  border-bottom: 1px solid var(--ux-line);
  background: rgba(13, 16, 23, 0.96);
  padding: env(safe-area-inset-top) 0.75rem 0;
  backdrop-filter: blur(14px);
}

.app-brand {
  display: flex;
  grid-column: 1 / 3;
  align-items: center;
  gap: 0.55rem;
  justify-content: flex-start;
  padding-left: 0.25rem;
  text-align: left;
}

.is-settings-mode .app-brand {
  grid-column: 2;
  justify-content: center;
  padding-left: 0;
  text-align: center;
}

.app-brand-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 7px;
}

.app-brand strong {
  font-size: 1rem;
  font-weight: 750;
}

.header-icon-btn,
.workout-icon-btn {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ux-line);
  border-radius: 8px;
  color: var(--ux-muted);
}

.header-icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#settingsBackBtn {
  grid-column: 1;
  margin-left: 0.15rem;
}

#openSettingsBtn {
  grid-column: 3;
}

.app-bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 50;
  border-top: 1px solid var(--ux-line);
  background: rgba(13, 16, 23, 0.97);
  padding: 0.45rem 0.75rem calc(env(safe-area-inset-bottom) + 0.45rem);
  backdrop-filter: blur(14px);
}

.nav-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.nav-btn,
.nav-btn.is-active {
  min-height: 54px;
  flex-direction: column;
  gap: 0.15rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 650;
}

.nav-btn.is-active {
  background: rgba(54, 211, 153, 0.12);
  color: #d9fff1;
}

.panel {
  border-color: var(--ux-line);
  background: var(--ux-surface);
  box-shadow: none;
}

.program-card,
.program-card.accent-emerald,
.program-card.accent-sky,
.program-card.accent-rose,
.program-card.is-selected {
  transform: none;
  background: var(--ux-surface);
  box-shadow: none;
}

.screen-stack {
  gap: 1rem;
}

.page-heading,
.page-heading-row,
.start-program-head,
.start-actions,
.workout-topbar,
.active-exercise-head,
.dock-inner,
.today-plan-line,
.trend-awaiting {
  min-width: 0;
}

.page-heading p,
.section-kicker {
  margin: 0 0 0.2rem;
  color: var(--ux-muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: none;
}

.page-heading h2 {
  font-size: 1.55rem;
  font-weight: 750;
  line-height: 1.15;
}

.page-heading span {
  display: block;
  margin-top: 0.35rem;
  color: var(--ux-muted);
  font-size: 0.82rem;
}

.page-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-command,
.filter-command {
  display: inline-flex;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--ux-line);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  color: var(--ux-text);
  font-size: 0.82rem;
  font-weight: 650;
}

.flat-section {
  border-top: 1px solid var(--ux-line);
  padding-top: 1rem;
}

.primary-command,
.secondary-command,
.action-btn,
.field,
.search-field,
.compact-select {
  border-radius: 8px;
}

.primary-command {
  background: var(--ux-mint);
  color: #07120f;
  font-weight: 750;
}

.secondary-command {
  border: 1px solid var(--ux-line);
  background: transparent;
  color: var(--ux-text);
  font-weight: 650;
}

.today-start-screen {
  display: grid;
  gap: 1.1rem;
  max-width: 34rem;
  margin-inline: auto;
}

.today-plan-line {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 0.65rem;
  border-block: 1px solid var(--ux-line);
  padding: 0.7rem 0;
  color: var(--ux-muted);
}

.today-plan-line > .ui-icon {
  color: var(--ux-mint);
}

.today-plan-line span:not(.ui-icon) {
  min-width: 0;
  flex: 1;
}

.today-plan-line small,
.today-plan-line strong {
  display: block;
}

.today-plan-line small {
  font-size: 0.7rem;
  font-weight: 550;
}

.today-plan-line strong {
  margin-top: 0.1rem;
  color: var(--ux-text);
  font-size: 0.86rem;
  font-weight: 650;
}

.today-plan-line button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--ux-line);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
}

.today-plan-line.is-completed { color: #a7f3d0; }
.today-plan-line.is-skipped { color: #fda4af; }

.start-program {
  border: 1px solid var(--ux-line);
  border-radius: 8px;
  background: var(--ux-surface);
  padding: 1rem;
}

.start-program-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.start-program .program-badge {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
}

.program-badge.accent-emerald { background: #36d399; }
.program-badge.accent-sky { background: #4cb8e8; }
.program-badge.accent-rose { background: #ef7589; }

.start-program-head h3 {
  font-size: 1.15rem;
  font-weight: 750;
}

.start-program-head p,
.start-warmup {
  color: var(--ux-muted);
  font-size: 0.82rem;
}

.start-warmup {
  margin-top: 0.85rem;
  line-height: 1.5;
}

.today-readiness {
  min-height: 52px;
  margin-top: 0.85rem;
  border-top: 1px solid var(--ux-line);
  border-bottom: 0;
  padding-top: 0.7rem;
}

.start-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.start-actions > :only-child {
  grid-column: 1 / -1;
}

.start-progress {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
  color: var(--ux-muted);
  font-size: 0.78rem;
}

.start-progress > div,
.workout-progress-line {
  height: 3px;
  overflow: hidden;
  background: var(--ux-line);
}

.start-progress i,
.workout-progress-line i {
  display: block;
  height: 100%;
  background: var(--ux-mint);
}

.program-picker-list {
  display: grid;
  gap: 0.55rem;
}

.program-picker-list .program-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  border-radius: 8px;
  background: transparent;
  padding: 0.8rem;
}

.program-picker-list .program-subtitle {
  justify-self: end;
}

.active-workout-screen {
  min-height: 100vh;
  background: var(--ux-bg);
}

body.is-workout-mode #view {
  padding: 0;
}

body.is-workout-mode .app-shell {
  max-width: 48rem;
  padding-bottom: 0;
}

.workout-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: grid;
  min-height: calc(58px + env(safe-area-inset-top));
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--ux-line);
  background: rgba(13, 16, 23, 0.97);
  padding: env(safe-area-inset-top) 0.75rem 0;
  backdrop-filter: blur(14px);
}

.workout-topbar > div {
  min-width: 0;
  text-align: center;
}

.workout-topbar small,
.workout-topbar strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workout-topbar small {
  color: var(--ux-muted);
  font-size: 0.68rem;
}

.workout-topbar strong {
  margin-top: 0.1rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.workout-icon-btn.has-value {
  border-color: rgba(54, 211, 153, 0.55);
  color: var(--ux-mint);
}

.workout-accordion {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 0.75rem;
}

.workout-exercise {
  overflow: hidden;
  border: 1px solid var(--ux-line);
  border-radius: 8px;
  background: var(--ux-surface);
}

.workout-exercise.is-complete {
  border-color: rgba(54, 211, 153, 0.35);
}

.workout-exercise-summary {
  display: grid;
  width: 100%;
  min-height: 70px;
  grid-template-columns: 34px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.exercise-order {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ux-surface-2);
  color: var(--ux-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.is-complete .exercise-order {
  background: rgba(54, 211, 153, 0.14);
  color: var(--ux-mint);
}

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

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

.exercise-summary-copy small {
  color: var(--ux-muted);
  font-size: 0.68rem;
}

.exercise-summary-copy strong {
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.exercise-set-progress {
  color: var(--ux-muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.workout-exercise-body {
  border-top: 1px solid var(--ux-line);
}

.active-exercise-part {
  padding: 0.85rem 0.75rem;
}

.active-exercise-part + .active-exercise-part {
  border-top: 1px solid var(--ux-line);
}

.active-exercise-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.active-exercise-head h3 {
  font-size: 0.96rem;
  font-weight: 700;
}

.active-exercise-head p,
.active-technique {
  color: var(--ux-muted);
  font-size: 0.75rem;
}

.active-exercise-head p {
  margin-top: 0.2rem;
}

.active-technique {
  margin: 0.65rem 0;
  line-height: 1.45;
}

.active-exercise-actions {
  display: flex;
  gap: 0.35rem;
}

.active-set-head,
.active-set-row {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr) minmax(0, 1fr) 3.25rem;
  gap: 0.45rem;
  align-items: center;
}

.active-set-head {
  margin-bottom: 0.45rem;
  color: #768191;
  font-size: 0.62rem;
  font-weight: 600;
  text-align: center;
}

.active-set-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.active-set-list {
  display: grid;
  gap: 0.45rem;
}

.active-set-row .field,
.active-set-index,
.active-set-row .done-shell {
  min-height: 50px;
  border-radius: 8px;
}

.active-set-row .field {
  padding: 0.55rem;
  text-align: center;
}

.active-set-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ux-line);
  background: #10151d;
  color: var(--ux-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.active-set-row.is-done .field,
.active-set-row.is-done .active-set-index,
.active-set-row.is-done .done-shell {
  border-color: rgba(54, 211, 153, 0.45);
  background: rgba(54, 211, 153, 0.07);
}

.workout-end-spacer {
  height: 92px;
}

.workout-dock {
  position: fixed;
  inset: auto 0 0;
  z-index: 45;
  padding: 0.5rem 0.75rem calc(env(safe-area-inset-bottom) + 0.5rem);
  background: rgba(13, 16, 23, 0.97);
  backdrop-filter: blur(14px);
}

.dock-inner {
  position: relative;
  display: grid;
  max-width: 46.5rem;
  min-height: 60px;
  grid-template-columns: minmax(58px, 0.7fr) auto minmax(104px, 1fr);
  align-items: center;
  gap: 0.55rem;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--ux-line);
  border-radius: 8px;
  background: var(--ux-surface);
  padding: 0.45rem;
}

.dock-status small,
.dock-status strong {
  display: block;
}

.dock-status small {
  max-width: 7rem;
  overflow: hidden;
  color: var(--ux-muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-status strong {
  margin-top: 0.1rem;
  font-size: 1.05rem;
  font-weight: 750;
}

.dock-timer-controls {
  display: flex;
  gap: 0.25rem;
}

.dock-timer-controls button {
  display: inline-flex;
  min-width: 42px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ux-line);
  border-radius: 8px;
  color: var(--ux-muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.dock-finish {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 8px;
  background: var(--ux-mint);
  color: #07120f;
  font-size: 0.8rem;
  font-weight: 750;
}

#timerProgress {
  position: absolute;
  inset: auto auto 0 0;
  height: 2px;
  background: var(--ux-mint);
}

.session-notes-field {
  min-height: 8rem;
  resize: vertical;
}

.finish-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-block: 1px solid var(--ux-line);
}

.finish-stats > div {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem;
  text-align: center;
}

.finish-stats > div + div {
  border-left: 1px solid var(--ux-line);
}

.finish-stats strong {
  font-size: 1.5rem;
  font-weight: 750;
}

.finish-stats span,
.finish-copy,
.finish-warning,
.finish-success {
  color: var(--ux-muted);
  font-size: 0.78rem;
}

.finish-warning { color: #fbbf24; }
.finish-success { color: #86efac; }

.planner-hero {
  display: none;
}

.planner-heading {
  min-height: 52px;
}

.plan-day.compact-day,
.plan-day {
  min-height: 78px;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: 0.45rem;
  padding: 0.55rem 0.15rem;
}

.plan-day-actions {
  grid-column: 3;
  flex-wrap: nowrap;
}

.plan-action {
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
}

.plan-action .ui-icon {
  width: 1.15rem;
  height: 1.15rem;
  color: currentColor;
}

.plan-empty-command {
  width: 46px;
  min-height: 46px;
  justify-content: center;
  justify-self: end;
  border-radius: 8px;
  padding: 0;
}

.plan-sheet-actions {
  display: grid;
  gap: 0.4rem;
}

.plan-sheet-actions button {
  display: grid;
  min-height: 60px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid var(--ux-line);
  padding: 0.6rem 0.25rem;
  text-align: left;
}

.plan-sheet-actions strong,
.plan-sheet-actions small {
  display: block;
}

.plan-sheet-actions strong { font-size: 0.9rem; }
.plan-sheet-actions small { margin-top: 0.15rem; color: var(--ux-muted); font-size: 0.72rem; }
.plan-sheet-actions .is-danger { color: #fda4af; }

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
}

.filter-command.has-filters {
  border-color: rgba(54, 211, 153, 0.5);
  color: #a7f3d0;
}

.advanced-filter-row {
  padding-top: 0.2rem;
}

.library-row {
  border-radius: 0;
  background: transparent;
}

.library-row:first-child {
  border-top: 1px solid var(--ux-line);
}

.custom-label {
  color: #a7f3d0;
  font-size: 0.65rem;
  font-weight: 650;
}

.progress-session-summary {
  display: flex;
  max-width: 8rem;
  align-items: center;
  gap: 0.45rem;
  color: var(--ux-muted);
}

.progress-session-summary strong {
  color: var(--ux-text);
  font-size: 1.4rem;
  font-weight: 750;
}

.progress-session-summary span {
  font-size: 0.68rem;
  line-height: 1.25;
}

.selector-panel,
.trend-panel,
.recent-panel {
  border-radius: 0;
  background: transparent;
  padding-inline: 0;
}

.record-card {
  border-radius: 8px;
  background: var(--ux-surface);
  box-shadow: none;
}

.trend-awaiting {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ux-muted);
}

.trend-awaiting strong {
  color: var(--ux-text);
  font-size: 0.86rem;
}

.trend-awaiting p {
  margin-top: 0.2rem;
  font-size: 0.75rem;
}

.settings-section,
.database-section {
  display: grid;
  gap: 0.65rem;
}

.primary-flat {
  background: var(--ux-mint);
  color: #07120f;
}

.secondary-flat {
  border: 1px solid var(--ux-line);
  background: transparent;
  color: var(--ux-text);
}

.database-section > p {
  color: var(--ux-muted);
  font-size: 0.72rem;
}

@media (max-width: 380px) {
  .active-set-head,
  .active-set-row {
    grid-template-columns: 2.35rem minmax(0, 1fr) minmax(0, 1fr) 2.8rem;
    gap: 0.32rem;
  }

  .active-set-head {
    font-size: 0.56rem;
  }

  .dock-inner {
    grid-template-columns: minmax(52px, 0.6fr) auto minmax(94px, 0.9fr);
    gap: 0.3rem;
  }

  .dock-timer-controls button {
    min-width: 38px;
  }

  .dock-finish span {
    font-size: 0.72rem;
  }
}

@media (min-width: 680px) {
  .plan-day,
  .plan-day.compact-day {
    min-height: 210px;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }

  .plan-day-actions {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: auto;
  }

  .plan-empty-command {
    width: 100%;
    min-height: 76px;
    justify-self: stretch;
  }
}
