/* Brooke Fit redesign layer: shared foundations, Today, workout mode and finish.
   Loaded after styles.css. Brooke stays large where people move or decide, and
   appears as a small portrait beside guidance elsewhere. */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/plus-jakarta-sans.woff') format('woff');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces.woff') format('woff');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --glass: color-mix(in srgb, var(--surface) 92%, transparent);
  --bubble-shadow: 0 10px 30px var(--art-color-233c3729);
  --room: url('../assets/brooke/backgrounds/roomwave-gym.webp');
}
:root[data-theme='dark'] {
  --bubble-shadow: 0 10px 30px var(--art-color-0006);
}
body {
  background: var(--bg);
  color: var(--ink);
  font-size: var(--text-base);
}
h1,
h2,
h3 {
  letter-spacing: -0.02em;
}
.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-heading h1 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link: only appears for keyboard users, never after a tap or a re-render. */
.skip-link {
  display: block;
  white-space: nowrap;
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 300;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}
.skip-link:not(:focus-visible) {
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
}

/* Buttons */
.button {
  min-height: 48px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}
.button.glass,
.icon-button.glass {
  background: var(--glass);
  color: var(--ink);
  border: 0;
  box-shadow: 0 2px 10px var(--art-color-233c371a);
  backdrop-filter: blur(8px);
}
.icon-button.glass {
  border-radius: 999px;
}
.button.glass:hover,
.icon-button.glass:hover {
  background: var(--surface);
}

/* Toasts sit just above the mobile navigation and never cover page headings. */
#toast {
  font-size: var(--text-sm);
  border-radius: 14px;
  bottom: 24px;
}
@media (max-width: 760px) {
  #toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
  body:has(.app-shell.is-workout) #toast {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    font-size: 11px;
  }
}

