/* 3 Flame Fit brand tokens, sampled from the official phoenix logo. The bird
   runs violet -> blue, the barbell and flame orange -> gold. Ember is the
   brand default; the other four themes stay available to members. */
:root {
  --brand-violet: #8b5cf6;
  --brand-blue: #2f7be0;
  --brand-orange: #f5762a;
  --brand-gold: #ffd24a;
  --bg: #0b0d12;
  --card: rgba(255, 255, 255, 0.065);
  --card2: rgba(255, 255, 255, 0.035);
  --text: #f7f8fb;
  --muted: #9299a8;
  --primary: #f5762a;
  --secondary: #ffc342;
  --danger: #ff5a65;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "Segoe UI",
    sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body,
#app {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}
body {
  overscroll-behavior-y: none;
}
.shell {
  min-height: 100dvh;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, var(--primary) 14%, transparent) 0,
      transparent 34%
    ),
    radial-gradient(
      circle at 0 90%,
      color-mix(in srgb, var(--secondary) 9%, transparent) 0,
      transparent 34%
    );
}
button,
input,
select,
textarea {
  font: inherit;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 20px 10px;
  max-width: 860px;
  margin: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}
.avatar {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: 800;
}
.main {
  width: min(100%, 860px);
  margin: auto;
  padding: 8px 16px 30px;
}
.eyebrow {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.hero {
  padding: 20px 4px 12px;
}
.hero h1,
.page-title {
  font-size: clamp(2rem, 7vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -2px;
  margin: 8px 0 10px;
}
.hero p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 24px 4px 12px;
}
.section-head h2 {
  font-size: 1.05rem;
  margin: 0;
}
.section-head span {
  color: var(--muted);
  font-size: 0.8rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.day-grid {
  display: grid;
  gap: 13px;
}
.day-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
}
.day-card:active {
  transform: scale(0.985);
}
.day-num {
  display: grid;
  place-items: center;
  flex: 0 0 70px;
  height: 70px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #07090c;
  font-size: 1.65rem;
  font-weight: 950;
}
.day-num small {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 1.5px;
  margin-bottom: -8px;
}
.day-copy {
  min-width: 0;
}
.day-copy h3 {
  margin: 0 0 3px;
  font-size: 1.12rem;
}
.day-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.day-copy .meta {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 8px;
}
.chev {
  margin-left: auto;
  color: var(--muted);
  font-size: 1.5rem;
}
.weekly {
  padding: 18px;
  margin-top: 16px;
}
.weekly-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.progress-track {
  height: 8px;
  margin-top: 12px;
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.bottom-nav {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(7, 9, 13, 0.92) 26%);
}
.nav-inner {
  width: min(100%, 520px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 7px;
  border-radius: 22px;
  background: rgba(18, 21, 29, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(18px);
}
.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  border-radius: 15px;
  font-size: 0.7rem;
  font-weight: 700;
}
.nav-btn span {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 2px;
}
.nav-btn.active {
  color: #090b0e;
  background: var(--primary);
}
.back {
  border: 0;
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 13px;
}
.workout-head {
  padding: 14px 4px 18px;
}
.workout-head h1 {
  margin: 6px 0;
  font-size: 2.3rem;
  letter-spacing: -1.5px;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  padding: 7px 10px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}
.primary-btn,
.secondary-btn,
.danger-btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 850;
  cursor: pointer;
}
.primary-btn {
  color: #07090b;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.secondary-btn {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
}
.danger-btn {
  color: #fff;
  background: var(--danger);
}
.full {
  width: 100%;
}
.start-btn {
  margin: 8px 0 16px;
}
.exercise-list {
  display: grid;
  gap: 11px;
}
.exercise {
  padding: 0;
  overflow: hidden;
}
.exercise-toggle {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: start;
  text-align: left;
  padding: 17px;
  border: 0;
  background: transparent;
  color: var(--text);
}
.exercise-index {
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 800;
  padding-top: 3px;
}
.exercise-copy {
  flex: 1;
}
.exercise-copy h3 {
  font-size: 0.97rem;
  margin: 0 0 4px;
}
.exercise-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}
.exercise-body {
  padding: 0 17px 17px;
  border-top: 1px solid var(--line);
}
.purpose {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 12px 0;
}
.metric {
  text-align: center;
  padding: 9px 4px;
  border-radius: 12px;
  background: var(--card2);
}
.metric small {
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 1px;
}
.metric strong {
  font-size: 0.85rem;
}
.set-head,
.set-row {
  display: grid;
  grid-template-columns: 34px 1fr 1fr 42px;
  gap: 8px;
  align-items: center;
}
.set-head {
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 12px 0 5px;
}
.set-row {
  margin: 7px 0;
}
.set-num {
  text-align: center;
  font-weight: 800;
}
.field {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 10px;
  text-align: center;
}
.check {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}
.check.done {
  background: var(--primary);
  color: #07090b;
  border-color: var(--primary);
}
.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 11px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  padding: 11px;
  font-weight: 800;
}
.cues {
  margin: 14px 0 0;
  padding: 12px 12px 10px;
  background: var(--card2);
  border-radius: 13px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}
