:root {
  color-scheme: light;
  --paper: #f5f5fd;
  --white: #fff;
  --ink: #17173a;
  --muted: #535574;
  --line: #d9dbef;
  --brand: #3025bf;
  --brand-hover: #261d99;
  --tint: #eeeefe;
  --input-line: #aeb0d1;
  --success: #295738;
  --error: #8b332e;
  --width: 1240px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
::selection { background: #d9d5ff; color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, select, summary { cursor: pointer; }
button, a { touch-action: manipulation; }
a { color: inherit; text-underline-offset: .2em; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #4b3cea; outline-offset: 3px; }
.skip { position: absolute; z-index: 5; top: 10px; left: 10px; background: var(--white); padding: 10px; transform: translateY(-160%); }
.skip:focus { transform: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(2.15rem, 4.8vw, 4.25rem); line-height: 1.03; letter-spacing: -.039em; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.3rem); line-height: 1.15; letter-spacing: -.028em; }
h3 { font-size: 1.18rem; line-height: 1.25; letter-spacing: -.012em; }
p { line-height: 1.55; }
.muted, .hint { color: var(--muted); }
.hint, .tiny { font-size: .875rem; }
.muted a:hover, .site-footer a:hover { color: var(--brand); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { width: min(var(--width), calc(100% - 80px)); min-height: 74px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: clamp(12px, 2.1vw, 30px); }
.display-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.display-option { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); }
.display-option select { width: auto; min-height: 36px; padding: 5px 8px; }
.brand { color: var(--brand); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 700; white-space: nowrap; letter-spacing: -.026em; }
.main-nav { align-self: stretch; display: flex; gap: clamp(18px, 4vw, 44px); }
.main-nav a { position: relative; display: flex; align-items: center; text-decoration: none; white-space: nowrap; color: var(--muted); font-size: .9375rem; font-weight: 700; }
.main-nav a[aria-current], .main-nav a:hover { color: var(--brand); }
.main-nav a[aria-current]::after { content: ''; position: absolute; inset: auto 0 0; height: 3px; background: var(--brand); }
.account-actions { display: flex; align-items: center; gap: 8px; }
.account-link { white-space: nowrap; }
.notification-tray { position: relative; }
.notification-bell { position: relative; width: 44px; padding: 0; }
.notification-bell[aria-expanded="true"] { background: var(--tint); border-color: var(--brand); }
.notification-count { position: absolute; inset: -6px -5px auto auto; min-width: 19px; padding: 2px 4px; border: 1px solid var(--white); border-radius: 12px; background: var(--brand); color: var(--white); font-size: .6875rem; }
.notification-panel { position: absolute; z-index: 4; inset: calc(100% + 8px) 0 auto auto; width: min(26rem, calc(100vw - 32px)); border-radius: 14px; background: var(--white); box-shadow: 0 8px 20px rgb(0 0 0 / .17); }
.notification-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.notification-header h2 { font-size: 1.18rem; }
.notification-header .button { padding-inline: 10px; }
.notification-list { list-style: none; margin: 0; padding: 3px; max-height: min(50vh, 24rem); overflow-y: auto; }
.notification-list li + li { border-top: 1px solid var(--line); }
.notification-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; padding: 11px 13px; text-decoration: none; border-radius: 7px; }
.notification-item:focus-visible { outline-offset: -3px; }
.notification-item[data-unread], .notification-item:hover { background: var(--tint); }
.notification-item[data-unread] strong::after { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 0 .14em 6px; border-radius: 50%; background: var(--brand); }
.notification-item strong, .notification-item time, .notification-item span.muted { display: block; overflow-wrap: anywhere; }
.notification-item time { margin-top: 3px; }
.notification-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 7px; color: var(--brand); background: var(--paper); }
.notification-empty, .notification-status { padding: 13px 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.main { width: min(var(--width), calc(100% - 80px)); margin: 34px auto 60px; flex: 1 0 auto; }
.site-footer { width: min(var(--width), calc(100% - 80px)); margin: auto auto 0; border-top: 1px solid var(--line); display: flex; gap: 22px; flex-wrap: wrap; align-items: center; padding: 24px 0; font-size: .875rem; color: var(--muted); }
.site-footer span { font-weight: 700; margin-right: auto; color: var(--ink); }
.site-footer a { text-decoration: none; }

.button { min-height: 44px; padding: 10px 16px; display: inline-flex; gap: 8px; justify-content: center; align-items: center; color: var(--white); background: var(--brand); border: 1px solid var(--brand); border-radius: 8px; text-decoration: none; text-align: center; font-weight: 700; font-size: .9375rem; line-height: 1.26; }
.button:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.button.quiet { color: var(--brand); border-color: var(--line); background: var(--white); }
.button.quiet:hover { border-color: var(--brand); background: var(--tint); }
.button:disabled { opacity: .65; cursor: wait; }
.link { display: inline-flex; gap: 7px; align-items: center; font-weight: 700; color: var(--brand); }

.section-title { margin: 0 0 23px; display: flex; gap: 16px; align-items: end; justify-content: space-between; flex-wrap: wrap; }
.section-title p { margin-top: 8px; }
.catalog { margin-top: 38px; scroll-margin-top: 16px; }
.category-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.category-filter button { color: var(--brand); padding: 8px 14px; min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: transparent; }
.category-filter button:hover { background: var(--tint); }
.category-filter button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--white); }
.filter-form { display: grid; grid-template-columns: minmax(12rem, 1.45fr) repeat(3, minmax(8rem, 1fr)); gap: 12px; margin-bottom: 20px; }
.search { position: relative; }
.search .icon { position: absolute; bottom: 13px; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 39px; }
.result-count { font-size: .875rem; color: var(--muted); margin-bottom: 11px; }
.program-list, .history-list { border-block: 1px solid var(--line); }
.program-row { display: grid; grid-template-columns: minmax(185px, 1.15fr) minmax(195px, 1.25fr) minmax(140px, .8fr) auto; align-items: center; gap: 20px; padding: 20px 16px; }
.program-row + .program-row, .history-row + .history-row { border-top: 1px solid var(--line); }
.program-row:hover { background: #eeeeff; }
.program-title { display: flex; gap: 13px; align-items: center; }
.program-symbol { color: var(--brand); background: #e9e6ff; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; flex: 0 0 auto; }
.program-title a { text-decoration: none; }
.program-title a:hover { text-decoration: underline; }
.program-meta { line-height: 1.48; font-size: .875rem; color: var(--muted); }
.program-meta strong { color: var(--ink); font-weight: 700; }
.program-goal { display: block; margin-top: 4px; }

.view-header { display: grid; gap: 15px; margin: 8px 0 30px; }
.view-header h1 { max-width: 21ch; }
.view-header p { max-width: 66ch; color: var(--muted); }
.view-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.view-facts > span { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); }
.fact-strip { margin: -7px 0 20px; }
.view-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 26px; align-items: start; }
.plan-grid { grid-template-columns: minmax(220px, .33fr) minmax(0, 1fr); }
.form-narrow { max-width: 550px; }
.panel { padding: clamp(16px, 2.6vw, 29px); border: 1px solid var(--line); border-radius: 14px; background: var(--white); min-width: 0; }
.panel > h2, .panel > h3 { margin-bottom: 14px; }
.panel > p + p { margin-top: 12px; }
.stack { display: grid; gap: 18px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.fields > .wide { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; font-size: .9rem; font-weight: 700; }
.field .hint { font-weight: 400; }
input, select, textarea { border: 1px solid var(--input-line); min-height: 44px; border-radius: 7px; padding: 9px 11px; background: var(--white); color: var(--ink); width: 100%; caret-color: var(--brand); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"] { width: 19px; min-height: 0; height: 19px; padding: 0; accent-color: var(--brand); }
textarea { resize: vertical; min-height: 80px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { margin-bottom: 7px; font-size: .9375rem; font-weight: 700; padding: 0; }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.day-picks label { position: relative; }
.day-picks input { width: 100%; height: 100%; position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.day-picks span { display: grid; place-items: center; white-space: nowrap; width: 42px; min-height: 42px; border: 1px solid var(--line); border-radius: 7px; color: var(--brand); }
.day-picks input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--white); }
.day-picks input:focus-visible + span { outline: 3px solid #4b3cea; outline-offset: 2px; }
.day-picks input:hover:not(:checked) + span { border-color: var(--brand); }
.corrections { padding-top: 12px; border-top: 1px solid var(--line); }
.corrections summary { font-weight: 700; line-height: 1.4; min-height: 34px; }
.corrections .fields, .corrections p { margin-top: 10px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.actions.end { justify-content: flex-end; }
.block-gap { margin-top: 20px; }
.error { color: var(--error); }
.loading, .empty { padding: 25px 0; color: var(--muted); }
.empty > * + * { margin-top: 12px; }
.empty h3 { color: var(--ink); }
.callout { padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--tint); color: var(--ink); }
.callout .button { margin-top: 10px; }
.toast { position: fixed; right: 19px; bottom: 19px; z-index: 2; max-width: calc(100% - 38px); background: var(--brand); color: var(--white); padding: 11px 16px; border-radius: 9px; }

.week-select { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 16px 0 20px; }
.week-select button { background: var(--white); min-height: 42px; border-radius: 7px; border: 1px solid var(--line); color: var(--brand); font-weight: 700; }
.week-select button:hover { border-color: var(--brand); }
.week-select button[aria-pressed="true"] { background: var(--brand); color: var(--white); border-color: var(--brand); }
.session-list { display: grid; gap: 6px; }
.session-list button { color: var(--ink); text-align: left; padding: 9px 11px; min-height: 46px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 4px; }
.session-list button[aria-pressed="true"] { background: var(--tint); border-color: var(--input-line); }
.session-list button:hover { border-color: var(--brand); }
.session-list .done { color: var(--success); font-weight: 700; }
.sessions { display: grid; gap: 15px; }
.session-head { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 8px 15px; margin-bottom: 12px; }
.session-head p { color: var(--muted); font-size: .875rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 12px 0; border-block: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.metrics dt { color: var(--muted); font-size: .81rem; }
.metrics dd { margin: 3px 0 0; font-size: 1rem; font-weight: 700; }
.exercises { display: grid; gap: 18px; padding-top: 15px; }
.exercise h3, .exercise h4 { margin: 0 0 4px; }
.exercise > p { margin-bottom: 8px; }
.exercise-table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; font-size: .9rem; }
.exercise-table th { color: var(--muted); font-weight: 700; font-size: .8125rem; }
.exercise-table td, .exercise-table th { padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); }
.exercise-table td:last-child, .exercise-table th:last-child { padding-right: 0; }
.exercise-table td:nth-child(n+2), .exercise-table th:nth-child(n+2) { text-align: right; }
.exercise-table input { min-width: 45px; width: min(100%, 91px); padding-inline: 5px; text-align: right; }
.set-label { min-width: 85px; }
.set-details { color: var(--muted); font-size: .8rem; }
.training-check { display: flex; gap: 8px; align-items: center; min-height: 36px; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; }
.history-row h3 a { display: inline-block; }
.history-row p { margin-top: 4px; }
.progress-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 22px 32px; margin-bottom: 24px; background: var(--white); }
.progress-overview h2 { font-size: 1.35rem; margin-bottom: 8px; }
.progress-overview h3 { margin: 2px 0 8px; }
.progress-score { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 13px; }
.progress-score strong { font-size: 1.2rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.progress-score .muted { font-size: .875rem; }
.progress-next .link { overflow-wrap: anywhere; }
.progress-next p { margin-top: 4px; }
.achievement-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px 12px; }
.achievement-list li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; background: var(--tint); color: var(--brand); border-radius: 6px; font-weight: 600; font-size: .875rem; }
.achievement-list .icon { width: 17px; height: 17px; }
.plan-progress { display: grid; gap: 6px; width: min(100%, 29rem); }
.plan-progress progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 6px; overflow: hidden; background: var(--line); color: var(--brand); accent-color: var(--brand); }
.plan-progress progress::-webkit-progress-bar { background: var(--line); }
.plan-progress progress::-webkit-progress-value { background: var(--brand); }
.plan-progress progress::-moz-progress-bar { background: var(--brand); }
.plan-toolbar .plan-progress { width: clamp(11rem, 48%, 22rem); margin-right: auto; }
.history-list button.quiet { text-align: right; }
.account-email { overflow-wrap: anywhere; }
.account-preferences { grid-column: 1 / -1; }
.reminder-fields .field { margin-top: 8px; }
.check-field { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: .9375rem; }
.check-field input { flex-shrink: 0; margin: 0; }
.push-device { border-inline-start: 1px solid var(--line); padding-inline-start: 24px; min-width: 0; }
.push-device h3, .push-device p { margin-bottom: 8px; }
.push-device > .error { margin: 9px 0 0; }
.food-item { border: 1px solid var(--line); border-radius: 8px; padding: 11px; }
.food-rows:empty { display: none; }
.food-item > legend { padding: 0 4px; margin-bottom: 0; }
.food-item .button, .food-nutrients { margin-top: 12px; }
#food-totals-help { margin: 0 0 9px; }
input:read-only, textarea:read-only { background: #f4f4fc; }
.preview-placeholder { background: var(--tint); }
.preview-head { margin-bottom: 0; }
details.panel > summary { font-size: 1.04rem; font-weight: 700; }
details.panel > form, details.panel .table-scroll { margin-top: 15px; }
.table-scroll { overflow-x: auto; }
.report-table { width: 100%; min-width: 32rem; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.report-table td, .report-table th { padding: 9px 7px; border-bottom: 1px solid var(--line); text-align: right; }
.report-table th[scope="row"], .report-table th[rowspan] { text-align: left; }
.report-table th[scope="colgroup"] { text-align: center; background: var(--tint); }
.print-only { display: none; }

@media (max-width: 1000px) {
  .header-inner, .main, .site-footer { width: calc(100% - 48px); }
  .program-row { grid-template-columns: minmax(160px, 1.1fr) minmax(160px, 1fr) minmax(112px, .7fr) auto; gap: 12px; padding-inline: 6px; }
}

@media (max-width: 880px) {
  .header-inner { flex-wrap: wrap; }
  .display-options { margin-left: auto; }
}

@media (max-width: 735px) {
  .header-inner, .main, .site-footer { width: calc(100% - 32px); }
  .header-inner { flex-wrap: wrap; min-height: 0; padding-top: 13px; gap: 8px 12px; }
  .main-nav { width: 100%; order: 3; min-height: 42px; justify-content: space-between; gap: 10px; }
  .display-options { order: 2; width: 100%; margin-left: 0; }
  .display-option select { min-height: 44px; }
  .account-actions { margin-left: auto; }
  .notification-panel { position: fixed; inset: 65px 16px auto auto; width: min(26rem, calc(100% - 32px)); }
  .main { margin-block: 20px 37px; }
  .catalog { margin-top: 27px; }
  .section-title { margin-bottom: 16px; }
  .filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .filter-form .search { grid-column: 1 / -1; }
  .filter-form select { padding-inline: 5px; font-size: .875rem; }
  .program-row { grid-template-columns: minmax(0, 1fr) auto; gap: 9px 16px; padding: 14px 0; }
  .program-row > .program-title, .program-row > .program-description, .program-row > .program-meta { grid-column: 1; }
  .program-row > .program-description { grid-column: 1 / -1; }
  .program-row > .button { grid-column: 2; grid-row: 1; }
  .view-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .push-device { border-inline-start: 0; border-top: 1px solid var(--line); padding: 17px 0 0; }
  .plan-toolbar .plan-progress { width: 100%; }
  .view-header { margin-bottom: 20px; }
  .week-select { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .session-list { grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); }
}

@media (max-width: 380px) {
  .button { padding-inline: 10px; }
  .brand { font-size: 1.1rem; gap: 7px; }
  .brand svg { width: 32px; height: 32px; }
  .account-link { font-size: .85rem; }
  .day-picks span { width: 35px; }
  .category-filter button { padding-inline: 9px; }
}

@media print {
  :root { background: white; color: black; font-size: 11pt; }
  @page { margin: 14mm 12mm; }
  body { display: block; }
  .site-header, .site-footer, .skip, .toast, .screen-only, .button { display: none !important; }
  .print-only { display: block; }
  .panel { padding: 0; border: 0; }
  .main { width: 100%; margin: 0; }
  .view-header { margin: 0 0 16pt; }
  .view-header h1 { font-size: 27pt; }
  .view-header p { color: #333; }
  .print-week { margin: 0 0 18pt; }
  .print-week > h2 { margin-bottom: 9pt; font-size: 18pt; }
  .session-head { margin-bottom: 5pt; }
  .session-head h3 { font-size: 14pt; }
  .exercises { gap: 8pt; }
  .exercise { break-inside: avoid; }
  h2, h3, h4, .session-head { break-after: avoid; }
  .metrics { padding-block: 5pt; }
}