/* Brooke as a small portrait beside guidance */
.brooke-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.brooke-note-face {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--green-soft);
}
.brooke-note strong {
  display: block;
  font-size: var(--text-sm);
  color: var(--green);
}
.brooke-note p {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Speech bubbles shared by Today, workout and finish */
.hero-bubble,
.brooke-dialogue {
  background: var(--surface);
  color: var(--ink);
  border-radius: 20px 20px 20px 6px;
  box-shadow: var(--bubble-shadow);
  padding: 14px 16px;
}
.bubble-name {
  display: block;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 4px;
}
.hero-line {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ---------- Today ---------- */
.page-home {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.home-hero {
  position: relative;
  min-height: 440px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--green-soft) var(--room) 30% 64% / cover no-repeat;
  isolation: isolate;
}
.home-hero .hero-character {
  position: absolute;
  right: -4%;
  bottom: 64px;
  width: 62%;
  height: calc(100% - 84px);
  z-index: 0;
}
.home-hero .hero-bubble {
  position: absolute;
  left: 16px;
  top: 16px;
  width: min(58%, 380px);
  z-index: 1;
}
.home-hero .hero-bubble p:not(.hero-line) {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.home-hero .hero-actions {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: var(--space-2);
  z-index: 1;
}
.home-hero .hero-actions .primary {
  flex: 1 1 auto;
  min-height: 52px;
  font-size: 15px;
}
.home-hero .hero-actions .glass {
  flex: none;
  min-height: 52px;
}

.week-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.week-card .section-heading {
  margin-bottom: var(--space-3);
  color: var(--ink);
}
.week-card h2 {
  font-size: var(--text-lg);
}
.week-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.week-strip li {
  min-height: 58px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: var(--text-sm);
  font-weight: 800;
}
.week-strip li i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.week-strip li small {
  font-size: 10.5px;
  font-weight: 800;
}
.week-strip li .icon {
  width: 15px;
  height: 15px;
  stroke-width: 3;
}
.week-strip li.done {
  background: var(--green);
  color: var(--surface);
}
.week-strip li.today:not(.done) {
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--green);
  color: var(--green);
}

.activity-icon.peach {
  background: var(--peach);
  color: var(--art-color-8a4b2c);
}
.activity-icon.blue {
  background: var(--blue);
  color: var(--art-color-2c5470);
}
.activity-icon.sage {
  background: var(--green-soft);
  color: var(--green);
}
:root[data-theme='dark'] .activity-icon.peach,
:root[data-theme='dark'] .activity-icon.blue {
  color: var(--ink);
}
.page-home .quiet-note {
  text-align: center;
}
@media (min-width: 1000px) {
  .home-hero {
    min-height: 480px;
  }
  .home-hero .hero-character {
    right: 6%;
    width: 46%;
    bottom: 24px;
    height: calc(100% - 40px);
  }
  .home-hero .hero-bubble {
    left: 40px;
    top: 48px;
    width: 400px;
    padding: 20px 22px;
  }
  .home-hero .hero-line {
    font-size: 28px;
  }
  .home-hero .hero-actions {
    left: 40px;
    right: auto;
    bottom: 40px;
    width: 400px;
  }
}
@media (max-width: 760px) {
  .page-home {
    gap: var(--space-4);
  }
  
  .page.page-home {
    padding-top: 4px;
  }
}
@media (max-width: 400px) {
  .home-hero {
    min-height: 420px;
  }
  .home-hero .hero-bubble {
    width: 64%;
  }
  .hero-line {
    font-size: 20px;
  }
}

/* ---------- Workout mode ---------- */
.app-shell.is-workout .sidebar,
.app-shell.is-workout .topbar,
.app-shell.is-workout .bottom-nav,
.app-shell.is-workout .resume-strip {
  display: none;
}
.app-shell.is-workout .main-column {
  margin-left: 0;
}
.page.page-workout {
  max-width: none;
  margin: 0;
  padding: 0;
}
.player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
  min-height: 100dvh;
}
.workout-stage {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--green-soft), var(--surface-2));
  isolation: isolate;
}
.workout-stage.has-room {
  background: var(--green-soft) var(--room) 40% 72% / cover no-repeat;
}
.stage-topline {
  position: absolute;
  z-index: 3;
  left: 24px;
  right: 24px;
  top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
}
.workout-progress {
  flex: 1 1 auto;
  display: flex;
  gap: 4px;
  min-width: 0;
}
.workout-progress span {
  flex: 1 1 0;
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.workout-progress span.done {
  background: var(--green);
}
.workout-progress span.current {
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--green);
}
.workout-progress span.skipped {
  background: color-mix(in srgb, var(--muted) 45%, transparent);
}
.stage-chip {
  flex: none;
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--glass);
  font-size: var(--text-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stage-tools {
  position: absolute;
  z-index: 3;
  right: 24px;
  top: 72px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 60%;
}
.stage-tools .button {
  min-height: 40px;
  padding: 8px 14px;
  font-size: var(--text-sm);
}
.stage-tools .icon-button {
  width: 40px;
  height: 40px;
}
.workout-companion {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: 120px;
  bottom: 70px;
}
.brooke-dialogue {
  position: absolute;
  z-index: 2;
  left: 28px;
  top: 128px;
  width: min(280px, 30%);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.3;
}
.brooke-dialogue .bubble-name {
  font-family: var(--font-sans);
}
.stage-count {
  position: absolute;
  z-index: 2;
  right: 28px;
  top: 128px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--glass);
  box-shadow: var(--bubble-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.stage-count small {
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.stage-count strong {
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
}
.stage-bottom {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 48px));
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--glass);
  font-size: 14px;
  text-align: center;
}
/* Enlargement is a desktop control; rotating or resizing must restore phone framing. */
@media (min-width: 1001px) {
  .page-workout.is-brooke-large .workout-companion {
    top: 40px;
    bottom: 8px;
  }
  .page-workout.is-brooke-large .stage-bottom {
    display: none;
  }
}

