html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --ink: #151515;
  --muted: #66727a;
  --paper: #ffffff;
  --paper-strong: #fff2d5;
  --surface: #ffffff;
  --line: #292421;
  --soft-line: #ece5d8;
  --accent: #ff4b2b;
  --accent-dark: #c72f16;
  --sun: #ffb000;
  --teal: #1aa99a;
  --blue: #3f6fff;
  --green: #35b863;
  --pink: #f05a8a;
  --purple: #8b66df;
  --shadow: 0 12px 28px rgba(21, 21, 21, 0.08);
  --shadow-soft: 0 18px 45px rgba(21, 21, 21, 0.08);
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent-dark);
}

main {
  min-height: calc(100vh - 148px);
}

.btn,
.form-control,
.form-check-input,
.navbar-toggler {
  border-radius: var(--radius);
}

.btn {
  border-width: 1px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 5px 14px rgba(21, 21, 21, 0.08);
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(21, 21, 21, 0.12);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.12rem var(--surface), 0 0 0 0.28rem rgba(255, 75, 43, 0.28);
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--ink);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--accent-dark);
  --bs-btn-hover-border-color: var(--ink);
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-active-border-color: var(--ink);
}

.btn-outline-dark {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--ink);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: var(--sun);
  --bs-btn-hover-border-color: var(--ink);
  background: #fff;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--soft-line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.navbar {
  min-height: 72px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}

.brand-mark img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(21, 21, 21, 0.14));
}

.brand-mark span {
  font-size: 1.3rem;
}

.navbar .nav-link {
  margin: 0 3px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 700;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.navbar-toggler {
  border: 1px solid var(--ink);
  background: #fff;
  box-shadow: 0 5px 14px rgba(21, 21, 21, 0.1);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2821, 21, 21, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.site-footer {
  padding: 28px 0;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.home-hero {
  padding: 52px 0 44px;
}

.hero-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.75fr);
  gap: 36px;
  align-items: center;
  min-height: min(720px, calc(100vh - 124px));
}

.hero-shell > * {
  min-width: 0;
}

.hero-logo {
  position: absolute;
  top: 12px;
  right: min(35%, 360px);
  z-index: -1;
  width: clamp(210px, 28vw, 390px);
  opacity: 0.06;
  transform: rotate(-6deg);
}

.hero-copy h1,
.page-heading h1,
.auth-panel h1 {
  max-width: 820px;
  margin: 0;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.02;
}

.hero-copy h1 {
  font-size: clamp(3rem, 7.3vw, 6.2rem);
  text-wrap: balance;
}

.lead {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
  font-weight: 450;
  line-height: 1.6;
}

.eyebrow,
.stat-label {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.fitness-panel,
.auth-panel,
.dashboard-panel,
.empty-state,
.calendar-shell,
.activity-json-panel,
.activity-chart-panel,
.coach-thread,
.coach-compose {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.fitness-panel {
  position: relative;
  max-width: 100%;
  padding: 28px;
}

.hero-preview {
  transform: rotate(1deg);
}

.panel-mascot {
  position: absolute;
  top: -34px;
  right: -22px;
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 5px 12px rgba(21, 21, 21, 0.16));
}

.panel-header,
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
}

.panel-header strong {
  color: var(--teal);
}

.metric-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--soft-line);
}

.metric-row span {
  color: var(--muted);
  font-weight: 600;
}

.metric-row strong {
  font-size: 2rem;
  line-height: 1;
}

.training-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  height: 140px;
  align-items: end;
  margin-top: 24px;
}

.training-bars span {
  min-height: 24px;
  border: 1px solid var(--ink);
  border-radius: 5px 5px 0 0;
  background: var(--accent);
}

.training-bars span:nth-child(2n) {
  background: var(--sun);
}

.training-bars span:nth-child(3n) {
  background: var(--teal);
}

.home-band {
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
}

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

.stat-grid > div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  min-width: 0;
}

.stat-grid img {
  grid-row: span 2;
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.stat-grid strong {
  overflow-wrap: anywhere;
  font-size: 1.35rem;
  line-height: 1.1;
}

.auth-shell,
.dashboard-shell,
.policy-shell {
  padding: 48px 0;
}

.auth-panel {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 32px;
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: -38px;
  right: 22px;
  width: 76px;
  height: 76px;
  background: url("../images/rule5_logo_128x128.png") center / contain no-repeat;
  filter: drop-shadow(0 5px 12px rgba(21, 21, 21, 0.14));
}

.profile-panel {
  width: min(100%, 640px);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.external-auth-form {
  margin-bottom: 20px;
}

.external-provider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.external-provider-intervals {
  border-color: rgba(255, 75, 43, 0.48);
  background: #fff8f4;
  color: var(--ink);
}

.external-provider-intervals::before {
  content: "";
  width: 22px;
  height: 22px;
  background: url("../images/rule5_logo_128x128.png") center / contain no-repeat;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--soft-line);
}

.auth-switch {
  margin: 18px 0 0;
  text-align: center;
}

.auth-switch a {
  font-weight: 700;
}

.form-control,
.form-select {
  border: 1px solid var(--soft-line);
  background-color: #fff;
}

.form-floating > label {
  color: var(--muted);
  font-weight: 700;
}

.terms-check {
  padding: 12px 12px 12px 2rem;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.policy-container {
  max-width: 900px;
}

.policy-container h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 820;
  line-height: 1.02;
}

.policy-updated {
  margin: 12px 0 32px;
  color: var(--muted);
}

.policy-container section {
  padding: 22px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.policy-container section + section {
  margin-top: 14px;
}

.policy-container h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 760;
}

.policy-container p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.otp-input {
  font-size: 1.5rem;
  letter-spacing: 0.16em;
}

.page-heading {
  margin-bottom: 28px;
}

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.page-heading h1,
.auth-panel h1 {
  font-size: clamp(2.3rem, 6vw, 3.5rem);
}

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

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
}