.cues summary {
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}
.finish {
  margin: 18px 0;
}
.cardio {
  padding: 18px;
  margin-top: 12px;
}
.cardio h3 {
  margin: 0 0 6px;
  color: var(--primary);
}
.cardio p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.form-card {
  padding: 18px;
  margin-bottom: 14px;
}
.form-card label {
  display: block;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.3px;
  margin: 0 0 7px;
}
.form-card input,
.form-card select,
.form-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
  padding: 13px;
}
.theme-list {
  display: grid;
  gap: 9px;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 15px;
  background: var(--card2);
  color: var(--text);
  padding: 11px;
  text-align: left;
}
.theme-option.selected {
  border-color: var(--primary);
}
.theme-dot {
  width: 35px;
  height: 35px;
  border-radius: 50%;
}
.theme-option small {
  display: block;
  color: var(--muted);
}
.theme-check {
  margin-left: auto;
  color: var(--primary);
}
.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.file-label {
  display: block;
  text-align: center;
}
.privacy-note {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}
.chart-card {
  padding: 18px;
}
.chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chart-title small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  margin-top: 3px;
}
.segment {
  display: flex;
  padding: 3px;
  border-radius: 11px;
  background: var(--card2);
  border: 1px solid var(--line);
}
.segment button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 7px 9px;
  border-radius: 8px;
}
.segment button.active {
  background: var(--primary);
  color: #080a0d;
}
.chart-wrap {
  height: 250px;
  margin-top: 15px;
}
.chart-wrap canvas {
  width: 100%;
  height: 100%;
}
.empty {
  padding: 34px 12px;
  text-align: center;
  color: var(--muted);
}
.empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.history {
  display: grid;
  gap: 8px;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  background: var(--card2);
  border-radius: 14px;
}
.history-icon {
  color: var(--primary);
}
.history-row strong {
  display: block;
  font-size: 0.88rem;
}
.history-row small {
  color: var(--muted);
}
.history-sets {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
}
.onboarding {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at 80% 10%, rgba(245, 118, 42, 0.2), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(139, 92, 246, 0.16), transparent 42%), #0b0d12;
}
.onboard-inner {
  width: min(100%, 480px);
}
.onboard-logo {
  width: 104px;
  height: 104px;
  object-fit: contain;
  display: block;
  margin-bottom: 4px;
}
.onboarding h1 {
  font-size: 3.2rem;
  line-height: 0.96;
  letter-spacing: -3px;
  margin: 26px 0 14px;
}
.onboarding p {
  color: var(--muted);
  line-height: 1.55;
}
.onboarding input {
  width: 100%;
  margin: 14px 0 10px;
  padding: 15px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--card);
  color: white;
}
.toast {
  position: fixed;
  z-index: 99;
  left: 50%;
  bottom: 110px;
  transform: translate(-50%, 20px);
  padding: 11px 16px;
  border-radius: 13px;
  background: #f5f7f8;
  color: #090b0d;
  font-weight: 750;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.22s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
[data-theme="obsidian"] {
  --bg: #050506;
  --primary: #f0444d;
  --secondary: #9e111b;
  --text: #faf7f7;
  --muted: #b7aeb0;
}
[data-theme="obsidian"] .shell {
  background:
    radial-gradient(circle at 92% 4%, rgba(213, 31, 43, 0.34), transparent 38%),
    radial-gradient(circle at 8% 88%, rgba(128, 10, 18, 0.2), transparent 42%),
    linear-gradient(145deg, #050506 0%, #100607 58%, #26080b 100%);
}
[data-theme="obsidian"]
  :is(
    .primary-btn,
    .day-num,
    .nav-btn.active,
    .check.done,
    .segment button.active,
    .rate-scale button.on,
    .wk-dot.on
  ) {
  color: #fff;
}
[data-theme="neon"] {
  --primary: #3be55a;
  --secondary: #b4ff3c;
}
[data-theme="aurora"] {
  --primary: #9b7cff;
  --secondary: #44e4ff;
}
[data-theme="ember"] {
  --primary: #f5762a;
  --secondary: #ffc342;
}
[data-theme="minimal"] {
  --bg: #f1f3f7;
  --card: #fff;
  --card2: #f4f6f9;
  --text: #17191d;
  --muted: #69717e;
  --primary: #2d6de8;
  --secondary: #7656e8;
  --line: rgba(20, 25, 35, 0.1);
  --shadow: 0 14px 45px rgba(35, 45, 65, 0.09);
  color-scheme: light;
}
[data-theme="minimal"] .shell {
  background: var(--bg);
}
[data-theme="minimal"] .nav-inner {
  background: rgba(255, 255, 255, 0.95);
}
[data-theme="minimal"] .bottom-nav {
  background: linear-gradient(transparent, rgba(241, 243, 247, 0.94) 28%);
}
[data-theme="minimal"] .field,
[data-theme="minimal"] .form-card input,
[data-theme="minimal"] .form-card select {
  background: #fff;
}
@media (min-width: 700px) {
  .day-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .day-card {
    display: block;
  }
  .day-num {
    margin-bottom: 14px;
  }
  .chev {
    position: absolute;
    right: 18px;
    top: 36px;
  }
  .exercise-list {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .topbar {
    padding-top: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Admin-only phone diary and workout preference switch. */
.preference-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text) !important;
  letter-spacing: 0 !important;
  font-size: 0.88rem !important;
}
.preference-toggle span {
  min-width: 0;
}
.preference-toggle strong,
.preference-toggle small {
  display: block;
}
.preference-toggle small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.4;
  margin-top: 3px;
}
.preference-toggle input {
  width: 22px !important;
  height: 22px;
  flex: none;
  accent-color: var(--primary);
}
.diary-calendar {
  padding: 14px;
  margin-bottom: 16px;
}
.diary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.diary-head button {
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 1.2rem;
}
.diary-weekdays,
.diary-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.diary-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 0.6rem;
  padding: 4px 0;
}
.diary-cell {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--card2);
  color: var(--text);
}
.diary-cell.blank {
  background: transparent;
}
.diary-cell.busy {
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}
.diary-cell.selected {
  background: var(--primary);
  color: #08090c;
}
.diary-cell small {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 0.55rem;
  font-weight: 900;
}
.booking-list {
  display: grid;
  gap: 9px;
}
.booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px;
}
.booking-row strong,
.booking-row small {
  display: block;
}
.booking-row small {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 3px;
}
.booking-row select {
  max-width: 112px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card2);
  color: var(--text);
  padding: 8px;
}
.member-allowances,
.payment-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.member-allowance,
.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.member-allowance strong,
.member-allowance small,
.payment-row strong,
.payment-row small {
  display: block;
}
.member-allowance small,
.payment-row small {
  color: var(--muted);
  font-size: 0.7rem;
}
.allowance {
  flex: none;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.7rem;
  font-weight: 850;
}
.allowance.ok {
  background: rgba(59, 229, 90, 0.14);
  color: #68ef7e;
}
.allowance.none {
  background: rgba(255, 90, 101, 0.16);
  color: #ff7e87;
}
.payment-row b {
  font-size: 0.78rem;
  color: var(--primary);
}