.player-sheet {
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.player-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.player-heading > div:first-child {
  min-width: 0;
}
.player-heading .eyebrow {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-heading h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.1;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.player-heading.long-title h1 {
  font-size: 22px;
}
.player-goal {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.mode-switch {
  flex: none;
  display: flex;
  padding: 3px;
  border-radius: 13px;
  background: var(--surface-2);
}
.mode-switch button {
  min-height: 40px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--muted);
}
.mode-switch button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px var(--art-color-233c3724);
}
.player-counter {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--surface-2);
}
.counter-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: none;
}
.counter-value strong {
  font-size: 54px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.counter-value span {
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
}
.counter-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.counter-meta p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
}
.counter-meta .text-button {
  min-height: 36px;
}
.pace-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 3.5ch;
  align-items: center;
  gap: 12px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.pace-control input {
  width: 100%;
  accent-color: var(--green);
  min-height: 32px;
}
.pace-control output {
  font-weight: 800;
  color: var(--ink);
  text-align: right;
}
.player-primary-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.player-primary-controls .button {
  min-height: 56px;
  border-radius: 18px;
  font-size: 16px;
}
.player-primary-controls .primary {
  flex: 1 1 auto;
}
.player-primary-controls .wide {
  flex: 1 1 100%;
}
.player-primary-controls .subtle {
  flex: 1 1 100%;
  min-height: 44px;
  font-size: 14px;
}
.player-primary-controls .pause-button {
  flex: none;
  width: 56px;
  padding: 0;
}
.player-primary-controls .pause-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.rest-card {
  display: flex;
  align-items: center;
  gap: 18px;
}
.rest-ring {
  position: relative;
  width: 116px;
  height: 116px;
  flex: none;
}
.rest-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.rest-ring circle {
  fill: none;
  stroke-width: 10;
}
.ring-track {
  stroke: var(--surface-2);
}
.ring-value {
  stroke: var(--green);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s linear;
}
.rest-ring > div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.rest-ring strong {
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.rest-ring span {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--muted);
}
.rest-next strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-top: 2px;
}
.rest-next p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.rest-controls .secondary {
  flex: none;
  padding: 0 18px;
}
.player-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.player-actions button {
  min-height: 60px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink);
}
.player-actions button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.player-actions .icon {
  width: 19px;
  height: 19px;
  color: var(--green);
}
.player-sheet .previous-box {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-2);
  margin: 0;
}
.player-sheet .previous-box p {
  margin: 4px 0 0;
  font-size: 14px;
}
.session-results {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
}
.session-results summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.session-results summary span {
  font-weight: 600;
  color: var(--muted);
}
.session-results[open] {
  padding-bottom: 8px;
}
.player-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.player-footer .text-button {
  font-size: 14px;
}
.player-sheet .quiet-note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

@media (max-width: 1000px) {
  .player {
    display: block;
    min-height: 0;
  }
  .workout-stage {
    position: relative;
    height: clamp(250px, calc(100svh - 346px), 560px);
  }
  .stage-topline {
    left: 14px;
    right: 14px;
    top: 12px;
    gap: 10px;
  }
  .stage-tools {
    top: 64px;
    right: 14px;
  }
  .stage-tools .stage-option,
.stage-tools .desktop-enlarge {
    display: none;
  }
  .workout-companion {
    top: 56px;
    bottom: 32px;
  }
  .workout-stage:has(.brooke-dialogue) .workout-companion {
    left: 34%;
  }
  .brooke-dialogue {
    left: 14px;
    top: 64px;
    width: 40%;
    max-width: 220px;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 16px 16px 16px 6px;
  }
  .stage-count {
    left: 14px;
    right: auto;
    top: auto;
    bottom: 44px;
    width: 84px;
    height: 84px;
  }
  .stage-count strong {
    font-size: 30px;
  }
  .stage-bottom {
    display: none;
  }
  .player-sheet {
    position: relative;
    margin-top: -26px;
    border-left: 0;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -10px 30px var(--art-color-233c371a);
    padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
    gap: 14px;
    z-index: 4;
  }
  .player-heading h1 {
    font-size: 25px;
  }
  .player-heading.long-title h1 {
    font-size: 20px;
  }
  .player-goal {
    font-size: var(--text-sm);
    margin-top: 2px;
  }
  .player-counter {
    padding: 10px 14px;
  }
  .counter-value strong {
    font-size: 44px;
  }
  .rest-ring {
    width: 100px;
    height: 100px;
  }
  .rest-ring strong {
    font-size: 26px;
  }
}
@media (max-width: 1000px) and (max-height: 700px) {
  .workout-stage {
    height: clamp(220px, calc(100svh - 330px), 560px);
  }
  .brooke-dialogue {
    font-size: 14px;
  }
  .player-sheet {
    gap: 12px;
  }
}
@media (max-width: 400px) {
  .mode-switch button {
    padding: 0 8px;
  }
  .player-heading h1 {
    font-size: 22px;
  }
}

