:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #65706a;
  --canvas: #f3f5f1;
  --surface: #ffffff;
  --surface-soft: #e9eee8;
  --line: #d7ded8;
  --green: #285d48;
  --green-deep: #174333;
  --green-soft: #dcebe2;
  --amber: #a06120;
  --amber-soft: #fff2dc;
  --danger: #a33c31;
  --shadow: 0 18px 45px rgba(23, 33, 29, 0.08);
  --radius: 18px;
  --radius-small: 11px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(40, 93, 72, 0.34);
  outline-offset: 3px;
}

a {
  color: var(--green-deep);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-small);
  background: var(--green-deep);
  color: #fff;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(243, 245, 241, 0.94);
}

.header-inner,
.app-shell,
.site-footer {
  width: min(1400px, calc(100% - 48px));
  margin-inline: auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.routine-switcher {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.routine-select,
.routine-add-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
}

.routine-select {
  max-width: 150px;
  padding: 0.4rem 2rem 0.4rem 0.65rem;
}

.routine-add-button {
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}

.routine-add-button:hover {
  background: var(--surface-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.header-gallery-link {
  color: var(--green-deep);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.header-gallery-link:hover {
  text-decoration: underline;
}

.header-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--green-deep);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.3rem;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 600;
}

.brand small,
.header-status,
.muted {
  color: var(--muted);
}

.brand small {
  margin-top: 0.1rem;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f916f;
  box-shadow: 0 0 0 4px rgba(79, 145, 111, 0.13);
}

.app-shell {
  padding-block: 34px 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(290px, 0.75fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 42px;
}

.eyebrow {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--green);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1,
h2,
.exercise-heading {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.exercise-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.prescription-edit-button {
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
}

h1 {
  max-width: 760px;
  margin-bottom: 1rem;
  font-size: clamp(2.45rem, 5vw, 4.8rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(1.65rem, 2.5vw, 2.4rem);
}

h3 {
  font-size: 1rem;
}

.hero-copy {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.today-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.today-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.12rem;
}

.today-card p {
  margin-bottom: 1.15rem;
  color: var(--muted);
  line-height: 1.5;
}

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

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading-row h2 {
  margin-bottom: 0;
}

.routine-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.empty-routine {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty-routine p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.55;
}

.session-card {
  display: flex;
  min-height: 285px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(23, 33, 29, 0.04);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.session-card:hover {
  transform: translateY(-3px);
  border-color: #b8c9be;
  box-shadow: var(--shadow);
}

.session-card.is-complete {
  background: linear-gradient(155deg, var(--surface), var(--green-soft));
}

.session-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 2.4rem;
}

.day-number {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.completion-badge {
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

.session-card h2 {
  margin-bottom: 0.75rem;
  font-size: 1.55rem;
}

.session-description {
  flex: 1;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.session-meta {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.button,
.icon-button,
.set-button,
.exercise-nav-button {
  border: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: var(--green-deep);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: #0e3728;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover,
.button-quiet:hover {
  background: var(--surface-soft);
}

.button-quiet {
  background: transparent;
  color: var(--ink);
}

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

.workout-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--green-deep);
}

.workout-title {
  margin-bottom: 0.35rem;
  font-size: clamp(2rem, 3.6vw, 3.5rem);
  line-height: 1;
}

.workout-subtitle {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.progress-wrap {
  width: min(340px, 100%);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 220ms ease;
}

.workout-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

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

.exercise-list-heading {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.exercise-nav-button {
  display: grid;
  width: 100%;
  grid-template-columns: 30px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.exercise-nav-button:last-child {
  border-bottom: 0;
}

.exercise-nav-button:hover {
  background: #f3f7f3;
}

.exercise-nav-button.is-active {
  background: var(--green-soft);
}

.exercise-nav-button.is-done .exercise-index {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.exercise-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.exercise-nav-name {
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-nav-arrow {
  color: var(--muted);
}

.exercise-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.exercise-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  align-items: stretch;
}

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

.technique-video {
  min-width: 0;
}

.technique-video > summary {
  display: none;
}

.video-frame {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #18201d;
}

.exercise-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px;
  border-left: 1px solid var(--line);
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 2rem;
  background: radial-gradient(circle at 30% 20%, #3f6657, #18201d 62%);
  color: #fff;
  text-align: center;
}

.play-button {
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
}

.video-placeholder p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.76);
}

.video-placeholder code {
  color: #fff;
}

.video-placeholder a {
  color: #fff;
}

.exercise-content {
  padding: 22px;
  border-top: 1px solid var(--line);
}

.exercise-heading {
  margin-bottom: 0.7rem;
  font-size: clamp(1.65rem, 2.6vw, 2.45rem);
  line-height: 1.04;
}

.prescription {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #38433e;
  font-size: 0.8rem;
  font-weight: 650;
}

.pill-load {
  background: var(--amber-soft);
  color: #774513;
}

.pill-edited {
  background: var(--green-soft);
  color: var(--green-deep);
}

.source-link {
  display: inline-flex;
  margin-top: 0.8rem;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.video-source-link {
  margin: 0;
  padding: 12px 22px;
}

.technique-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 0;
}

.technique-block {
  padding: 18px;
  border-left: 3px solid var(--green-soft);
  background: #f7f9f6;
}

.technique-block h3 {
  margin-bottom: 0.75rem;
}

.technique-block ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #46524c;
  font-size: 0.9rem;
  line-height: 1.6;
}

.personal-note {
  margin: 18px 0;
  padding: 13px 14px;
  border-radius: var(--radius-small);
  background: var(--green-soft);
  color: #254535;
  line-height: 1.5;
}

.personal-note strong {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.set-tracker {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.set-tracker-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 12px;
  flex-direction: column;
}

.set-tracker-heading h3 {
  margin-bottom: 0;
}

.sets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.set-button {
  min-width: 92px;
  padding: 0.68rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.set-button:hover {
  background: var(--surface-soft);
}

.set-button.is-complete {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

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

.rest-controls span {
  color: var(--muted);
  font-size: 0.8rem;
}

.rest-button {
  min-height: 34px;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
}

.exercise-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.exercise-summary .exercise-actions {
  align-items: stretch;
  flex-direction: column;
}

.exercise-summary .action-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.builder-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 42px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--green-soft);
}

.builder-callout h2 {
  margin-bottom: 0.35rem;
}

.builder-callout p {
  max-width: 720px;
  margin-bottom: 0;
  color: #3f5a4c;
  line-height: 1.5;
}

.gallery-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 28px;
}

.gallery-header h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.gallery-header p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.custom-summary {
  flex: 0 0 auto;
  min-width: 290px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.custom-summary strong {
  display: block;
  margin-bottom: 0.75rem;
}

.custom-summary-actions {
  display: flex;
  gap: 8px;
}

.button.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

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

.gallery-filter-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.gallery-filter-heading h2 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.45rem;
}

.gallery-filter-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.gallery-filter-groups {
  display: grid;
  grid-template-columns: 0.8fr 1.35fr 0.9fr;
  gap: 22px;
  padding: 18px 0 14px;
}

.gallery-filter-group {
  min-width: 0;
  padding: 0;
  border: 0;
}

.gallery-filter-group legend {
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-chip:hover {
  border-color: #91b2a0;
  color: var(--green-deep);
}

.filter-chip.is-active {
  border-color: var(--green-deep);
  background: var(--green-deep);
  color: #fff;
}

.filter-chip:focus-visible {
  outline: 3px solid rgba(40, 101, 75, 0.22);
  outline-offset: 2px;
}

.gallery-result-count {
  color: var(--muted);
  font-size: 0.82rem;
}

.gallery-result-count strong {
  color: var(--ink);
}

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

.gallery-card {
  display: flex;
  min-height: 290px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.gallery-card.is-selected {
  border-color: #91b2a0;
  background: linear-gradient(155deg, var(--surface), var(--green-soft));
}

.gallery-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.selection-state {
  color: var(--green-deep);
  font-size: 0.75rem;
  font-weight: 700;
}

.gallery-card h2 {
  margin-bottom: 0.65rem;
  font-size: 1.35rem;
}

.gallery-card p {
  flex: 1;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.gallery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.difficulty-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
}

.difficulty-easy {
  background: var(--green-soft);
  color: var(--green-deep);
}

.difficulty-medium {
  background: var(--amber-soft);
  color: #744a1f;
}

.difficulty-hard {
  background: #f5dfdc;
  color: #803e36;
}

.gallery-empty {
  display: flex;
  grid-column: 1 / -1;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 36px;
  border: 1px dashed #b8c5bd;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  text-align: center;
}

.gallery-empty strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
}

.gallery-empty .button {
  margin-top: 8px;
}

.action-group {
  display: flex;
  gap: 10px;
}

.safety-note {
  display: flex;
  gap: 0.8rem;
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid #efd5ad;
  border-radius: var(--radius-small);
  background: var(--amber-soft);
  color: #6a421b;
  font-size: 0.88rem;
  line-height: 1.5;
}

.safety-note strong {
  display: block;
}

.completion-panel {
  max-width: 760px;
  margin: 60px auto;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.completion-mark {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 0 auto 1.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 2rem;
}

.completion-panel p {
  max-width: 540px;
  margin-inline: auto;
  color: var(--muted);
  line-height: 1.6;
}

.completion-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1.5rem;
}

.timer-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: flex;
  min-width: 285px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(23, 33, 29, 0.18);
}

.timer-dock[hidden] {
  display: none;
}

.confirmation-dialog,
.editor-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 26px 80px rgba(23, 33, 29, 0.28);
}

.editor-dialog [hidden] {
  display: none !important;
}

.confirmation-dialog::backdrop,
.editor-dialog::backdrop {
  background: rgba(14, 28, 22, 0.55);
  backdrop-filter: blur(2px);
}

.editor-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.editor-dialog > form,
.editor-dialog > div {
  padding: 28px;
}

.editor-dialog h2 {
  margin-bottom: 0.45rem;
}

.dialog-lead,
.dialog-help,
.plan-data-section p {
  color: var(--muted);
  line-height: 1.5;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 16px;
}

.editor-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.editor-grid select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.editor-grid select:disabled {
  background: var(--surface-soft);
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.split-actions .action-spacer {
  flex: 1 1 auto;
}

.plan-data-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.plan-data-section h3 {
  margin-bottom: 0.4rem;
}

.dialog-close-row {
  justify-content: flex-end;
}

.confirmation-dialog form {
  padding: 28px;
}

.confirmation-dialog h2 {
  margin-bottom: 0.75rem;
}

.confirmation-dialog p {
  margin-bottom: 1.5rem;
  color: var(--muted);
  line-height: 1.55;
}

.confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.timer-dock > div:first-child {
  flex: 1;
}

.timer-dock .eyebrow {
  margin-bottom: 0.1rem;
  font-size: 0.6rem;
}

#dock-time {
  font-variant-numeric: tabular-nums;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
}

.icon-button:hover {
  background: var(--surface-soft);
}

.site-footer {
  padding-block: 22px 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.site-footer p {
  margin: 0;
}

.notice {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius-small);
}

.notice-warning {
  background: var(--amber-soft);
}

.week-reset-notice {
  display: flex;
  gap: 0.35rem;
  flex-direction: column;
  border: 1px solid #bfd7c8;
  background: var(--green-soft);
  color: var(--green-deep);
}

.direct-file-notice {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 28px;
  flex-direction: column;
  border: 1px solid #efd5ad;
  color: #6a421b;
  line-height: 1.5;
}

.direct-file-notice code {
  font-weight: 700;
}

@media (max-width: 1120px) {
  .session-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-card {
    min-height: 250px;
  }

  .workout-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .exercise-stage {
    grid-template-columns: 1fr;
  }

  .exercise-demonstration {
    display: contents;
  }

  .technique-video {
    order: 0;
  }

  .exercise-summary {
    order: 1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .exercise-content {
    order: 2;
  }

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

  .gallery-filter-groups {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .header-inner,
  .app-shell,
  .site-footer {
    width: min(100% - 32px, 720px);
  }

  .hero,
  .workout-layout,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .workout-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-header,
  .gallery-filter-heading,
  .builder-callout,
  .section-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-filter-groups {
    grid-template-columns: 1fr;
  }

  .custom-summary {
    min-width: 0;
  }

  .progress-wrap {
    width: 100%;
  }

  .exercise-list {
    display: flex;
    overflow-x: auto;
    border-radius: 14px;
  }

  .exercise-list-heading {
    display: none;
  }

  .exercise-nav-button {
    min-width: 220px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

}

@media (max-width: 600px) {
  .header-status {
    display: none;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-gallery-link:not(.header-button),
  .routine-add-button {
    display: none;
  }

  .header-button {
    display: inline-flex;
    white-space: nowrap;
  }

  .editor-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
  }

  .editor-dialog > form,
  .editor-dialog > div {
    padding: 20px;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .exercise-summary-top {
    align-items: center;
  }

  .routine-select {
    max-width: 118px;
  }

  .app-shell {
    padding-block: 34px 56px;
  }

  .session-grid,
  .technique-grid {
    grid-template-columns: 1fr;
  }

  .session-card {
    min-height: 235px;
  }

  .exercise-content,
  .completion-panel {
    padding: 22px;
  }

  .exercise-stage {
    display: flex;
    flex-direction: column;
  }

  .exercise-summary {
    order: 1;
  }

  .exercise-summary .personal-note {
    order: 1;
  }

  .technique-video {
    order: 2;
  }

  .exercise-content {
    order: 3;
  }

  .technique-video > summary {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-top: 1px solid var(--line);
    color: var(--green-deep);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }

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

  .technique-video > summary::after {
    content: "Show +";
    font-size: 0.78rem;
  }

  .technique-video[open] > summary::after {
    content: "Hide −";
  }

  .technique-video[open] > summary {
    border-bottom: 1px solid var(--line);
  }

  .completion-panel {
    margin: 0 auto;
  }

  .set-tracker {
    margin-top: 18px;
    padding-top: 20px;
  }

  .sets-row {
    gap: 12px;
    margin-bottom: 14px;
  }

  .set-tracker-heading,
  .exercise-actions,
  .completion-actions,
  .routine-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .custom-summary-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .action-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .timer-dock {
    right: 16px;
    bottom: 16px;
    left: 16px;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.auth-panel {
  max-width: 720px;
  margin: 9vh auto;
  padding: clamp(28px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-panel h1 {
  margin: 12px 0;
}

.template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.history-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.history-list span {
  color: var(--muted);
}

input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
}
