:root {
  color-scheme: dark;
  --bg: #121315;
  --sidebar: #161719;
  --panel: #1b1c1f;
  --raised: #222327;
  --line: #303136;
  --text: #f6f4f1;
  --muted: #a7a7ad;
  --subtle: #888a91;
  --accent: #ff755e;
  --accent-strong: #ff856f;
  --accent-faint: #3c2625;
  --green: #a7d8aa;
  --radius: 18px;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; line-height: 1.45; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#main:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; }
h2 { font-size: 1.17rem; letter-spacing: -.021em; }
p { color: var(--muted); }
svg { flex: 0 0 auto; vertical-align: middle; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip:focus { position: fixed; z-index: 9; top: 12px; left: 12px; padding: 10px; background: var(--panel); }
.sidebar {
  width: 232px; background: var(--sidebar); border-right: 1px solid #292a2e;
  padding: 30px 17px 22px; position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column; z-index: 3;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 5px; font-size: 1.14rem; line-height: 1; font-weight: 900; letter-spacing: -.044em; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #211513; flex: none; }
.brand-icon svg { transform: rotate(-12deg); stroke-width: 2.2; }
.brand-accent { color: var(--accent); margin-left: 2px; }
.brand small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .025em; color: var(--muted); margin-top: 5px; }
.nav { display: grid; gap: 7px; margin-top: 48px; }
.nav-item {
  background: none; color: var(--muted); border: 1px solid transparent; border-radius: 10px;
  display: flex; align-items: center; gap: 12px; min-height: 47px; padding: 0 13px; width: 100%;
  text-align: left; font-size: .94rem; font-weight: 650;
}
.nav-item:hover, .icon-button:hover { background: var(--raised); color: var(--text); }
.nav-item.active { background: #342423; border-color: #51302c; color: var(--accent-strong); }
.side-footer { margin-top: auto; }
.local-info { border-top: 1px solid var(--line); margin: 14px 5px 0; padding-top: 15px; }
.connection { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .76rem; }
.status-dot { background: #a1cd9e; width: 7px; height: 7px; border-radius: 50%; flex: none; }
#main { max-width: 1640px; margin-left: 232px; padding: 37px clamp(24px, 3.1vw, 52px) 42px; }
.page-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 27px; }
.page-header h1 { font-size: clamp(2.15rem, 3.3vw, 3.07rem); letter-spacing: -.063em; font-weight: 850; }
.page-header p { font-size: 1rem; margin-top: 7px; }
.date-chip, .cycle-id { flex: none; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.date-chip { display: flex; align-items: center; gap: 8px; }
.date-chip span, .hero-details > span:first-child, .latest > span, .dialog-heading p { text-transform: capitalize; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.83fr) minmax(275px, 1fr); gap: 18px; }
.panel {
  border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius);
  padding: 21px 23px; min-width: 0;
}
.hero {
  position: relative; border: 1px solid #54302b; border-radius: var(--radius); overflow: hidden;
  min-height: 278px; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(90deg,#1a1515 1%,rgba(22,15,14,.92) 25%,rgba(19,12,11,.3) 62%,rgba(17,14,14,.06) 100%),
    #261715 url("./hero.jpg") 70% center / cover no-repeat;
}
.hero-content { padding: 26px 32px; position: relative; z-index: 1; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 7px; font-size: .73rem; font-weight: 800; letter-spacing: .105em;
  color: #ff9a86; padding: 5px 8px; border: 1px solid #70413a; border-radius: 6px; background: #3b2522c9;
}
.hero h2 { font-size: clamp(3.1rem, 5.2vw, 5.4rem); font-weight: 900; letter-spacing: -.082em; margin: 9px 0 4px; }
.hero-details { display: flex; column-gap: 8px; flex-wrap: wrap; font-size: 1rem; color: #d0c5c3; margin-bottom: 20px; }
.middot { color: #a28a85; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border-radius: 9px; padding: 0 14px; font-weight: 750; border: 1px solid transparent;
  font-size: .91rem; line-height: 1.2;
}
.btn.primary { color: #211411; background: var(--accent); }
.btn.primary:hover { background: #ff937f; }
.btn.secondary { background: var(--raised); border-color: var(--line); color: var(--text); }
.btn.secondary:hover { background: #303137; }
.text-button { background: transparent; border: 0; color: var(--accent-strong); font-size: .87rem; font-weight: 700; padding: 7px 0; }
.text-button:hover { text-decoration: underline; }
.panel-title, .section-head { display: flex; align-items: center; gap: 11px; min-width: 0; }
.section-head { justify-content: space-between; }
.section-head p { margin-top: 5px; font-size: .88rem; }
.tile-icon, .empty-icon {
  flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; color: var(--accent-strong);
  border: 1px solid #54342f; border-radius: 9px; background: #362624;
}
.cycle-id { margin-left: auto; padding: 3px 8px; font-size: .76rem; white-space: nowrap; }
.cycle-meter { margin-top: 19px; display: flex; align-items: baseline; gap: 8px; }
.cycle-meter strong { font-size: clamp(1.75rem, 2.45vw, 2.4rem); line-height: 1.05; letter-spacing: -.065em; }
.cycle-meter > span { color: var(--muted); font-weight: 600; }
.week-bars { display: flex; gap: 5px; margin: 13px 0 16px; }
.week-bars span { flex: 1; height: 6px; border-radius: 10px; background: #35363a; }
.week-bars .past { background: #ad574c; }
.week-bars .current { background: var(--accent); }
.cycle-dates { border-top: 1px solid var(--line); display: grid; gap: 10px; padding-top: 13px; }
.cycle-dates > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; }
.cycle-dates span { color: var(--muted); display: flex; align-items: center; gap: 7px; }
.cycle-dates span svg { color: var(--accent-strong); }
.cycle-dates b { font-size: .82rem; text-align: right; white-space: nowrap; }
.week-nav { display: flex; gap: 5px; }
.icon-button {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  background: var(--raised); border: 1px solid var(--line); border-radius: 8px; color: var(--muted);
}
.schedule-list { margin-top: 13px; display: grid; gap: 6px; }
.schedule-row {
  font-size: .9rem; display: flex; align-items: center; gap: 11px; text-align: left;
  min-width: 0; color: var(--text); background: #202124; border: 1px solid #2d2e33;
  border-radius: 9px; min-height: 48px; width: 100%; padding: 4px 9px;
}
.schedule-row.next { border-color: #663c35; background: #2f2222; }
button.schedule-row:hover, .history-row:hover { background: #2b2c30; }
.day-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; width: 38px; min-height: 36px; border-radius: 7px; background: #2a2b2f; line-height: 1; }
.day-tile small { color: var(--muted); font-size: .64rem; font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.day-tile b { font-size: .95rem; }
.next .day-tile { background: #49302c; color: #ff9a86; }
.next .day-tile small { color: #ff9a86; }
.schedule-name { font-weight: 700; }
.slot-status {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto; flex: none; color: var(--muted);
  background: #2a2b30; border-radius: 20px; padding: 3px 8px; font-size: .74rem; font-weight: 650;
}
.next .slot-status { background: #4c302b; color: #ff9a86; }
.done .slot-status { background: #28382d; color: var(--green); }
.progress-empty { display: grid; justify-items: center; gap: 7px; align-content: center; min-height: 164px; text-align: center; }
.progress-empty .empty-icon { background: #25262a; border-color: #36373d; color: var(--subtle); width: 45px; height: 45px; margin-bottom: 2px; }
.progress-empty b { font-size: .94rem; }
.progress-empty p { max-width: 222px; font-size: .86rem; }
.latest { display: flex; justify-content: space-between; align-items: baseline; gap: 9px; margin-top: 17px; }
.latest > b { font-size: 1.06rem; }
.latest > span { font-size: .79rem; color: var(--muted); text-align: right; }
.recent-sets { border-top: 1px solid var(--line); margin: 9px 0 4px; padding-top: 8px; display: grid; gap: 5px; }
.recent-sets > div { display: flex; justify-content: space-between; gap: 8px; font-size: .87rem; color: var(--muted); }
.recent-sets b { color: var(--text); white-space: nowrap; }
.rotation { margin-top: 18px; }
.rotation-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin-top: 13px; }
.rotation-item { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #222327; color: var(--text); display: flex; align-items: center; gap: 9px; text-align: left; min-height: 53px; }
.rotation-item:hover { background: #2a2b2f; }
.rotation-item.current { border-color: #754138; background: #322423; }
.rotation-icon { color: var(--muted); }
.rotation-item.current .rotation-icon { color: var(--accent-strong); }
.rotation-item b { display: block; font-size: .90rem; }
.rotation-item small { display: block; color: var(--muted); font-size: .73rem; }
.rotation-item.current small { color: #ff9a86; }

.content-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(265px,1fr); gap: 18px; align-items: start; }
.inner { padding: 23px; }
.tab-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-bottom: 18px; }
.tab, .suggestion {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); padding: 10px 8px; border-radius: 9px;
  font-weight: 700; min-height: 43px; font-size: .9rem;
}
.tab.chosen { border-color: #774239; color: var(--accent-strong); background: var(--accent-faint); }
.tab:hover, .suggestion:hover { border-color: #774239; color: var(--accent-strong); }
.exercise-list { list-style: none; padding: 0; margin: 15px 0; display: grid; gap: 6px; }
.exercise-list li, .session-detail > div {
  display: flex; align-items: center; gap: 9px; padding: 8px; min-width: 0;
  border: 1px solid var(--line); border-radius: 9px; background: var(--raised);
}
.exercise-name { flex: 1; min-width: 0; }
.exercise-name b, .session-detail b { display: block; overflow-wrap: anywhere; }
.exercise-name p, .session-detail p { font-size: .81rem; margin-top: 1px; }
.exercise-list .icon-button { border-color: transparent; background: transparent; }
.exercise-list .icon-button:hover { border-color: var(--line); background: #313238; }
.empty-text { padding: 19px 0 4px; font-size: .94rem; }
.add-exercise { margin-top: 20px; display: grid; gap: 6px; }
label { font-size: .88rem; font-weight: 650; }
.field-row { display: flex; gap: 8px; align-items: center; }
input:not([type="checkbox"],[type="file"]), select {
  width: 100%; min-width: 0; background: #17181a; border: 1px solid #414247; border-radius: 8px; color: var(--text);
  padding: 9px 10px; min-height: 44px; font-size: 1rem;
}
input::placeholder { color: #98999f; opacity: 1; }
input:focus, select:focus { border-color: var(--accent); }
select {
  appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, #a7a7ad 50%),
  linear-gradient(135deg, #a7a7ad 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
select:disabled { opacity: .65; }
.suggestions { margin-top: 17px; }
.suggestions p { font-size: .82rem; margin-bottom: 7px; }
.suggestions > div { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestion { padding: 5px 8px; min-height: 36px; font-size: .79rem; }
.suggestion svg { width: 14px; height: 14px; }
.protocol ol { margin: 15px 0; list-style: none; padding: 0; counter-reset: series; }
.protocol li {
  padding: 10px 0 10px 38px; border-bottom: 1px solid var(--line); position: relative;
  counter-increment: series;
}
.protocol li::before {
  content: counter(series); position: absolute; left: 0; top: 12px; width: 27px; height: 27px; display: grid;
  place-items: center; border-radius: 8px; background: var(--raised); color: var(--muted); font-weight: 750; font-size: .82rem;
}
.protocol li:last-child::before { color: var(--accent-strong); background: var(--accent-faint); }
.protocol li span { display: block; font-size: .87rem; color: var(--muted); margin-top: 3px; }
.hint { background: #312423; border: 1px solid #583730; color: var(--accent-strong); border-radius: 9px; padding: 10px 12px; font-size: .88rem; }
.hint p { color: #d1b7b3; margin-top: 4px; }
.history-controls { margin-bottom: 16px; }
.history-controls > p { margin: 0; }
.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field select { width: auto; }
.empty-page { min-height: 310px; display: grid; justify-items: center; align-content: center; text-align: center; gap: 9px; }
.empty-page .empty-icon { width: 53px; height: 53px; margin-bottom: 5px; }
.empty-page .btn { margin-top: 8px; }
.history-list { padding: 7px 15px; }
.history-row { display: flex; align-items: center; gap: 12px; padding: 10px 7px; width: 100%; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: none; text-align: left; }
.history-row:last-child { border-bottom: 0; }
.history-name { display: grid; }
.history-name small { color: var(--muted); font-size: .8rem; }
.settings-form { display: grid; gap: 6px; margin-top: 18px; }
.settings-form label:not(:first-child) { margin-top: 8px; }
.settings-form .btn { justify-self: start; margin-top: 10px; }
.settings-stack { display: grid; gap: 18px; }
.settings-copy { margin: 12px 0; font-size: .94rem; }
.field-hint { font-size: .83rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 7px; }
.alert { color: #ffa992; margin-bottom: 14px; }
dialog {
  color: var(--text); background: var(--panel); border: 1px solid #44454b; border-radius: 18px; padding: 22px;
  width: min(520px, calc(100% - 28px)); max-height: calc(100% - 32px); overflow: auto; box-shadow: 0 20px 70px #0009;
}
dialog.wide { width: min(750px, calc(100% - 28px)); }
dialog::backdrop { background: #09090bc7; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.dialog-heading h2 { font-size: 1.82rem; letter-spacing: -.05em; }
.dialog-heading p { font-size: .76rem; color: var(--accent-strong); letter-spacing: .06em; font-weight: 750; margin-bottom: 4px; }
.dialog-copy, .install-guide { margin: 4px 0 16px; }
.install-guide { display: grid; gap: 10px; }
.install-guide > div { padding: 9px 11px; border-radius: 8px; background: var(--raised); }
.install-guide p { margin-top: 2px; font-size: .92rem; }
.dialog-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 13px; margin-top: 15px; }
.dialog-foot .text-button { margin-right: auto; }
#rename-form { display: grid; gap: 6px; }
.session-intro { display: grid; grid-template-columns: 1fr minmax(140px,.37fr); align-items: end; gap: 10px; }
.session-intro p { font-size: .9rem; margin-top: 3px; }
.session-intro label input { display: block; margin-top: 4px; }
.session-plan { background: var(--raised); padding: 8px 10px; border-radius: 8px; margin-top: 10px; font-size: .81rem; }
.set-list, .session-detail { display: grid; gap: 9px; margin-top: 13px; }
.set-card { background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin: 0; min-width: 0; }
.set-card.met { border-color: #527456; }
.set-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.set-heading h3 { font-size: 1rem; overflow-wrap: anywhere; }
.set-heading p { margin-top: 2px; font-size: .82rem; }
.progress-badge {
  border-radius: 20px; background: #343237; color: #d9cfdf; padding: 4px 8px;
  font-size: .74rem; font-weight: 700; flex: none;
}
.progress-badge.ahead { color: var(--green); background: #2b3a2a; }
.set-inputs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.set-inputs input { display: block; margin-top: 3px; }
.set-summary { display: flex; justify-content: space-between; gap: 6px; align-items: center; color: var(--muted); margin-top: 7px; font-size: .86rem; }
.set-card.met [data-total] { color: var(--green); }
.check-label { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; line-height: 1.1; }
.check-label input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.check-label:has(:disabled) { opacity: .65; }
.form-error, .set-error { margin-top: 7px; color: #ffab98; font-size: .87rem; }
.session-detail > div { padding: 9px; }
.session-detail > div > div { flex: 1; min-width: 0; }
.session-detail strong { white-space: nowrap; }
#toast { position: fixed; z-index: 10; inset: auto 17px 17px auto; max-width: min(350px,calc(100vw - 34px)); background: #322b2a; color: var(--text); border: 1px solid #835147; border-radius: 11px; padding: 10px 14px; opacity: 0; visibility: hidden; transition: opacity .16s; font-size: .92rem; }
#toast.visible { opacity: 1; visibility: visible; }
@media (max-width: 1050px) {
  .sidebar { width: 196px; padding-inline: 12px; }
  #main { margin-left: 196px; padding-inline: 24px; }
  .dashboard-grid { grid-template-columns: minmax(0,1.5fr) minmax(245px,1fr); gap: 13px; }
  .panel { padding-inline: 16px; }
  .hero-content { padding-inline: 24px; }
}
@media (max-width: 850px) {
  .sidebar {
    width: auto; height: auto; padding: max(9px,env(safe-area-inset-top)) 16px 9px; inset: 0 0 auto;
    align-items: center; flex-direction: row; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; }
  .brand-icon { width: 37px; height: 37px; }
  .side-footer { margin: 0; }
  .side-footer .install { min-height: 36px; padding-inline: 8px; border-color: var(--line); font-size: .8rem; gap: 5px; }
  .side-footer .install svg { width: 16px; }
  .local-info { display: none; }
  .nav {
    position: fixed; inset: auto 0 0; background: var(--sidebar); border-top: 1px solid var(--line);
    display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 5px 8px max(5px,env(safe-area-inset-bottom)); gap: 4px; margin: 0;
  }
  .nav-item:not(.install) { flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px 2px; font-size: .75rem; }
  #main { margin-left: 0; padding: calc(74px + env(safe-area-inset-top)) 20px calc(76px + env(safe-area-inset-bottom)); }
  .page-header { margin-bottom: 18px; }
  #toast { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (max-width: 615px) {
  #main { padding-inline: 14px; }
  .page-header { align-items: flex-start; gap: 5px; }
  .page-header h1 { font-size: clamp(1.9rem,7.5vw,2.75rem); }
  .page-header p { font-size: .9rem; margin-top: 4px; }
  .date-chip { display: none; }
  .dashboard-grid, .content-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .hero { min-height: 225px; background-position: 68% center; }
  .hero-content { padding: 20px; }
  .hero h2 { font-size: clamp(2.7rem,13vw,4.5rem); }
  .hero-details { font-size: .9rem; margin-bottom: 15px; }
  .panel { padding: 16px; border-radius: 14px; }
  .rotation { margin-top: 12px; }
  .rotation-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .progress-empty { min-height: 123px; }
  .cycle-meter { margin-top: 13px; }
  .tab-strip { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 12px; }
  .history-controls { align-items: flex-start; flex-direction: column; }
  .history-list { padding: 4px 8px; }
  .session-intro { grid-template-columns: minmax(0,1fr); }
  .session-intro label { max-width: 200px; }
  .set-heading { flex-wrap: wrap; }
  .set-inputs label { font-size: .76rem; }
  .set-inputs input { padding-inline: 5px; }
  dialog { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-secondary { background: #1b1819db; border-color: #966255; color: #fff1eb; }
.hero-secondary:hover { background: #45302b; }
.rest-action { display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; min-height: 42px; }
.rest-reminder { margin-top: 10px; font-size: .86rem; }
.schedule-row.moved .slot-status { color: var(--accent-strong); }
.recent-sets > div { align-items: baseline; flex-wrap: wrap; }
.recent-sets b, .session-detail strong { font-variant-numeric: tabular-nums; }
.session-detail strong { white-space: normal; max-width: 46%; text-align: right; font-size: .91rem; }
.session-last { color: var(--accent-strong); font-weight: 700; }
.gym-unit { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.gym-unit > span { font-size: .9rem; font-weight: 700; }
.unit-toggle { display: flex; gap: 4px; flex: none; background: var(--raised); border: 1px solid var(--line); padding: 3px; border-radius: 9px; }
.unit-option { display: inline-grid; place-items: center; border: 0; border-radius: 6px; padding: 4px 9px; min-width: 46px; min-height: 40px; background: transparent; font-weight: 750; color: var(--muted); }
.unit-option[aria-pressed="true"] { background: var(--accent-faint); color: var(--accent-strong); }
.set-heading .muscle-label { margin: 0 0 3px; color: var(--accent-strong); font-size: .78rem; }
.set-heading h3 { font-size: 1.12rem; }
.set-previous:empty { display: none; }
.prior-set { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin: 3px 0 7px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.prior-set b, .prior-set p { font-size: .82rem; }
.prior-set p.progress-badge { display: inline-block; margin-top: 4px; }
.prior-set .rep-preset { min-height: 44px; text-align: center; max-width: 46%; white-space: normal; }
.set-note { color: var(--muted); font-size: .82rem; margin: 6px 0; }
.substitute { margin-bottom: 9px; }
.substitute summary { cursor: pointer; color: var(--accent-strong); font-size: .87rem; font-weight: 650; min-height: 36px; padding-block: 8px; }
.substitute label { display: block; margin-top: 5px; }
.substitute select, .substitute input { display: block; margin-top: 4px; }
.weight-line { display: flex; gap: 10px; align-items: end; margin: 7px 0 9px; }
.weight-line label { width: min(48%,180px); }
.weight-line input { display: block; margin-top: 3px; }
.weight-equivalent { color: var(--muted); padding-bottom: 10px; font-size: .88rem; }
.rep-presets { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin: 7px 0; }
.rep-presets > span { font-size: .87rem; font-weight: 700; }
.rep-presets > div { display: flex; gap: 4px; }
.rep-preset { font-size: .81rem; min-height: 40px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-weight: 700; }
.rep-preset:hover { border-color: var(--accent); color: var(--accent-strong); }
.rep-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.rep-step { padding: 6px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); }
.rep-step label { display: block; text-align: center; }
.rep-step input[type="number"] { display: block; appearance: textfield; text-align: center; margin: 3px 0 5px; min-height: 39px; font-size: 1.02rem; font-weight: 750; }
.rep-step input::-webkit-inner-spin-button, .rep-step input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.rep-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.rep-controls .icon-button { width: 100%; min-height: 44px; color: var(--text); }
.rep-controls .icon-button:last-child { color: var(--accent-strong); background: var(--accent-faint); }
.session-foot { position: sticky; bottom: -22px; z-index: 1; margin: 12px -5px -9px; padding: 9px 5px; background: var(--panel); }
.rest-preview { color: var(--accent-strong); font-weight: 750; padding: 5px 0; }
.variant-list { list-style: none; margin: 4px 0; padding: 0; }
.variant-list li { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--line); }
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf9f7;
  --sidebar: #fffdfb;
  --panel: #fffdfb;
  --raised: #f3efec;
  --line: #e1d9d4;
  --text: #242022;
  --muted: #655b5d;
  --subtle: #746a68;
  --accent: #e6634f;
  --accent-strong: #9d3728;
  --accent-faint: #fae7e1;
  --green: #286139;
}
:root[data-theme="light"] .sidebar { border-color: var(--line); }
:root[data-theme="light"] .brand-icon, :root[data-theme="light"] .btn.primary { background: #f77b65; }
:root[data-theme="light"] .btn.primary:hover { background: #fc947e; }
:root[data-theme="light"] .hero { color: #f6f4f1; }
:root[data-theme="light"] .nav-item.active, :root[data-theme="light"] .tile-icon, :root[data-theme="light"] .empty-icon,
:root[data-theme="light"] .rotation-item.current, :root[data-theme="light"] .schedule-row.next {
  background: var(--accent-faint); border-color: #edc0b5; color: var(--accent-strong);
}
:root[data-theme="light"] .week-bars span { background: #e8e0dc; }
:root[data-theme="light"] .week-bars .past { background: #dd9284; }
:root[data-theme="light"] .week-bars .current { background: #c94e3b; }
:root[data-theme="light"] .schedule-row, :root[data-theme="light"] .rotation-item { background: var(--raised); border-color: var(--line); }
:root[data-theme="light"] .day-tile, :root[data-theme="light"] .slot-status { background: #e9e1dd; }
:root[data-theme="light"] .next .day-tile, :root[data-theme="light"] .next .slot-status {
  background: #f5d4ca; color: var(--accent-strong);
}
:root[data-theme="light"] .next .day-tile small, :root[data-theme="light"] .rotation-item.current small { color: var(--accent-strong); }
:root[data-theme="light"] .done .slot-status { background: #dfeddf; color: var(--green); }
:root[data-theme="light"] button.schedule-row:hover, :root[data-theme="light"] .history-row:hover,
:root[data-theme="light"] .rotation-item:hover, :root[data-theme="light"] .btn.secondary:hover,
:root[data-theme="light"] .exercise-list .icon-button:hover { background: #eee4de; }
:root[data-theme="light"] input:not([type="checkbox"],[type="file"]), :root[data-theme="light"] select {
  background-color: #fff; border-color: #cfc4bf;
}
:root[data-theme="light"] input::placeholder { color: #786d6d; }
:root[data-theme="light"] .hint { background: var(--accent-faint); border-color: #edc0b5; color: var(--accent-strong); }
:root[data-theme="light"] .hint p { color: var(--muted); }
:root[data-theme="light"] .progress-badge { color: #56445b; background: #eee4ef; }
:root[data-theme="light"] .progress-badge.ahead { color: var(--green); background: #e0eee2; }
:root[data-theme="light"] dialog { border-color: var(--line); }
:root[data-theme="light"] .form-error, :root[data-theme="light"] .set-error, :root[data-theme="light"] .alert { color: #9c3021; }
:root[data-theme="light"] #toast { background: #fff0eb; border-color: #d99889; }
@media (max-width: 615px) {
  .hero-actions .btn { min-height: 46px; padding-inline: 9px; gap: 5px; }
  .hero-actions .btn svg { width: 16px; }
  .exercise-list li { gap: 4px; padding: 5px; }
  .exercise-list .tile-icon { display: none; }
  .exercise-list .icon-button { width: 40px; height: 44px; }
  dialog.wide:has(#session-form) { width: 100%; max-width: 100%; max-height: min(calc(100% - 8px), 100dvh); margin: auto 0 0; border-radius: 16px 16px 0 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .session-foot { bottom: calc(-12px - env(safe-area-inset-bottom)); padding-bottom: max(9px, env(safe-area-inset-bottom)); }
  .rep-step { padding: 4px; }
  .rep-controls { gap: 3px; }
  .rep-controls .icon-button { min-width: 0; }
  .rep-preset { min-height: 44px; }
  .schedule-name { line-height: 1.2; }
  .page-header h1 { overflow-wrap: anywhere; }
}

.session-tip { margin-top: 10px; }
