:root {
  color-scheme: dark;
  --bg: #090b0f;
  --bg-deep: #050609;
  --surface: #12151b;
  --surface-raised: #191d25;
  --surface-soft: #20252f;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f7ef;
  --muted: #969da7;
  --muted-bright: #c3c8cf;
  --lime: #c8ff38;
  --lime-dark: #182200;
  --violet: #9178ff;
  --amber: #ffb84d;
  --danger: #ff6f61;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --nav-touch-row: 64px;
  --nav-top-padding: 6px;
  --nav-safe-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  --nav-height: calc(1px + var(--nav-top-padding) + var(--nav-touch-row) + var(--nav-safe-bottom));
  --max-width: 680px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  scroll-behavior: smooth;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 100% -10%, rgba(145, 120, 255, 0.13), transparent 29rem),
    var(--bg);
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

input,
textarea {
  font-size: 16px;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}

img,
svg {
  -webkit-user-drag: none;
  user-select: none;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

/* Dialogtitel erhalten beim Öffnen bewusst den Fokus, damit iOS nicht sofort
   ein Eingabefeld samt Tastatur aktiviert. Sie sind keine Bedienelemente und
   brauchen deshalb keinen sichtbaren Browser-Fokusrahmen. */
.sheet-content [tabindex="-1"]:focus {
  outline: none;
}

button:active,
.primary-action:active,
.secondary-action:active {
  transform: scale(0.98);
}

[hidden] {
  display: none !important;
}

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

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  display: grid;
  width: min(100%, var(--max-width));
  height: 100%;
  min-height: 0;
  margin-inline: auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: rgba(9, 11, 15, 0.9);
  overscroll-behavior: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  background: rgba(9, 11, 15, 0.86);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(5, 6, 9, 0.22);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--lime);
  box-shadow: 0 8px 24px rgba(200, 255, 56, 0.12);
  object-fit: cover;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.icon-button,