/* ---------- Finished ---------- */
.finish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
  min-height: 100dvh;
}
.finish-stage {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--green-soft) var(--room) 60% 70% / cover no-repeat;
  overflow: hidden;
}
.finish-art {
  position: absolute;
  inset: 120px 0 40px;
}
.finish-bubble {
  position: absolute;
  left: 28px;
  top: 40px;
  width: min(320px, 40%);
}
.finish-copy {
  background: var(--surface);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.finish-copy h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.1;
}
.finish-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}
.finish-stats > span {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-2);
  font-size: var(--text-sm);
  color: var(--muted);
}
.finish-stats strong {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.finish-copy > .primary {
  min-height: 56px;
  border-radius: 18px;
  font-size: 16px;
}
.finish-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.finish-secondary .button {
  font-size: var(--text-sm);
}
@media (max-width: 1000px) {
  .finish-layout {
    display: block;
    min-height: 0;
  }
  .finish-stage {
    position: relative;
    height: clamp(300px, 46svh, 480px);
  }
  .finish-art {
    inset: 40px 0 34px 34%;
  }
  .finish-bubble {
    left: 14px;
    top: 56px;
    width: 46%;
  }
  .finish-bubble .hero-line {
    font-size: 18px;
  }
  .finish-copy {
    position: relative;
    margin-top: -26px;
    border-radius: 26px 26px 0 0;
    padding: 22px 16px calc(28px + env(safe-area-inset-bottom));
    gap: 14px;
  }
  .finish-copy h1 {
    font-size: 28px;
  }
}

/* ---------- Bottom-sheet dialogs on phones, with steppers ---------- */
@media (max-width: 760px) {
  dialog.modal[open] {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    max-height: 92dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }
}
.stepper-field > label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 6px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper input {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  min-height: 56px;
}
.stepper-button {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.stepper-button:hover {
  background: var(--green-soft);
}

@media (prefers-reduced-motion: reduce) {
  .workout-companion,
.ring-value {
    transition: none;
  }
}

/* Follow mode: Brooke's count lives beside her; the sheet holds the person's choices. */
.player-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.player-target p {
  margin: 0;
  flex: 1 1 200px;
}
.player-target .text-button {
  min-height: 40px;
}
.set-inputs:has(.stepper-field) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.set-fields:has(.stepper-field) .set-number {
  display: none;
}

/* Compact speech bubbles that sit beside Brooke, never across her. */
.hero-bubble,
.brooke-dialogue {
  padding: 10px 13px;
  border-radius: 16px 16px 16px 5px;
}
.bubble-name {
  font-size: 11px;
  margin-bottom: 2px;
}
.hero-line {
  font-size: 18px;
}
.home-hero .hero-bubble {
  width: min(46%, 300px);
}
.home-hero .hero-bubble p:not(.hero-line) {
  margin-top: 4px;
  font-size: var(--text-sm);
}
.home-hero .hero-character {
  right: -10%;
  width: 62%;
}
.brooke-dialogue {
  width: min(230px, 24%);
  font-size: 16px;
  line-height: 1.3;
}
@media (min-width: 1000px) {
  .home-hero .hero-bubble {
    width: 320px;
    padding: 14px 16px;
  }
  .home-hero .hero-line {
    font-size: 22px;
  }
  .home-hero .hero-character {
    right: 6%;
    width: 46%;
  }
}
@media (max-width: 1000px) {
  .workout-stage:has(.brooke-dialogue) .workout-companion {
    left: 38%;
  }
  .brooke-dialogue {
    width: 36%;
    max-width: 170px;
    font-size: 14px;
    padding: 8px 11px;
  }
  .finish-art {
    inset: 40px 0 34px 36%;
  }
  .finish-bubble {
    width: 38%;
  }
  .finish-bubble .hero-line {
    font-size: 16px;
  }
}

/* In a short landscape stage, keep the counter clear of the speech bubble and form button. */
@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
  .stage-count {
    left: auto;
    right: 14px;
    top: 108px;
    bottom: auto;
  }
}

/* Watch Brooke: keep the movement name to one line so it never reaches her feet. */
.watch-scene-bottom {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 760px) {
  .watch-scene-bottom {
    font-size: 14px;
  }
}

/* ---------- Secondary screens ---------- */
/* Section tabs read as tabs; date ranges become one compact segmented control. */
.tab-strip:not(.range-tabs) {
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 0;
  margin-bottom: 18px;
  mask-image: linear-gradient(90deg, var(--art-color-000) 88%, transparent);
}
.tab-strip:not(.range-tabs) button {
  border-radius: 0;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 -3px 0 transparent;
}
.tab-strip:not(.range-tabs) button.active {
  background: none;
  color: var(--ink);
  font-weight: 800;
  box-shadow: inset 0 -3px 0 var(--green);
}
.range-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 3px;
  border-radius: 13px;
  background: var(--surface-2);
  overflow: visible;
  max-width: 520px;
}
.range-tabs button {
  min-height: 40px;
  padding: 6px 4px;
  border-radius: 10px;
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
}
.range-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px var(--art-color-233c3724);
}

