:root {
  color-scheme: dark;
  --bg: #101213;
  --sidebar: #151718;
  --surface: #191c1d;
  --surface-raised: #202324;
  --divider: #2d3031;
  --text: #f1f3ee;
  --muted: #a5aaa4;
  --muted-strong: #c5cac2;
  --accent-rgb: 222, 251, 105;
  --accent: rgb(var(--accent-rgb));
  --accent-text: #181b17;
  --accent-soft: rgba(var(--accent-rgb), .1);
  --accent-border: rgba(var(--accent-rgb), .28);
  --danger: #ff9b93;
  --radius: 17px;
  --sidebar-width: 226px;
  --bottom-safe: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  font-family: 'Manrope', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 300px; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .47; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.125rem; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 1.0625rem; line-height: 1.3; }
.icon { flex: 0 0 auto; display: inline-block; vertical-align: middle; }
main:focus { outline: none; }
.skip { position: fixed; left: 12px; top: 12px; transform: translateY(-150%); z-index: 99; padding: 10px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-text); }
.skip:focus { transform: none; }

.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5; width: var(--sidebar-width);
  background: var(--sidebar); border-right: 1px solid #252829;
  display: flex; flex-direction: column; padding: 29px 16px 17px;
}
.brand {
  appearance: none; display: flex; align-items: center; gap: 11px; text-align: left;
  border: 0; background: transparent; border-radius: 10px; padding: 0; color: var(--text); width: fit-content;
}
.sidebar .brand { margin-left: 8px; }
.brand-mark {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent); color: var(--accent-text);
}
.brand-name { font-weight: 850; font-size: 1.0625rem; letter-spacing: .105em; line-height: 1.15; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; letter-spacing: 0; font-size: .75rem; white-space: nowrap; }
.side-nav { margin-top: 44px; display: grid; gap: 5px; }
.nav-button {
  display: flex; width: 100%; min-height: 46px; gap: 12px; align-items: center; text-align: left;
  padding: 9px 13px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: .9375rem; font-weight: 610;
  transition: color .14s, background .14s, border-color .14s;
}
.nav-button:hover { background: #222525; color: var(--text); }
.nav-button.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.profile-button {
  background: var(--surface); color: var(--text); border: 1px solid var(--divider); border-radius: 11px;
  display: flex; align-items: center; text-align: left; gap: 10px; padding: 9px; min-width: 0; margin-top: auto;
}
.profile-button:hover, .mobile-profile:hover,
.profile-button[aria-current="page"], .mobile-profile[aria-current="page"] {
  border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent);
}
.avatar {
  position: relative; display: grid; place-items: center; overflow: hidden;
  flex: 0 0 35px; width: 35px; height: 35px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border);
  font-size: .875rem; font-weight: 780;
}
.avatar-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-name { min-width: 0; }
.profile-name b, .profile-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-name b { font-size: .875rem; }
.profile-name small { color: var(--muted); font-size: .75rem; margin-top: 2px; }
.mobile-header, .mobile-nav { display: none; }

