:root {
  --blue: #2563eb;
  --blue-2: #38bdf8;
  --green: #22c55e;
  --cyan: #22d3ee;
  --bg: #06111d;
  --surface: #0b1724;
  --surface-2: #101f30;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.22);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --blue-2: #0369a1;
  --green: #15803d;
  --cyan: #0891b2;
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-2: #eef5fb;
  --text: #102033;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 20px 50px rgba(37, 99, 235, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.18), transparent 34rem),
    radial-gradient(circle at 80% 12%, rgba(34, 197, 94, 0.12), transparent 30rem),
    var(--bg);
  color: var(--text);
}

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

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blue-2);
  outline-offset: 3px;
}

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

h1,
h2,
.brand-row strong {
  font-family: Outfit, Inter, sans-serif;
}

.boot,
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.boot {
  gap: 1rem;
}

.auth-shell {
  width: 100%;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
  gap: 2rem;
  max-width: 1180px;
  margin: 0 auto;
}

.auth-hero,
.auth-card,
.panel,
.metric-card,
.sidebar,
.topbar,
.mobile-nav {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-hero,
.auth-card,
.panel {
  border-radius: 24px;
}

.auth-hero,
.auth-card {
  min-width: 0;
  max-width: 100%;
}

.auth-hero {
  padding: clamp(2rem, 5vw, 4rem);
}

.auth-hero h1 {
  max-width: 760px;
  margin-top: 2rem;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.auth-hero p {
  max-width: 600px;
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.auth-card {
  width: 100%;
  padding: 1.25rem;
}

.auth-card h2 {
  margin: 0.35rem 0 1.25rem;
}

.auth-link {
  width: 100%;
  margin-top: 0.75rem;
  border: 0;
  background: transparent;
  color: var(--blue-2);
  font-weight: 800;
}

.auth-notice {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.14);
  color: var(--green);
  font-weight: 800;
  line-height: 1.45;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  font-family: Outfit, sans-serif;
  font-weight: 800;
}

.hero-stats,
.metric-grid,
.split,
.exercise-grid {
  display: grid;
  gap: 1rem;
}

.hero-stats {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 2rem;
}

.hero-stats div,
.metric-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
  background: var(--surface-2);
}

.hero-stats strong,
.metric-card strong {
  display: block;
  font-size: 1.8rem;
}

.hero-stats span,
.metric-card span,
.row-card span,
.exercise-card span,
.template-card small,
.eyebrow {
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab,
.ghost,
.nav-item {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.tab,
.primary,
.ghost,
.nav-item {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.tab.active,
.primary,
.nav-item.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), #1d4ed8);
  color: #fff;
}

label {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

label small,
.set-head small {
  display: inline-flex;
  width: fit-content;
  margin-left: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-2);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.hidden {
  display: none;
}

.error,
.notice {
  color: #fecaca;
  font-weight: 800;
  margin-top: 0.8rem;
}

.notice {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

:root[data-theme="light"] .error,
:root[data-theme="light"] .notice {
  color: #991b1b;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.toast {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.32);
  color: var(--green);
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  border-width: 0 0 1px;
}

.top-actions {
  display: flex;
  gap: 0.6rem;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1.2rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.2rem;
}

.sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  display: grid;
  gap: 0.5rem;
  padding: 0.8rem;
  border-radius: 22px;
}

.content {
  min-width: 0;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-head h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 0.3rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.74rem;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.metric-card {
  min-height: 118px;
  display: grid;
  align-content: center;
}

.metric-card.clickable {
  cursor: pointer;
}

.metric-card.clickable:hover,
.exercise-card:hover,
.pr-row:hover {
  border-color: var(--blue-2);
}

.metric-card p {
  margin: 0 0 0.35rem;
  color: var(--muted);
}

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

.stack-space {
  margin-top: 1rem;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: -0.2rem 0 1rem;
}

.panel {
  padding: 1rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head.compact {
  margin-bottom: 0.6rem;
}

.template-card,
.row-card,
.exercise-card,
.insight,
.record-card,
.goal-card,
.photo-card,
.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.template-card,
.exercise-card {
  align-items: center;
}

.template-card {
  align-items: stretch;
}

.template-card > button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0;
}

.template-card span,
.template-card small {
  display: block;
}

.template-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.template-config {
  margin-bottom: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}

.template-config-grid {
  display: grid;
  grid-template-columns: 100px 100px 140px minmax(180px, 1fr);
  gap: 0.75rem;
}

.exercise-card em {
  color: var(--green);
  font-size: 0.72rem;
  font-style: normal;
  text-transform: uppercase;
}

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

.optional-box {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
}

.optional-box p {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-weight: 800;
}

.exercise-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.exercise-card {
  cursor: pointer;
}

.exercise-thumb {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(34, 197, 94, 0.35));
  font-weight: 800;
}

.filter-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.compact-list {
  display: grid;
  gap: 0.5rem;
  max-height: 460px;
  overflow: auto;
  margin-top: 0.8rem;
}

.exercise-picker {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.exercise-picker.selected {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.12);
}

.exercise-picker span {
  color: var(--muted);
}

.workout-log {
  display: grid;
  gap: 1rem;
}

.exercise-log {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  background: var(--surface-2);
}

.journal-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.rest-timer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.rest-timer span,
.rest-timer strong {
  display: block;
}

.rest-timer span {
  color: var(--muted);
  font-size: 0.82rem;
}

.rest-timer strong {
  margin-top: 0.15rem;
  font-size: 1.45rem;
}

.complete-workout-bar {
  width: 100%;
}

.set-head,
.set-row {
  display: grid;
  grid-template-columns: 50px 60px 1fr 1fr 100px;
  gap: 0.7rem;
  align-items: center;
}

.set-head {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.set-row {
  margin-bottom: 0.6rem;
}

.danger {
  color: #fca5a5;
}

.wide {
  width: 100%;
}

.form-panel {
  display: block;
}

.bars {
  display: flex;
  align-items: end;
  gap: 0.45rem;
  height: 180px;
  margin-bottom: 1rem;
}

.bars span {
  flex: 1;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
}

.empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  align-content: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 16px;
  text-align: center;
}

.empty p {
  margin: 0;
}

.insight-list {
  display: grid;
  gap: 0.85rem;
}

.insight {
  display: block;
}

.insight p {
  margin-top: 0.35rem;
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.summary-grid div {
  padding: 1rem;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.summary-grid strong,
.record-card strong {
  display: block;
  font-size: 1.6rem;
}

.summary-grid span {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
}

.record-card,
.goal-card {
  display: block;
}

.pr-tabs {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.pr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 1rem;
  align-items: center;
  width: 100%;
  margin-bottom: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.pr-row span,
.pr-row time {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.pr-row em {
  justify-self: end;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(34, 197, 94, 0.16);
  color: var(--green);
  font-style: normal;
  font-weight: 800;
  font-size: 0.75rem;
}

.pr-history {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}

.detail-card,
.history-hint {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.08);
}

.history-hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.set-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.set-list span {
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
}

.record-card h3 {
  margin-bottom: 0.25rem;
}

.record-card small,
.goal-card small {
  color: var(--muted);
}

.progress-track {
  overflow: hidden;
  height: 10px;
  margin: 0.65rem 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.photo-card {
  display: block;
  padding: 0.65rem;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface);
}

.photo-card div {
  padding: 0.75rem 0.35rem 0.2rem;
}

.photo-card p {
  margin-top: 0.35rem;
  color: var(--muted);
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.comparison-label {
  margin-bottom: 0.75rem;
  color: var(--muted);
  text-transform: capitalize;
}

.first-run {
  margin-bottom: 1rem;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.55rem;
}

.checklist button {
  display: grid;
  grid-template-columns: 26px 1fr 20px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.checklist button.complete {
  color: var(--muted);
}

.checklist button.complete strong {
  text-decoration: line-through;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.timeline {
  display: grid;
  gap: 0.75rem;
}

.timeline-month {
  margin-bottom: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
}

.timeline-item span {
  width: fit-content;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
  color: var(--blue-2);
  font-weight: 800;
  font-size: 0.75rem;
}

.timeline-item p,
.timeline-item time {
  color: var(--muted);
}

.trend-chart {
  overflow-x: auto;
  margin: 0.75rem 0 1rem;
}

.trend-chart svg {
  display: block;
  width: 100%;
  min-width: 560px;
}

.trend-chart text {
  fill: var(--muted);
  font-size: 12px;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--blue-2);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-chart circle {
  fill: var(--green);
  stroke: var(--surface);
  stroke-width: 3;
}

.goal-line {
  stroke: var(--green);
  stroke-width: 2;
  stroke-dasharray: 8 6;
}

.settings-row {
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.72);
}

.modal-panel {
  width: min(720px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.confirm-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 1rem;
}

.confirm-panel > p {
  color: var(--muted);
  line-height: 1.55;
}

.confirm-actions {
  justify-content: flex-end;
}

.pr-detection-panel {
  width: min(560px, 100%);
  display: grid;
  gap: 1rem;
}

.pr-detection-list {
  display: grid;
  gap: 0.65rem;
}

.detected-pr {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  margin: 0;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
}

.detected-pr span,
.detected-pr small {
  display: block;
}

.detected-pr small {
  width: auto;
  margin-top: 0.25rem;
  margin-left: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  text-transform: none;
}

.destructive {
  background: #dc2626;
}

.destructive:hover {
  background: #b91c1c;
}

.wide-modal {
  width: min(880px, 100%);
}

.media-box {
  overflow: hidden;
  display: grid;
  min-height: 220px;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.media-box img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.image-fallback {
  padding: 2rem;
  object-fit: contain !important;
  background: var(--surface-2);
}

.exercise-placeholder {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: white;
  font-size: 2rem;
  font-weight: 900;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-grid div {
  padding: 0.85rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.detail-grid span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
}

.media-link {
  display: inline-flex;
  margin-bottom: 1rem;
  text-decoration: none;
}

.mobile-nav {
  display: none;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  background: rgba(2, 6, 23, 0.62);
}

.more-sheet {
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  padding: 1rem 1rem 1.25rem;
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.skeleton-panel,
.skeleton-card {
  overflow: hidden;
}

.skeleton {
  position: relative;
  display: block;
  width: 100%;
  height: 0.85rem;
  overflow: hidden;
  border-radius: 8px;
  background: color-mix(in srgb, var(--muted) 18%, var(--surface-2));
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  animation: skeleton-shimmer 1.25s infinite;
}

.skeleton-card {
  display: grid;
  gap: 0.8rem;
}

.skeleton-short {
  width: 45%;
}

.skeleton-value {
  width: 65%;
  height: 2rem;
}

.skeleton-panel {
  display: grid;
  gap: 1rem;
  min-height: 260px;
}

.skeleton-heading {
  width: 38%;
  height: 1.4rem;
}

.skeleton-row {
  height: 3.8rem;
}

@keyframes skeleton-shimmer {
  to {
    transform: translateX(100%);
  }
}

@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;
  }
}

@media (max-width: 920px) {
  .auth-shell,
  .layout,
  .split,
  .metric-grid,
  .filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    padding: 0.5rem;
    border-radius: 20px;
  }

  .mobile-nav .nav-item,
  .more-grid .nav-item {
    min-height: 48px;
    padding: 0.7rem 0.45rem;
  }

  .mobile-nav .nav-item {
    justify-content: center;
    gap: 0.25rem;
    flex-direction: column;
    font-size: 0.68rem;
  }

  .mobile-nav .icon {
    width: 19px;
    height: 19px;
  }

  .layout {
    padding-bottom: 6rem;
  }

  .set-head,
  .set-row {
    grid-template-columns: 40px 44px 1fr 1fr;
  }

  .set-head span:last-child,
  .set-row button {
    grid-column: 1 / -1;
  }

  .journal-tools,
  .compare-grid,
  .timeline-item,
  .detail-grid,
  .template-config-grid,
  .pr-tabs,
  .pr-row {
    grid-template-columns: 1fr;
  }

  .complete-workout-bar {
    position: sticky;
    bottom: 5.8rem;
    z-index: 2;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
  }
}

@media (max-width: 560px) {
  .auth-shell {
    padding: 1rem;
  }

  .auth-hero,
  .auth-card {
    width: 100%;
  }

  .auth-hero {
    padding: 1.5rem;
  }

  .auth-hero h1 {
    font-size: 2.15rem;
    line-height: 1.05;
  }

  .auth-card .tab {
    padding-inline: 0.55rem;
    font-size: 0.88rem;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: start;
    flex-direction: column;
  }

  .template-card {
    align-items: stretch;
    flex-direction: column;
  }

  .template-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .rest-timer {
    align-items: stretch;
    flex-direction: column;
  }
}