/* Settings: jump links to each group */
.jump-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: -8px 0 20px;
  padding: 2px;
}
.jump-chips button {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
}
.jump-chips button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.settings-grid > section {
  scroll-margin-top: 16px;
}

/* Quick log: search, then Brooke's encouragement */
.exercise-search {
  margin-bottom: 18px;
}
.exercise-search > label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 6px;
}
.exercise-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.exercise-search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.exercise-search-box .icon {
  color: var(--muted);
}
.exercise-search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-size: 16px;
  min-height: 48px;
  outline: none;
  color: var(--ink);
}
.exercise-search-results {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.exercise-search-results:empty {
  display: none;
}
.exercise-search-results button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  text-align: left;
  font-weight: 700;
  color: var(--ink);
}
.exercise-search-results button:hover {
  background: var(--green-soft);
}
.exercise-search-results button .icon {
  color: var(--green);
}
.exercise-search-results small {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
}
.quick-brooke {
  margin-top: 16px;
}

/* Steps & cardio action buttons: equal size, one line each */
.page-cardio .heading-actions,
.page-cardio .cardio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 760px) {
  .page-heading {
    flex-wrap: wrap;
  }
  .page-heading .heading-actions {
    width: 100%;
  }
}
.page-cardio .page-heading {
  display: block;
}
.page-cardio .page-heading .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.page-cardio .page-heading .button-row .button {
  flex: 1 1 0;
  min-width: 110px;
  white-space: nowrap;
}
.range-toolbar {
  flex-wrap: wrap;
}
.page-heading .muted {
  font-size: 14px;
}
.quick-layout > * {
  min-width: 0;
}
.exercise-search-box input {
  width: 100%;
}

/* Brooke occupies the window by default; the workout dock holds only the next action. */
.player.immersive-workout,
.finish-layout.immersive-finish {
  --workout-dock-height: 108px;
  position: relative;
  display: block;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}