.dashboard-panel {
  position: relative;
  padding: 24px;
}

.state-panel,
.training-plan-panel {
  overflow: hidden;
  min-height: 166px;
}

.state-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 58px;
  height: 58px;
  object-fit: contain;
  opacity: 0.92;
}

.dashboard-number {
  display: block;
  margin-top: 12px;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 820;
  line-height: 0.9;
}

.state-panel p,
.training-plan-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 500;
}

.metric-positive {
  color: var(--green);
}

.metric-negative {
  color: var(--accent);
}

.fitness-trend-panel canvas {
  display: block;
  width: 100%;
  min-height: 430px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  display: inline-block;
  width: 22px;
  height: 4px;
  border: 1px solid var(--ink);
  border-radius: 999px;
}

.training-plan-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.training-plan-panel h2 {
  margin: 12px 0 0;
  font-size: 1.55rem;
  font-weight: 820;
}

.training-plan-panel .btn {
  margin-top: 18px;
}

.empty-state {
  margin-top: 16px;
  padding: 28px;
}

.empty-state h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 820;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

.sync-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #e9fff8;
  box-shadow: var(--shadow);
}

.sync-banner strong,
.sync-banner span {
  display: block;
}

.sync-banner span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.sync-banner-error {
  background: #ffe7e1;
}

.sync-banner-success {
  background: #eefbe9;
}

.sync-progress {
  height: 12px;
  border: 1px solid var(--soft-line);
  background: #fff;
}

.sync-progress .progress-bar {
  width: 100%;
  background-color: var(--teal);
}

.dashboard-summary {
  display: grid;
  gap: 2px;
}

.month-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.month-controls span {
  min-width: 150px;
  color: var(--ink);
  font-weight: 820;
  text-align: center;
}

.calendar-shell {
  overflow: hidden;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border-bottom: 1px solid var(--soft-line);
  background: var(--paper-strong);
}

.calendar-weekdays span {
  padding: 12px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 142px;
  padding: 10px;
  border-right: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day-empty {
  background: #fff4dc;
}

.calendar-day-today {
  box-shadow: inset 0 0 0 2px rgba(255, 75, 43, 0.55);
}

.calendar-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

.calendar-date span {
  font-weight: 820;
}

.calendar-date strong {
  color: var(--accent-dark);
  font-size: 0.72rem;
}

.calendar-items {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.calendar-item {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  background: #e9fff8;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 140ms ease, transform 140ms ease;
}

.calendar-item:hover {
  background: #ffe7b5;
  transform: translateY(-1px);
}

.calendar-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

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

.activity-detail-grid .dashboard-panel strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.35rem;
}

.activity-json-panel {
  margin-top: 16px;
  padding: 24px;
}

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

.panel-title-row h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 820;
}

.activity-json-panel pre {
  max-height: 560px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #181c1f;
  color: #fff7e8;
  font-size: 0.86rem;
}

.activity-heading h1 {
  max-width: 940px;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  line-height: 1.05;
}

.activity-metric-strip {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.activity-metric-strip section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.activity-metric-strip span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.activity-metric-strip strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.1;
}

.activity-analytics-grid,
.activity-bottom-grid {
  display: grid;
  gap: 16px;
}

.activity-analytics-grid {
  grid-template-columns: 1fr;
}

.activity-bottom-grid {
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  margin-top: 16px;
}

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

.activity-chart-panel canvas {
  display: block;
  width: 100%;
  min-height: 150px;
}

.stacked-chart-panel canvas {
  min-height: 360px;
}

.compact-title {
  margin-bottom: 10px;
}

.compact-title h2 {
  margin: 0;
  font-size: 1rem;
}

.compact-title span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.zone-bars {
  display: grid;
  gap: 7px;
}

.zone-row {
  display: grid;
  grid-template-columns: 28px minmax(94px, 1fr) 70px 82px minmax(180px, 2fr) 58px 50px;
  gap: 8px;
  align-items: center;
  min-height: 24px;
}

.zone-row span,
.zone-row strong {
  min-width: 0;
  font-size: 0.76rem;
  line-height: 1.15;
}

.zone-id {
  color: var(--ink);
  font-weight: 820;
}

