:root {
  color-scheme: light;
  --ink: #14211f;
  --muted: #65716d;
  --paper: #fbfcf8;
  --surface: #ffffff;
  --wash: #eef5ef;
  --line: #dce6df;
  --green: #2f7f65;
  --green-deep: #17362f;
  --mint: #bfe7d4;
  --blue: #356f91;
  --amber: #d9922e;
  --coral: #c95d4e;
  --shadow: 0 18px 50px rgba(23, 54, 47, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--wash);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(47, 127, 101, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(217, 146, 46, 0.12), transparent 28%),
    var(--wash);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(53, 111, 145, 0.35);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
  flex: 0 0 auto;
}

#app {
  min-height: 100vh;
  padding: 18px 18px 96px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1480px;
  margin: 0 auto 16px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(251, 252, 248, 0.88);
  box-shadow: 0 10px 30px rgba(23, 54, 47, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  color: var(--green-deep);
  background: transparent;
  border-radius: 8px;
  text-align: left;
}

.brand .icon {
  width: 2rem;
  height: 2rem;
  padding: 7px;
  border-radius: 8px;
  color: #fff;
  background: var(--green-deep);
}

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

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

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f8f4;
}

.section-nav button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.section-nav button.is-active {
  color: white;
  background: var(--green-deep);
}

.install-button,
.primary-mini,
.secondary-button,
.primary-control,
.circle-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.install-button {
  padding: 0 14px;
  color: white;
  background: var(--green-deep);
  border-color: var(--green-deep);
}