.immersive-workout .workout-stage,
.immersive-finish .finish-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}
.immersive-workout .workout-companion,
.immersive-workout .workout-stage:has(.brooke-dialogue) .workout-companion,
.immersive-finish .finish-art {
  inset: calc(76px + env(safe-area-inset-top, 0px)) 3% calc(var(--workout-dock-height) + 28px + env(safe-area-inset-bottom, 0px));
}
.immersive-workout .stage-topline {
  top: max(12px, env(safe-area-inset-top, 0px));
  left: max(14px, env(safe-area-inset-left, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
}
.immersive-workout .stage-topline .stage-tools {
  position: static;
  max-width: none;
  flex: none;
  margin: 0;
}
.immersive-workout .workout-progress {
  margin: 0;
}
.immersive-workout .stage-count,
.immersive-workout .stage-rest {
  position: absolute;
  left: auto;
  right: max(18px, env(safe-area-inset-right, 0px));
  top: calc(76px + env(safe-area-inset-top, 0px));
  bottom: auto;
  width: 84px;
  height: 84px;
  z-index: 2;
}
.immersive-workout .stage-count strong {
  font-size: 30px;
  margin: 3px 0;
}
.immersive-workout .stage-count.is-timer strong {
  font-size: 24px;
}
.immersive-workout .stage-count small {
  font-size: 11px;
}
.immersive-workout .stage-rest {
  border-radius: 50%;
  background: var(--glass);
}
.immersive-workout .stage-rest strong {
  font-size: 23px;
}
.immersive-workout .brooke-dialogue {
  left: max(18px, env(safe-area-inset-left, 0px));
  top: calc(76px + env(safe-area-inset-top, 0px));
  width: min(240px, 25%);
  max-width: none;
  padding: 10px 12px;
  font-size: 16px;
}
.immersive-workout .player-sheet,
.immersive-finish .finish-copy {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(960px, calc(100% - 28px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: stretch;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--bubble-shadow);
}
.workout-dock-main,
.finish-dock-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 320px);
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.immersive-workout .player-heading {
  display: block;
  margin: 0;
  min-width: 0;
}
.immersive-workout .player-heading .eyebrow,
.immersive-finish .finish-dock-main .eyebrow {
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.immersive-workout .player-heading h1,
.immersive-finish .finish-copy h1 {
  margin: 3px 0;
  font-size: 24px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.immersive-workout .player-goal,
.immersive-finish .finish-totals {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.immersive-workout .player-goal {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.immersive-workout .player-primary-controls {
  flex-wrap: nowrap;
  gap: 8px;
}
.immersive-workout .player-primary-controls .button,
.immersive-finish .finish-dock-main > .button {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 13px;
  font-size: 14px;
  white-space: nowrap;
}
.immersive-workout .player-primary-controls .pause-button {
  width: 48px;
  padding: 0;
}
.workout-details > summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 100%;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}
.workout-details > summary::-webkit-details-marker {
  display: none;
}
.workout-details > summary:hover,
.workout-details[open] > summary {
  background: var(--green-soft);
  border-color: var(--green);
}
.workout-details-panel {
  position: absolute;
  left: auto;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(520px, 100%);
  max-height: calc(100dvh - var(--workout-dock-height) - 90px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 20px;
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--bubble-shadow);
}
.workout-details-panel h2 {
  margin: 0;
  font-size: 20px;
}
.workout-details-panel .mode-switch {
  width: fit-content;
}
.workout-details-panel .player-target {
  display: block;
}
.workout-details-panel .player-target p {
  margin-bottom: 4px;
}
.workout-details-panel .previous-box {
  padding: 12px;
}
.workout-scene-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.workout-scene-options .button,
.workout-details-panel .player-actions button {
  min-height: 44px;
  font-size: 12px;
}
.immersive-finish .finish-exit {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: max(14px, env(safe-area-inset-left, 0px));
  z-index: 3;
}
.immersive-finish .finish-bubble {
  left: max(18px, env(safe-area-inset-left, 0px));
  top: calc(76px + env(safe-area-inset-top, 0px));
  width: min(250px, 30%);
}
.immersive-finish .finish-bubble .hero-line {
  font-size: 18px;
}
@media (max-width: 760px) {
  .player.immersive-workout,
.finish-layout.immersive-finish {
    --workout-dock-height: 142px;
  }
  .immersive-workout .player-sheet,
.immersive-finish .finish-copy {
    width: calc(100% - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
  }
  .workout-dock-main,
.finish-dock-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }
  .immersive-workout .player-heading h1,
.immersive-finish .finish-copy h1 {
    font-size: 21px;
  }
  .immersive-workout .player-primary-controls .button,
.immersive-finish .finish-dock-main > .button {
    min-height: 44px;
    padding: 9px 10px;
    font-size: 13px;
  }
  .immersive-workout .player-primary-controls .pause-button {
    width: 44px;
  }
  .immersive-workout .brooke-dialogue {
    width: calc(100% - 118px);
    top: calc(70px + env(safe-area-inset-top, 0px));
    font-size: 14px;
    padding: 8px 10px;
  }
  .immersive-workout .stage-count,
.immersive-workout .stage-rest {
    top: calc(70px + env(safe-area-inset-top, 0px));
    right: 14px;
    width: 74px;
    height: 74px;
  }
  .immersive-workout .workout-companion,
.immersive-workout .workout-stage:has(.brooke-dialogue) .workout-companion {
    inset: calc(150px + env(safe-area-inset-top, 0px)) 3% calc(var(--workout-dock-height) + 20px + env(safe-area-inset-bottom, 0px));
  }
  .immersive-finish .finish-art {
    inset: calc(122px + env(safe-area-inset-top, 0px)) 3% calc(var(--workout-dock-height) + 20px + env(safe-area-inset-bottom, 0px));
  }
  .immersive-finish .finish-bubble {
    top: calc(64px + env(safe-area-inset-top, 0px));
    left: 72px;
    width: calc(100% - 90px);
    padding: 8px 10px;
  }
  .workout-details-panel {
    width: 100%;
    padding: 16px;
    max-height: calc(100dvh - var(--workout-dock-height) - 80px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .workout-dock-main,
.finish-dock-main {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    gap: 12px;
  }
  .immersive-workout .player-heading h1,
.immersive-finish .finish-copy h1 {
    font-size: 19px;
  }
  .immersive-workout .brooke-dialogue {
    top: 68px;
    width: min(210px, 30%);
    font-size: 13px;
  }
  .immersive-workout .stage-count,
.immersive-workout .stage-rest {
    top: 68px;
    width: 70px;
    height: 70px;
  }
  .immersive-workout .workout-companion,
.immersive-workout .workout-stage:has(.brooke-dialogue) .workout-companion,
.immersive-finish .finish-art {
    inset: 64px 18% calc(var(--workout-dock-height) + 20px + env(safe-area-inset-bottom, 0px));
  }
  .immersive-finish .finish-bubble {
    left: 18px;
    top: 68px;
    width: min(210px, 30%);
    padding: 8px 10px;
  }
  .immersive-finish .finish-bubble .hero-line {
    font-size: 15px;
  }
}

/* Secondary routine and backup actions stay available without competing with starting. */
.routine-options {
  position: relative;
}
.routine-options > summary {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  list-style: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.routine-options > summary::-webkit-details-marker {
  display: none;
}
.routine-options > summary .icon {
  width: 15px;
  height: 15px;
}
.routine-options[open] > summary {
  background: var(--green-soft);
}
.routine-options-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 6;
  width: min(210px, calc(50vw - 32px));
  display: grid;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--bubble-shadow);
}
.routine-options-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px;
  border-radius: 7px;
  text-align: left;
  font-size: 13px;
}
.routine-options-menu button:hover {
  background: var(--surface-2);
}
.routine-options-menu button .icon {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
}
.quick-layout.quick-layout-simple {
  grid-template-columns: minmax(0, 1fr);
  max-width: 820px;
}
.quick-layout-simple .quick-brooke {
  padding: 0 8px;
}
.backup-options {
  margin-top: 16px;
}
.backup-options .backup-actions {
  margin-top: 12px;
}
/* ---------- Brooke at the centre (round 2) ----------
   Brooke fills the first screen of the app and of Today; every page opens
   with her portrait and one line, and the header stays quiet. */

/* Saving status: only speak up when something needs attention. */
.save-status:not(.failed) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Every page opens with Brooke's portrait and one line from her. */
.page-heading h1 {
  margin-bottom: 12px;
}
.brooke-says {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
}
.brooke-says-face {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--green-soft);
  box-shadow: 0 0 0 3px var(--surface), 0 4px 14px var(--art-color-233c3722);
}
.brooke-says p {
  margin: 0;
  padding: 10px 14px;
  border-radius: 16px 16px 16px 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
}

/* Welcome: Brooke is the first thing anyone sees. */
.welcome {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 1fr);
  background: var(--bg);
}
.welcome-stage {
  position: relative;
  min-height: 100dvh;
  background: var(--green-soft) var(--room) 40% 68% / cover no-repeat;
  overflow: hidden;
}
.welcome-stage .brand {
  position: absolute;
  z-index: 2;
  left: 24px;
  top: 20px;
  padding: 6px 12px 6px 6px;
  border-radius: 14px;
  background: var(--glass);
  font-size: 22px;
}
.welcome-character {
  position: absolute;
  inset: 90px 0 24px 30%;
}
.welcome-bubble {
  position: absolute;
  z-index: 2;
  left: 24px;
  top: 96px;
  width: min(300px, 36%);
}
.welcome-bubble .hero-line {
  font-size: 24px;
}
.welcome-bubble p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.welcome-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  background: var(--surface);
}
.welcome-form .button {
  min-height: 54px;
  font-size: 16px;
}
.profile-list {
  display: grid;
  gap: 8px;
}
.welcome .local-note {
  margin: 8px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}
.welcome .local-note .text-button {
  display: inline-flex;
  min-height: 44px;
  font-size: var(--text-sm);
}
@media (max-width: 760px) {
  .welcome {
    display: block;
  }
  .welcome-stage {
    min-height: 0;
    height: max(430px, calc(100svh - 270px));
  }
  .welcome-stage .brand {
    left: 14px;
    top: 12px;
    font-size: 19px;
  }
  .welcome-character {
    inset: 64px -8% 34px 38%;
  }
  .welcome-bubble {
    left: 14px;
    top: 72px;
    width: 46%;
  }
  .welcome-bubble .hero-line {
    font-size: 18px;
  }
  .welcome-bubble p {
    font-size: var(--text-sm);
  }
  .welcome-form {
    position: relative;
    margin-top: -26px;
    border-radius: 26px 26px 0 0;
    padding: 22px 16px calc(24px + env(safe-area-inset-bottom));
    gap: 10px;
  }
}

/* Today: Brooke fills the screen; one clear action; the week underneath. */
.page.page-home {
  gap: 16px;
}
.home-hero {
  min-height: 0;
  height: clamp(460px, calc(100svh - 300px), 720px);
}
.home-hero .hero-character {
  left: 30%;
  right: -6%;
  width: auto;
  top: 16px;
  bottom: 112px;
  height: auto;
}
.home-hero .hero-actions {
  left: 16px;
  right: 16px;
  bottom: 16px;
  width: auto;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.home-hero .hero-actions .primary {
  min-height: 56px;
  border-radius: 18px;
  font-size: 17px;
  white-space: nowrap;
}
.hero-alt {
  align-self: center;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--glass);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.last-session {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.last-session > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.last-session strong {
  display: block;
  font-size: 14px;
}
.last-session small {
  font-size: var(--text-sm);
  color: var(--muted);
}
.last-session > .icon {
  color: var(--muted);
}
@media (min-width: 1000px) {
  .home-hero {
    height: clamp(520px, calc(100dvh - 330px), 680px);
  }
  .home-hero .hero-character {
    left: 40%;
    right: 4%;
    top: 24px;
    bottom: 24px;
  }
  .home-hero .hero-actions {
    left: 40px;
    right: auto;
    bottom: 40px;
    width: 340px;
  }
  .home-hero .hero-bubble {
    left: 40px;
    top: 48px;
    width: 340px;
  }
  .week-card {
    max-width: none;
  }
}

/* Workouts: two quiet actions at the end instead of a header button. */
.make-your-own {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.make-your-own-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.plan-notice {
  margin: 12px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: center;
}

/* More: one simple list instead of uneven tiles. */
.more-grid {
  display: grid;
  gap: 8px;
  max-width: 640px;
}
.more-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--ink);
}
.more-card > .icon:first-child {
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green);
  box-sizing: border-box;
}
.more-card h2 {
  font-size: 16px;
  margin: 0;
}
.more-card p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
}
.more-card > .icon:last-child {
  grid-column: 3;
  grid-row: 1 / 3;
  color: var(--muted);
}

/* Workouts: keep routine cards short. */
.routine-card > p.muted.small-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Quick log: the picker already names a single exercise. */
.page-quick .log-entries > .log-exercise:only-child .section-heading .log-exercise-title,
.page-quick .log-entries > .log-exercise:only-child .section-heading .eyebrow {
  display: none;
}
.page-quick .log-entries > .log-exercise:only-child .section-heading {
  margin: 0;
}
.page-quick .set-inputs {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/* ---------- Overlays on Brooke's room follow the theme ----------
   Everything that floats over the room artwork (bubbles, chips, round
   buttons, the count and rest badges, Watch's back and full-screen
   buttons) shares one surface: cream in light mode, deep green in dark.
   Several earlier rules hard-coded a cream fill with dark text, which
   became dark-on-dark in the dark theme; !important keeps this single
   source of truth above those scattered, more specific rules. */
:root {
  --overlay-bg: color-mix(in srgb, var(--surface) 94%, transparent);
  --overlay-ink: var(--ink);
}
:is(
    .watch-back,
    .watch-fullscreen,
    .watch-scene-label span,
    .watch-scene-bottom,
    .stage-chip,
    .stage-count,
    .stage-rest,
    .brooke-dialogue,
    .hero-bubble,
    .hero-alt,
    .page-workout :is(.stage-topline, .stage-tools, .finish-stage) :is(.icon-button, .button)
  ) {
  background: var(--overlay-bg) !important;
  color: var(--overlay-ink) !important;
  border-color: transparent !important;
}
:is(.watch-back, .watch-fullscreen, .page-workout .stage-topline .icon-button) .icon {
  color: inherit;
  stroke: currentColor;
}
.bubble-name {
  color: var(--green) !important;
}
:root[data-theme='dark'] {
  --bubble-shadow: 0 10px 30px var(--art-color-0008);
}
:root[data-theme='dark'] .home-hero .hero-actions .primary,
:root[data-theme='dark'] .page-workout .player-primary-controls .primary {
  box-shadow: 0 6px 20px var(--art-color-0006);
}

/* Contrast fixes found by the theme audit. */
:root:not([data-theme='dark']) {
  --muted: var(--art-color-59695f);
}
:root[data-theme='dark'] .brand-mark {
  color: var(--art-color-0f201b);
}