.zone-name,
.zone-range,
.zone-watts {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-time,
.zone-percent {
  color: var(--muted);
  font-weight: 500;
  text-align: right;
}

.zone-track {
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: #fff;
}

.zone-track i {
  display: block;
  height: 100%;
  min-width: 2px;
}

.coach-shell {
  padding: 24px 0 32px;
}

.coach-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 980px;
  min-height: calc(100vh - 158px);
}

.coach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.coach-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 760;
  line-height: 1.02;
}

.coach-thread {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 16px;
  min-height: 520px;
  padding: 24px;
  overflow-y: auto;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(255, 75, 43, 0.18), rgba(26, 169, 154, 0.12)) border-box;
}

.coach-empty-thread {
  width: min(100%, 620px);
  margin: auto;
  text-align: center;
}

.coach-empty-thread h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 720;
}

.coach-empty-thread p {
  margin: 10px 0 0;
  color: var(--muted);
}

.chat-message {
  display: grid;
  gap: 6px;
  max-width: min(720px, 82%);
}

.chat-message-user {
  align-self: flex-end;
  justify-items: end;
}

.chat-message-coach {
  align-self: flex-start;
}

.chat-bubble {
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 16px;
  line-height: 1.55;
  box-shadow: none;
}

.chat-message-user .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.chat-message-coach .chat-bubble {
  border-color: var(--soft-line);
  background: #f8f8f7;
  color: var(--ink);
  border-bottom-left-radius: 5px;
}

.chat-bubble p {
  margin: 0;
}

.chat-bubble p + p {
  margin-top: 10px;
}

.chat-timestamp {
  color: var(--muted);
  font-size: 0.72rem;
}

.coach-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(21, 21, 21, 0.09);
}

.coach-compose textarea {
  min-height: 46px;
  max-height: 170px;
  padding: 10px 12px;
  border-color: transparent;
  box-shadow: none;
  resize: vertical;
}

.coach-compose textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.coach-compose .btn {
  min-height: 46px;
  padding-right: 18px;
  padding-left: 18px;
  border-radius: 14px;
}

.coach-validation {
  grid-column: 1 / -1;
}

.thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.thinking-bubble i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: thinkingPulse 1s infinite ease-in-out;
}

.thinking-bubble i:nth-child(3) {
  animation-delay: 0.15s;
}

.thinking-bubble i:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes thinkingPulse {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    padding: 12px 0 8px;
  }

  .navbar-nav {
    gap: 4px;
  }
}

@media (max-width: 800px) {
  .navbar .container {
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    padding-right: 12px;
    padding-left: 12px;
  }

  .navbar-toggler {
    display: none !important;
  }

  .navbar-collapse {
    display: block !important;
    width: 100%;
    margin-top: 8px;
  }

  .container {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding-right: 0;
    padding-left: 0;
  }

  .home-hero {
    padding-top: 34px;
  }

  .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .navbar .nav-link {
    padding: 0.36rem 0.5rem;
    font-size: 0.88rem;
  }

  .home-hero .hero-shell {
    width: min(330px, calc(100vw - 40px));
    max-width: min(330px, calc(100vw - 40px));
    margin-right: auto;
    margin-left: 16px;
    padding-right: 0;
    padding-left: 0;
  }

  .hero-shell,
  .stat-grid,
  .dashboard-grid,
  .dashboard-state-grid,
  .dashboard-main-grid,
  .activity-detail-grid,
  .activity-metric-strip,
  .activity-analytics-grid,
  .activity-bottom-grid,
  .sync-banner {
    grid-template-columns: 1fr;
  }

  .hero-shell {
    min-height: auto;
    gap: 28px;
  }

  .hero-logo {
    right: 18px;
    opacity: 0.09;
  }

  .hero-copy h1 {
    font-size: clamp(2.12rem, 10.5vw, 2.85rem);
  }

  .lead {
    font-size: 1.02rem;
  }

  .hero-preview {
    transform: none;
    overflow: hidden;
    padding: 28px 24px 24px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .panel-mascot {
    top: 8px;
    right: 8px;
    width: 58px;
    height: 58px;
  }

  .training-bars {
    gap: 6px;
  }

  .stat-grid > div {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .stat-grid img {
    width: 48px;
    height: 48px;
  }

  .coach-header,
  .coach-compose {
    grid-template-columns: 1fr;
  }

  .coach-header {
    align-items: stretch;
    flex-direction: column;
  }

  .coach-container {
    min-height: calc(100vh - 214px);
  }

  .coach-thread {
    min-height: 430px;
    padding: 18px;
  }

  .coach-compose {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .chat-message {
    max-width: 100%;
  }

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

  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-weekdays {
    display: none;
  }

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

  .calendar-day,
  .calendar-day:nth-child(7n) {
    border-right: 0;
  }

  .calendar-day-empty {
    display: none;
  }

  .month-controls {
    justify-content: space-between;
  }

  .zone-row {
    grid-template-columns: 28px minmax(0, 1fr) 54px;
    gap: 8px;
  }

  .zone-range,
  .zone-watts,
  .zone-percent {
    display: none;
  }
}