/* Progress filters and the set log. Day chips narrow the exercise list; the
   exercise row scrolls sideways so a long library stays one thumb-swipe away
   rather than hidden behind a dropdown. */
.filter-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.filter-chip {
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--muted);
  border-radius: 99px;
  padding: 8px 15px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #08090c;
  font-weight: 850;
}
.ex-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ex-scroll::-webkit-scrollbar {
  height: 4px;
}
.ex-scroll::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
}
.ex-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--muted);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.ex-chip.active {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  border-color: var(--primary);
  color: var(--text);
  font-weight: 800;
}
.log-list {
  display: grid;
  gap: 6px;
}
.log-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  background: var(--card2);
  border-radius: 12px;
  padding: 11px 13px;
}
.log-date {
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 52px;
}
.log-weight {
  font-size: 1rem;
  font-weight: 850;
  color: var(--primary);
}
.log-weight small {
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 1px;
}
.log-reps {
  font-size: 0.8rem;
  color: var(--text);
}
.log-set {
  font-size: 0.7rem;
  color: var(--muted);
}

/* Sync status line on the profile screen. */
.sync-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--card2);
  border-radius: 13px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-left: 3px solid var(--muted);
}
.sync-line strong {
  font-size: 0.92rem;
}
.sync-line small {
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.45;
}
.sync-line.ok {
  border-left-color: #3fb980;
}
.sync-line.warn {
  border-left-color: #f5b93e;
}

/* Add-to-home-screen prompt. iOS gets instructions (no programmatic install
   exists there); Android gets a real button backed by beforeinstallprompt. */
.install-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  margin: 4px 0 16px;
  background: color-mix(in srgb, var(--primary) 11%, var(--card));
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
}
.install-copy {
  flex: 1;
  min-width: 0;
}
.install-copy strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 3px;
}
.install-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}
.ios-share {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 5px;
  font-size: 0.74rem;
  color: var(--text);
}
.install-go {
  flex: 0 0 auto;
  padding: 10px 16px;
  font-size: 0.85rem;
}
.install-dismiss {
  position: absolute;
  top: 7px;
  right: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}