.round-action,
.session-exit {
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted-bright);
  background: var(--surface);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.app-main {
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.view {
  width: 100%;
  height: 100%;
  padding: 10px max(18px, env(safe-area-inset-right)) 34px max(18px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  touch-action: pan-y;
  animation: view-in 260ms ease both;
}

.view,
.checkin-main,
.session-main,
.sheet-content {
  scrollbar-width: none;
}

.view::-webkit-scrollbar,
.checkin-main::-webkit-scrollbar,
.session-main::-webkit-scrollbar,
.sheet-content::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-row,
.section-heading,
.split-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.welcome-row {
  min-height: 92px;
  margin: 4px 2px 22px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 530px;
  margin-bottom: 0;
  font-size: clamp(32px, 9vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: 23px;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.live-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-bright);
  background: var(--surface);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(200, 255, 56, 0.12);
}

.hero-card {
  position: relative;
  min-height: 460px;
  padding: 20px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: #0b0d0e;
  background: var(--lime);
  box-shadow: 0 18px 60px rgba(200, 255, 56, 0.1);
}

.hero-card::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(9, 11, 15, 0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(9, 11, 15, 0.055) 1px, transparent 1px);
  background-size: 30px 30px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.hero-topline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pill-dark {
  color: var(--lime);
  background: #0b0d0e;
  border-color: #0b0d0e;
}

.pill-dark .status-dot {
  box-shadow: none;
}

.hero-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.hero-visual {
  position: absolute;
  top: 54px;
  right: -22px;
  display: grid;
  width: 260px;
  height: 260px;
  place-items: center;
}

.hero-visual svg {
  z-index: 1;
  width: 94px;
  height: 94px;
  stroke-width: 1;
  transform: rotate(-12deg);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(9, 11, 15, 0.22);
  border-radius: 50%;
}

.orbit-one {
  width: 178px;
  height: 178px;
}

.orbit-two {
  width: 250px;
  height: 250px;
  border-style: dashed;
  animation: rotate-orbit 26s linear infinite;
}

@keyframes rotate-orbit {
  to { transform: rotate(360deg); }
}

.hero-copy {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 104px;
  left: 20px;
}

.hero-copy p {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.hero-copy h2 {
  max-width: 340px;
  margin-bottom: 7px;
  font-size: clamp(36px, 11vw, 58px);
  line-height: 0.89;
  letter-spacing: -0.06em;
}

.hero-copy span {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.7;
}

.night-intel-home {
  margin-top: 12px;
}

.intel-home-card {
  position: relative;
  min-height: 220px;
  padding: 21px;
  overflow: hidden;
  border: 1px solid rgba(145, 120, 255, 0.34);
  border-radius: var(--radius-lg);
  background: #11131a;
}

.intel-home-card::before {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 8px, rgba(145, 120, 255, 0.025) 9px 10px);
  content: "";
  pointer-events: none;
}

.intel-home-head,
.intel-home-meta,
.signal-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.intel-badge {
  display: inline-flex;
  min-height: 34px;
  padding: 0 11px;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  color: var(--violet);
  background: rgba(145, 120, 255, 0.11);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.intel-badge svg {
  width: 16px;
  height: 16px;
}

.intel-confidence {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.intel-home-card h2 {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 28px 0 8px;
  font-size: clamp(28px, 8vw, 40px);
}

.intel-home-card > p {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.intel-home-meta {
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted-bright);
  font-size: 11px;
}

.intel-home-meta button {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action,
.secondary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 68px;
  padding: 0 20px;
  border: 0;
  border-radius: 19px;
  color: #0a0c0d;
  background: var(--lime);
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}

.primary-action-dark {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  left: 14px;
  width: calc(100% - 28px);
  color: var(--text);
  background: #0b0d0e;
}

.primary-action svg,
.secondary-action svg {
  width: 25px;
  height: 25px;
}

.section-block {
  margin-top: 42px;
}

.section-heading {
  margin: 0 2px 17px;
}

.goal-count {
  color: var(--lime);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.text-button {
  min-height: 44px;
  padding: 0 3px 0 14px;
  border: 0;
  color: var(--muted-bright);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-bottom: 16px;
}

.week-day {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.week-day span {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  max-width: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  font-size: 12px;
}

.week-day.is-today span {
  border-color: var(--line-strong);
  color: var(--text);
}

.week-day.is-done span {
  color: #0b0d0e;
  background: var(--lime);
  border-color: var(--lime);
}

.week-day.is-done span::before {
  content: "✓";
}

.week-day.is-done span {
  font-size: 0;
}

.week-day.is-done span::before {
  font-size: 17px;
  font-weight: 950;
}

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

.stat-card {
  display: flex;
  min-width: 0;
  min-height: 123px;
  padding: 14px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.stat-card span,
.stat-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.stat-card strong {
  margin-top: auto;
  font-size: clamp(25px, 7vw, 34px);
  letter-spacing: -0.05em;
}

.accent-stat {
  border-color: rgba(145, 120, 255, 0.3);
  background: rgba(145, 120, 255, 0.1);
}

.empty-card,
.recent-card,
.weight-display {
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: inherit;
  background: var(--surface);
  text-align: left;
}

.empty-card {
  color: var(--muted);
}

.empty-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 16px;
}

.empty-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.recent-card-top,
.recent-meta,
.history-top,
.note-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recent-card-top strong {
  font-size: 18px;
}

.recent-card-top span,
.recent-meta span {
  color: var(--muted);
  font-size: 12px;
}

.recent-meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.gym-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.gym-map {
  position: relative;
  height: 170px;
  overflow: hidden;
  background-color: #1c2025;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.11) 1px, transparent 1.4px);
  background-size: 17px 17px;
}

.street {
  position: absolute;
  display: block;
  height: 16px;
  border: 3px solid #2a3038;
  border-right: 0;
  border-left: 0;
  background: #111419;
  transform-origin: center;
}

.street-one {
  top: 60px;
  left: -40px;
  width: 470px;
  transform: rotate(-17deg);
}

.street-two {
  top: 62px;
  left: 38%;
  width: 260px;
  transform: rotate(68deg);
}

.street-three {
  top: 122px;
  left: -30px;
  width: 240px;
  transform: rotate(8deg);
}

.map-pin {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 7px solid rgba(200, 255, 56, 0.15);
  border-radius: 50%;
  color: #090b0f;
  background: var(--lime);
  background-clip: padding-box;
  transform: translate(-50%, -50%);
}

.gym-details {
  padding: 20px;
}

.gym-details p {
  margin: 12px 0 19px;
  color: var(--muted-bright);
  font-size: 14px;
}

.gym-facts {
  display: flex;
  margin-bottom: 20px;
  flex-direction: column;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.gym-facts span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gym-facts svg {
  width: 18px;
  height: 18px;
  color: var(--lime);
}

.studio-info-link {
  display: flex;
  min-height: 52px;
  margin-top: 6px;
  align-items: center;
  justify-content: center;
  color: var(--muted-bright);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.gym-details .studio-source-note {
  margin: -5px 7px 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.secondary-action {
  min-height: 60px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.page-intro {
  margin: 22px 2px 28px;
}

.page-intro h1 {
  margin-bottom: 15px;
}

.page-intro > p:last-child {
  max-width: 510px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.coach-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
  padding: 17px;
  border: 1px solid rgba(255, 184, 77, 0.22);
  border-radius: var(--radius-md);
  background: rgba(255, 184, 77, 0.07);
}

.coach-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: #12100b;
  background: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

.coach-note p {
  margin: 0;
  color: var(--muted-bright);
  font-size: 13px;
  line-height: 1.5;
}

.coach-note strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}

.plan-list,
.machine-region-list,
.history-list,
.notes-list,
.pr-list {
  display: grid;
  gap: 12px;
}

.machine-browser {
  margin: 28px 0 30px;
}

.copilot-card,
.health-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(200, 255, 56, 0.28);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(200, 255, 56, 0.1), rgba(133, 107, 255, 0.08) 65%, var(--surface));
}

.copilot-card {
  margin-top: 16px;
}

.copilot-card::after {
  position: absolute;
  width: 110px;
  height: 110px;
  right: -48px;
  bottom: -54px;
  border: 1px solid rgba(200, 255, 56, 0.2);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 24px rgba(200, 255, 56, 0.025);
}

.copilot-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.copilot-card h2 {
  max-width: 290px;
  margin: 14px 0 8px;
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1.05;
}

.copilot-card p,
.health-card > p,
.health-explainer,
.private-profile-block > p,
.field-help {
  color: var(--muted-bright);
  font-size: 12px;
  line-height: 1.55;
}

.copilot-card > small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.health-card {
  margin: 18px 0;
  border-color: rgba(133, 107, 255, 0.3);
}

.health-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.health-card-head h2 {
  margin-top: 4px;
}

.privacy-chip {
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--lime);
  background: rgba(200, 255, 56, 0.09);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.health-card .secondary-action {
  min-height: 62px;
  margin-top: 16px;
}

.bmi-display {
  display: grid;
  grid-template-columns: auto auto 1fr;
  margin-top: 18px;
  align-items: end;
  gap: 8px 12px;
}

.bmi-display > strong {
  color: var(--lime);
  font-size: 46px;
  line-height: 0.9;
}

.bmi-display > span {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bmi-display > div {
  display: grid;
  gap: 4px;
}

.bmi-display b {
  font-size: 12px;
}

.bmi-display small {
  color: var(--muted);
  font-size: 10px;
}

.health-explainer {
  margin-top: 16px;
}

.private-profile-block {
  display: grid;
  margin: 8px 0 20px;
  padding: 18px;
  gap: 10px;
  border: 1px solid rgba(133, 107, 255, 0.28);
  border-radius: 20px;
  background: rgba(133, 107, 255, 0.06);
}

.private-profile-block > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.private-profile-block > div:first-child strong {
  color: var(--lime);
  font-size: 10px;
  text-transform: uppercase;
}

.private-profile-block .field-label {
  margin-top: 5px;
}

.field-help {
  margin-top: -4px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 360px) {
  .bmi-display {
    grid-template-columns: auto auto;
  }

  .bmi-display > div {
    grid-column: 1 / -1;
    margin-top: 6px;
  }
}

.machine-source-note {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.machine-region {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.machine-region.is-open {
  border-color: rgba(200, 255, 56, 0.38);
}

.machine-region-toggle {
  display: flex;
  width: 100%;
  min-height: 76px;
  padding: 16px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.machine-region-toggle > span:first-child {
  display: grid;
  gap: 4px;
}

.machine-region-toggle strong {
  font-size: 18px;
}

.machine-region-toggle small,
.machine-region-panel p,
.machine-region-panel li small {
  color: var(--muted);
}

.machine-region-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: #090b0f;
  background: var(--lime);
  font-size: 25px;
  font-weight: 900;
}

.machine-region-panel {
  padding: 0 18px 18px;
}

.machine-region-panel p {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.machine-region-panel ul {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 8px;
  list-style: none;
}

.machine-region-panel li {
  display: flex;
  min-height: 48px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 750;
}

.machine-region-panel li small {
  max-width: 76px;
  text-align: right;
  font-size: 9px;
  line-height: 1.2;
  text-transform: uppercase;
}

.plan-section-heading {
  margin-bottom: 14px;
}

.plan-card {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.plan-card.is-next {
  border-color: rgba(200, 255, 56, 0.38);
}

.plan-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.plan-letter {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 18px;
  color: #0b0d0e;
  background: var(--lime);
  font-size: 27px;
  font-weight: 950;
}

.plan-card:nth-child(2) .plan-letter {
  color: var(--text);
  background: var(--violet);
}

.plan-title {
  flex: 1;
}

.plan-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.plan-title h2 {
  margin-top: 5px;
}

.exercise-preview {
  display: grid;
  margin: 20px 0;
  gap: 0;
  counter-reset: exercise;
}

.exercise-preview li {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-bright);
  font-size: 13px;
  list-style: none;
}

.exercise-preview li:last-child {
  border-bottom: 0;
}

.exercise-preview li::before {
  margin-right: 5px;
  color: var(--muted);
  content: "0" counter(exercise);
  counter-increment: exercise;
  font-size: 10px;
  font-weight: 800;
}

.exercise-preview li span:first-of-type {
  flex: 1;
}

.exercise-preview li small {
  color: var(--muted);
}

.plan-card .primary-action {
  min-height: 62px;
}

.history-item,
.note-card,
.pr-item {
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: inherit;
  background: var(--surface);
  text-align: left;
}

button.history-item,
button.note-card,
button.recent-card {
  appearance: none;
  cursor: pointer;
}

.history-top strong,
.note-top strong {
  font-size: 15px;
}

.history-top span,
.note-top time {
  color: var(--muted);
  font-size: 11px;
}

.history-meta {
  display: flex;
  gap: 16px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.round-action {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  color: #0b0d0e;
  background: var(--lime);
  border-color: var(--lime);
}

.progress-summary {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 9px;
}

.progress-summary article {
  display: flex;
  min-height: 132px;
  padding: 17px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.progress-summary span {
  color: var(--muted);
  font-size: 11px;
}

.progress-summary strong {
  font-size: clamp(27px, 8vw, 40px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.intel-lab {
  position: relative;
  min-height: 330px;
  margin-top: 12px;
  padding: 23px;
  overflow: hidden;
  border: 1px solid rgba(200, 255, 56, 0.22);
  border-radius: var(--radius-lg);
  background: #0d100f;
}

.intel-lab::after {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(200, 255, 56, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(200, 255, 56, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  content: "";
  pointer-events: none;
}

.intel-radar {
  position: absolute;
  top: -52px;
  right: -76px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(200, 255, 56, 0.13);
  border-radius: 50%;
}

.intel-radar::before,
.intel-radar::after,
.intel-radar span {
  position: absolute;
  inset: 21%;
  border: 1px solid rgba(200, 255, 56, 0.12);
  border-radius: 50%;
  content: "";
}

.intel-radar::after {
  inset: 42%;
}

.intel-radar span {
  inset: 50% 0 auto;
  height: 1px;
  border: 0;
  border-top: 1px solid rgba(200, 255, 56, 0.18);
  border-radius: 0;
}

.intel-radar i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 47%;
  height: 2px;
  background: linear-gradient(90deg, rgba(200, 255, 56, 0.6), transparent);
  transform-origin: left;
  animation: radar-sweep 8s linear infinite;
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

.intel-content {
  position: relative;
  z-index: 2;
}

.intel-status {
  display: inline-flex;
  min-height: 32px;
  margin-bottom: 56px;
  padding: 0 10px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-bright);
  background: rgba(9, 11, 15, 0.7);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.intel-content h2 {
  max-width: 360px;
  margin-bottom: 16px;
  font-size: 31px;
}

.insight-stack {
  display: grid;
  gap: 8px;
}

.insight-line {
  display: grid;
  min-height: 57px;
  padding: 11px 13px;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--muted-bright);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  line-height: 1.4;
}

.insight-line > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--lime);
  background: rgba(200, 255, 56, 0.09);
  font-size: 9px;
  font-weight: 900;
}

.crowd-heatmap-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.crowd-heatmap {
  display: grid;
  grid-template-columns: 28px repeat(4, 1fr);
  gap: 6px;
}

.heat-label {
  display: grid;
  min-height: 30px;
  place-items: center;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.heat-cell {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  color: var(--muted-bright);
  background: var(--surface-raised);
  font-size: 9px;
  font-weight: 850;
}

.heat-cell::before {
  margin-right: 2px;
  font-size: 11px;
}

.heat-cell[data-level="1"]::before { content: "○"; }
.heat-cell[data-level="2"]::before { content: "◔"; }
.heat-cell[data-level="3"]::before { content: "◕"; }
.heat-cell[data-level="4"]::before { content: "●"; }

.heat-cell[data-level="1"],
.heat-legend i[data-level="1"] {
  color: var(--lime);
  background: rgba(200, 255, 56, 0.16);
}

.heat-cell[data-level="2"],
.heat-legend i[data-level="2"] {
  color: #bcacff;
  background: rgba(145, 120, 255, 0.2);
}

.heat-cell[data-level="3"],
.heat-legend i[data-level="3"] {
  color: var(--amber);
  background: rgba(255, 184, 77, 0.2);
}

.heat-cell[data-level="4"],
.heat-legend i[data-level="4"] {
  color: var(--danger);
  background: rgba(255, 111, 97, 0.22);
}

.heat-cell.no-data {
  color: #5d6470;
  background: var(--surface-raised);
}

.heat-cell.is-learning {
  opacity: 0.62;
  filter: saturate(0.65);
}

.heat-legend {
  display: grid;
  margin-top: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.heat-legend span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.heat-legend i {
  display: grid;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.crowd-summary {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.crowd-summary strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 15px;
}

.smart-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.smart-metric {
  display: flex;
  min-height: 124px;
  padding: 15px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.smart-metric span,
.smart-metric small {
  color: var(--muted);
  font-size: 10px;
}

.smart-metric strong {
  font-size: 27px;
  letter-spacing: -0.05em;
}

.observation-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.chart-card {
  margin-top: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.bar-chart {
  display: grid;
  height: 210px;
  margin-top: 24px;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 9px;
}

.chart-column {
  display: flex;
  height: 100%;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
}

.chart-column strong {
  color: var(--muted-bright);
  font-size: 9px;
  font-weight: 750;
}

.chart-bar-track {
  display: flex;
  width: 100%;
  height: 150px;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-raised);
}

.chart-bar {
  display: block;
  width: 100%;
  min-height: 5px;
  border-radius: 12px;
  background: var(--violet);
  transition: height 500ms cubic-bezier(.2,.8,.2,1);
}

.chart-column.is-current .chart-bar {
  background: var(--lime);
}

.chart-column > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.pr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.pr-item div {
  min-width: 0;
}

.pr-item span {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pr-item strong {
  font-size: 17px;
}

.pr-value {
  color: var(--lime);
  font-size: 20px !important;
  white-space: nowrap;
}

.weight-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.weight-display strong {
  font-size: 30px;
  letter-spacing: -0.05em;
}

.weight-display span {
  color: var(--muted);
  font-size: 12px;
}

.weight-trend {
  text-align: right;
}

.note-main-action {
  min-height: 74px;
}

.filter-row {
  display: grid;
  margin: 23px -2px 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow: hidden;
}

.filter-chip {
  min-width: 0;
  min-height: 52px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--muted-bright);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.filter-chip.is-active {
  color: #0b0d0e;
  background: var(--lime);
  border-color: var(--lime);
}

.note-card {
  min-height: 120px;
}

.note-card p {
  margin: 16px 0 0;
  color: var(--muted-bright);
  font-size: 14px;
  line-height: 1.55;
}

.note-category {
  display: inline-flex;
  min-height: 28px;
  padding: 0 9px;
  align-items: center;
  border-radius: 9px;
  color: var(--lime);
  background: rgba(200, 255, 56, 0.09);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bottom-nav {
  position: relative;
  z-index: 30;
  display: grid;
  width: 100%;
  height: var(--nav-height);
  padding: var(--nav-top-padding) max(10px, env(safe-area-inset-right, 0px)) var(--nav-safe-bottom) max(10px, env(safe-area-inset-left, 0px));
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: var(--nav-touch-row);
  align-items: start;
  gap: 4px;
  border-top: 1px solid var(--line);
  background: rgba(12, 14, 18, 0.94);
  backdrop-filter: blur(22px);
}

.nav-item {
  display: flex;
  min-width: 0;
  height: 100%;
  min-height: 60px;
  padding: 5px 4px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item.is-active {
  color: var(--lime);
  background: rgba(200, 255, 56, 0.08);
}

/* Four-tap, glove-first context capture before a session. */
.checkin-screen {
  position: fixed;
  z-index: 105;
  inset: 0;
  display: grid;
  width: min(100%, var(--max-width));
  height: auto;
  min-height: 0;
  margin-inline: auto;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--text);
  background: #090b0f;
  overscroll-behavior: none;
  touch-action: pan-y;
}

.checkin-header {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: 82px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  grid-template-columns: 58px 1fr 104px;
  align-items: center;
  gap: 8px;
  background: rgba(9, 11, 15, 0.93);
  backdrop-filter: blur(18px);
}

.checkin-header .session-exit svg {
  transform: rotate(180deg);
}

.checkin-header > div {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 3px;
}

.checkin-header span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.15em;
}

.checkin-header strong {
  font-size: 14px;
}

.checkin-progress {
  display: grid;
  height: 4px;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  background: var(--surface-soft);
}

.checkin-progress span {
  background: var(--surface-soft);
}

.checkin-progress span.is-done {
  background: var(--lime);
}

.checkin-main {
  position: relative;
  min-height: 0;
  padding: 48px max(18px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  touch-action: pan-y;
}

.checkin-main h1 {
  position: relative;
  z-index: 1;
  max-width: 450px;
  margin-bottom: 12px;
  font-size: clamp(38px, 12vw, 58px);
}

.checkin-main > p:not(.eyebrow):not(.privacy-line) {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin-bottom: 29px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.checkin-orbit {
  position: absolute;
  top: -80px;
  right: -115px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(145, 120, 255, 0.14);
  border-radius: 50%;
}

.checkin-orbit::after,
.checkin-orbit span {
  position: absolute;
  inset: 24%;
  border: 1px solid rgba(145, 120, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.checkin-orbit span {
  inset: 47%;
  background: var(--violet);
  box-shadow: 0 0 24px rgba(145, 120, 255, 0.55);
}

.checkin-choices,
.crowd-choice-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.checkin-choice,
.crowd-choice {
  display: flex;
  width: 100%;
  min-height: 82px;
  padding: 15px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 21px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.checkin-choice strong,
.crowd-choice strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
}

.checkin-choice small,
.crowd-choice small {
  color: var(--muted);
  font-size: 11px;
}

.checkin-choice > span:last-child,
.crowd-choice > span:last-child {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: #090b0f;
  background: var(--lime);
  font-size: 11px;
  font-weight: 950;
}

.privacy-line {
  display: flex;
  margin: 22px 0 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.privacy-line svg {
  width: 15px;
  height: 15px;
  color: var(--violet);
}

/* Active workout: intentionally sparse and glove-first. */
.session-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  width: min(100%, var(--max-width));
  height: auto;
  min-height: 0;
  margin-inline: auto;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  overscroll-behavior: none;
  touch-action: pan-y;
}

.session-header {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: 82px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  grid-template-columns: 58px 1fr 104px;
  align-items: center;
  gap: 8px;
  background: rgba(9, 11, 15, 0.93);
  backdrop-filter: blur(18px);
}

.session-exit {
  width: 58px;
  height: 58px;
}

.session-header > div {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 3px;
}

.session-header span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.session-header strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.finish-action {
  min-height: 56px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--muted-bright);
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.session-progress {
  position: relative;
  z-index: 4;
  height: 4px;
  background: var(--surface-soft);
}

.session-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
  transition: width 300ms ease;
}

.session-main {
  display: flex;
  min-height: 0;
  padding: 25px max(18px, env(safe-area-inset-right)) max(132px, calc(env(safe-area-inset-bottom) + 116px)) max(18px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  overscroll-behavior: none;
  touch-action: pan-y;
}

.exercise-focus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 24px;
}

.session-signal {
  display: flex;
  width: 100%;
  min-height: 56px;
  margin-bottom: 15px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(145, 120, 255, 0.25);
  border-radius: 16px;
  color: var(--text);
  background: rgba(145, 120, 255, 0.08);
  text-align: left;
  cursor: pointer;
}

.session-signal span {
  display: block;
  margin-bottom: 3px;
  color: var(--violet);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.session-signal strong {
  font-size: 12px;
}

.session-signal small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.exercise-focus-head h1 {
  max-width: 440px;
  margin: 7px 0 8px;
  font-size: clamp(34px, 10vw, 50px);
}

.exercise-focus-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.exercise-count {
  display: grid;
  min-width: 64px;
  min-height: 64px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 19px;
  color: var(--lime);
  background: var(--surface);
  font-size: 14px;
  font-weight: 850;
}

.last-time-note {
  display: flex;
  min-height: 52px;
  margin-bottom: 15px;
  padding: 12px 15px;
  align-items: center;
  gap: 10px;
  border-radius: 15px;
  color: var(--muted-bright);
  background: rgba(145, 120, 255, 0.1);
  font-size: 12px;
}

.last-time-note strong {
  color: var(--violet);
}

.set-dots {
  display: flex;
  min-height: 38px;
  margin-bottom: 12px;
  align-items: center;
  gap: 8px;
}

.set-dot {
  display: grid;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 850;
}

.set-dot.is-done {
  color: #0b0d0e;
  border-color: var(--lime);
  background: var(--lime);
}

.control-deck {
  display: grid;
  gap: 10px;
}

.value-control {
  display: grid;
  min-height: 112px;
  padding: 8px;
  grid-template-columns: 84px 1fr 84px;
  align-items: stretch;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.value-button {
  display: grid;
  min-width: 76px;
  min-height: 92px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 19px;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform 100ms ease, background 100ms ease;
}

.value-button:active {
  background: #303640;
}

.value-button svg {
  width: 31px;
  height: 31px;
  stroke-width: 2.3;
}

.value-display {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}

.value-display span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.value-display strong {
  margin-top: 3px;
  font-size: clamp(34px, 11vw, 52px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.055em;
}

.value-display em {
  margin-left: 2px;
  color: var(--muted-bright);
  font-size: 13px;
  font-style: normal;
  letter-spacing: 0;
}

.effort-control {
  display: grid;
  margin: 2px 0 10px;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.effort-button {
  min-height: 58px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.effort-button.is-active {
  color: var(--text);
  border-color: rgba(145, 120, 255, 0.45);
  background: rgba(145, 120, 255, 0.13);
}

.complete-set {
  position: fixed;
  z-index: 8;
  right: max(18px, calc((100vw - var(--max-width)) / 2 + 18px));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(18px, calc((100vw - var(--max-width)) / 2 + 18px));
  width: auto;
  min-height: 78px;
  margin-top: auto;
  border-radius: 22px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.48);
  font-size: 16px;
  letter-spacing: 0.015em;
}

.exercise-nav {
  display: grid;
  margin-top: 10px;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.exercise-nav button {
  min-height: 62px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted-bright);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.exercise-nav button:disabled {
  opacity: 0.35;
}

.session-note-action {
  min-height: 58px;
  margin-top: 9px;
  border: 0;
  border-radius: 17px;
  color: var(--muted-bright);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.rest-overlay {
  position: fixed;
  z-index: 130;
  inset: 0;
  display: flex;
  width: min(100%, var(--max-width));
  height: auto;
  min-height: 0;
  margin-inline: auto;
  padding: max(40px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  align-items: center;
  flex-direction: column;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(7, 8, 11, 0.97);
  backdrop-filter: blur(20px);
  overscroll-behavior: none;
  touch-action: pan-y;
}

.rest-ring {
  display: flex;
  width: min(74vw, 320px);
  aspect-ratio: 1;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border: 2px solid rgba(200, 255, 56, 0.5);
  border-radius: 50%;
  box-shadow: inset 0 0 0 14px rgba(200, 255, 56, 0.035), 0 0 80px rgba(200, 255, 56, 0.08);
}

.rest-ring span {
  margin-bottom: 8px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.rest-ring strong {
  font-size: clamp(52px, 16vw, 78px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.065em;
}

.rest-overlay > p {
  margin: 25px 0 32px;
  color: var(--muted);
  text-align: center;
}

.rest-actions {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

dialog {
  color: var(--text);
}

.sheet-dialog {
  width: min(100%, var(--max-width));
  max-width: var(--max-width);
  max-height: min(92dvh, 820px);
  margin: auto auto 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sheet-dialog::backdrop {
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(5px);
}

.sheet-dialog[open] {
  animation: sheet-in 220ms ease-out both;
}

@keyframes sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-content {
  display: flex;
  max-height: min(92dvh, 820px);
  padding: 11px 19px max(22px, env(safe-area-inset-bottom));
  overflow-y: auto;
  flex-direction: column;
  overscroll-behavior: none;
  touch-action: pan-y;
  scroll-padding: 16px 0 24px;
}

body.has-visual-keyboard .sheet-dialog[open] {
  top: auto;
  bottom: var(--keyboard-bottom, 0px);
  max-height: var(--visual-viewport-height, 100dvh);
  margin: 0 auto;
}

body.has-visual-keyboard .sheet-dialog[open] .sheet-content {
  max-height: var(--visual-viewport-height, 100dvh);
  padding-bottom: 18px;
}

.sheet-content input,
.sheet-content textarea {
  scroll-margin-block: 20px;
}

.sheet-handle {
  width: 44px;
  height: 5px;
  margin: 0 auto 24px;
  border-radius: 999px;
  background: var(--line-strong);
}

.sheet-content h2 {
  margin-bottom: 24px;
  font-size: 30px;
}

.sheet-explainer {
  margin: -12px 0 21px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-label {
  display: flex;
  margin: 5px 2px 9px;
  justify-content: space-between;
  color: var(--muted-bright);
  font-size: 12px;
  font-weight: 750;
}

.field-label span {
  color: var(--muted);
  font-weight: 500;
}

textarea,
.text-field,
.number-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: var(--bg);
}

textarea,
.text-field {
  min-height: 62px;
  padding: 16px;
}

textarea {
  min-height: 120px;
  margin-bottom: 15px;
  line-height: 1.5;
  resize: vertical;
}

textarea::placeholder,
input::placeholder {
  color: #69717c;
}

.text-field {
  margin-bottom: 19px;
}

.segmented-control,
.mood-picker {
  display: grid;
  margin-bottom: 20px;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.segmented-control button,
.mood-picker button {
  min-height: 62px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--muted);
  background: var(--surface-raised);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.segmented-control button.is-active,
.mood-picker button.is-active {
  color: #0b0d0e;
  border-color: var(--lime);
  background: var(--lime);
}

.mood-picker button {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.mood-picker span {
  font-size: 7px;
  letter-spacing: 3px;
}

.dialog-cancel,
.danger-action {
  min-height: 58px;
  margin-top: 6px;
  border: 0;
  color: var(--muted-bright);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.danger-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--danger);
}

.number-field {
  display: flex;
  min-height: 86px;
  margin-bottom: 17px;
  align-items: center;
  padding: 0 20px;
}

.number-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 38px;
  font-weight: 800;
}

.number-field:focus-within {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.number-field span {
  color: var(--muted);
  font-weight: 750;
}

.goal-stepper {
  display: grid;
  min-height: 102px;
  margin-bottom: 18px;
  padding: 8px;
  grid-template-columns: 76px 1fr 76px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--bg);
}

.goal-stepper button {
  display: grid;
  min-height: 80px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
}

.goal-stepper strong {
  display: flex;
  align-items: center;
  flex-direction: column;
  font-size: 36px;
}

.goal-stepper small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.install-action,
.share-action {
  margin-top: 9px;
}

.share-note,
.share-status {
  margin: 9px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.share-status {
  padding: 11px 13px;
  border-radius: 13px;
  color: var(--text);
  background: rgba(200, 255, 56, 0.09);
}

.share-status:empty {
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}

.install-steps {
  display: grid;
  margin-bottom: 18px;
  gap: 9px;
}

.install-steps > div {
  display: grid;
  min-height: 78px;
  padding: 13px;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--bg);
}

.install-steps > div > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: #090b0f;
  background: var(--lime);
  font-weight: 950;
}

.install-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.install-steps strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.install-note {
  margin: 0 0 16px;
  padding: 13px;
  border-radius: 15px;
  color: var(--muted-bright);
  background: rgba(145, 120, 255, 0.09);
  font-size: 11px;
  line-height: 1.45;
}

.data-panel {
  display: flex;
  margin-top: 22px;
  padding: 17px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
}

.data-panel strong {
  font-size: 13px;
}

.data-panel p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.data-panel button {
  min-height: 52px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--muted-bright);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.data-panel .danger-text {
  color: var(--danger);
}

.workout-detail-head {
  margin-bottom: 22px;
}

.workout-detail-head h2 {
  margin-bottom: 9px;
}

.workout-detail-head > span {
  color: var(--muted);
  font-size: 12px;
}

.workout-detail-stats {
  display: grid;
  margin-bottom: 20px;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.workout-detail-stats div {
  display: flex;
  min-height: 82px;
  padding: 12px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}

.workout-detail-stats span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.workout-detail-stats strong {
  font-size: 14px;
}

.workout-journal-note {
  margin-bottom: 20px;
  padding: 15px;
  border-left: 3px solid var(--violet);
  border-radius: 0 15px 15px 0;
  color: var(--muted-bright);
  background: rgba(145, 120, 255, 0.08);
  font-size: 13px;
  line-height: 1.5;
}

.session-replay {
  display: grid;
  margin-bottom: 20px;
  gap: 8px;
}

.replay-signal {
  display: grid;
  min-height: 62px;
  padding: 11px 13px;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}

.replay-signal > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #090b0f;
  background: var(--lime);
  font-size: 10px;
  font-weight: 950;
}

.replay-signal strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

.replay-signal small {
  color: var(--muted);
  font-size: 10px;
}

.workout-exercise-detail {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.workout-exercise-detail > strong {
  display: block;
  margin-bottom: 11px;
  font-size: 15px;
}

.detail-set-row {
  display: grid;
  min-height: 38px;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted-bright);
  font-size: 12px;
}

.detail-set-row span:first-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.detail-set-row em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.toast {
  position: fixed;
  z-index: 200;
  right: max(18px, calc((100vw - var(--max-width)) / 2 + 18px));
  bottom: calc(var(--nav-height) + 12px);
  left: max(18px, calc((100vw - var(--max-width)) / 2 + 18px));
  min-height: 60px;
  padding: 17px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  color: var(--text);
  background: #222730;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 750;
  animation: toast-in 180ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

noscript {
  position: fixed;
  inset: 20px;
  z-index: 999;
  padding: 30px;
  color: var(--text);
  background: var(--bg);
}

@media (min-width: 720px) {
  body {
    padding: 18px;
  }

  .app-shell {
    height: calc(100vh - 36px);
    height: calc(100dvh - 36px);
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 32px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
  }

  .topbar {
    top: auto;
    border-radius: 32px 32px 0 0;
  }

  .bottom-nav {
    inset: auto;
    border: 1px solid var(--line);
    border-radius: 0 0 32px 32px;
  }

  .checkin-screen,
  .session-screen {
    top: 18px;
    bottom: 18px;
    height: auto;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 32px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
  }

  .rest-overlay {
    top: 18px;
    bottom: 18px;
    height: auto;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 32px;
  }

  .checkin-header,
  .session-header {
    border-radius: 32px 32px 0 0;
  }

  .complete-set {
    bottom: 32px;
  }

  .hero-card {
    min-height: 500px;
  }
}

@media (max-width: 380px) {
  .view {
    padding-right: max(13px, env(safe-area-inset-right));
    padding-left: max(13px, env(safe-area-inset-left));
  }

  .topbar {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .brand-copy small {
    display: none;
  }

  .hero-card {
    min-height: 440px;
  }

  .stat-card {
    padding: 11px;
  }

  .value-control {
    grid-template-columns: 72px 1fr 72px;
  }

  .value-button {
    min-width: 64px;
  }

  .filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
  }

  .filter-chip {
    width: 100%;
    min-width: 0;
  }
}

@media (max-height: 700px) {
  .topbar {
    min-height: 64px;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .welcome-row {
    min-height: 62px;
    margin-bottom: 12px;
  }

  .welcome-row h1 {
    font-size: 32px;
  }

  .hero-card {
    min-height: 310px;
  }

  .hero-visual {
    top: 36px;
    width: 190px;
    height: 190px;
  }

  .hero-visual svg {
    width: 70px;
    height: 70px;
  }

  .orbit-one {
    width: 130px;
    height: 130px;
  }

  .orbit-two {
    width: 185px;
    height: 185px;
  }

  .hero-copy {
    bottom: 91px;
  }

  .hero-copy h2 {
    max-width: 250px;
    margin-bottom: 4px;
    font-size: 34px;
  }

  .hero-copy p {
    margin-bottom: 5px;
  }

  .hero-card .primary-action-dark {
    min-height: 62px;
  }

  .exercise-focus-head {
    margin-bottom: 15px;
  }

  .exercise-focus-head h1 {
    font-size: 33px;
  }

  .session-main {
    padding-top: 16px;
  }

  .checkin-header {
    min-height: 68px;
    padding-top: max(8px, env(safe-area-inset-top));
    grid-template-columns: 52px 1fr 100px;
  }

  .checkin-header .session-exit {
    width: 52px;
    height: 52px;
  }

  .checkin-main {
    padding-top: 18px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .checkin-main h1 {
    margin-bottom: 7px;
    font-size: clamp(31px, 9vw, 42px);
  }

  .checkin-main > p:not(.eyebrow):not(.privacy-line) {
    margin-bottom: 15px;
    line-height: 1.35;
  }

  .checkin-orbit {
    top: -120px;
    right: -135px;
    width: 235px;
    height: 235px;
  }

  .checkin-choices {
    gap: 8px;
  }

  .checkin-choice {
    min-height: 68px;
    padding-block: 10px;
  }

  .privacy-line {
    margin-top: 12px;
  }
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  body {
    background: var(--bg);
  }

  .app-shell {
    /* iOS can anchor a status-bar-shortened standalone viewport at y=0.
       Extending by the top safe-area removes the resulting empty strip below
       the bottom navigation; its own bottom safe-area still protects taps. */
    height: calc(100% + env(safe-area-inset-top, 0px));
    background: var(--bg);
  }
}

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