.main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width)); max-width: 1470px; min-width: 0;
  padding: 27px 34px 42px;
}
.page-head {
  min-height: 66px; margin-bottom: 21px; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.page-heading { min-width: 0; }
.page-heading h1 { font-size: clamp(1.8rem, 3vw, 2.43rem); font-weight: 780; line-height: 1.14; letter-spacing: -.043em; }
.page-detail { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); margin-top: 7px; font-size: .875rem; }
.page-detail .icon { color: var(--muted); }
.page-actions { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.page-actions:empty { display: none; }
.mode-pill {
  display: flex; align-items: center; gap: 7px; border: 1px solid var(--divider); border-radius: 8px;
  min-height: 34px; padding: 5px 10px; color: var(--muted-strong); background: var(--surface); font-size: .8125rem;
  font-weight: 600; white-space: nowrap;
}
.mode-pill:hover { border-color: var(--accent-border); color: var(--accent); }
.mode-pill .icon { color: var(--accent); }

.button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 8px;
  min-height: 43px; border: 1px solid transparent; border-radius: 9px; padding: 9px 14px;
  font-weight: 670; font-size: .875rem; line-height: 1.25; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.button > span { min-width: 0; }
.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); box-shadow: 0 1px 0 #fff6 inset; }
.primary:hover:not(:disabled) { filter: brightness(1.07); }
.primary:active:not(:disabled) { filter: brightness(.93); }
.secondary { background: #25282a; color: var(--text); border-color: #373a3b; }
.secondary:hover:not(:disabled) { background: #303433; border-color: #4b514b; }
.hero-secondary { background: #181b19be; color: #f0f2ec; border-color: #5a5c52; }
.hero-secondary:hover { background: #303430; border-color: #858b78; }
.text { background: transparent; color: var(--accent); padding-inline: 8px; border-color: transparent; }
.text:hover { background: var(--accent-soft); }
.quiet { color: var(--muted); }
.quiet:hover { background: #282b2b; color: var(--text); }
.danger { background: #532a29; border-color: #834342; color: #fff0ee; }
.danger:hover { background: #743735; }
.icon-button { width: 40px; height: 40px; min-height: 40px; padding: 0; background: var(--surface-raised); border-color: var(--divider); color: var(--muted-strong); flex-shrink: 0; }
.icon-button:hover { background: #343938; color: var(--text); }
.icon-button.subtle { background: transparent; border-color: transparent; color: var(--muted); }
.icon-button.subtle:hover { background: var(--surface-raised); color: var(--text); }
.icon-button.selected { color: var(--accent); border-color: var(--accent-border); }
.link-text { appearance: none; border: 0; background: transparent; padding: 0; color: var(--text); font-size: 1rem; font-weight: 700; text-align: left; }
.link-text:hover { color: var(--accent); }

.hero {
  min-height: 246px; position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; border-radius: 19px;
  background: #171b19; border: 1px solid #353931;
}
.hero-photo {
  position: absolute; z-index: -2; inset: 0;
  background: url('/assets/training-hero.jpg') no-repeat right 13% / 82% auto;
}
.hero::after {
  content: ''; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg, #181d19 0%, #181d19 11%, #181d19ee 24%, #151916a6 43%, #1115110b 70%),
    linear-gradient(0deg, #11141266 0%, transparent 41%);
}
.hero-content { position: relative; padding: 25px 34px 27px; max-width: min(600px, 95%); }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 6px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 6px;
  padding: 4px 8px; font-size: .6875rem; font-weight: 790; letter-spacing: .085em; text-transform: uppercase;
}
.hero h2 { font-size: clamp(2.35rem, 5vw, 3.7rem); font-weight: 830; line-height: 1.02; letter-spacing: -.055em; margin-top: 11px; overflow-wrap: anywhere; }
.hero p { margin-top: 9px; color: #d2d7ca; font-size: .9375rem; }
.hero p span { padding-inline: 3px; color: #a1ac91; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 20px; }
.hero-actions .button { min-height: 43px; padding-inline: 15px; }
.hero-actions .hero-secondary { min-width: 69px; }

.activity-section { margin-top: 22px; }
.section-heading { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 11px; }
.section-heading h2 { font-size: 1.23rem; }
.section-meta { flex-shrink: 0; display: flex; gap: 7px; align-items: center; font-size: .8125rem; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.metric { min-width: 0; padding: 13px 15px 12px; background: var(--surface); border: 1px solid var(--divider); border-radius: 13px; }
.metric-heading { display: flex; gap: 10px; align-items: center; color: var(--muted-strong); font-size: .875rem; font-weight: 590; }
.icon-tile {
  width: 37px; height: 37px; border-radius: 9px; display: inline-flex; justify-content: center; align-items: center;
  background: var(--accent-soft); color: var(--accent); flex: 0 0 auto;
}
.icon-tile.mint { background: rgba(var(--accent-rgb), .14); }
.icon-tile.purple { color: #d4bdf4; background: #342d40; }
.icon-tile.sand { color: #f2c99a; background: #3c3229; }
.icon-tile.plain { color: #b6beb3; background: #292d2d; }
.metric-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 6px; }
.metric-bottom strong { font-weight: 780; font-size: 1.875rem; letter-spacing: -.045em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.metric-bottom strong small { font-size: .875rem; letter-spacing: 0; color: var(--muted); font-weight: 630; }
.metric-change { display: inline-flex; flex: 0 0 auto; }
.delta { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; border-radius: 5px; padding: 2px 7px; font-size: .75rem; font-weight: 720; line-height: 1; white-space: nowrap; }
.delta.up { background: #303a23; color: #def786; }
.delta.down { background: #3d302b; color: #ffc0a5; }
.delta.neutral { background: #2a2e2d; color: var(--muted); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr); gap: 14px; margin-top: 16px; align-items: stretch; }
.panel { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.panel-head p, .head-icon p { margin-top: 4px; color: var(--muted); font-size: .8125rem; line-height: 1.38; }
.head-icon { display: flex; gap: 10px; align-items: center; min-width: 0; }
.head-icon > div { min-width: 0; }
.chart-panel, .compare-panel, .recent-panel, .coach-panel, .motivation-panel, .records-panel { padding: 17px 18px; }
.chart-panel .panel-head { align-items: center; }
.segmented {
  display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; border: 1px solid #303435; border-radius: 8px;
  padding: 3px; background: #131617; flex: 0 0 auto;
}
.segmented button, .catalog-groups button {
  min-height: 28px; background: transparent; padding: 4px 9px;
  color: var(--muted); border: 1px solid transparent; border-radius: 5px; font-size: .75rem; white-space: nowrap; font-weight: 640;
}
.segmented button:hover, .catalog-groups button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: #2c3130; border-color: #3b403d; color: var(--text); }
.chart-box { display: flex; width: 100%; margin-top: 20px; padding-bottom: 2px; }
.chart-axis { position: relative; flex: 0 0 48px; height: 148px; }
.chart-axis i, .chart-grid i { position: absolute; width: 100%; top: var(--position); }
.chart-axis i { display: flex; align-items: center; height: 0; }
.chart-axis i span { font-size: .6875rem; color: #a5aaa3; font-style: normal; font-variant-numeric: tabular-nums; }
.chart-content { min-width: 0; flex: 1; margin-right: 9px; }
.chart-plot { height: 148px; position: relative; }
.chart-grid, .chart-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart-grid i { border-top: 1px dashed #343838; }
.chart-grid i:last-child { border-top-style: solid; }
.chart-grid span { display: none; }
.chart-svg stop { stop-color: var(--accent); }
.chart-stroke { fill: none; stroke: var(--accent); stroke-width: 2.6px; stroke-linecap: round; }
.chart-bar { fill: var(--accent); fill-opacity: .76; }
.chart-ticks { position: relative; height: 19px; margin-top: 10px; }
.chart-ticks span { position: absolute; transform: translateX(-50%); color: #a5aaa3; font-size: .6875rem; white-space: nowrap; }
.chart-ticks span:first-child:not(:only-child) { transform: translateX(0); }
.chart-ticks span:last-child:not(:only-child) { transform: translateX(-100%); }
.chart-point { position: absolute; top: var(--top); left: var(--left); transform: translate(-50%, -50%); display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--accent); }
.point-core { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--accent-border); }
.chart-point.last .point-core, .chart-point:only-of-type .point-core {
  width: 9px; height: 9px; box-shadow: 0 0 0 4px var(--accent-soft), 0 0 10px var(--accent-border);
}
.chart-point:hover, .chart-point:focus-visible, .chart-point.point-selected { z-index: 2; }
.point-label { display: none; position: absolute; left: 50%; transform: translateX(-50%); bottom: 28px; padding: 6px 8px; color: var(--text); background: var(--surface-raised); border: 1px solid var(--accent-border); border-radius: 6px; font-size: .75rem; white-space: nowrap; pointer-events: none; }
.chart-point:hover .point-label, .chart-point:focus-visible .point-label, .chart-point.point-selected .point-label { display: block; }
.chart-point.first .point-label { left: 10%; transform: none; }
.chart-point.last .point-label { right: 8%; left: auto; transform: none; }
.chart-empty { margin-top: 17px; min-height: 177px; display: grid; place-items: center; position: relative; }
.chart-empty p { position: relative; padding: 8px 12px; color: var(--muted-strong); background: var(--surface); border-radius: 7px; text-align: center; font-size: .875rem; }
.empty-plot { position: absolute; inset: 0; opacity: .6; background: repeating-linear-gradient(to bottom, transparent 0 35px, #393e3c 35px 36px); }

.comparison-list { display: grid; margin-top: 10px; }
.comparison-row {
  display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px; padding: 7px 0; width: 100%; border: 0; border-bottom: 1px solid #2d3130; text-align: left; background: transparent;
}
.comparison-row:last-child { border-bottom: none; }
.comparison-row > span:first-child { min-width: 0; }
.comparison-row b, .comparison-row small { display: block; }
.comparison-row b { font-size: .875rem; font-weight: 665; }
.comparison-row:hover b { color: var(--accent); }
.comparison-row small { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; margin-top: 2px; }
.compare-divider { padding-inline: 3px; color: #b8c4a0; }
.comparison-empty { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); margin-top: 17px; font-size: .875rem; }
.comparison-empty .icon { margin-top: 2px; }
.coach-panel { align-self: start; background: linear-gradient(122deg, var(--accent-soft), transparent 87%), var(--surface); border-color: var(--accent-border); }
.coach-copy { color: var(--muted-strong); font-size: .875rem; margin-top: 13px; }
.motivation-panel { background: linear-gradient(122deg, #30261d, #1e201b 87%); border-color: #514132; }
.motivation-copy { display: grid; gap: 6px; margin: 13px 0 8px; font-size: .9375rem; }
.motivation-copy p + p { color: var(--muted-strong); font-size: .875rem; }
.motivation-panel .text { color: #f2c99a; padding-inline: 7px; min-height: 36px; }
.motivation-panel .text:hover { background: #3b3024; }
.overview-aside { display: grid; gap: 14px; align-content: start; }
.journal-shortcut { display: flex; align-items: center; text-align: left; gap: 10px; padding: 13px 17px; width: 100%; }
.journal-shortcut > span:nth-child(2) { flex: 1; }
.journal-shortcut b, .journal-shortcut small { display: block; }
.journal-shortcut b { font-size: .9375rem; }
.journal-shortcut small { color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.journal-shortcut > .icon { color: var(--muted); }
.journal-shortcut:hover b { color: var(--accent); }
.recent-panel .panel-head { align-items: center; }
.recent-panel .panel-head .button { min-height: 30px; }
.history-list { margin-top: 3px; }
.history-row {
  display: flex; width: 100%; align-items: center; min-width: 0; text-align: left; gap: 10px;
  min-height: 60px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--divider); background: transparent;
}
.history-row:last-child { border-bottom: 0; }
.history-row:hover .history-text b { color: var(--accent); }
.history-row > .icon { color: var(--muted); }
.history-text { display: grid; gap: 3px; flex: 1; min-width: 0; }
.history-text b { overflow-wrap: anywhere; font-size: .9375rem; font-weight: 670; line-height: 1.25; }
.history-text small { color: var(--muted); font-size: .75rem; }
.history-volume { color: var(--muted-strong); font-weight: 680; font-size: .875rem; text-align: right; white-space: nowrap; }
.history-volume small { font-weight: 530; color: var(--muted); }
.history-panel { padding: 18px; }
.history-filter { display: flex; justify-content: space-between; align-items: center; gap: 13px; margin-bottom: 15px; }
.history-filter .search-field { width: min(100%, 390px); }
.history-filter .segmented { align-self: center; }

.plan-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cardio-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; margin-bottom: 14px; }
.plan-empty .empty-state { min-height: 235px; }
.plan-empty .icon-tile { width: 44px; height: 44px; }
.plan-card { padding: 18px; display: flex; flex-direction: column; }
.plan-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.plan-top .icon-button { margin: -2px -4px -2px 0; }
.plan-card h3 { font-size: 1.33rem; font-weight: 730; overflow-wrap: anywhere; letter-spacing: -.02em; }
.plan-card p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.plan-card .button { margin-top: auto; }
.plan-exercises { list-style: none; padding: 0; margin: 12px 0 17px; display: grid; gap: 6px; font-size: .875rem; color: var(--muted-strong); }
.plan-exercises li { display: flex; justify-content: space-between; gap: 8px; padding-left: 14px; position: relative; }
.plan-exercises li > span { min-width: 0; overflow-wrap: anywhere; }
.plan-exercises small { flex: none; font-size: .8125rem; color: var(--muted); }
.plan-exercises li::before { content: ''; position: absolute; top: .68em; left: 1px; width: 4px; height: 4px; border-radius: 50%; background: #9caa86; }
.builtin-plans { margin-top: 16px; padding-inline: 15px; }
.builtin-plans > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 49px; cursor: pointer;
  list-style: none; color: var(--muted-strong); font-size: .875rem; font-weight: 660;
}
.builtin-plans > summary::-webkit-details-marker { display: none; }
.builtin-plans > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.builtin-plans[open] > summary .icon { transform: rotate(180deg); }
.builtin-plans > .plan-grid { margin-bottom: 15px; }
.plan-name { padding: 16px 17px; }
.plan-editor-list { list-style: none; padding: 0 16px; margin: 0; }
.plan-exercise {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px 16px;
  padding: 12px 0; border-bottom: 1px solid var(--divider);
}
.plan-exercise:last-child { border-bottom: 0; }
.plan-exercise h3 { font-size: 1rem; overflow-wrap: anywhere; }
.plan-exercise-controls { display: flex; align-items: center; gap: 12px; }
.plan-exercise-controls .icon-button { width: 36px; height: 39px; min-height: 39px; }
.field.plan-set-field { display: flex; align-items: center; gap: 7px; }
.field.plan-set-field input { width: 57px; min-height: 39px; padding-inline: 5px; text-align: center; }
.plan-editor-actions { position: sticky; bottom: 12px; z-index: 3; box-shadow: 0 -5px 24px #0e10117a; }
.plan-editor-actions .primary { margin-left: auto; }

.session-grid { display: grid; gap: 13px; max-width: 835px; }
.session-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 17px; }
.field { display: grid; gap: 6px; min-width: 0; text-align: left; }
.field > span:first-child { color: var(--muted-strong); font-size: .875rem; font-weight: 630; }
.field.full { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .search-field {
  border: 1px solid #383c3c; min-height: 43px; border-radius: 8px; background: #131617;
  padding: 8px 10px; width: 100%; min-width: 0;
}
.field input, .field select, .field textarea { font-size: 1rem; }
.workout-date { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.workout-date input { width: min(10.5rem, 50%); }
.field textarea { resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder, .search-field input::placeholder { color: #a2a8a0; opacity: 1; }
.select-wrap { display: block; position: relative; }
.select-wrap select { appearance: none; padding-right: 36px; }
.select-wrap > .icon { position: absolute; pointer-events: none; top: 50%; right: 11px; transform: translateY(-50%); color: var(--muted); }
.search-field { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 6px 10px; }
.search-field:focus-within { border-color: var(--accent); outline: 1px solid var(--accent); }
.search-field input { background: none; border: 0; color: var(--text); width: 100%; min-width: 0; outline: none; }
.search-field input:focus-visible { outline: none; }
.exercise-card { padding: 15px 17px 10px; }
.exercise-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
.exercise-head > div { flex: 1; min-width: 0; }
.exercise-head > .exercise-tools { flex: none; }
.exercise-tools { display: flex; gap: 5px; align-items: center; }
.session-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 5px 0 1px; }
.session-tools .button { min-height: 38px; }
.exercise-head h2 { overflow-wrap: anywhere; }
.exercise-head p { margin-top: 3px; color: var(--muted); font-size: .8125rem; }
.exercise-set-count {
  display: inline-flex; margin-top: 5px; padding: 2px 6px; border-radius: 5px;
  color: var(--accent); background: var(--accent-soft); font-size: .8125rem; line-height: 1.3;
}
.sets { display: grid; gap: 5px; }
.set-row { display: grid; grid-template-columns: 32px minmax(66px, 1fr) minmax(50px, .9fr) minmax(50px, .9fr) 42px 39px; align-items: center; gap: 9px; }
.set-row > span { text-align: center; }
.set-heading { min-height: 26px; margin-bottom: 1px; color: var(--muted); font-size: .8125rem; font-weight: 610; }
.set-past { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.set-index { color: var(--muted); font-size: .875rem; font-weight: 670; }
.set-input {
  border: 1px solid #353939; border-radius: 7px; background: #121616; width: 100%; min-width: 0; min-height: 39px;
  padding: 6px 4px; font-size: 1rem; text-align: center; font-variant-numeric: tabular-nums;
}
.set-input[aria-invalid="true"] { border-color: #b96359; }
.set-row.checked .set-input { background: var(--accent-soft); border-color: var(--accent-border); }
.set-row.checked .set-index { color: var(--accent); }
.set-check {
  background: #292d2d; color: var(--muted); border: 1px solid #3a3f3c; border-radius: 8px;
  height: 39px; display: grid; place-items: center;
}
.set-check:hover { border-color: var(--accent); }
.set-check.checked { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.remove-set { min-height: 37px; height: 37px; width: 36px; }
.add-set { width: 100%; margin-top: 6px; color: var(--accent); background: transparent; }
.add-set:hover { background: var(--accent-soft); }
.workout-notes { padding: 14px 17px; }
.session-end { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; }
.session-numbers { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; color: var(--muted); font-size: .875rem; }
.session-numbers b { color: var(--text); font-size: 1rem; }
.session-grid > .quiet { justify-self: start; }

.progress-top { margin-bottom: 14px; max-width: 430px; }
.progress-sections { margin-bottom: 14px; }
.progress-sections .segmented button { min-height: 34px; padding-inline: 14px; font-size: .875rem; }
.cardio-switch { margin-bottom: 14px; }
.weight-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weigh-date, .metric-note { font-size: .8125rem; color: var(--muted); margin-top: 4px; }
.alcohol-metrics .metric-bottom strong, .cardio-metrics .metric-bottom strong { white-space: normal; overflow-wrap: anywhere; }
.alcohol-form, .cardio-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.alcohol-form select { text-overflow: ellipsis; }
.alcohol-form .subtle-text { font-size: .8125rem; }
.alcohol-form-total {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 11px; border: 1px solid #3b4336; border-radius: 8px; background: #21281e; color: var(--muted-strong);
}
.alcohol-form-total strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.progress-metrics .metric-bottom strong { font-size: clamp(1.1rem, 2.5vw, 1.8rem); white-space: normal; }
.detail-chart, .records-panel { margin-top: 14px; }
.detail-chart .chart-axis, .detail-chart .chart-plot { height: 190px; }
.chart-view { margin: 14px 0 0; }
.records-panel .panel-head { margin-bottom: 8px; }
.profile-grid, .settings-grid { display: grid; gap: 14px; max-width: 1080px; }
.profile-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); margin-bottom: 14px; }
.profile-card, .theme-panel { padding: 20px; }
.profile-card {
  border-color: var(--accent-border);
  background: linear-gradient(140deg, var(--accent-soft), transparent 72%), var(--surface);
}
.profile-card-header { display: flex; align-items: center; gap: 15px; min-width: 0; }
.profile-card-header > div { min-width: 0; }
.profile-card-header .avatar {
  flex-basis: 68px; width: 68px; height: 68px; color: var(--accent-text);
  background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); font-size: 1.4rem;
}
.profile-card-header h2 { font-size: 1.45rem; overflow-wrap: anywhere; }
.profile-card-header p { color: var(--muted-strong); font-size: .875rem; margin-top: 3px; overflow-wrap: anywhere; }
.profile-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 17px 0 15px; padding: 12px 0;
  border-block: 1px solid var(--divider);
}
.profile-stats > div { display: flex; flex-direction: column-reverse; gap: 2px; align-items: flex-start; }
.profile-stats dt { color: var(--muted-strong); font-size: .875rem; }
.profile-stats dd { margin: 0; font-size: 1.25rem; font-weight: 780; font-variant-numeric: tabular-nums; }
.profile-edit { display: flex; align-items: flex-end; gap: 8px; }
.profile-edit .field { flex: 1; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.theme-option { display: block; position: relative; cursor: pointer; min-width: 0; }
.theme-option input { position: absolute; width: 1px; height: 1px; left: 50%; top: 50%; margin: 0; opacity: 0; }
.theme-sample {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-height: 78px;
  padding: 10px; color: var(--muted-strong); background: #151819; border: 1px solid var(--divider);
  border-radius: 9px; font-size: .875rem; font-weight: 650;
}
.theme-option:hover .theme-sample { border-color: rgba(var(--swatch-rgb), .6); }
.theme-option input:focus-visible + .theme-sample { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-option input:checked + .theme-sample { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.theme-swatch {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: rgb(var(--swatch-rgb)); color: var(--accent-text);
}
.theme-swatch .icon { visibility: hidden; }
.theme-option input:checked + .theme-sample .icon { visibility: visible; }
.settings-panel { padding: 17px; }
.settings-panel > .button { margin-top: 13px; }
.settings-panel .head-icon p { font-size: .875rem; }
.settings-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.settings-form .field { max-width: 180px; }

.schedule-layout, .goals-layout {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px;
  align-items: start; max-width: 1080px;
}
.schedule-week, .goals-main { display: grid; gap: 9px; min-width: 0; }
.schedule-day, .schedule-today { padding: 10px 14px; }
.schedule-day.is-today, .schedule-today {
  border-color: var(--accent-border); background: linear-gradient(135deg, var(--accent-soft), transparent 80%), var(--surface);
}
.schedule-today { margin-top: 14px; }
.schedule-today .panel-head { align-items: center; }
.schedule-day-head { display: flex; align-items: center; gap: 9px; min-height: 36px; }
.schedule-day-head h2 { font-size: 1rem; }
.schedule-day-head small { color: var(--muted); font-size: .8125rem; }
.schedule-day-head .icon-button { margin-left: auto; width: 36px; min-height: 36px; height: 36px; }
.schedule-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 0 2px; margin-top: 6px; min-width: 0;
  border-top: 1px solid var(--divider);
}
.schedule-row time { color: var(--accent); font-size: .875rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.schedule-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.schedule-name b, .schedule-name small { display: block; }
.schedule-name small { color: var(--muted); font-size: .8125rem; }
.schedule-row .button, .schedule-row .icon-button { min-height: 36px; }
.reminders-panel, .suggestions-panel { padding: 16px; }
#reminders-heading { scroll-margin-block-start: 14px; }
.reminders-panel .stack-form { margin-top: 13px; }
.reminder-group { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--divider); }
.reminder-toggle { display: flex; align-items: center; min-height: 36px; gap: 9px; font-weight: 650; }
.reminder-toggle input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.reminder-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.reminders-panel .subtle-text, .suggestions-panel .subtle-text { color: var(--muted); font-size: .875rem; }
.goals-shortcut { display: flex; max-width: 1080px; margin-bottom: 14px; }
.goals-shortcut .goal-star { flex: none; }
.stars-panel {
  display: flex; align-items: center; gap: 13px; padding: 17px; border-color: #544233;
  background: linear-gradient(130deg, #3a2e24, var(--surface) 78%);
}
.stars-panel p, .goal-card p, .suggestion-row p, .summary-exercise p, .summary-skipped p {
  color: var(--muted-strong); font-size: .875rem;
}
.star-medal {
  display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px;
  background: #4b3828; color: #ffd197;
}
.goal-card { padding: 13px 16px; }
.goal-card-head, .summary-exercise > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.goal-card-head h3, .suggestion-row h3 { overflow-wrap: anywhere; }
.goal-star {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 6px;
  white-space: nowrap; font-size: .875rem; font-weight: 700; color: #ffd197; background: #392e24;
}
.goal-progress { display: flex; align-items: center; gap: 8px; margin: 9px 0 5px; }
.goal-progress progress { flex: 1; min-width: 0; height: 8px; border: 0; border-radius: 6px; overflow: hidden; appearance: none; }
.goal-progress progress::-webkit-progress-bar { background: var(--divider); }
.goal-progress progress::-webkit-progress-value { background: var(--accent); }
.goal-progress progress::-moz-progress-bar { background: var(--accent); }
.goal-progress span { color: var(--muted-strong); font-variant-numeric: tabular-nums; font-size: .875rem; }
.suggestion-row { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.suggestion-row:last-child { border-bottom: 0; padding-bottom: 0; }
.suggestion-row > div { min-width: 0; flex: 1; }
.suggestion-row p, .suggestions-panel > .subtle-text { margin-top: 4px; }
.summary-reward {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #ffd197; background: #392e24;
  padding: 8px 10px; margin-bottom: 10px; border-radius: 9px;
}
.summary-reward .button { margin-left: auto; color: #ffd197; min-height: 35px; }
.summary-stats { margin-bottom: 12px; }
.detail-stats.summary-stats span { background: var(--accent-soft); }
.summary-list { display: grid; gap: 7px; }
.summary-exercise, .summary-skipped { border: 1px solid var(--divider); border-radius: 9px; padding: 10px; }
.summary-exercise > div { flex-wrap: wrap; }
.summary-exercise h3 { overflow-wrap: anywhere; }
.summary-exercise p, .summary-skipped p { margin-top: 3px; }
.summary-exercise strong { color: var(--text); }
.summary-change { margin-left: 7px; color: var(--accent); font-weight: 650; }
.record-label { display: inline-flex; align-items: center; gap: 4px; color: #ffd197; font-size: .8125rem; font-weight: 690; }
.summary-skipped { margin-top: 9px; }

.empty-state { text-align: center; min-height: 145px; padding: 20px 14px; display: grid; justify-items: center; align-content: center; gap: 6px; }
.empty-state h3 { margin-top: 4px; }
.empty-state p { color: var(--muted); font-size: .875rem; }
.empty-state .button { margin-top: 7px; }
.loading { min-height: 90vh; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px; color: var(--muted); text-align: center; }
.spinner { width: 21px; height: 21px; border: 2px solid #333b2b; border-top-color: var(--accent); border-radius: 50%; animation: rotate .8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.load-error { display: grid; gap: 14px; justify-items: center; max-width: 420px; }
.sync-notice { display: flex; align-items: center; background: #242920; border: 1px solid #404c34; border-radius: 9px; padding: 5px 9px; gap: 8px; margin-bottom: 10px; font-size: .8125rem; color: var(--muted-strong); }
.sync-notice > span { flex: 1; }
.sync-notice > .icon { color: var(--accent); }
.sync-notice .button { min-height: 29px; }

dialog {
  width: min(100% - 28px, 570px); max-height: min(86vh, 740px); max-height: min(86dvh, 740px);
  padding: 0; border: 1px solid #464b43; border-radius: 18px;
  box-shadow: 0 14px 70px #0009; background: #1b1e1f; color: var(--text);
  overscroll-behavior: contain;
}
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #080b0bd1; backdrop-filter: blur(3px); }
body:has(dialog[open]) { overflow: hidden; }
.modal-head { display: flex; flex: none; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--divider); padding: 16px 19px 13px; }
.modal-head h2 { padding-top: 5px; font-size: 1.33rem; overflow-wrap: anywhere; }
.modal-head p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.modal-head .icon-button { margin: -3px -6px 0 0; }
.modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 19px 16px; }
.modal-actions { flex: none; border-top: 1px solid var(--divider); padding: 12px 19px; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.modal-list { display: grid; }
.modal-list-row { min-height: 55px; display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--divider); }
.modal-list-row:last-child { border: 0; }
.modal-list-row > div { min-width: 0; flex: 1; }
.modal-list-row b, .modal-list-row small { display: block; }
.modal-list-row b { font-weight: 675; font-size: .9375rem; overflow-wrap: anywhere; }
.modal-list-row small, .modal-list-row > span:last-child { color: var(--muted); font-size: .8125rem; }
.modal-list-row > span:last-child { flex: 0 0 auto; }
.confirm-copy { color: var(--muted-strong); }
.modal-feedback { display: flex; align-items: center; gap: 7px; padding: 8px; margin-bottom: 12px; border-radius: 6px; background: #3a3725; color: #e9dbab; font-size: .875rem; }
.picker-filters { position: sticky; top: -14px; z-index: 2; margin-top: -2px; padding: 2px 0 6px; background: #1b1e1f; }
.catalog-groups { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 9px; }
.catalog-groups button { background: #282c2b; min-height: 33px; font-size: .8125rem; }
.catalog-groups button[aria-pressed="true"] { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }
.catalog-segments button { background: #232625; }
.picker-count { min-height: 31px; margin-top: 3px; }
.picker-count[aria-pressed="true"] { background: var(--accent-soft); }
.picker-actions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; width: 100%; }
.catalog-list { display: grid; gap: 5px; }
.catalog-row { display: flex; width: 100%; align-items: center; gap: 3px; border: 1px solid var(--divider); border-radius: 9px; padding-right: 4px; }
.catalog-row.picked { border-color: var(--accent-border); background: var(--accent-soft); }
.catalog-select { min-width: 0; min-height: 58px; text-align: left; flex: 1; display: flex; align-items: center; gap: 9px; padding: 6px 5px; border: 0; border-radius: 8px; background: transparent; }
.catalog-select:not(:disabled):hover .catalog-name b { color: var(--accent); }
.catalog-name { flex: 1; min-width: 0; }
.catalog-thumb { display: grid; place-items: center; flex: 0 0 39px; height: 42px; overflow: hidden; border-radius: 6px; background: #232627; }
.catalog-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.catalog-name b, .catalog-name small { display: block; overflow-wrap: anywhere; }
.catalog-name b { font-size: .9375rem; line-height: 1.23; }
.catalog-name small { color: var(--muted); font-size: .8125rem; margin-top: 3px; line-height: 1.2; }
.catalog-mark { color: var(--accent); background: var(--accent-soft); border-radius: 6px; width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; }
.catalog-row.picked .catalog-mark { color: var(--accent-text); background: var(--accent); }
.catalog-info { border-color: transparent; background: transparent; width: 41px; height: 41px; min-height: 41px; }
.catalog-info:hover { color: var(--accent); }
.catalog-empty { color: var(--muted); text-align: center; padding: 18px 4px; font-size: .875rem; }
.technique-guide { display: grid; gap: 13px; }
.technique-frames { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.technique-frames figure, .technique-photo { margin: 0; overflow: hidden; border: 1px solid var(--divider); border-radius: 9px; background: #222626; }
.technique-frames img, .technique-photo img { display: block; width: 100%; height: clamp(137px, 33dvh, 258px); object-fit: contain; background: #171a1c; }
.technique-photos img { height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.technique-photo img { height: clamp(140px, 33dvh, 260px); object-fit: contain; }
.technique-guide figcaption { padding: 6px 7px; color: var(--muted-strong); font-size: .8125rem; line-height: 1.15; text-align: center; }
.technique-steps { display: grid; gap: 7px; padding-left: 22px; margin: 7px 0 0; color: var(--muted-strong); }
.technique-steps li::marker { color: var(--accent); }
.technique-note { white-space: pre-wrap; margin-top: 7px; color: var(--muted-strong); }
.technique-details summary { cursor: pointer; font-size: .875rem; color: var(--muted-strong); padding-bottom: 7px; }
.technique-credit { color: var(--muted); font-size: .75rem; }
.workout-order { padding: 0; margin: 0; list-style: none; }
.order-row { display: flex; gap: 6px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--divider); }
.order-row:last-child { border: 0; }
.order-row span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.stack-form { display: grid; gap: 12px; }
.subtle-text { color: var(--muted); font-size: .875rem; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.detail-stats span, .set-chips span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 6px; background: #2c312c; color: var(--muted-strong); font-size: .8125rem; white-space: nowrap; }
.detail-exercise { border-bottom: 1px solid var(--divider); padding: 10px 0; }
.detail-exercise-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.detail-exercise-head button { overflow-wrap: anywhere; }
.detail-exercise > small { margin-top: 5px; display: block; color: var(--muted); font-size: .75rem; }
.set-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.detail-notes { margin-top: 12px; }
.detail-notes p { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted-strong); font-size: .875rem; }
.detail-controls { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 9px; }
.detail-controls .button { min-height: 34px; }
.detail-controls .icon-button { margin-left: auto; }

.rest-host, .toast-host { position: fixed; z-index: 8; right: 20px; bottom: calc(17px + var(--bottom-safe)); pointer-events: none; }
.rest-timer, .toast {
  pointer-events: auto; display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 7px 10px;
  border-radius: 11px; border: 1px solid var(--accent-border); color: var(--muted-strong);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface);
  box-shadow: 0 7px 28px #0007;
}
.rest-timer > div { display: flex; align-items: center; gap: 8px; padding-right: 4px; font-size: .875rem; }
.rest-timer b { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 1.04rem; }
.timer-mark { color: var(--accent); display: inline-flex; }
.rest-timer .button, .rest-timer .icon-button, .toast .icon-button { min-height: 34px; height: 34px; }
.rest-timer .icon-button, .toast .icon-button { width: 34px; }
.rest-timer .button { padding: 4px 8px; }
.toast { width: max-content; max-width: min(410px, calc(100vw - 25px)); font-size: .875rem; }
.toast > .icon { color: var(--accent); }
.toast.info { background: #2a2b24; border-color: #57583d; }
.has-rest .toast-host { bottom: calc(78px + var(--bottom-safe)); }

@media (min-width: 1600px) {
  .main { margin-left: max(var(--sidebar-width), calc((100vw + var(--sidebar-width) - 1470px) / 2)); }
}
@media (min-width: 1161px) {
  .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1160px) {
  :root { --sidebar-width: 203px; }
  .main { padding-inline: 24px; }
  .overview-grid { grid-template-columns: minmax(0, 1.44fr) minmax(0, 1fr); }
  .hero-content { padding-inline: 28px; }
  .metric { padding-inline: 12px; }
  .metric-bottom strong { font-size: 1.65rem; }
  .plan-card { padding: 14px; }
}
@media (max-width: 900px) and (min-width: 761px) {
  :root { --sidebar-width: 178px; }
  .sidebar { padding-inline: 11px; }
  .main { padding-inline: 18px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .schedule-layout, .goals-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .mobile-header {
    display: flex; gap: 9px; align-items: center; justify-content: space-between; border-bottom: 1px solid #242829;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 15px 9px; background: #141617;
  }
  .mobile-header .brand-mark { width: 35px; height: 35px; border-radius: 9px; }
  .mobile-header .brand-mark .icon { width: 23px; height: 23px; }
  .mobile-header .brand-name { font-size: .9375rem; }
  .mobile-header .brand small { font-size: .6875rem; margin-top: 2px; }
  .mobile-profile {
    display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 4px 8px 4px 5px;
    color: var(--text); background: var(--surface); border: 1px solid var(--divider); border-radius: 9px;
    font-size: .875rem; font-weight: 650;
  }
  .mobile-profile .avatar { width: 30px; height: 30px; flex-basis: 30px; }
  .mobile-nav {
    position: fixed; z-index: 6; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
    padding: 5px 7px calc(5px + var(--bottom-safe)); inset: auto 0 0; background: #151819f5;
    backdrop-filter: blur(12px); border-top: 1px solid var(--divider);
  }
  .mobile-nav .nav-button {
    justify-content: center; text-align: center; flex-direction: column; padding: 4px 1px; min-height: 49px; gap: 3px;
    border: 0; font-size: .6875rem; line-height: 1.1; white-space: nowrap; font-weight: 640;
  }
  .mobile-nav .icon { width: 21px; height: 21px; }
  .main { margin-left: 0; width: 100%; padding: 17px 15px calc(76px + var(--bottom-safe)); }
  .has-rest .main { padding-bottom: calc(128px + var(--bottom-safe)); }
  .page-head { margin-bottom: 14px; min-height: 51px; gap: 8px; align-items: flex-start; }
  .page-heading h1 { font-size: clamp(1.49rem, 5.7vw, 2rem); }
  .page-detail { font-size: .8125rem; margin-top: 4px; }
  .page-detail .icon { width: 14px; height: 14px; }
  .page-actions .button { min-height: 37px; font-size: .8125rem; padding: 6px 8px; gap: 5px; }
  .page-actions .button .icon { width: 16px; height: 16px; }
  .mode-pill { padding: 3px 6px; min-height: 28px; gap: 4px; font-size: .6875rem; }
  .mode-pill .icon { width: 13px; height: 13px; }
  .hero { min-height: 218px; }
  .hero-photo { background-size: auto 112%; background-position: 83% 44%; }
  .hero::after { background: linear-gradient(90deg, #151a16 0%, #171a16f0 16%, #171a16ab 40%, #11151009 83%),
    linear-gradient(0deg, #11161270 0%, transparent 45%); }
  .hero-content { padding: 18px; max-width: 100%; }
  .hero h2 { font-size: clamp(2.1rem, 8vw, 3.05rem); margin-top: 9px; }
  .hero p { font-size: .875rem; }
  .hero-actions { margin-top: 16px; gap: 6px; }
  .hero-actions .button { min-height: 41px; padding-inline: 10px; font-size: .8125rem; gap: 5px; }
  .hero-actions .hero-secondary { min-width: 54px; }
  .activity-section { margin-top: 17px; }
  .overview-aside { gap: 10px; }
  .section-heading { margin-bottom: 8px; }
  .section-heading h2 { font-size: 1.08rem; }
  .section-meta { font-size: .75rem; gap: 5px; }
  .metrics { gap: 6px; }
  .metric { padding: 7px 7px 8px; border-radius: 10px; }
  .metric-heading { align-items: flex-start; flex-direction: column; gap: 5px; font-size: .75rem; line-height: 1.18; min-height: 46px; }
  .metric-heading .icon-tile { width: 28px; height: 28px; border-radius: 6px; }
  .metric-heading .icon { width: 16px; height: 16px; }
  .metric-bottom { display: grid; justify-items: start; gap: 5px; margin-top: 4px; }
  .metric-bottom strong { font-size: clamp(1.15rem, 4.8vw, 1.62rem); letter-spacing: -.035em; }
  .metric-bottom strong small { font-size: .6875rem; }
  .delta { min-height: 21px; padding: 2px 5px; }
  .overview-grid { grid-template-columns: 1fr; margin-top: 10px; gap: 10px; }
  .panel { border-radius: 13px; }
  .chart-panel, .compare-panel, .recent-panel, .coach-panel, .motivation-panel, .history-panel, .records-panel { padding: 13px 12px; }
  .cardio-shortcut { padding: 11px 12px; }
  .cardio-shortcut .button { padding-inline: 9px; }
  .chart-panel .panel-head h2 { font-size: 1.04rem; }
  .chart-panel .panel-head p { font-size: .75rem; }
  .chart-box { margin-top: 20px; }
  .chart-axis { flex-basis: 42px; }
  .overview-grid .chart-plot, .overview-grid .chart-axis { height: 112px; }
  .segmented button { min-height: 28px; padding-inline: 6px; font-size: .6875rem; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .plan-card { padding: 12px; }
  .plan-card h3 { font-size: 1.14rem; }
  .profile-card, .theme-panel { padding: 15px; }
  .profile-card-header .avatar { flex-basis: 58px; width: 58px; height: 58px; }
  .plan-exercises { font-size: .8125rem; }
  .plan-exercise { grid-template-columns: minmax(0, 1fr); }
  .plan-exercise-controls { justify-content: space-between; }
  .plan-editor-list { padding-inline: 11px; }
  .plan-editor-actions { bottom: calc(66px + var(--bottom-safe)); }
  .has-rest .plan-editor-actions { bottom: calc(120px + var(--bottom-safe)); }
  .session-meta, .exercise-card, .workout-notes, .session-end { padding-inline: 10px; }
  .set-row { grid-template-columns: 22px minmax(54px, 1fr) minmax(50px, .9fr) minmax(42px, .8fr) 38px 29px; gap: 5px; }
  .set-row .remove-set { width: 29px; }
  .set-row .remove-set .icon { width: 16px; height: 16px; }
  .set-input, .set-check { min-height: 42px; height: 42px; }
  .session-end { flex-wrap: wrap; }
  .session-end .button { margin-left: auto; }
  .history-row { gap: 7px; }
  .history-row > .icon { width: 13px; height: 13px; }
  .history-volume { font-size: .75rem; }
  .progress-metrics .metric-bottom strong { font-size: clamp(.82rem, 3.9vw, 1.13rem); }
  .progress-metrics .metric-heading { min-height: 51px; }
  .weight-metrics .metric-heading { min-height: 47px; }
  .weight-metrics .metric { padding: 9px 10px; }
  .alcohol-metrics .metric-heading, .cardio-metrics .metric-heading { min-height: 61px; }
  .alcohol-metrics .metric-note, .cardio-metrics .metric-note { font-size: .75rem; line-height: 1.3; }
  .exercise-tools { gap: 4px; }
  .exercise-head .icon-button { width: 35px; min-height: 36px; height: 36px; }
  .session-tools .button { padding: 6px 9px; min-height: 38px; }
  .catalog-groups { gap: 4px; }
  .catalog-groups button { padding-inline: 7px; }
  .catalog-info { width: 38px; min-height: 41px; }
  .detail-chart .chart-axis, .detail-chart .chart-plot { height: 149px; }
  .rest-host, .toast-host { right: 10px; bottom: calc(66px + var(--bottom-safe)); }
  .has-rest .toast-host { bottom: calc(120px + var(--bottom-safe)); }
}
@media (max-width: 400px) {
  .main { padding-inline: 11px; }
  .mobile-header { padding-inline: 11px; }
  .page-head:not(:has(.mode-pill)) { flex-wrap: wrap; }
  .page-actions { justify-content: flex-start; max-width: 100%; }
  .progress-sections .segmented button { padding-inline: 10px; }
  .page-actions .button { margin-bottom: 2px; }
  .plan-grid { grid-template-columns: 1fr; }
  .history-filter { flex-wrap: wrap; }
  .history-filter .search-field { width: 100%; }
  .detail-chart .panel-head { flex-wrap: wrap; }
  .modal-actions, .modal-head, .modal-body { padding-inline: 12px; }
}
@media (max-width: 374px) {
  .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 350px) {
  .mobile-nav .nav-button { font-size: .625rem; }
  .schedule-row { gap: 6px; }
  .schedule-row .button { padding-inline: 6px; }
  .alcohol-form, .cardio-form { grid-template-columns: minmax(0, 1fr); }
  .alcohol-metrics .metric-heading, .cardio-metrics .metric-heading { min-height: 65px; }
  .progress-sections .segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .cardio-shortcut { flex-wrap: wrap; }
  .plan-exercise-controls { gap: 6px; }
  .plan-exercise-controls .icon-button { width: 31px; }
  .field.plan-set-field input { width: 45px; }
  .hero h2 { font-size: 2rem; }
  .overview-grid .chart-panel .panel-head { align-items: flex-start; flex-wrap: wrap; }
  .history-row .icon-tile { width: 29px; height: 29px; }
  .history-row .icon-tile .icon { width: 16px; height: 16px; }
  .set-row { grid-template-columns: 17px minmax(45px, 1fr) minmax(43px, .8fr) minmax(39px, .75fr) 34px 23px; gap: 4px; }
  .set-row .remove-set { width: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