/* Streak and achievements on the Progress screen. */
.streak-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px;
  margin-bottom: 16px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 20%, var(--card)),
    var(--card)
  );
  border-color: color-mix(in srgb, var(--primary) 34%, transparent);
}
.streak-num {
  font-size: 2.6rem;
  font-weight: 950;
  letter-spacing: -2px;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-width: 52px;
  text-align: center;
}
.streak-copy {
  flex: 1;
  min-width: 0;
}
.streak-copy strong {
  display: block;
  font-size: 1rem;
}
.streak-copy small {
  color: var(--muted);
  font-size: 0.8rem;
}
.wk-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.wk-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.wk-dot.on {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #08090c;
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.badge-grid.scrolls {
  max-height: 214px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.badge-grid.scrolls::-webkit-scrollbar {
  width: 5px;
}
.badge-grid.scrolls::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
}
.badge-cell {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
}
.badge-cell.got {
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  background: color-mix(in srgb, var(--primary) 11%, transparent);
}
.badge-ico {
  display: block;
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 7px;
  filter: grayscale(1);
  opacity: 0.35;
}
.badge-cell.got .badge-ico {
  filter: none;
  opacity: 1;
}
.badge-cell strong {
  display: block;
  font-size: 0.74rem;
  margin-bottom: 2px;
}
.badge-cell small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.25;
  display: block;
}
.badge-cell.legendary {
  border-color: #e9bd54;
  background: radial-gradient(circle at 50% 20%, rgba(255, 183, 35, 0.2), rgba(25, 12, 6, 0.82));
  box-shadow: inset 0 0 18px rgba(255, 190, 54, 0.12);
}
.badge-art {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  margin: 0 auto 7px;
  filter: drop-shadow(0 0 8px rgba(255, 177, 35, 0.35));
}
.special-heading h2 {
  color: #efc45e;
}
.special-achievements {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-color: #d9ab48;
  background: linear-gradient(145deg, rgba(76, 35, 5, 0.72), rgba(11, 7, 8, 0.92));
  box-shadow: 0 0 28px rgba(232, 169, 43, 0.1);
}
.special-badge {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  border: 1px solid rgba(238, 190, 88, 0.32);
  border-radius: 18px;
  background: radial-gradient(circle at 12% 50%, rgba(255, 155, 24, 0.15), transparent 43%);
}
.special-badge img {
  flex: none;
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 177, 35, 0.38));
}
.special-badge div {
  min-width: 0;
}
.special-badge span {
  display: block;
  color: #eec45f;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
}
.special-badge strong {
  display: block;
  font-size: 1rem;
  color: #fff2bd;
}
.special-badge small {
  display: block;
  color: #cfbfa9;
  font-size: 0.72rem;
  line-height: 1.4;
  margin-top: 4px;
}

