:root {
  color-scheme: light;
  --ink: #202b42;
  --muted: #697588;
  --soft-muted: #9ca6b7;
  --green: #ef6838;
  --green-dark: #d84f27;
  --green-pale: #fff0e8;
  --paper: #ffffff;
  --canvas: #faf8f3;
  --line: #e8eaf0;
  --peach: #fff2d6;
  --lilac: #eaf0ff;
  --danger: #b9413b;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #ff9a68;
  outline-offset: 3px;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  width: 254px;
  flex-direction: column;
  padding: 31px 18px 22px;
  border-right: 1px solid #293751;
  color: #f7f8fb;
  background: #18243a;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 7px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--green);
}

.brand-mark svg { width: 27px; height: 27px; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 19px; letter-spacing: -.5px; }
.brand-name > span { display: block; margin-top: 3px; color: #aab5c8; font: 600 8px/1.2 "Segoe UI", Arial, sans-serif; letter-spacing: 1.15px; }

.nav-label {
  margin: 57px 10px 12px;
  color: #9ca9be;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.15px;
}

.main-nav { display: grid; gap: 5px; }

.nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #c2ccdc;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, color .16s ease;
}

.nav-link:hover { color: #fff; background: #24334d; }
.nav-link.is-active { color: #ffca65; background: #2b3a54; font-weight: 650; }
.nav-link svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-link span { font-size: 12px; }

.sidebar-bottom { margin-top: auto; }
.privacy-indicator { display: flex; align-items: center; gap: 8px; padding: 12px 9px 17px; color: #bdc7d7; font-size: 10px; }
.privacy-indicator > span, .footer-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #ffc14f; }
.sidebar-tools { display: grid; gap: 1px; padding-top: 12px; border-top: 1px solid #34415a; }
.tool-button { width: fit-content; padding: 7px 9px; border: 0; color: #bac5d6; background: transparent; cursor: pointer; font-size: 10px; text-align: left; }
.tool-button:hover { color: #ffca65; }
.tool-button.is-danger-text:hover { color: #ff8c7c; }

.main-content { min-height: 100vh; margin-left: 254px; }
.topbar { display: flex; height: 65px; align-items: center; justify-content: space-between; padding: 0 54px; border-bottom: 1px solid #eeece5; background: rgba(255, 255, 255, .76); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #a0a89f; font-size: 9px; font-weight: 700; letter-spacing: .85px; }
.breadcrumb strong { color: #647166; font-size: 10px; letter-spacing: .1px; }
.install-app { min-height: 34px; font-size: 9px; }

.page-wrap { width: min(100%, 1120px); margin: 0 auto; padding: 43px 54px 25px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { color: #e36a3e; font-size: 9px; font-weight: 750; letter-spacing: 1.3px; }
.eyebrow-line { display: inline-block; width: 16px; height: 2px; margin: 0 7px 3px 0; background: #f08a58; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin: 13px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 3.2vw, 40px); font-weight: 400; letter-spacing: -1.2px; line-height: 1.14; }
h1 em { color: var(--green); font-weight: 400; }
.page-description, .section-description { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

.date-picker { display: grid; min-width: 172px; gap: 7px; padding: 10px 12px; border: 1px solid #e5e9e1; border-radius: 8px; background: var(--paper); }
.date-picker > span { color: #929b91; font-size: 8px; font-weight: 700; letter-spacing: .9px; }
.date-picker input { width: 100%; padding: 0; border: 0; color: #46564a; background: transparent; font-size: 11px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 42px; }
.stat-card { display: flex; min-height: 94px; align-items: center; gap: 12px; padding: 17px; border: 1px solid #e9ece5; border-radius: 10px; background: var(--paper); }
.stat-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; }
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon-green { color: #e45b2e; background: var(--green-pale); }
.stat-icon-peach { color: #bd801e; background: var(--peach); }
.stat-icon-lilac { color: #4268c5; background: var(--lilac); }
.stat-copy { display: grid; gap: 5px; }
.stat-copy > span { color: #929b91; font-size: 8px; font-weight: 700; letter-spacing: .65px; }
.stat-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 400; line-height: 1; }
.stat-caption { margin-left: auto; align-self: end; padding-bottom: 3px; color: #9aa29a; font-size: 9px; white-space: nowrap; }

.view-panel { display: none; }
.view-panel.is-visible { display: block; animation: appear .2s ease-out; }
@keyframes appear { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading h2 { margin: 7px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 400; letter-spacing: -.45px; }
.section-heading .section-description { margin-top: 5px; }

.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-size: 10px; font-weight: 650; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:active { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-primary > span { font-size: 17px; font-weight: 400; line-height: 1; }
.button-outline { border-color: #e2e8de; color: #627465; background: var(--paper); }
.button-outline:hover { border-color: #b7c9b7; background: #f7faf5; }
.button-outline svg { width: 16px; height: 16px; }
.button-quiet { border-color: #e5e9e2; color: #657166; background: transparent; }
.button-quiet:hover { background: #f4f6f2; }
.button:disabled { cursor: not-allowed; opacity: .5; }

.workout-list, .exercise-library, .history-list { display: grid; gap: 11px; }
.exercise-card, .history-day { border: 1px solid #e8ebe4; border-radius: 10px; background: var(--paper); }
.exercise-card { padding: 17px 19px; }
.exercise-card-heading { display: flex; align-items: center; gap: 12px; }
.exercise-symbol { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-pale); }
.exercise-symbol svg { width: 21px; height: 21px; }
.exercise-title-block { min-width: 0; flex: 1; }
.exercise-title-block h3 { margin: 0 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 400; }
.exercise-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #879188; font-size: 9px; }
.meta-separator { color: #c1c8c0; }
.completion-count { padding: 5px 8px; border-radius: 20px; color: #597b60; background: #edf4ec; font-size: 10px; font-weight: 650; }
.exercise-card-actions { display: flex; align-items: center; gap: 8px; }
.completion-count { color: #b24a27; background: #fff0e8; }
.exercise-check { display: inline-flex; min-height: 31px; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid #dfe4ed; border-radius: 7px; color: #59667b; background: white; cursor: pointer; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.exercise-check:hover { border-color: #ef9a72; color: #c64d27; }
.exercise-check > span { display: grid; width: 14px; height: 14px; place-items: center; border: 1px solid #c7cfdb; border-radius: 4px; font-size: 11px; }
.exercise-check.is-checked { border-color: #ef6838; color: #fff; background: #ef6838; }
.exercise-check.is-checked > span { border-color: rgba(255,255,255,.75); }
.exercise-reminder { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 13px 0 2px; padding: 9px 11px; border: 1px solid #f0e5c9; border-radius: 7px; color: #856423; background: #fff9e9; font-size: 9px; }
.exercise-reminder.is-active { border-color: #f4c368; color: #784b14; background: #fff1cc; font-weight: 650; }
.exercise-reminder button { padding: 5px 8px; border: 0; border-radius: 5px; color: #a45b23; background: #ffedc5; cursor: pointer; font-size: 9px; font-weight: 700; white-space: nowrap; }
.exercise-reminder button:hover { color: #783e18; background: #ffe2a1; }
.exercise-note { margin: 12px 0 0; color: #7d877d; font-size: 10px; line-height: 1.5; }
.set-table-head, .set-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(100px, .7fr) minmax(100px, .7fr) 74px; align-items: center; gap: 12px; }
.set-table-head { margin: 19px 0 2px; padding: 0 8px; color: #929b92; font-size: 8px; font-weight: 700; letter-spacing: .5px; }
.set-row { min-height: 48px; padding: 6px 8px; border-top: 1px solid #f0f1ed; }
.set-number { display: flex; align-items: center; gap: 8px; color: #49564c; font-size: 10px; font-weight: 600; }
.target-reps { color: #9aa29a; font-size: 9px; font-weight: 400; }
.set-input-wrap { display: flex; width: 94px; height: 30px; align-items: center; gap: 7px; padding: 0 8px; border: 1px solid #e7ebe4; border-radius: 6px; color: #9aa29a; background: white; font-size: 9px; }
.set-input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.set-input-wrap input:focus-visible { outline: none; }
.set-row-status { color: #d15c32; font-size: 8px; font-weight: 700; text-align: right; }
.set-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 10px 8px 0; border-top: 1px solid #f0f1ed; color: #8b95a4; font-size: 8px; }
.set-actions .text-button { color: #d3572e; font-weight: 700; }
.set-actions .text-button:disabled { cursor: not-allowed; opacity: .5; }
.consent-row input { width: 15px; height: 15px; accent-color: var(--green); }
.exercise-controls { display: flex; gap: 4px; }
.icon-button { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid transparent; border-radius: 7px; color: #819084; background: transparent; cursor: pointer; font-size: 19px; }
.icon-button:hover { border-color: #e8ece5; background: #f5f7f3; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button.is-danger:hover { color: var(--danger); }

.empty-state { display: flex; min-height: 222px; align-items: center; justify-content: center; gap: 17px; padding: 30px; border: 1px dashed #dce4d9; border-radius: 10px; background: rgba(251, 252, 249, .7); }
.empty-state-illustration { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 15px; color: var(--green); background: var(--green-pale); }
.empty-state-illustration svg { width: 27px; height: 27px; }
.empty-state h3 { margin: 0 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 400; }
.empty-state p { max-width: 430px; margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty-state .button { min-height: 34px; font-size: 9px; }

.history-day { padding: 18px 20px; }
.history-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 12px; border-bottom: 1px solid #edf0ea; }
.history-day-heading h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 15px; font-weight: 400; text-transform: capitalize; }
.history-day-heading > span { color: #66806a; font-size: 9px; }
.history-exercise { display: flex; align-items: start; justify-content: space-between; gap: 15px; padding: 12px 0 0; }
.history-exercise strong { font-size: 10px; font-weight: 650; }
.history-exercise p { margin: 4px 0 0; color: #89928a; font-size: 9px; line-height: 1.6; }
.text-button { padding: 2px 0; border: 0; color: var(--green); background: transparent; cursor: pointer; font-size: 9px; white-space: nowrap; }
.text-button:hover { color: var(--green-dark); }

.page-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 52px; padding: 16px 0 4px; border-top: 1px solid #e7ebe4; color: #9aa29a; font-size: 9px; }
.page-footer > span:last-child { display: inline-flex; align-items: center; gap: 7px; }
.footer-dot { width: 6px; height: 6px; }
.storage-alert { margin: 14px 54px 0; padding: 11px 13px; border: 1px solid #eed9c3; border-radius: 7px; color: #805a3b; background: #fbf3e9; font-size: 11px; line-height: 1.5; }

.app-dialog { width: min(460px, calc(100vw - 28px)); max-width: none; max-height: min(88vh, 760px); padding: 0; overflow: auto; border: 0; border-radius: 12px; color: var(--ink); background: transparent; box-shadow: 0 24px 80px rgba(35, 49, 38, .2); }
.app-dialog::backdrop { background: rgba(33, 44, 36, .34); backdrop-filter: blur(2px); }
.dialog-card { display: grid; gap: 16px; padding: 25px; border: 1px solid #e8ece5; border-radius: 12px; background: var(--paper); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.dialog-heading h2 { margin: 6px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 400; }
.dialog-close { width: 29px; height: 29px; border-color: #eaede8; font-size: 19px; }
.form-field { display: grid; gap: 7px; color: #657167; font-size: 10px; font-weight: 600; }
.form-field small { margin-left: 4px; color: #a0a89f; font-size: 9px; font-weight: 400; }
.form-field input, .form-field select { width: 100%; min-height: 39px; padding: 0 11px; border: 1px solid #e3e8e0; border-radius: 6px; color: var(--ink); background: white; font-size: 11px; }
.form-field input::placeholder { color: #adb5ad; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { margin: -5px 0 0; color: #8792a3; font-size: 9px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; padding-top: 13px; border-top: 1px solid #edf0ea; }

.toast { position: fixed; right: 24px; bottom: 22px; z-index: 5; max-width: min(360px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #dfe8de; border-radius: 8px; color: #3f6146; background: #fbfdf9; box-shadow: 0 9px 30px rgba(39, 53, 42, .12); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { border-color: #efdcd8; color: #95544b; background: #fffaf9; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

[hidden] { display: none !important; }

@media (min-width: 1400px) {
  .page-wrap { padding-top: 50px; }
}

@media (max-width: 1000px) {
  .sidebar { width: 215px; }
  .main-content { margin-left: 215px; }
  .topbar { padding-right: 30px; padding-left: 30px; }
  .page-wrap { padding-right: 30px; padding-left: 30px; }
  .storage-alert { margin-right: 30px; margin-left: 30px; }
  .stat-card { gap: 9px; padding: 13px; }
  .stat-caption { display: none; }
}

@media (max-width: 720px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 13px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 17px; }
  .nav-label, .sidebar-bottom { display: none; }
  .main-nav { display: flex; gap: 4px; margin: 12px -4px 0; overflow-x: auto; }
  .nav-link { min-height: 40px; justify-content: center; gap: 7px; padding: 0 10px; color: #c2ccdc; white-space: nowrap; }
  .nav-link:hover { color: #fff; background: #24334d; }
  .nav-link.is-active { color: #ffca65; background: #2b3a54; }
  .nav-link svg { width: 16px; height: 16px; }
  .nav-link span { font-size: 10px; }
  .main-content { margin-left: 0; }
  .topbar { height: 49px; padding: 0 19px; }
  .breadcrumb { font-size: 8px; }
  .breadcrumb strong { font-size: 9px; }
  .install-app { min-height: 30px; padding: 0 10px; font-size: 8px; }
  .page-wrap { padding: 29px 19px 20px; }
  .page-intro { align-items: start; flex-direction: column; gap: 16px; }
  h1 { font-size: 33px; }
  .date-picker { width: 100%; }
  .stats-grid { gap: 7px; margin-bottom: 33px; }
  .stat-card { min-height: 84px; flex-direction: column; align-items: start; gap: 7px; padding: 10px; }
  .stat-icon { width: 28px; height: 28px; border-radius: 8px; }
  .stat-icon svg { width: 16px; height: 16px; }
  .stat-copy { gap: 3px; }
  .stat-copy > span { font-size: 7px; letter-spacing: .2px; }
  .stat-copy strong { font-size: 18px; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 21px; }
  .section-heading > .button { min-height: 34px; padding: 0 9px; font-size: 8px; white-space: nowrap; }
  .section-heading > .button span { font-size: 14px; }
  .exercise-card { padding: 14px 12px; }
  .set-table-head, .set-row { grid-template-columns: minmax(88px, 1fr) 68px 74px; gap: 6px; }
  .set-table-head { font-size: 7px; }
  .set-table-head > span:last-child, .set-row-status { display: none; }
  .set-number { flex-wrap: wrap; gap: 3px 6px; font-size: 9px; }
  .target-reps { font-size: 8px; }
  .empty-state { min-height: 190px; gap: 12px; padding: 19px; }
  .empty-state-illustration { width: 38px; height: 38px; border-radius: 12px; }
  .empty-state h3 { font-size: 16px; }
  .empty-state p { font-size: 10px; }
  .page-footer { margin-top: 37px; font-size: 8px; }
  .storage-alert { margin: 12px 19px 0; }
}

@media (max-width: 410px) {
  .nav-link { gap: 5px; padding: 0 7px; }
  .nav-link span { font-size: 9px; }
  .set-table-head, .set-row { grid-template-columns: minmax(76px, 1fr) 62px 68px; gap: 4px; }
  .set-input-wrap { width: 62px; }
  .exercise-card-actions { gap: 5px; }
  .exercise-check { min-height: 28px; padding: 0 6px; font-size: 8px; }
  .exercise-reminder { align-items: start; flex-direction: column; gap: 6px; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-card { padding: 20px; }
  .page-footer { align-items: start; flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