.primary-mini {
  padding: 0 16px;
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.secondary-button {
  padding: 0 12px;
}

.secondary-button.strong {
  color: var(--green-deep);
  background: #e7f4ed;
}

.icon-button,
.circle-button {
  width: 42px;
  padding: 0;
}

.circle-button {
  border-radius: 50%;
}

.icon-button.is-active {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

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

.primary-control {
  min-width: 128px;
  min-height: 54px;
  padding: 0 20px;
  color: white;
  background: var(--green-deep);
  border-color: var(--green-deep);
  box-shadow: 0 12px 28px rgba(23, 54, 47, 0.22);
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(250px, 310px);
  gap: 16px;
  max-width: 1480px;
  margin: 0 auto;
}

.panel,
.workspace-panel {
  border: 1px solid rgba(220, 230, 223, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.routine-dock,
.insight-dock {
  align-self: start;
  padding: 16px;
}

.workspace-panel {
  min-width: 0;
  padding: 16px;
}

.panel-heading,
.view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading.compact {
  margin-bottom: 10px;
}

.eyebrow,
.mini-label {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(1.7rem, 2.8vw, 2.7rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

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

.count-pill,
.panel-heading > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green-deep);
  background: #e7f4ed;
  font-size: 0.85rem;
  font-weight: 800;
}

.routine-list {
  display: grid;
  gap: 9px;
}

.routine-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.routine-button.is-selected {
  border-color: rgba(47, 127, 101, 0.65);
  background: #eef8f2;
}

.routine-button strong,
.routine-button small {
  display: block;
}

.routine-button small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.routine-button em {
  align-self: center;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.today-routine-list {
  display: grid;
  gap: 12px;
}

.today-routine-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: white;
}

.today-routine-group-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 11px;
  border-bottom: 1px solid var(--line);
  background: #f5f8f5;
}

.today-routine-group-heading > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.today-routine-group-heading span,
.today-active-set > span {
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.today-routine-group-heading strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.25;
}

.today-routine-group-heading small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.today-routine-slots {
  display: grid;
}

.today-routine-slot {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 4px 9px;
  width: 100%;
  padding: 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: white;
  text-align: left;
  cursor: pointer;
}

.today-routine-slot:last-child {
  border-bottom: 0;
}

.today-routine-slot:hover,
.today-routine-slot.is-active {
  background: #edf6f1;
}

.today-routine-slot.is-active {
  box-shadow: inset 3px 0 0 var(--green);
}

.today-routine-slot:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.today-routine-slot time {
  grid-row: 1 / 3;
  color: var(--green-deep);
  font-size: 0.76rem;
  font-weight: 900;
}

.today-routine-slot > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.today-routine-slot strong,
.today-routine-slot small {
  overflow-wrap: anywhere;
}

.today-routine-slot strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.today-routine-slot small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.today-routine-slot em {
  grid-column: 2;
  justify-self: start;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--muted);
  background: #f0f3f1;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.today-routine-slot em.status-active,
.today-routine-slot em.status-done {
  color: #266a55;
  background: #ddf2e8;
}

.today-routine-slot em.status-ready {
  color: #8c331e;
  background: #fff0eb;
}

.today-routine-slot em.status-upcoming {
  color: #245a79;
  background: #e5f3fb;
}

.today-routine-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.today-routine-empty .icon {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--green);
}

.today-routine-empty strong {
  color: var(--ink);
}

.today-routine-empty span {
  font-size: 0.78rem;
  line-height: 1.4;
}

.today-routine-empty .secondary-button {
  width: 100%;
  margin-top: 4px;
}

.today-active-set {
  display: grid;
  gap: 3px;
  margin-top: 14px;
  padding: 12px;
  border-top: 3px solid var(--green);
  border-radius: 6px;
  background: #edf6f1;
}

.today-active-set strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.today-active-set small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.theme-amber {
  border-left-color: var(--amber);
}

.theme-blue {
  border-left-color: var(--blue);
}

.theme-coral {
  border-left-color: var(--coral);
}

.theme-mint {
  border-left-color: #4a9e8a;
}

.theme-custom,
.theme-quick {
  border-left-color: var(--green-deep);
}

.practice-view,
.routine-library-view,
.day-routines-view,
.library-view,
.builder-view,
.safety-view {
  display: grid;
  gap: 16px;
}

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

.routine-library-card {
  display: grid;
  gap: 14px;
  min-height: 290px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.routine-library-card.theme-amber {
  border-left-color: var(--amber);
}

.routine-library-card.theme-blue {
  border-left-color: var(--blue);
}

.routine-library-card.theme-coral {
  border-left-color: var(--coral);
}

.routine-library-card.theme-mint {
  border-left-color: #4a9e8a;
}

.routine-library-card h2,
.routine-library-card p {
  margin: 0;
}

.routine-library-card h2 {
  font-size: 1.2rem;
}

.routine-library-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.routine-card-heading,
.routine-card-stats,
.routine-library-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.routine-card-heading > span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.routine-card-stats {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.routine-card-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--green-deep);
  background: #e8f3ee;
  font-size: 0.78rem;
  font-weight: 800;
}

.routine-card-stats .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.routine-library-card .routine-card-sequence {
  display: grid;
  gap: 8px;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.routine-card-sequence > strong {
  color: var(--green-deep);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.routine-card-sequence ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding-left: 24px;
}

.routine-card-sequence li {
  padding: 7px 0;
  border-bottom: 1px solid #e6ece8;
  color: var(--green-deep);
}

.routine-card-sequence li:last-child {
  border-bottom: 0;
}

.routine-exercise-review > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  cursor: pointer;
  list-style: none;
}

.routine-exercise-review > summary::-webkit-details-marker {
  display: none;
}

.routine-exercise-review > summary::after {
  content: "+";
  flex: 0 0 16px;
  color: var(--green-deep);
  font-weight: 900;
  text-align: right;
}

.routine-exercise-review[open] > summary::after {
  content: "-";
}

.routine-exercise-review > summary > span {
  display: grid;
  flex: 1;
  min-width: 0;
}

.routine-exercise-review > summary b {
  color: var(--ink);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.routine-exercise-review > summary em,
.routine-exercise-review > summary small {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.routine-exercise-review > summary small {
  flex: 0 0 auto;
  margin-left: auto;
}

.routine-exercise-review-body {
  padding: 4px 0 12px;
}

.routine-exercise-review-body > p {
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.5;
}

.exercise-duration-preference {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr) auto;
  gap: 14px;
  align-items: center;
  margin: 12px 0;
  padding: 12px 0;
  border-top: 1px solid #e6ece8;
  border-bottom: 1px solid #e6ece8;
}

.exercise-duration-preference-heading {
  display: grid;
  gap: 2px;
}

.exercise-duration-preference-heading > span {
  color: var(--green-deep);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.exercise-duration-preference-heading > strong {
  color: var(--ink);
  font-size: 1rem;
}

.exercise-duration-preference-heading > small,
.practice-duration-preference > small {
  color: var(--muted);
  font-size: 0.74rem;
}

.exercise-duration-preference .builder-duration-editor {
  margin-top: 0;
}

.exercise-duration-reset {
  justify-self: end;
  white-space: nowrap;
}

.routine-exercise-review-body dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.routine-exercise-review-body dl > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #e6ece8;
}

.routine-exercise-review-body dt {
  color: var(--green-deep);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.routine-exercise-review-body dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.routine-library-card .primary-mini {
  align-self: end;
  justify-self: start;
}

.routine-library-section-heading {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.routine-library-section-heading h2,
.routine-library-section-heading p {
  margin: 0;
}

.routine-library-section-heading > span {
  color: var(--muted);
  font-weight: 800;
}

.personal-sets-layout {
  display: grid;
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr) minmax(250px, 300px);
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.personal-set-list,
.personal-set-add {
  min-width: 0;
  padding: 16px;
  background: #f7faf7;
}

.personal-set-list {
  border-right: 1px solid var(--line);
}

.personal-set-add {
  border-left: 1px solid var(--line);
}

.personal-set-pane-heading,
.personal-set-detail-heading,
.personal-set-detail-actions,
.available-set-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.personal-set-pane-heading h2,
.personal-set-pane-heading p,
.personal-set-detail-heading h2,
.personal-set-detail-heading p,
.available-set-group-heading h3 {
  margin: 0;
}

.personal-set-list-items {
  display: grid;
  gap: 7px;
  max-height: 68vh;
  margin-top: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.personal-set-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 5px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 7px;
  background: var(--surface);
}

.personal-set-list-row.is-selected {
  border-left-color: var(--green);
  border-color: rgba(47, 127, 101, 0.5);
  background: #edf7f1;
}

.personal-set-select {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 8px 11px 11px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.personal-set-select strong,
.personal-set-select small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.personal-set-select small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.personal-set-select .mini-label {
  margin-bottom: 0;
  font-size: 0.64rem;
}

.personal-set-remove {
  width: 34px;
  min-height: 34px;
  margin-right: 4px;
}

.personal-set-detail {
  min-width: 0;
  padding: 20px;
}

.personal-set-detail-content {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding-top: 14px;
  border-top: 4px solid var(--green);
}

.personal-set-detail-content.theme-amber {
  border-top-color: var(--amber);
}

.personal-set-detail-content.theme-blue {
  border-top-color: var(--blue);
}

.personal-set-detail-content.theme-coral {
  border-top-color: var(--coral);
}

.personal-set-detail-content.theme-mint {
  border-top-color: #4a9e8a;
}

.personal-set-detail-heading {
  align-items: start;
}

.personal-set-detail-heading > div {
  min-width: 0;
}

.personal-set-detail-heading h2 {
  font-size: 1.35rem;
}

.personal-set-detail-heading p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.personal-set-detail-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.personal-set-sequence {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.personal-set-detail-actions {
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.personal-set-primary-actions,
.builder-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.personal-set-build {
  width: 100%;
  margin-top: 14px;
}

.available-set-group {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.available-set-group-heading > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.available-set-list {
  display: grid;
  gap: 7px;
}

.available-set-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 7px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.available-set-row > span,
.available-set-row strong,
.available-set-row small {
  display: block;
  min-width: 0;
}

.available-set-row strong {
  color: var(--ink);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.available-set-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

.available-set-row .icon-button {
  width: 36px;
  min-height: 36px;
  color: var(--green-deep);
}

.available-set-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.personal-set-empty,
.personal-set-empty-detail {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.personal-set-empty-detail {
  min-height: 420px;
}

.personal-set-empty .icon,
.personal-set-empty-detail .icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--green);
}

.personal-set-empty strong,
.personal-set-empty-detail strong {
  color: var(--ink);
}

.personal-set-empty span,
.personal-set-empty-detail span {
  max-width: 300px;
  line-height: 1.45;
}

.day-routine-tabs {
  justify-self: start;
}

.routine-calendar,
.day-routine-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.routine-calendar {
  overflow-x: auto;
}

.routine-calendar-heading,
.routine-calendar-footer,
.day-routine-editor-heading,
.day-routine-set-heading,
.day-routine-editor-actions,
.day-routine-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.routine-calendar-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-width: 0;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.routine-month-view .routine-calendar-heading,
.routine-week-view .routine-calendar-heading {
  min-width: 720px;
}

.routine-calendar-heading-copy {
  text-align: center;
}

.routine-calendar-heading-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calendar-today-button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green-deep);
  background: white;
  font-weight: 900;
  cursor: pointer;
}

.calendar-today-button:hover {
  border-color: var(--green);
  background: #edf6f1;
}

.routine-calendar-heading h2,
.routine-calendar-heading p,
.day-routine-card h2,
.day-routine-card p,
.day-routine-set-heading h3,
.day-routine-set-heading p {
  margin: 0;
}

.routine-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  min-width: 720px;
  border-bottom: 1px solid var(--line);
}

.routine-calendar-weekday {
  padding: 9px 8px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: #f4f8f4;
  font-size: 0.74rem;
  text-align: center;
  text-transform: uppercase;
}

.routine-calendar-day {
  min-height: 122px;
  padding: 8px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #fff;
}

.routine-calendar-day.is-empty {
  background: #f7f9f7;
}

.routine-calendar-day.is-today {
  box-shadow: inset 0 0 0 2px var(--green);
}

.routine-calendar-day > time {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 7px;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 900;
}

.routine-calendar-day.is-today > time {
  border-radius: 50%;
  color: white;
  background: var(--green-deep);
}

.routine-calendar-events {
  display: grid;
  gap: 5px;
}

.routine-calendar-event {
  display: grid;
  gap: 2px;
  padding: 6px;
  overflow: hidden;
  border-left: 3px solid var(--green);
  border-radius: 4px;
  color: var(--ink);
  background: #edf6f1;
  font-size: 0.7rem;
  line-height: 1.25;
}

.routine-calendar-event b {
  color: var(--green-deep);
  font-size: 0.64rem;
}

.routine-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  min-width: 840px;
  border-bottom: 1px solid var(--line);
}

.routine-week-day {
  min-height: 310px;
  border-right: 1px solid var(--line);
  background: #fff;
}

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

.routine-week-day.is-today {
  box-shadow: inset 0 0 0 2px var(--green);
}

.routine-week-day > header {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  background: #f4f8f4;
}

.routine-week-day > header > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.routine-week-day > header time {
  display: flex;
  gap: 4px;
  align-items: baseline;
  color: var(--green-deep);
}

.routine-week-day > header b {
  font-size: 1.15rem;
}

.routine-week-day > header small {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.routine-week-day.is-today > header time {
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--green-deep);
}

.routine-week-events {
  display: grid;
  gap: 7px;
  padding: 9px;
}

.routine-week-event {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px;
  border: 0;
  border-left: 4px solid var(--green);
  border-radius: 4px;
  color: var(--ink);
  background: #edf6f1;
  text-align: left;
  cursor: pointer;
}

.routine-week-event:hover {
  background: #dfede5;
}

.routine-week-event b {
  color: var(--green-deep);
  font-size: 0.68rem;
}

.routine-week-event strong {
  font-size: 0.78rem;
  line-height: 1.25;
}

.routine-week-event span,
.routine-week-empty {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.routine-week-empty {
  padding: 8px 3px;
  text-align: center;
}

.routine-day-agenda {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #f8faf8;
}

.routine-day-summary {
  display: grid;
  align-content: start;
  gap: 12px;
}

.routine-day-summary > div {
  display: grid;
  place-items: center;
  width: 84px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.routine-day-summary span {
  width: 100%;
  padding: 6px;
  color: white;
  background: var(--green-deep);
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.routine-day-summary strong {
  padding: 12px;
  color: var(--ink);
  font-size: 1.8rem;
}

.routine-day-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
}

.routine-day-grid {
  grid-template-columns: minmax(0, 1fr);
}

.routine-calendar-empty {
  min-height: 280px;
  background: white;
}

.routine-calendar-footer {
  min-width: 0;
  padding: 14px 16px;
}

.routine-month-view .routine-calendar-footer,
.routine-week-view .routine-calendar-footer {
  min-width: 720px;
}

.routine-calendar-footer > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.day-routine-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.day-routine-card > p {
  color: var(--muted);
  line-height: 1.45;
}

.day-routine-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-routine-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--green-deep);
  background: #e8f3ee;
  font-size: 0.76rem;
  font-weight: 800;
}

.day-routine-summary .icon {
  width: 0.9rem;
  height: 0.9rem;
}

.day-routine-timeline {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-routine-timeline li {
  display: grid;
  grid-template-columns: 76px 28px minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  min-height: 72px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.day-routine-timeline time {
  color: var(--green-deep);
  font-weight: 900;
}

.day-routine-marker {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.day-routine-timeline li > div {
  display: grid;
  min-width: 0;
}

.day-routine-timeline small {
  margin-top: 3px;
  color: var(--muted);
}

.routine-slot-status {
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--muted);
  background: #f0f3f1;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.routine-slot-status.status-done {
  color: #266a55;
  background: #ddf2e8;
}

.routine-slot-status.status-ready {
  color: #8c331e;
  background: #fff0eb;
}

.routine-slot-status.status-upcoming {
  color: #245a79;
  background: #e5f3fb;
}

.day-routine-delete {
  justify-self: start;
}

.day-routine-editor {
  padding: 18px;
}

.day-routine-editor-heading {
  margin-bottom: 16px;
}

.day-routine-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.day-routine-field,
.day-routine-schedule-field {
  display: grid;
  gap: 6px;
}

.day-routine-field > span,
.day-routine-schedule-field > span,
.day-routine-editor-slot label > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.day-routine-field input,
.day-routine-field select,
.day-routine-field textarea,
.day-routine-editor-slot input,
.day-routine-editor-slot select {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: white;
}

.day-routine-description-field,
.day-routine-schedule-field {
  grid-column: 1 / -1;
}

.day-routine-description-field textarea {
  min-height: 74px;
  resize: vertical;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekday-picker label {
  position: relative;
}

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

.weekday-picker span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: white;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.weekday-picker input:checked + span {
  color: white;
  background: var(--green-deep);
  border-color: var(--green-deep);
}

.weekday-picker input:focus-visible + span {
  outline: 3px solid rgba(47, 127, 101, 0.25);
  outline-offset: 2px;
}

.day-routine-set-builder {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.day-routine-set-heading p {
  margin-top: 4px;
  color: var(--muted);
}

.day-routine-editor-slots {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.day-routine-editor-slot {
  display: grid;
  grid-template-columns: 34px minmax(120px, 0.5fr) minmax(220px, 1.5fr) auto 42px;
  gap: 10px;
  align-items: end;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.day-routine-editor-slot > label,
.day-routine-editor-slot-meta {
  display: grid;
  gap: 5px;
}

.day-routine-editor-slot-meta {
  align-self: center;
  min-width: 92px;
}

.day-routine-editor-slot-meta small {
  color: var(--muted);
}

.day-routine-editor-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.day-routine-editor-actions > span {
  color: var(--muted);
  font-weight: 800;
}

.day-routine-editor-actions > div {
  display: flex;
  gap: 8px;
}

.scene-strip {
  position: relative;
  display: grid;
  min-height: 260px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--green-deep);
}

.scene-strip img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.scene-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 33, 31, 0.68), rgba(20, 33, 31, 0.1) 65%, transparent);
}

.scene-copy,
.scene-stats {
  position: absolute;
  z-index: 1;
}

.scene-copy {
  left: 22px;
  bottom: 22px;
  max-width: min(560px, calc(100% - 44px));
  color: white;
}

.scene-copy .eyebrow {
  color: var(--mint);
}

.scene-copy p:last-child {
  max-width: 44rem;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
}

.scene-stats {
  top: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 50%;
}

.scene-stats span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: white;
  background: rgba(23, 54, 47, 0.36);
  font-size: 0.78rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.timer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.86fr) minmax(0, 1.14fr);
  gap: 16px;
}

.timer-stage,
.cue-panel,
.timeline-panel,
.builder-add-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.timer-stage {
  display: grid;
  place-items: center;
  gap: 18px;
  min-height: 390px;
  padding: 24px;
}

.timer-ring {
  display: grid;
  place-items: center;
  width: min(250px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 61%, transparent 62%),
    conic-gradient(var(--green) var(--progress), #e5ece7 0);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 34px rgba(23, 54, 47, 0.12);
}

.timer-ring.rep-ring {
  background:
    radial-gradient(circle at center, var(--surface) 0 61%, transparent 62%),
    conic-gradient(var(--coral) 0 32%, var(--amber) 32% 64%, var(--green) 64% 100%);
}

.timer-ring.rest-ring {
  background:
    radial-gradient(circle at center, var(--surface) 0 61%, transparent 62%),
    conic-gradient(var(--blue) var(--progress), #e5ece7 0);
}

.timer-center {
  display: grid;
  place-items: center;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fbfdf9;
}

.timer-center span {
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
}

.timer-center small {
  color: var(--muted);
  font-weight: 800;
}

.timer-center.rep-center {
  align-content: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
}

.timer-center.rep-center span {
  max-width: 100%;
  font-size: 1.55rem;
  line-height: 1.15;
  overflow-wrap: normal;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.rep-controls .primary-control {
  min-width: 170px;
}

.cue-panel {
  padding: 20px;
}

.step-label {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.step-label span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.step-label strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.practice-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 0;
  padding: 14px 0 10px;
  border-top: 1px solid var(--line);
}

.practice-section-heading > div {
  display: grid;
  gap: 3px;
}

.practice-section-heading span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.practice-section-heading strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.practice-section-heading em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.practice-section-instruction {
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.5;
}

.practice-section-list {
  display: grid;
  gap: 5px;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.practice-section-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px;
  border-left: 3px solid transparent;
  color: var(--muted);
}

.practice-section-list li > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--green-deep);
  background: #e7f0ea;
  font-size: 0.75rem;
  font-weight: 900;
}

.practice-section-list li > div {
  display: grid;
  gap: 1px;
}

.practice-section-list strong,
.practice-section-list small,
.practice-section-list time {
  font-size: 0.78rem;
}

.practice-section-list time {
  font-weight: 800;
}

.practice-section-list li.is-current {
  border-left-color: var(--green);
  color: var(--ink);
  background: #f1f7f3;
}

.practice-section-list li.is-complete > span {
  color: white;
  background: var(--green);
}

.summary {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.cue-grid {
  display: grid;
  gap: 10px;
}

.cue-grid div,
.safety-item,
.claim-table div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf9;
}

.cue-grid span,
.mini-section span,
.claim-table span,
.builder-name-row span {
  display: block;
  margin-bottom: 4px;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cue-grid p,
.mini-section p,
.safety-item p,
.claim-table p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.book-practice-material {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.book-practice-material > strong {
  color: var(--green-deep);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.book-practice-material > p {
  margin: 6px 0 9px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
}

.book-practice-material > small {
  color: var(--muted);
}

.duration-tools {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.practice-duration-preference {
  display: grid;
  gap: 7px;
}

.practice-duration-preference > small {
  text-align: center;
}

.duration-tools label,
.builder-copy label {
  display: grid;
  gap: 6px;
}

.rep-guidance {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #efcbbf;
  border-radius: 8px;
  color: #733523;
  background: #fff3ee;
}

.rep-guidance .icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
}

.rep-guidance > div {
  display: grid;
  gap: 3px;
}

.rep-guidance span {
  color: var(--muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.caution-strip {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #dce6df;
  border-radius: 8px;
  color: var(--green-deep);
  background: #edf7f1;
}

.caution-strip.high {
  color: #7e2f25;
  background: #fff1ed;
  border-color: #f0c3ba;
}

.caution-strip p {
  margin: 4px 0 0;
  color: inherit;
  line-height: 1.45;
}

.timeline-panel {
  padding: 16px;
}

.step-list {
  display: grid;
  gap: 8px;
}

.step-row,
.builder-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfdf9;
  text-align: left;
}

.step-row.is-current {
  border-color: rgba(47, 127, 101, 0.58);
  background: #edf8f2;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: var(--green-deep);
  font-size: 0.86rem;
  font-weight: 900;
}

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

.step-copy strong,
.step-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.step-copy small {
  margin-top: 2px;
  color: var(--muted);
}

.step-chip,
.card-meta span,
.caution-list em,
.device-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green-deep);
  background: #e8f3ee;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.view-heading {
  margin-bottom: 0;
}

.view-heading p {
  margin-bottom: 3px;
}

.view-intro {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-box {
  display: grid;
  grid-template-columns: 20px minmax(150px, 250px);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-box input,
.builder-name-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tabs button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-deep);
  background: var(--surface);
  font-weight: 800;
}

.category-tabs button.is-active {
  color: white;
  background: var(--green-deep);
  border-color: var(--green-deep);
}

.library-mode-tabs {
  margin: 2px 0;
}

.all-exercise-library {
  display: grid;
  gap: 12px;
}

.all-exercise-toolbar,
.all-exercise-result-summary,
.all-exercise-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.all-exercise-toolbar h2 {
  margin: 0;
}

.exercise-source-filters {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef3ef;
}

.exercise-source-filters button {
  min-height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.exercise-source-filters button.is-active {
  color: white;
  background: var(--green-deep);
}

.exercise-source-filters span {
  margin-left: 4px;
  opacity: 0.78;
}

.all-exercise-result-summary {
  justify-content: flex-start;
  padding: 9px 12px;
  border-left: 3px solid var(--green);
  color: var(--muted);
  background: #f2f7f3;
  font-size: 0.82rem;
}

.all-exercise-result-summary strong {
  color: var(--ink);
}

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

.all-exercise-row {
  border-bottom: 1px solid var(--line);
}

.all-exercise-row:last-child {
  border-bottom: 0;
}

.all-exercise-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.all-exercise-row > summary::-webkit-details-marker {
  display: none;
}

.all-exercise-row > summary::after {
  content: "+";
  color: var(--green-deep);
  font-size: 1.05rem;
  font-weight: 900;
}

.all-exercise-row[open] > summary::after {
  content: "-";
}

.all-exercise-row[open] > summary {
  background: #f7faf7;
}

.all-exercise-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.all-exercise-title strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.all-exercise-title small,
.all-exercise-badges em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
}

.all-exercise-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.all-exercise-badges b {
  padding: 3px 7px;
  border: 1px solid #cbdcd3;
  border-radius: 999px;
  color: #175a45;
  background: #e5f3eb;
  font-size: 0.7rem;
  white-space: nowrap;
}

.all-exercise-badges b.is-book {
  border-color: #d6dde5;
  color: #31556d;
  background: #f0f5f8;
}

.all-exercise-body {
  display: grid;
  gap: 13px;
  padding: 0 14px 16px;
}

.all-exercise-body > p {
  max-width: 86ch;
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.all-exercise-instructions {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.all-exercise-instructions > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.all-exercise-instructions dt,
.all-exercise-sources > strong {
  color: var(--green-deep);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.all-exercise-instructions dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.all-exercise-sources {
  display: grid;
  gap: 7px;
}

.all-exercise-sources ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.all-exercise-sources li {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.all-exercise-sources li span {
  color: var(--ink);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.all-exercise-sources li small,
.all-exercise-sources > small {
  color: var(--muted);
  font-size: 0.73rem;
}

.all-exercise-actions {
  justify-content: flex-start;
}

.all-exercise-more {
  justify-self: center;
}

.set-library-view {
  display: grid;
  gap: 14px;
}

.set-library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.set-library-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.set-library-card[open] {
  grid-column: 1 / -1;
}

.set-library-card > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  gap: 14px;
  align-items: center;
  min-height: 136px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.set-library-card > summary::-webkit-details-marker {
  display: none;
}

.set-library-card > summary::after {
  content: "+";
  color: var(--green-deep);
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
}

.set-library-card[open] > summary::after {
  content: "-";
}

.set-library-card-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.set-library-card-copy > strong {
  color: var(--ink);
  font-size: 1rem;
}

.set-library-card-copy > span:last-child {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.set-library-card-stats {
  display: grid;
  gap: 4px;
  min-width: 112px;
  text-align: right;
}

.set-library-card-stats b {
  color: var(--green-deep);
  font-size: 0.78rem;
}

.set-library-card-stats small {
  color: var(--muted);
  font-size: 0.72rem;
}

.set-library-card-body {
  border-top: 1px solid var(--line);
  background: #f5faf6;
}

.set-library-source {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.set-library-source > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.set-library-source b {
  display: block;
  margin-bottom: 2px;
  color: var(--green-deep);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.set-library-exercises {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
  padding: 10px 18px 16px 42px;
}

.set-library-exercises > li {
  min-width: 0;
  padding: 7px 0;
  color: var(--green-deep);
}

.exercise-search-results,
.search-result-section {
  display: grid;
  gap: 18px;
}

.exercise-search-results {
  gap: 28px;
}

.search-results-summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--green-deep);
}

.search-results-summary div,
.search-result-heading div {
  min-width: 0;
}

.search-results-summary strong,
.search-results-summary span {
  display: block;
}

.search-results-summary span {
  margin-top: 3px;
  color: var(--muted);
}

.search-result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.search-result-heading h2,
.search-result-heading p {
  margin-bottom: 0;
}

.empty-state.compact {
  min-height: 150px;
}

.book-index-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-left: 4px solid var(--green);
  color: var(--green-deep);
  background: #edf7f1;
}

.book-index-note .icon {
  margin-top: 2px;
}

.book-index-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.book-index {
  border-top: 1px solid var(--line);
}

.book-source {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.book-source summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 94px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.book-source summary::-webkit-details-marker {
  display: none;
}

.book-source summary::after {
  content: "+";
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  margin-top: 2px;
  color: var(--green-deep);
  font-size: 1.35rem;
  font-weight: 800;
}

.book-source[open] summary::after {
  content: "-";
}

.book-source-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.book-source-copy strong {
  padding-right: 30px;
  color: var(--ink);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.book-source-copy small {
  max-width: 68ch;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.book-count {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-self: end;
  margin-bottom: 3px;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.book-exercise-list {
  display: grid;
  border-top: 1px solid var(--line);
  background: #f7faf7;
}

.book-source-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 12px 18px 0;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.book-source-file .icon {
  width: 1rem;
  height: 1rem;
}

.book-exercise-entry {
  border-bottom: 1px solid #e1e9e4;
}

.book-exercise-entry:last-child {
  border-bottom: 0;
}

.book-exercise-description > summary {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  min-height: 48px;
  padding: 11px 18px;
  cursor: pointer;
  list-style: none;
}

.book-exercise-description > summary::-webkit-details-marker {
  display: none;
}

.book-exercise-description > summary::after {
  content: "+";
  flex: 0 0 20px;
  color: var(--green-deep);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  text-align: right;
}

.book-exercise-description[open] > summary::after {
  content: "-";
}

.book-exercise-description > summary > span:first-child {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.book-exercise-summary-copy > strong,
.book-set-exercise-summary-copy > strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
}

.book-record-kind {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 6px;
  border: 1px solid #b7cec2;
  border-radius: 4px;
  color: var(--green-deep);
  background: #edf7f1;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.book-record-kind.is-exercise {
  border-color: #cfd9e5;
  color: #31556d;
  background: #f0f5f8;
}

.book-exercise-preview,
.book-set-exercise-preview {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 400;
  line-height: 1.4;
}

.book-exercise-preview b,
.book-set-exercise-preview b {
  color: var(--green-deep);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.book-exercise-meta {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.book-exercise-meta em {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  white-space: nowrap;
}

.book-exercise-meta b {
  padding: 3px 7px;
  border-radius: 999px;
  color: #175a45;
  background: #dff2e8;
  font-size: 0.74rem;
  white-space: nowrap;
}

.book-exercise-entry.needs-review .book-exercise-description > summary {
  border-left: 3px solid #d49a4f;
}

.book-exercise-detail {
  padding: 2px 18px 16px;
}

.book-exercise-detail > p {
  max-width: 78ch;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.55;
}

.book-exercise-detail > small {
  color: var(--muted);
  font-size: 0.76rem;
}

.set-exercise-list {
  padding: 13px 18px 16px;
  border-top: 1px solid #dce6df;
  background: #eef6f0;
}

.set-exercise-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.set-exercise-list-heading > strong {
  display: flex;
  gap: 10px;
  color: var(--green-deep);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.set-exercise-list-heading > strong span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: none;
}

.set-exercise-list-heading .primary-mini {
  flex: 0 0 auto;
}

.set-exercise-list ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
  padding-left: 24px;
}

.set-exercise-review p {
  margin: 8px 0 0;
  color: var(--muted);
}

.set-exercise-list li {
  min-width: 0;
  padding: 7px 0;
  color: var(--green-deep);
}

.book-set-exercise > summary span,
.book-set-exercise > summary small {
  display: block;
  overflow-wrap: anywhere;
}

.book-set-exercise > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 42px;
  cursor: pointer;
  list-style: none;
}

.book-set-exercise > summary::-webkit-details-marker {
  display: none;
}

.book-set-exercise > summary::after {
  content: "+";
  flex: 0 0 16px;
  color: var(--green-deep);
  font-weight: 900;
  text-align: right;
}

.book-set-exercise[open] > summary::after {
  content: "-";
}

.book-set-exercise > summary span {
  flex: 1;
  min-width: 0;
}

.book-set-exercise-summary-copy {
  display: block;
}

.book-set-exercise-summary-copy > .book-set-exercise-preview {
  color: var(--muted);
  font-weight: 400;
}

.book-set-exercise > summary small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.book-set-exercise-body {
  padding: 1px 0 13px;
}

.book-set-exercise-body > strong {
  color: var(--green-deep);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.book-set-exercise-body > p {
  margin: 5px 0 7px;
  color: var(--ink);
  line-height: 1.5;
}

.book-set-exercise-body > small {
  color: var(--muted);
  font-size: 0.72rem;
}

.book-timer-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #dce6df;
}

.book-timer-action > span {
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.book-practice-start {
  margin-top: 12px;
}

.book-set-exercise.needs-review > summary {
  border-left: 3px solid #d49a4f;
  padding-left: 8px;
}

.book-empty {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #f7faf7;
}

.book-empty strong {
  color: var(--ink);
}

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

.exercise-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.exercise-card.has-caution {
  border-top-color: var(--coral);
}

.exercise-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.exercise-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.exercise-description {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.exercise-description > span {
  color: var(--green-deep);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.exercise-description > p {
  margin: 0;
  color: var(--ink-soft);
}

.exercise-instructions {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.exercise-instructions > strong {
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.exercise-instructions ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 24px;
}

.exercise-instructions li {
  padding-left: 3px;
  color: var(--green-deep);
}

.exercise-instructions li::marker {
  font-weight: 900;
}

.exercise-instructions li > span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.exercise-instructions li > p,
.exercise-instructions.missing > p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.exercise-media {
  display: grid;
  gap: 7px;
  margin: 0;
}

.exercise-media img,
.exercise-media video,
.exercise-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2ef;
}

.exercise-media img,
.exercise-media video,
.exercise-thumbnail img {
  object-fit: contain;
}

.exercise-media video {
  background: #111817;
}

.exercise-media figcaption {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.exercise-thumbnail {
  overflow: hidden;
}

.exercise-thumbnail img {
  width: 100%;
  height: 100%;
}

.video-thumbnail,
.media-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--green-deep);
  background: #e9f3ed;
  text-align: center;
  font-weight: 800;
}

.video-thumbnail .icon,
.media-empty .icon {
  width: 1.65rem;
  height: 1.65rem;
}

.media-empty {
  min-height: 132px;
  padding: 16px;
  border: 1px dashed #b8c9bf;
  border-radius: 8px;
  color: var(--muted);
  background: #f7faf7;
}

.card-meta,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions {
  align-self: end;
}

.builder-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
}

.builder-name-row label,
.builder-total {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.builder-total {
  display: grid;
  align-content: center;
}

.builder-total strong {
  font-size: 1.35rem;
}

.builder-total span {
  margin: 0;
  color: var(--muted);
  text-transform: none;
}

.builder-steps {
  display: grid;
  gap: 9px;
}

.builder-step {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  background: var(--surface);
}

.builder-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.builder-copy small {
  color: var(--muted);
}

.builder-copy label span {
  margin-bottom: 0;
  color: var(--muted);
  text-transform: none;
}

.builder-duration-editor {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.builder-timing-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 5px;
}

.builder-time-control {
  min-width: 0;
}

.builder-time-control-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.builder-time-control-heading strong {
  color: var(--ink);
  white-space: nowrap;
}

.builder-controls {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 6px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 170px;
  padding: 24px;
  border: 1px dashed #bdcec5;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdf9;
  text-align: center;
}

.empty-state .icon {
  width: 2.2rem;
  height: 2.2rem;
  color: var(--green);
}

.empty-state strong {
  color: var(--ink);
}

.builder-add-list {
  padding: 16px;
}

.admin-view {
  display: grid;
  gap: 16px;
}

.admin-titlebar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.admin-titlebar h1,
.admin-titlebar p {
  margin-bottom: 0;
}

.admin-set-create {
  display: grid;
  grid-template-columns: minmax(220px, 300px) auto;
  gap: 9px;
  align-items: end;
}

.admin-set-create label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-set-create select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: white;
}

.admin-section-tabs {
  display: flex;
  width: fit-content;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3ef;
}

.admin-section-tabs button {
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.admin-section-tabs button.is-active {
  color: var(--green-deep);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(24, 56, 46, 0.12);
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  overflow: hidden;
}

.admin-summary div {
  display: grid;
  gap: 2px;
  min-height: 84px;
  align-content: center;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.admin-summary div:last-child {
  border-right: 0;
}

.admin-summary strong {
  font-size: 1.55rem;
  color: var(--green-deep);
}

.admin-summary span,
.admin-result-count {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.catalog-sync {
  width: fit-content;
  margin: 8px 0 0;
  padding: 4px 8px;
  border-radius: 999px;
  color: #175a45;
  background: #dff2e8;
  font-size: 0.78rem;
  font-weight: 800;
}

.catalog-sync.has-error {
  color: #775012;
  background: #fff0cc;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px 150px auto;
  gap: 10px;
  align-items: end;
}

.admin-book-toolbar {
  grid-template-columns: minmax(240px, 1fr) 170px auto;
}

.admin-toolbar > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-toolbar input,
.admin-toolbar select,
.admin-form-grid input,
.admin-form-grid select,
.admin-form-wide textarea,
.admin-routine-description textarea,
.admin-routine-add-step select,
.timed-section-fields input,
.timed-section-fields select,
.timed-section-fields textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: white;
}

.admin-book-exercise-row input,
.admin-book-exercise-row textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: white;
}

.admin-media-section {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.exercise-builder-admin {
  gap: 18px;
}

.exercise-builder-titlebar {
  align-items: center;
}

.exercise-builder-toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
}

.exercise-builder-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.exercise-builder-summary div {
  display: grid;
  gap: 3px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.exercise-builder-summary div:last-child {
  border-right: 0;
}

.exercise-builder-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.exercise-builder-summary strong {
  color: var(--green-deep);
  font-size: 1.18rem;
}

.exercise-builder-band {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 4px 0 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.exercise-builder-band-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.exercise-builder-band-heading h2,
.exercise-builder-band-heading p {
  margin-bottom: 0;
}

.exercise-builder-band-heading > div > p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.timed-section-list {
  display: grid;
  gap: 10px;
}

.timed-section-editor {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf9;
}

.timed-section-order {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
}

.timed-section-order .builder-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.timed-section-order .icon-button {
  width: 36px;
  height: 36px;
}

.timed-section-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.55fr) minmax(210px, 0.75fr);
  gap: 10px;
}

.timed-section-fields > label,
.timed-section-duration {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.timed-section-instructions {
  grid-column: 1 / -1;
}

.timed-section-fields textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.45;
}

.timed-section-duration > div {
  display: grid;
  grid-template-columns: 40px minmax(100px, 1fr) 40px;
  gap: 6px;
  align-items: center;
}

.timed-section-duration label {
  position: relative;
}

.timed-section-duration input {
  padding-right: 62px;
}

.timed-section-duration small {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.exercise-builder-band.admin-media-section {
  padding: 4px 0 22px;
  background: transparent;
}

.exercise-builder-band.caution-choices {
  padding: 14px 0 22px;
  background: transparent;
}

.exercise-builder-actions {
  position: static;
  margin: -2px -2px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(23, 54, 47, 0.1);
}

.admin-media-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.admin-media-heading h3,
.admin-media-heading p {
  margin: 0;
}

.admin-media-heading p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.admin-media-heading > span,
.media-status {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #285d78;
  background: #e4f1f8;
  font-size: 0.76rem;
  font-weight: 900;
}

.admin-media-preview {
  width: min(520px, 100%);
}

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

.admin-media-grid > label,
.admin-media-control,
.admin-media-control > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-media-grid input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: white;
}

.admin-media-control {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.media-control-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: white;
  background: var(--green);
  cursor: pointer;
}

.upload-button.is-uploading {
  opacity: 0.7;
  cursor: wait;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.admin-search {
  position: relative;
}

.admin-search .icon {
  position: absolute;
  left: 12px;
  bottom: 13px;
  color: var(--muted);
}

.admin-search input {
  padding-left: 39px;
}

.admin-result-count {
  padding: 0 2px 13px;
  text-align: right;
}

.admin-set-more {
  justify-self: center;
  min-width: 180px;
}

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

.admin-book-drilldown {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

#admin-book-drilldown-title {
  scroll-margin-top: 12px;
}

.admin-book-drilldown-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.admin-book-drilldown-header h2,
.admin-book-drilldown-header p {
  margin-bottom: 0;
}

.admin-book-drilldown-header > div > p:last-child {
  margin-top: 5px;
  color: var(--muted);
}

.admin-book-drill-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) minmax(320px, 1.25fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.admin-book-drill-column {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.admin-book-drill-column:last-child {
  border-right: 0;
}

.admin-book-drill-column-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  background: #eaf1ec;
}

.admin-book-drill-column-heading > span,
.admin-book-component-list > li > span {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  background: var(--green-deep);
  font-size: 0.76rem;
  font-weight: 900;
}

.admin-book-drill-column-heading > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-book-drill-column-heading strong,
.admin-book-drill-column-heading small {
  overflow-wrap: anywhere;
}

.admin-book-drill-column-heading small {
  color: var(--muted);
}

.admin-book-drill-list {
  max-height: 560px;
  overflow-y: auto;
}

.admin-book-drill-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  color: var(--ink);
  background: white;
  text-align: left;
}

.admin-book-drill-item:hover,
.admin-book-drill-item.is-active {
  border-left-color: var(--green);
  background: #f0f7f3;
}

.admin-book-drill-item strong {
  overflow-wrap: anywhere;
}

.admin-book-drill-item > span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-book-drill-item em {
  color: var(--green-deep);
  font-style: normal;
  font-weight: 800;
}

.admin-book-drill-selection-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8faf8;
}

.admin-book-drill-selection-note p {
  max-height: 4.4em;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow: auto;
}

.admin-book-drill-prompt {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 220px;
  align-content: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.admin-book-drill-prompt .icon {
  width: 1.8rem;
  height: 1.8rem;
  color: var(--green);
}

.admin-book-drill-prompt strong {
  color: var(--ink);
}

.admin-book-component-column {
  max-height: 622px;
  overflow-y: auto;
}

.admin-book-component-detail {
  display: grid;
}

.admin-book-component-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(90px, 0.7fr) minmax(54px, 0.4fr);
  border-bottom: 1px solid var(--line);
}

.admin-book-component-summary > div {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
}

.admin-book-component-summary > div:last-child {
  border-right: 0;
}

.admin-book-component-summary span,
.admin-book-component-heading small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-book-source-instructions,
.admin-book-component-heading {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-book-source-instructions p {
  margin: 6px 0 0;
  color: var(--ink);
  line-height: 1.5;
}

.admin-book-source-instructions small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.admin-book-component-heading > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-book-component-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-book-component-list > li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-book-component-list > li > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-book-component-list strong,
.admin-book-component-list small,
.admin-book-component-list p {
  overflow-wrap: anywhere;
}

.admin-book-component-list small {
  color: var(--green-deep);
  font-weight: 800;
}

.admin-book-component-list p {
  margin: 2px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-table-head,
.admin-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.45fr) minmax(130px, 0.8fr) minmax(120px, 0.7fr) minmax(95px, 0.5fr) minmax(115px, 0.7fr) minmax(190px, 1fr);
  gap: 14px;
  align-items: center;
}

.admin-table-head {
  min-height: 44px;
  padding: 0 14px;
  color: #485652;
  background: #eaf1ec;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-row {
  min-height: 78px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.admin-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-row strong,
.admin-row small,
.admin-exercise-name span {
  overflow-wrap: anywhere;
}

.admin-row small,
.admin-exercise-name span {
  color: var(--muted);
  line-height: 1.35;
}

.admin-row .mini-label {
  width: fit-content;
}

.status-pill {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.status-published {
  color: #175a45;
  background: #dff2e8;
}

.status-draft {
  color: #775012;
  background: #fff0cc;
}

.status-archived {
  color: #5f6966;
  background: #e9edeb;
}

.admin-row-actions {
  grid-template-columns: 42px auto;
  align-items: center;
}

.admin-book-table .admin-row-actions {
  grid-template-columns: 42px 42px minmax(82px, auto);
}

.admin-status-button {
  min-width: 82px;
}

.text-button {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 2px 0;
  color: var(--blue);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
}

.admin-empty {
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
}

.admin-modal-backdrop {
  align-items: start;
  overflow-y: auto;
}

.admin-editor {
  width: min(920px, 100%);
  margin: 24px 0;
  padding: 22px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.admin-editor-header,
.admin-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-editor-header h2,
.admin-editor-header p {
  margin-bottom: 0;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.admin-form-grid label,
.admin-form-wide label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-form-wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-form-wide textarea {
  min-height: 94px;
  resize: vertical;
  line-height: 1.4;
}

.admin-routine-description {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-routine-description textarea {
  resize: vertical;
  line-height: 1.4;
}

.admin-routine-steps {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.admin-book-editor {
  width: min(1100px, 100%);
}

.admin-set-context {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-left: 3px solid var(--green);
  color: var(--muted);
  background: #f2f7f3;
}

.admin-set-context span {
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-set-context strong {
  color: var(--ink);
}

.admin-book-source,
.admin-book-sets {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.book-file-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.book-file-actions small {
  max-width: 100%;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.book-file-actions .secondary-button {
  text-decoration: none;
}

.admin-book-set-list {
  display: grid;
  gap: 10px;
}

.admin-book-set {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.admin-book-set > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.admin-book-set > summary::-webkit-details-marker {
  display: none;
}

.admin-book-set > summary::after {
  content: "+";
  color: var(--green-deep);
  font-size: 1.1rem;
  font-weight: 900;
}

.admin-book-set[open] > summary::after {
  content: "-";
}

.admin-book-set > summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-book-set > summary strong,
.admin-book-set > summary small {
  overflow-wrap: anywhere;
}

.admin-book-set > summary small,
.admin-book-set > summary em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.admin-book-set-body {
  padding: 0 14px 16px;
  border-top: 1px solid var(--line);
}

.admin-book-set-fields {
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 0.7fr) minmax(100px, 0.4fr);
}

.admin-book-set-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.danger-text {
  margin-left: auto;
  color: #a73333;
}

.admin-book-exercises {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-book-exercise-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--green-deep);
}

.admin-book-exercise-heading span {
  min-width: 28px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #eaf1ec;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-book-exercise-row {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) 90px minmax(180px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.admin-book-exercise-row > label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-book-exercise-row .step-number {
  align-self: center;
}

.admin-book-exercise-row .book-exercise-description-field {
  grid-column: 2 / 6;
}

.book-duration-scale {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.book-duration-scale-heading,
.book-duration-scale-labels,
.admin-book-timed-sections-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.book-duration-scale output {
  color: var(--green-deep);
  font-size: 0.86rem;
  font-weight: 900;
}

.book-duration-scale input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.book-duration-scale-labels {
  font-size: 0.68rem;
}

.admin-book-timed-sections {
  grid-column: 2 / 6;
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.admin-book-timed-sections-heading > span {
  display: grid;
  gap: 2px;
}

.admin-book-timed-sections-heading small {
  color: var(--muted);
}

.admin-book-timed-section {
  display: grid;
  grid-template-columns: 34px minmax(150px, 0.8fr) 120px minmax(190px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border-left: 3px solid #7bb69d;
  background: #f4f8f5;
}

.admin-book-timed-section > label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.book-section-duration {
  display: grid;
  grid-template-columns: 34px minmax(64px, 1fr) auto 34px;
  gap: 5px;
  align-items: center;
}

.book-section-duration input {
  min-width: 0;
}

.book-section-instructions {
  grid-column: 2 / 6;
}

.admin-book-add-set {
  justify-self: start;
}

.text-link {
  color: var(--blue);
  font-weight: 800;
}

.admin-routine-step-list {
  display: grid;
  gap: 8px;
}

.admin-routine-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-routine-add-step {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-routine-add-step label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.caution-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.caution-choices legend {
  padding: 0 6px;
  color: var(--green-deep);
  font-weight: 900;
}

.caution-choices label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 8px;
}

.caution-choices input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.caution-choices span {
  display: grid;
  gap: 2px;
}

.caution-choices small {
  color: var(--muted);
  line-height: 1.35;
}

.admin-editor-actions {
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

body:not([data-tab="practice"]) .routine-dock,
body:not([data-tab="practice"]) .insight-dock {
  display: none;
}

body:not([data-tab="practice"]) .app-layout {
  grid-template-columns: minmax(0, 1fr);
}

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

.quick-add {
  min-height: 74px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfdf9;
  text-align: left;
}

.quick-add strong,
.quick-add span {
  display: block;
  overflow-wrap: anywhere;
}

.quick-add span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.safety-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green-deep);
}

.claim-table {
  display: grid;
  gap: 8px;
}

.daily-meter {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin-bottom: 14px;
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(145deg, rgba(23, 54, 47, 0.95), rgba(47, 127, 101, 0.92)),
    var(--green-deep);
  text-align: center;
}

.daily-meter strong {
  display: block;
  font-size: 3.4rem;
  line-height: 1;
}

.daily-meter span {
  max-width: 12rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 800;
}

.practice-summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.practice-summary-heading {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
}

.practice-summary-heading > div {
  display: grid;
  gap: 3px;
}

.practice-summary-heading span {
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.practice-summary-heading strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.practice-summary-heading b {
  color: var(--green-deep);
  font-size: 0.78rem;
}

.practice-consistency-track {
  height: 9px;
  overflow: hidden;
  border-radius: 5px;
  background: #e2ebe5;
}

.practice-consistency-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.practice-summary > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.practice-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.practice-summary-stats > div {
  display: grid;
  gap: 2px;
  padding: 10px 8px;
}

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

.practice-summary-stats strong {
  color: var(--green-deep);
  font-size: 1.15rem;
}

.practice-summary-stats span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.mini-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.caution-list,
.device-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.flag-high {
  color: #7e2f25;
  background: #fff1ed;
}

.flag-medium {
  color: #6c4413;
  background: #fff6e8;
}

.flag-low {
  color: var(--green-deep);
  background: #e8f3ee;
}

.device-strip {
  margin-top: 14px;
}

.device-strip .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.mobile-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 32;
  display: none;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(220, 230, 223, 0.95);
  border-radius: 8px;
  background: rgba(251, 252, 248, 0.94);
  box-shadow: 0 16px 44px rgba(23, 54, 47, 0.18);
  backdrop-filter: blur(14px);
}

.mobile-nav button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 54px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 800;
}

.mobile-nav button.is-active {
  color: white;
  background: var(--green-deep);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 33, 31, 0.54);
}

.modal-panel {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 8px;
  color: #7e2f25;
  background: #fff1ed;
}

.modal-icon .icon {
  width: 1.6rem;
  height: 1.6rem;
}

.modal-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 50;
  width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  padding: 13px 16px;
  border-radius: 8px;
  color: white;
  background: var(--green-deep);
  box-shadow: 0 16px 40px rgba(23, 54, 47, 0.24);
  text-align: center;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .app-layout {
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  }

  .personal-sets-layout {
    grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
  }

  .personal-set-add {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .personal-set-add .available-set-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insight-dock {
    display: none;
  }

  .timer-grid,
  .exercise-grid,
  .quick-add-grid,
  .day-routine-grid {
    grid-template-columns: 1fr;
  }

  .section-nav button {
    padding: 0 8px;
  }

  .admin-table-head {
    display: none;
  }

  .admin-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .admin-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .admin-row > div::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .admin-row-actions {
    grid-template-columns: 42px auto;
  }
}

@media (max-width: 820px) {
  #app {
    padding: 10px 10px 92px;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .brand small,
  .install-button span {
    display: none;
  }

  .section-nav {
    display: none;
  }

  .app-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .workspace-panel {
    padding: 10px;
  }

  .all-exercise-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-source-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exercise-source-filters button {
    min-width: 0;
    padding: 0 6px;
  }

  .all-exercise-row > summary {
    grid-template-columns: minmax(0, 1fr) 18px;
  }

  .all-exercise-badges {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .all-exercise-row > summary::after {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .all-exercise-sources ul {
    grid-template-columns: 1fr;
  }

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

  .all-exercise-actions button {
    width: 100%;
  }

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

  .builder-timing-controls {
    grid-template-columns: 1fr;
  }

  .exercise-duration-reset {
    justify-self: start;
  }

  .routine-dock,
  .insight-dock {
    display: none;
  }

  body[data-tab="practice"] .routine-dock,
  body[data-tab="practice"] .insight-dock {
    display: block;
  }

  .routine-dock {
    order: 2;
  }

  .insight-dock {
    order: 3;
  }

  .workspace-panel {
    order: 1;
  }

  .scene-strip,
  .scene-strip img {
    min-height: 220px;
  }

  .scene-strip::after {
    background: linear-gradient(0deg, rgba(20, 33, 31, 0.72), rgba(20, 33, 31, 0.12));
  }

  .scene-copy {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .scene-stats {
    left: 12px;
    right: 12px;
    top: 12px;
    max-width: none;
    justify-content: flex-start;
  }

  .timer-stage {
    min-height: 330px;
    padding: 18px;
  }

  .timer-center.rep-center {
    padding: 10px;
  }

  .timer-center.rep-center span {
    font-size: 1.25rem;
  }

  .timer-controls {
    width: 100%;
  }

  .primary-control {
    flex: 1 1 150px;
  }

  .duration-tools {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .step-row,
  .builder-step,
  .admin-routine-step,
  .admin-book-exercise-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .step-chip,
  .builder-controls {
    grid-column: 2;
  }

  .builder-controls {
    display: flex;
  }

  .admin-book-exercise-row > label,
  .admin-book-exercise-row > .book-duration-scale,
  .admin-book-exercise-row > .admin-book-timed-sections,
  .admin-book-exercise-row .builder-controls,
  .admin-book-timed-section > label,
  .admin-book-timed-section > .builder-controls {
    grid-column: 2;
  }

  .admin-book-timed-section {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .book-section-instructions {
    grid-column: 2;
  }

  .view-heading,
  .builder-name-row,
  .day-routine-form-grid,
  .safety-grid,
  .admin-form-grid,
  .admin-form-wide,
  .admin-toolbar,
  .admin-media-grid,
  .admin-routine-add-step,
  .routine-library-grid {
    grid-template-columns: 1fr;
  }

  .day-routine-description-field,
  .day-routine-schedule-field {
    grid-column: auto;
  }

  .day-routine-timeline li {
    grid-template-columns: 70px 28px minmax(0, 1fr) auto;
  }

  .day-routine-timeline .secondary-button {
    grid-column: 3 / -1;
    justify-self: start;
  }

  .day-routine-editor-slot {
    grid-template-columns: 34px minmax(0, 0.7fr) minmax(0, 1.3fr) 42px;
  }

  .day-routine-editor-slot-meta {
    grid-column: 2 / 4;
  }

  .admin-section-tabs {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-section-tabs button {
    flex: 1 1 150px;
  }

  .routine-day-agenda {
    grid-template-columns: minmax(0, 1fr);
  }

  .routine-day-summary {
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
  }

  .book-source-file {
    margin-left: 14px;
    margin-right: 14px;
  }

  .book-source summary {
    grid-template-columns: minmax(0, 1fr) 78px;
    gap: 10px;
    padding: 14px;
  }

  .book-exercise-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .book-exercise-description > summary,
  .book-exercise-detail {
    padding-left: 14px;
    padding-right: 14px;
  }

  .book-exercise-description > summary {
    align-items: center;
  }

  .book-exercise-meta em {
    display: none;
  }

  .book-exercise-meta b {
    white-space: normal;
  }

  .set-exercise-list {
    padding-left: 14px;
    padding-right: 14px;
  }

  .set-exercise-list ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .set-exercise-list-heading,
  .book-timer-action {
    align-items: stretch;
    flex-direction: column;
  }

  .set-exercise-list-heading .primary-mini,
  .book-timer-action .secondary-button {
    width: 100%;
  }

  .admin-media-heading {
    flex-direction: column;
  }

  .admin-titlebar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-titlebar .primary-mini {
    width: 100%;
  }

  .admin-set-create {
    grid-template-columns: 1fr;
  }

  .admin-book-drilldown-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-book-drill-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-book-drill-column {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-book-drill-column:last-child {
    border-bottom: 0;
  }

  .admin-book-drill-list {
    max-height: 320px;
  }

  .admin-book-component-column {
    max-height: none;
  }

  .admin-book-component-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-book-component-summary > div:first-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-book-table .admin-row-actions {
    grid-column: 1 / -1;
    grid-template-columns: 42px 42px minmax(82px, auto);
  }

  .exercise-builder-toolbar {
    width: 100%;
  }

  .exercise-builder-toolbar > button {
    flex: 1 1 0;
  }

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

  .exercise-builder-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .exercise-builder-summary div:last-child {
    border-bottom: 0;
  }

  .exercise-builder-band-heading,
  .practice-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-builder-band-heading .secondary-button {
    width: 100%;
  }

  .timed-section-editor,
  .timed-section-fields {
    grid-template-columns: 1fr;
  }

  .timed-section-order {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .timed-section-instructions {
    grid-column: auto;
  }

  .exercise-builder-actions {
    position: static;
  }

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

  .admin-summary div:nth-child(2) {
    border-right: 0;
  }

  .admin-summary div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .admin-result-count {
    padding: 2px 0 0;
    text-align: left;
  }

  .admin-editor {
    margin: 0;
    padding: 16px;
  }

  .caution-choices {
    grid-template-columns: 1fr;
  }

  .view-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .view-heading > .primary-mini {
    width: 100%;
  }

  .personal-sets-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .personal-set-list,
  .personal-set-add {
    border-right: 0;
    border-left: 0;
  }

  .personal-set-list {
    border-bottom: 1px solid var(--line);
  }

  .personal-set-list-items {
    max-height: 330px;
  }

  .personal-set-detail {
    padding: 16px;
  }

  .personal-set-add {
    grid-column: auto;
  }

  .personal-set-add .available-set-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .set-library-grid,
  .set-library-exercises {
    grid-template-columns: minmax(0, 1fr);
  }

  .set-library-card[open] {
    grid-column: auto;
  }

  .set-library-card > summary {
    grid-template-columns: minmax(0, 1fr) 18px;
  }

  .set-library-card-stats {
    grid-column: 1 / -1;
    text-align: left;
  }

  .set-library-source {
    align-items: stretch;
    flex-direction: column;
  }

  .set-library-source .primary-mini {
    width: 100%;
  }

  .search-box {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .mobile-nav {
    display: grid;
  }
}

@media (max-width: 620px) {
  .mobile-nav button span {
    display: none;
  }

  .day-routine-timeline li {
    grid-template-columns: 70px 28px minmax(0, 1fr);
  }

  .routine-calendar-heading {
    gap: 8px;
    padding: 12px;
  }

  .routine-calendar-heading-copy h2 {
    font-size: 1rem;
    line-height: 1.25;
  }

  .routine-calendar-heading-actions {
    gap: 5px;
  }

  .calendar-today-button {
    min-height: 38px;
    padding: 0 9px;
    font-size: 0.75rem;
  }

  .routine-day-agenda {
    padding: 12px;
  }

  .routine-day-summary {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .routine-day-summary > div {
    width: 68px;
  }

  .routine-calendar-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .routine-calendar-footer .secondary-button {
    width: 100%;
  }

  .routine-slot-status {
    grid-column: 3;
    justify-self: start;
  }

  .day-routine-timeline .secondary-button {
    grid-column: 3;
    width: 100%;
  }

  .day-routine-editor-slot {
    grid-template-columns: 34px minmax(0, 1fr) 42px;
    align-items: center;
  }

  .day-routine-editor-slot > label,
  .day-routine-editor-slot-meta {
    grid-column: 2;
  }

  .day-routine-editor-slot .icon-button {
    grid-column: 3;
    grid-row: 1;
  }

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

  .day-routine-set-heading,
  .day-routine-editor-actions,
  .personal-set-detail-heading,
  .personal-set-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .personal-set-detail-actions .primary-mini,
  .personal-set-detail-actions .secondary-button,
  .personal-set-detail-actions .text-button {
    width: 100%;
  }

  .personal-set-primary-actions,
  .builder-heading-actions,
  .builder-heading-actions button {
    width: 100%;
  }

  .personal-set-primary-actions,
  .builder-heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .day-routine-set-heading .secondary-button,
  .day-routine-editor-actions > div,
  .day-routine-editor-actions button {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .mobile-nav button span {
    display: none;
  }

  .admin-table {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .admin-row {
    grid-template-columns: 1fr 1fr;
  }

  .admin-exercise-name,
  .admin-row-actions {
    grid-column: 1 / -1;
  }

  .scene-copy h1 {
    font-size: 1.65rem;
  }

  .scene-stats span {
    font-size: 0.72rem;
  }

  .cue-panel,
  .timeline-panel,
  .builder-add-list,
  .exercise-card,
  .routine-library-card {
    padding: 12px;
  }

  .timer-ring {
    width: min(230px, 76vw);
  }

  .card-actions .secondary-button {
    flex: 1 1 130px;
  }
}

.account-button,
.auth-primary,
.auth-secondary,
.auth-text-button,
.auth-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.account-button {
  max-width: 150px;
  padding: 0 13px;
  color: var(--green-deep);
  background: #e4f2ea;
  border: 1px solid #c8dfd1;
  text-decoration: none;
}

.account-button:focus-visible {
  outline: 3px solid rgba(53, 111, 145, 0.35);
  outline-offset: 3px;
}

.account-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button .icon,
.account-button span {
  pointer-events: none;
}

body[data-auth="signed-out"],
body[data-auth="password-change"],
body[data-auth="unavailable"] {
  background:
    linear-gradient(rgba(15, 36, 31, 0.44), rgba(15, 36, 31, 0.58)),
    url("./assets/yoga-studio.webp") center / cover fixed;
}

body[data-auth] #app {
  padding: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-card {
  width: min(100%, 440px);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(9, 32, 25, 0.28);
}

.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 130px;
  color: var(--green-deep);
  font-weight: 800;
}

.auth-loading p {
  margin: 0;
}

.auth-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #c8dfd1;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

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

.auth-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border-radius: 8px;
  color: white;
  background: var(--green-deep);
}

.auth-mark .icon {
  width: 25px;
  height: 25px;
}

.auth-eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-card h1,
.account-header h2 {
  margin: 0;
  color: var(--green-deep);
  line-height: 1.15;
}

.auth-card h1 {
  font-size: 1.85rem;
}

.auth-intro {
  margin: 12px 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label,
.create-user-form label,
.user-row label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.auth-form label > span,
.create-user-form label > span,
.user-row label > span {
  color: #34443f;
  font-size: 0.79rem;
  font-weight: 800;
}

.auth-form input,
.create-user-form input,
.create-user-form select,
.user-row input,
.user-row select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #cbd9d0;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

.auth-primary {
  padding: 0 18px;
  color: white;
  background: var(--green-deep);
  border: 1px solid var(--green-deep);
}

.auth-secondary {
  padding: 0 16px;
  color: var(--green-deep);
  background: #fff;
  border: 1px solid #cbd9d0;
}

.auth-secondary.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.8rem;
}

.auth-text-button {
  width: 100%;
  margin-top: 12px;
  color: var(--muted);
  background: transparent;
}

.auth-primary:disabled,
.auth-secondary:disabled {
  cursor: wait;
  opacity: 0.66;
}

.auth-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.auth-message {
  margin: 0 0 18px;
  padding: 11px 12px;
  border-radius: 6px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-error {
  color: #7d2f25;
  background: #fff0ed;
  border: 1px solid #efc7c0;
}

.auth-success {
  color: #19523e;
  background: #e8f6ed;
  border: 1px solid #bfdfca;
}

.account-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 33, 28, 0.58);
  backdrop-filter: blur(5px);
}

.account-panel {
  width: min(100%, 980px);
  max-height: min(880px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: #f8fbf8;
  box-shadow: 0 24px 70px rgba(9, 32, 25, 0.32);
}

.account-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
  background: rgba(248, 251, 248, 0.97);
  border-bottom: 1px solid var(--line);
}

.account-header h2 {
  font-size: 1.35rem;
}

.account-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.auth-tab {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border-bottom: 3px solid transparent;
  border-radius: 0;
}

.auth-tab.is-active {
  color: var(--green-deep);
  border-bottom-color: var(--green);
}

.account-panel > .auth-message {
  margin: 16px 24px 0;
}

.account-content {
  padding: 24px;
}

.account-section {
  display: grid;
  gap: 22px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.account-identity > div,
.user-row-heading > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-identity span:not(.account-avatar),
.account-identity small,
.user-row-heading small {
  color: var(--muted);
}

.account-identity strong,
.account-identity span,
.user-row-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-weight: 900;
}

.account-avatar.small {
  width: 38px;
  height: 38px;
  font-size: 0.75rem;
}

.account-password-form,
.create-user-form {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.account-password-form h3,
.account-password-form .auth-help,
.account-password-form .auth-primary {
  grid-column: 1 / -1;
}

.account-section h3,
.section-heading p {
  margin: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-heading > div {
  display: grid;
  gap: 4px;
}

.section-heading p {
  color: var(--muted);
  font-size: 0.84rem;
}

.create-user-form {
  display: grid;
  grid-template-columns: 1fr 1fr 160px;
  gap: 14px;
}

.create-user-form .section-heading,
.create-user-form .auth-help {
  grid-column: 1 / -1;
}

.create-user-form .create-user-password {
  grid-column: 1 / 3;
}

.create-user-form .auth-primary {
  align-self: end;
}

.credential-result {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #c5dbcc;
  border-radius: 8px;
  background: #ecf7f0;
}

.credential-result > div {
  display: grid;
  gap: 3px;
}

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

.credential-result code {
  overflow-wrap: anywhere;
  padding: 11px 12px;
  border: 1px solid #b9d0c0;
  border-radius: 6px;
  color: #153c31;
  background: white;
  font-size: 0.9rem;
}

.user-list-heading {
  margin-top: 4px;
}

.user-list {
  display: grid;
  gap: 10px;
}

.users-empty {
  margin: 0;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(150px, 1fr) 140px 130px auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-row-heading {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 10px;
  min-width: 0;
}

.user-row-actions {
  display: flex;
  gap: 7px;
}

@media (max-width: 1040px) {
  .user-row {
    grid-template-columns: minmax(200px, 1.4fr) minmax(170px, 1fr) 140px 130px;
  }

  .user-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 820px) {
  .account-button span {
    display: none;
  }

  .account-button {
    width: 42px;
    padding: 0;
  }

  .create-user-form,
  .user-row,
  .account-password-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .create-user-form .create-user-password,
  .user-row-heading,
  .user-row-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .auth-card {
    padding: 26px 22px;
  }

  .account-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .account-panel {
    width: 100%;
    max-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .account-header,
  .account-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .account-tabs {
    padding-left: 16px;
    padding-right: 16px;
  }

  .create-user-form,
  .user-row,
  .account-password-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .create-user-form .create-user-password,
  .account-password-form h3,
  .account-password-form .auth-help,
  .account-password-form .auth-primary,
  .user-row-heading,
  .user-row-actions {
    grid-column: 1;
  }

  .user-row-actions {
    justify-content: stretch;
  }

  .user-row-actions button {
    flex: 1 1 0;
  }
}