/* Achievement reveal: fire followed by the gold phoenix. */
.achievement-unlock {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 24px;
  background:
    radial-gradient(circle at 50% 70%, rgba(190, 43, 8, 0.54), transparent 43%),
    linear-gradient(180deg, #030305 0%, #100505 72%, #290702 100%);
  text-align: center;
  color: #fff;
}
.achievement-close {
  position: absolute;
  z-index: 3;
  top: calc(16px + env(safe-area-inset-top));
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 211, 111, 0.55);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #f5ca6d;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.achievement-rise {
  position: relative;
  width: min(76vw, 370px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  animation: phoenix-rise 2.4s cubic-bezier(0.18, 0.8, 0.2, 1) both;
}
.achievement-rise img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(255, 160, 25, 0.52));
  animation: gold-pulse 2.4s ease-in-out 2.2s infinite alternate;
}
.achievement-fire {
  position: absolute;
  z-index: 1;
  bottom: -8%;
  width: 78%;
  height: 46%;
  border-radius: 50% 50% 35% 35%;
  background: radial-gradient(
    ellipse at 50% 100%,
    #fff2a2 0 8%,
    #ffb21c 20%,
    #f04a0b 48%,
    rgba(155, 16, 3, 0.4) 70%,
    transparent 72%
  );
  filter: blur(5px);
  transform-origin: 50% 100%;
  animation: fire-bloom 1.45s ease-out both;
}
.achievement-embers {
  position: absolute;
  inset: 24% 8% 15%;
  background-image:
    radial-gradient(circle, #ffd36a 0 2px, transparent 3px),
    radial-gradient(circle, #ff761c 0 1.5px, transparent 2.5px);
  background-size:
    91px 113px,
    67px 89px;
  animation: embers-rise 3.2s linear infinite;
  opacity: 0.75;
}
.achievement-copy {
  position: relative;
  z-index: 2;
  animation: award-copy 0.8s ease-out 1.7s both;
}
.achievement-copy span {
  color: #f4c65f;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.22em;
}
.achievement-copy h1 {
  margin: 8px 0 6px;
  font-size: clamp(2rem, 9vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  background: linear-gradient(#fff4bd, #e7ad3a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.achievement-copy p {
  max-width: 420px;
  margin: 12px auto 0;
  color: #f4d8b0;
  line-height: 1.5;
}
.special-award-card > img {
  display: block;
  width: 108px;
  height: 108px;
  object-fit: contain;
  margin: 4px auto 8px;
  filter: drop-shadow(0 0 12px rgba(255, 184, 47, 0.32));
}
.special-award-card > div {
  text-align: center;
  margin-bottom: 14px;
}
.special-award-card > div > strong {
  color: #efc45e;
  font-size: 1.1rem;
}
@keyframes phoenix-rise {
  0% {
    opacity: 0;
    transform: translateY(52%) scale(0.42);
    filter: brightness(2);
  }
  45% {
    opacity: 1;
  }
  72% {
    transform: translateY(-3%) scale(1.04);
  }
  100% {
    transform: none;
  }
}
@keyframes fire-bloom {
  0% {
    opacity: 0;
    transform: scale(0.2, 0.05);
  }
  45% {
    opacity: 1;
    transform: scale(1.15, 1.3);
  }
  100% {
    opacity: 0.72;
    transform: scale(1);
  }
}
@keyframes embers-rise {
  from {
    transform: translateY(18%);
  }
  to {
    transform: translateY(-22%);
    background-position:
      18px -90px,
      -10px -70px;
  }
}
@keyframes award-copy {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes gold-pulse {
  from {
    filter: drop-shadow(0 0 12px rgba(255, 160, 25, 0.35));
  }
  to {
    filter: drop-shadow(0 0 29px rgba(255, 190, 45, 0.68));
  }
}
@media (prefers-reduced-motion: reduce) {
  .achievement-rise,
  .achievement-rise img,
  .achievement-fire,
  .achievement-embers,
  .achievement-copy {
    animation: none !important;
  }
  .achievement-embers {
    display: none;
  }
}

/* Expandable workout history */
.history-item {
  background: var(--card2);
  border-radius: 14px;
  overflow: hidden;
}
.history-item + .history-item {
  margin-top: 8px;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 13px;
  cursor: pointer;
}
.history-chev {
  color: var(--muted);
  font-size: 1rem;
  margin-left: 2px;
}
.history-detail {
  padding: 0 13px 14px;
  border-top: 1px solid var(--line);
}
.hd-compare {
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  margin: 11px 0;
}
.hd-compare.up {
  background: color-mix(in srgb, #3fb980 16%, transparent);
  color: #57d69b;
}
.hd-compare.down {
  background: color-mix(in srgb, #f5b93e 15%, transparent);
  color: #f5c76b;
}
.hd-compare.same {
  background: var(--card2);
  color: var(--muted);
  font-weight: 600;
}
.hd-ex {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.hd-ex-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}
.hd-ex-head strong {
  font-size: 0.85rem;
}
.delta {
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 99px;
  padding: 2px 8px;
  margin-left: auto;
}
.delta.up {
  background: color-mix(in srgb, #3fb980 18%, transparent);
  color: #57d69b;
}
.delta.down {
  background: color-mix(in srgb, #f06a5a 16%, transparent);
  color: #f08e80;
}
.delta.same {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}
.hd-sets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.hd-set {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 0.76rem;
  color: var(--muted);
}
.hd-set em {
  font-style: normal;
  font-size: 0.62rem;
  opacity: 0.75;
  margin-left: 1px;
}

/* Header lockup links back to the website. */
.brand {
  text-decoration: none;
  color: inherit;
}

/* Post-workout rating scales */
.rate-scale {
  display: flex;
  gap: 5px;
}
.rate-scale button {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.rate-scale button.on {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #08090c;
  border-color: transparent;
}

.rate-q {
  margin: -2px 0 11px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}
.rate-anchors {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}
.rate-anchors span:last-child {
  text-align: right;
}

/* Streak pause */
.pause-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.pause-card > div:first-child {
  flex: 1;
  min-width: 180px;
}
.pause-card strong {
  display: block;
  font-size: 0.92rem;
}
.pause-card small {
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.45;
}
.pause-opts {
  display: flex;
  gap: 7px;
}
.pause-opts .secondary-btn {
  padding: 10px 14px;
  font-size: 0.85rem;
}

/* coaching mode */
/* Deliberately loud. Logging a set onto the wrong person's account is the one
   mistake this screen must never let happen quietly. */
.coach-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(59, 229, 90, 0.16), rgba(59, 229, 90, 0.05));
  border: 1px solid rgba(59, 229, 90, 0.42);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.coach-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3be55a;
  box-shadow: 0 0 0 4px rgba(59, 229, 90, 0.18);
  flex: none;
  animation: coach-pulse 2.4s ease-in-out infinite;
}
@keyframes coach-pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(59, 229, 90, 0.06);
  }
}
.coach-who {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.coach-who small {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: #3be55a;
  font-weight: 700;
}
.coach-who strong {
  font-size: 1rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coach-who em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coach-exit {
  flex: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.coach-exit:hover {
  background: rgba(255, 255, 255, 0.14);
}

.admin-preview-search {
  width: 100%;
  margin: 4px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card2);
  color: var(--text);
  font: inherit;
}
.client-row[hidden] {
  display: none;
}
.admin-preview-label {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.admin-preview-banner {
  border-color: rgba(255, 190, 80, 0.48);
  background: linear-gradient(135deg, rgba(255, 190, 80, 0.18), rgba(255, 190, 80, 0.05));
}
.admin-preview-banner .coach-who small {
  color: #f4c65f;
}
.admin-preview-exercise {
  display: flex;
  gap: 15px;
  padding: 17px;
  margin-bottom: 10px;
}
.admin-preview-exercise .exercise-index {
  flex: none;
}
.admin-preview-exercise h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}
.admin-preview-exercise p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.admin-preview-history {
  padding: 18px;
  margin-top: 18px;
}
.admin-preview-history h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}
.admin-preview-session {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}
.admin-preview-session small {
  color: var(--muted);
  white-space: nowrap;
}
.admin-preview-document {
  display: block;
  text-align: center;
  text-decoration: none;
  margin: 0 0 18px;
}

.coach-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin-bottom: 18px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
}
.coach-cta:hover {
  border-color: var(--primary);
}
.coach-cta-icon {
  font-size: 1.3rem;
  color: var(--primary);
  flex: none;
}
.coach-cta-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.coach-cta-copy strong {
  font-size: 0.98rem;
}
.coach-cta-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.client-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.client-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  cursor: pointer;
}
.client-row:hover {
  border-color: var(--primary);
}
.client-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0b0d12;
}
.client-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.client-copy strong {
  font-size: 0.95rem;
}
.client-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar.coaching {
  box-shadow: 0 0 0 2px #3be55a;
}

/* Coach's note at the end of a PT session. */
.note-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}
.note-input:focus {
  outline: none;
  border-color: var(--primary);
}
.note-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.note-actions .ghost-btn {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 600;
  cursor: pointer;
}
.note-actions .ghost-btn:hover {
  color: var(--text);
  border-color: var(--text);
}
.note-actions .primary-btn {
  flex: 1;
}
/* Destructive, and it should look it. */
.danger-btn {
  border-color: rgba(255, 90, 90, 0.4);
  color: #ff8080;
}
.danger-btn:hover {
  background: rgba(255, 90, 90, 0.12);
  border-color: rgba(255, 90, 90, 0.7);
}

/* A note from the coach, on the screen they land on. */
.notes-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin-bottom: 18px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
}
.notes-card:hover {
  border-color: var(--primary);
}
.notes-card.unread {
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
}
.notes-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.notes-head small {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--primary);
  font-weight: 700;
}
.notes-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.notes-preview {
  margin: 0 0 9px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notes-more {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.note-item {
  padding: 14px 16px;
}
.note-item .note-meta {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.note-item p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Flexible activity, weight and nutrition tracking. */
.track-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
  width: 100%;
  min-width: 0;
}
.track-form > * {
  min-width: 0;
  max-width: 100%;
}
.track-form input[type="date"],
.track-form input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  inline-size: 100%;
  max-width: 100%;
  max-inline-size: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 13px;
  font-size: inherit;
  line-height: normal;
  text-align: left;
  overflow: hidden;
  justify-self: stretch;
}
.track-form input[type="date"]::-webkit-date-and-time-value,
.track-form input[type="datetime-local"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}
.track-form input[type="date"]::-webkit-calendar-picker-indicator,
.track-form input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 2px;
  max-width: 18px;
}
.track-form textarea,
.track-form button,
.track-form > label {
  grid-column: 1/-1;
}
.track-form .track-wide {
  grid-column: 1/-1;
}
.track-form.single {
  grid-template-columns: minmax(0, 1fr);
}
.track-form.compact {
  grid-template-columns: 1fr 1fr auto;
}
.track-form.compact button {
  grid-column: auto;
}
.macro-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 8px;
  margin-top: 12px;
}
.macro-ring {
  text-align: center;
  min-width: 0;
}
.macro-dial {
  width: 58px;
  height: 58px;
  margin: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--primary) var(--fill), rgba(255, 255, 255, 0.08) 0);
}
.macro-dial:after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--card);
}
.macro-dial strong {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
}
.macro-ring small {
  display: block;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 6px;
}
.macro-ring span {
  display: block;
  color: var(--muted);
  font-size: 0.6rem;
  margin-top: 2px;
  white-space: nowrap;
}
.track-list {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.track-history {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.track-history strong,
.track-history small {
  display: block;
}
.track-history small,
.track-history > span {
  color: var(--muted);
  font-size: 0.72rem;
}
.weight-edit-btn {
  flex: none;
  padding: 7px 11px;
  font-size: 0.72rem;
}
.weight-due {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
}
.weight-due strong,
.weight-due small {
  display: block;
}
.weight-due small {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 3px;
}
.wheel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
}
.wheel-row[hidden] {
  display: none;
}
.wheel-row label,
.track-form .unit-switch {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: none;
}
.wheel-row label span,
.unit-switch span {
  display: block;
  margin-bottom: 5px;
}
.wheel-row select {
  font-size: 1.05rem;
  text-align: center;
  max-height: 140px;
}
.rest-adjuster {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  margin: 12px 0;
  border-radius: 13px;
  background: var(--card2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 750;
}
.rest-adjuster > span:first-child {
  flex: 1;
}
.rest-adjuster small {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
  max-width: 120px;
  line-height: 1.3;
}
.rest-wheel {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rest-wheel select {
  width: 76px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 8px;
  text-align: center;
  font-weight: 850;
}
.rest-wheel b {
  color: var(--muted);
  font-size: 0.68rem;
}
@media (max-width: 520px) {
  .rest-adjuster {
    flex-wrap: wrap;
  }
  .rest-adjuster small {
    flex-basis: 100%;
    max-width: none;
  }
}
@media (max-width: 420px) {
  .track-form,
  .track-form.compact {
    grid-template-columns: 1fr;
  }
  .track-form.compact button {
    grid-column: 1;
  }
  .weight-due {
    align-items: flex-start;
    flex-direction: column;
  }
}
.calorie-card {
  overflow: hidden;
}
.cal-legend {
  display: flex;
  gap: 14px;
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 0.68rem;
}
.cal-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.cal-legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}
.cal-legend .base {
  background: color-mix(in srgb, var(--primary) 55%, var(--card2));
}
.cal-legend .active {
  background: var(--secondary);
}
.cal-scroll {
  overflow-x: auto;
  padding: 4px 0 8px;
}
.cal-chart {
  height: 210px;
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 7px;
  align-items: end;
  min-width: 100%;
}
.cal-chart.month {
  grid-template-columns: repeat(30, 30px);
  min-width: 1040px;
}
.cal-day {
  height: 100%;
  display: grid;
  grid-template-rows: 20px 1fr 22px;
  align-items: end;
  text-align: center;
}
.cal-total {
  font-size: 0.58rem;
  color: var(--muted);
  overflow: hidden;
}
.cal-column {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 8px 8px 3px 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
}
.cal-column i {
  display: block;
  flex: none;
}
.cal-base {
  background: color-mix(in srgb, var(--primary) 55%, var(--card2));
}
.cal-activity {
  background: var(--secondary);
}
.cal-day small {
  font-size: 0.58rem;
  color: var(--muted);
  padding-top: 6px;
}
.calorie-today {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px;
  margin-bottom: 14px;
}
.calorie-today strong,
.calorie-today small {
  display: block;
}
.calorie-today strong {
  font-size: 1.8rem;
  letter-spacing: -1px;
  margin: 5px 0 2px;
}
.calorie-today small {
  color: var(--muted);
  font-size: 0.7rem;
}
.calorie-today .secondary-btn {
  flex: none;
}
@media (max-width: 420px) {
  .calorie-today {
    align-items: flex-start;
    flex-direction: column;
  }
  .calorie-today .secondary-btn {
    width: 100%;
  }
}

/* Per-session and future workout exercise editing. */
.add-exercise-btn {
  margin-top: 12px;
}
.exercise-picker {
  margin-top: 12px;
  padding: 17px;
}
.picker-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
}
.picker-head h3 {
  margin: 4px 0 12px;
}
.picker-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--card2);
  padding: 4px;
  border-radius: 13px;
  margin-bottom: 14px;
}
.type-switch button {
  border: 0;
  border-radius: 10px;
  padding: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.type-switch button.active {
  background: var(--primary);
  color: #08090c;
}
.picker-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}
.picker-label select,
.picker-label input,
.picker-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card2);
  color: var(--text);
  padding: 12px;
}
.picker-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 12px 0;
}
.picker-fields label {
  color: var(--muted);
  font-size: 0.72rem;
}
.scope-choice {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  margin: 12px 0;
  padding: 12px;
}
.scope-choice legend {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0 5px;
}
.scope-choice label {
  font-size: 0.86rem;
}
.picker-help {
  color: var(--muted);
  font-size: 0.74rem;
}
.remove-exercise {
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: #ff8080;
  padding: 7px 0;
  font-weight: 750;
  cursor: pointer;
}
.undo-bar {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f7f8;
  color: #090b0d;
  border-radius: 13px;
  padding: 11px 14px;
  margin-bottom: 12px;
  font-weight: 750;
}
.undo-bar button {
  border: 0;
  background: transparent;
  color: #b04418;
  font-weight: 900;
  cursor: pointer;
}
.cardio-log {
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: end;
  gap: 10px;
  margin-top: 13px;
}
.cardio-log label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.7rem;
}
.cardio-log .field {
  text-align: left;
}
.removed-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.removed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card2);
  border-radius: 12px;
  padding: 11px 12px;
}
.removed-row span {
  flex: 1;
  min-width: 0;
}
.removed-row strong,
.removed-row small {
  display: block;
}
.removed-row small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 3px;
}
.removed-row .secondary-btn {
  padding: 8px 12px;
  font-size: 0.76rem;
}
.effort-picker {
  border: 0;
  padding: 0;
  margin: 2px 0 4px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
.effort-picker legend {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.effort-picker legend small {
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}
.effort-picker label {
  min-width: 0;
  cursor: pointer;
}
.effort-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.effort-picker span {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card2);
  color: var(--muted);
  padding: 9px 3px;
  font-size: 0.65rem;
  line-height: 1.15;
  font-weight: 750;
}
.effort-picker input:checked + span {
  background: color-mix(in srgb, var(--primary) 18%, var(--card2));
  border-color: var(--primary);
  color: var(--text);
}
.calorie-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.calorie-actions .secondary-btn {
  padding: 10px 12px;
}
.expenditure-date {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  margin-bottom: 12px;
}
.expenditure-date label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.7rem;
}
.expenditure-date input {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card2);
  color: var(--text);
  padding: 10px;
}
.expenditure-date div {
  text-align: right;
}
.expenditure-date small,
.expenditure-date strong {
  display: block;
}
.expenditure-date small {
  color: var(--muted);
  font-size: 0.68rem;
}
.expenditure-date strong {
  font-size: 1.35rem;
  margin-top: 3px;
}
.expenditure-list {
  display: grid;
  gap: 8px;
}
.expenditure-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  background: var(--card2);
  border-radius: 12px;
  padding: 11px 12px;
}
.expenditure-row strong,
.expenditure-row small {
  display: block;
}
.expenditure-row small {
  color: var(--muted);
  font-size: 0.68rem;
  margin-top: 3px;
}
.expenditure-row > b {
  color: var(--primary);
  white-space: nowrap;
}
.expenditure-row .secondary-btn,
.expenditure-row .primary-btn {
  padding: 8px 11px;
  font-size: 0.75rem;
}
.calorie-edit {
  display: flex;
  align-items: center;
  gap: 5px;
}
.calorie-edit input {
  width: 72px;
  border: 1px solid var(--primary);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  padding: 8px;
  text-align: right;
}
.calorie-edit span {
  color: var(--muted);
  font-size: 0.7rem;
}
@media (max-width: 460px) {
  .calorie-today {
    align-items: flex-start;
    flex-direction: column;
  }
  .calorie-actions {
    width: 100%;
  }
  .calorie-actions button {
    flex: 1;
  }
  .expenditure-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .expenditure-row > button {
    grid-column: 2;
  }
  .calorie-edit {
    grid-column: 2;
  }
}
.shell:has(.admin-test-banner) {
  padding-top: 52px;
}
.admin-test-banner {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  min-height: 52px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #fff4cf;
  color: #17120b;
  box-shadow: 0 4px 18px #0005;
  font-size: 0.79rem;
  text-align: center;
}
.admin-test-banner button {
  flex: none;
  border: 0;
  border-radius: 9px;
  background: #17120b;
  color: white;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}
.goal-field {
  min-width: 0;
}
.goal-field label {
  display: block;
  margin: 0 0 6px;
}
.goal-field input {
  width: 100%;
}
.cues strong {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
}
.cues ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.cues li {
  margin: 4px 0;
}
.cues-note {
  margin: 10px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.cues-note b {
  display: block;
  color: var(--text);
  margin-bottom: 3px;
}
.load-guidance {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.8rem;
}
.load-guidance select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
}
.load-guidance small {
  color: var(--muted);
  line-height: 1.5;
}
.themed-entry {
  padding: 20px;
  margin-top: 18px;
}
.themed-entry a {
  display: inline-block;
  text-decoration: none;
}
.custom-workout-entry {
  margin-top: 18px;
  padding: 20px;
}
.custom-workout-entry h2 {
  margin: 0 0 8px;
}
.custom-workout-entry p {
  color: var(--muted);
  line-height: 1.5;
}
#custom-workout-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}
#custom-workout-form label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}
#custom-workout-form input,
#custom-workout-form select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.day-builder-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}
.day-builder-actions .add-exercise-btn {
  margin-top: 0;
}
.day-builder-empty {
  padding: 22px;
  margin: 16px 0;
  color: var(--muted);
}
.day-builder-empty h2 {
  color: var(--text);
  margin: 0 0 8px;
}
.scope-choice[hidden] {
  display: none;
}
.completed-day {
  margin: 18px 0;
}
.completed-day summary {
  cursor: pointer;
  font-weight: 750;
}
#day-activity-form label,
#completed-day-form label {
  display: grid;
  gap: 7px;
}
@media (max-width: 420px) {
  .day-builder-actions {
    grid-template-columns: 1fr;
  }
}
.diary-customer summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--primary);
  padding: 6px 0;
}
.diary-customer label {
  display: grid;
  gap: 8px;
}
