:root {
  color-scheme: dark;
  --bg: #101012;
  --surface: #19191d;
  --surface-raised: #222227;
  --surface-soft: #28282e;
  --text: #f5f4f6;
  --muted: #a4a1aa;
  --line: #34333a;
  --accent: #f0444b;
  --accent-strong: #d92f38;
  --positive: #59c98c;
  --focus: #ff8589;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 50% -25%, #292024 0, var(--bg) 48rem);
  color: var(--text);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-shell { width: min(100%, 1080px); min-height: 100vh; margin: 0 auto; padding: 0 22px 56px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 28px 0 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--accent); color: white; font-size: 22px; font-weight: 900; box-shadow: 0 8px 26px #f0444b33; }
.brand strong, .brand small { display: block; letter-spacing: .12em; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.local-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 12px #59c98c88; }
.status-dot.error-dot { background: var(--accent); box-shadow: 0 0 12px #f0444b88; }

.main-nav { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.nav-button { position: relative; min-height: 48px; padding: 0 18px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 650; }
.nav-button span { margin-right: 9px; font-size: 17px; }
.nav-button:hover, .nav-button.active { color: var(--text); }
.nav-button.active::after { position: absolute; right: 14px; bottom: -1px; left: 14px; height: 2px; background: var(--accent); content: ""; }

.main-content { padding: 30px 0 20px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(25px, 5vw, 35px); letter-spacing: -.04em; line-height: 1.1; }
h2 { margin-bottom: 8px; font-size: 21px; letter-spacing: -.025em; }
h3 { margin-bottom: 7px; font-size: 16px; }
.subheading { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.welcome {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px;
  margin: 0 0 28px; padding: 23px 26px; overflow: hidden; border: 1px solid #583136;
  border-radius: 18px; background: linear-gradient(112deg, #311b1f, #211b20 68%, #1b191e);
}
.welcome h2 { margin: 0 0 7px; font-size: 20px; }
.welcome p { max-width: 570px; margin: 0; color: #c6bdc3; font-size: 13px; line-height: 1.55; }
.welcome-actions { display: flex; gap: 9px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 15px; border: 1px solid transparent; border-radius: 11px; background: var(--surface-soft); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 700; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { border-color: #55535c; background: #323138; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { border-color: var(--accent); background: var(--accent-strong); }
.button-quiet { border-color: var(--line); background: transparent; }
.button-danger { border-color: #69343a; background: #371e22; color: #ffb3b6; }
.button-small { min-height: 44px; padding: 0 11px; border-radius: 9px; font-size: 12px; }
.button-icon { width: 44px; padding: 0; }

.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.search-wrap { position: relative; flex: 1 1 260px; }
.search-wrap span { position: absolute; top: 50%; left: 13px; color: var(--muted); transform: translateY(-50%); }
.field, .select-field, .textarea-field { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #151519; color: var(--text); }
.search-wrap .field { padding-left: 39px; }
.select-field { max-width: 190px; cursor: pointer; }
.field::placeholder, .textarea-field::placeholder { color: #797680; }
.field:disabled { opacity: .6; }

.section-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 0 12px; }
.section-label h2 { margin: 0; font-size: 17px; }
.count { color: var(--muted); font-size: 12px; }
.exercise-grid, .template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.exercise-card, .template-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(150deg, #1c1c20, #17171a); }
.exercise-card:hover, .template-card:hover { border-color: #555059; }
.exercise-card-inner { display: grid; grid-template-columns: 134px minmax(0, 1fr); gap: 16px; padding: 14px; }
.exercise-art { width: 100%; aspect-ratio: 1.15; overflow: hidden; border: 1px solid #3c3034; border-radius: 11px; background: radial-gradient(circle at 50% 45%, #382329, #201b20 75%); }
.exercise-art svg { display: block; width: 100%; height: 100%; }
.exercise-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.exercise-art img.builtin-art { object-fit: contain; padding: 5px; }
.exercise-info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.exercise-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; width: 100%; }
.exercise-title { margin: 1px 0 5px; font-size: 16px; line-height: 1.3; }
.muscle-line { margin: 0 0 8px; color: #ff888c; font-size: 11px; font-weight: 700; }
.description { margin: 0 0 10px; color: #c5c2c9; font-size: 12px; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid #3d3b43; border-radius: 999px; color: var(--muted); font-size: 10px; }
.prescription { margin-top: 8px; color: #e7e4e8; font-size: 11px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 14px; }
.favorite-button { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: #a09ca5; cursor: pointer; font-size: 20px; }
.favorite-button[aria-pressed="true"] { color: #ffcb6d; }
.template-card { padding: 17px; }
.template-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.template-card p { margin: 0 0 11px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.template-list { display: grid; gap: 8px; margin: 0 0 15px; padding: 0; list-style: none; }
.template-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 9px; color: #dedbe1; font-size: 12px; }
.mini-art { width: 36px; height: 32px; overflow: hidden; border-radius: 7px; background: #272227; }
.mini-art svg, .mini-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.template-actions { display: flex; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); padding-top: 13px; }
.archived-card { opacity: .72; }
.template-items-editor { display: grid; gap: 9px; }
.template-edit-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #151519; }
.template-edit-row > .mini-art { width: 54px; height: 48px; }
.template-edit-main { min-width: 0; }
.template-edit-main > strong { display: block; margin: 2px 0 8px; font-size: 12px; }
.template-edit-fields { display: grid; grid-template-columns: repeat(5, minmax(55px, 1fr)); gap: 6px; }
.template-edit-fields label { color: var(--muted); font-size: 10px; }
.template-edit-fields .field { min-height: 44px; margin-top: 4px; padding: 5px 7px; font-size: 12px; }
.template-reorder { display: grid; gap: 5px; }
.template-reorder .button { min-height: 44px; width: 44px; }
.template-select-list { max-height: 185px; overflow-y: auto; padding: 2px; }

.empty-state { display: grid; min-height: 230px; place-items: center; padding: 34px 20px; border: 1px dashed #48464f; border-radius: 15px; text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; font-size: 15px; }
.empty-state p { max-width: 400px; margin: 0 auto 15px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty-symbol { display: grid; width: 46px; height: 46px; margin: 0 auto 12px; place-items: center; border-radius: 15px; background: #322025; color: #ff8185; font-size: 21px; }

.dialog { width: min(680px, calc(100vw - 24px)); max-height: min(90vh, 840px); padding: 0; overflow: auto; border: 1px solid #4a474f; border-radius: 18px; background: #19191d; color: var(--text); box-shadow: 0 24px 90px #000b; }
.dialog::backdrop { background: #08080bd9; backdrop-filter: blur(4px); }
.dialog-small { width: min(440px, calc(100vw - 24px)); }
.dialog-content { padding: 22px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.dialog-head h2 { margin: 0 0 5px; }
.dialog-head p { margin: 0; color: var(--muted); font-size: 12px; }
.dialog-close { flex: 0 0 42px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label, .field-label { display: block; margin-bottom: 6px; color: #dbd8df; font-size: 12px; font-weight: 700; }
.textarea-field { min-height: 92px; resize: vertical; line-height: 1.45; }
.help-text { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.check-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #151519; color: #d0cdd4; cursor: pointer; font-size: 11px; }
.check-chip:has(input:checked) { border-color: #89424a; background: #371f24; color: #ffb7ba; }
.check-chip input { accent-color: var(--accent); }
.image-control { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 1px dashed #514d56; border-radius: 12px; }
.image-preview { width: 120px; aspect-ratio: 1.2; overflow: hidden; border-radius: 9px; background: #272227; }
.image-preview svg, .image-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-preview img.builtin-art { object-fit: contain; padding: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.form-error { min-height: 18px; margin: 8px 0 0; color: #ff999d; font-size: 12px; }
.toast { position: fixed; z-index: 5; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); max-width: min(400px, calc(100vw - 36px)); padding: 12px 16px; border: 1px solid #49464e; border-radius: 12px; background: #252429; color: var(--text); box-shadow: 0 10px 34px #0008; font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(9px); transition: opacity .18s ease, transform .18s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.notice { margin: 0 0 17px; padding: 12px 14px; border: 1px solid #6e4c2b; border-radius: 10px; background: #30251a; color: #f2d4aa; font-size: 12px; line-height: 1.5; }
.notice.error { border-color: #713941; background: #351f23; color: #ffc1c4; }

body.large-text { font-size: 18px; }
body.large-text .description, body.large-text .template-card p { font-size: 14px; }
body.high-contrast { --muted: #d0ccd4; --line: #77747e; --surface: #101012; --surface-raised: #16161a; }

@media (max-width: 720px) {
  .app-shell { padding: 0 16px 36px; }
  .topbar { padding-top: 19px; }
  .welcome { grid-template-columns: 1fr; padding: 19px; }
  .welcome-actions { flex-wrap: wrap; }
  .exercise-grid, .template-grid { grid-template-columns: 1fr; }
  .exercise-card-inner { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .card-actions { padding: 0 12px 12px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .toolbar { flex-wrap: wrap; }
  .select-field { flex: 1 1 135px; max-width: none; }
}

@media (max-width: 420px) {
  .app-shell { padding-right: 12px; padding-left: 12px; }
  .local-badge { font-size: 0; gap: 0; }
  .local-badge .status-dot { width: 9px; height: 9px; }
  .nav-button { flex: 1; padding: 0 8px; }
  .exercise-card-inner { grid-template-columns: 92px minmax(0, 1fr); gap: 10px; }
  .exercise-title { font-size: 14px; }
  .description { font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .image-control { grid-template-columns: 95px minmax(0, 1fr); }
  .image-preview { width: 95px; }
  .template-edit-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 7px; padding: 8px; }
  .template-edit-row > .mini-art { width: 44px; height: 42px; }
  .template-edit-fields { grid-template-columns: repeat(3, minmax(50px, 1fr)); }
  .dialog-content { padding: 17px; }
  .welcome-actions .button { flex: 1 1 145px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.calendar-create, .calendar-controls, .mode-switch, .workout-card-head, .workout-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calendar-panel, .day-panel { background: var(--surface); border: 1px solid var(--border, #303036); border-radius: 18px; padding: 18px; margin: 18px 0; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.calendar-controls h2 { margin: 0 0 0 8px; font-size: 18px; text-transform: capitalize; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-weekday { color: var(--muted); text-align: center; padding: 8px 2px; font-size: 12px; }
.calendar-day { border: 1px solid transparent; min-height: 66px; border-radius: 10px; background: var(--surface-raised); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; padding: 8px 3px; cursor: pointer; }
.calendar-day:hover, .calendar-day.selected { border-color: var(--accent, #f0444b); }
.calendar-day.today > span:first-child { background: var(--accent, #f0444b); color: white; border-radius: 50%; min-width: 25px; line-height: 25px; }
.calendar-day.outside-month { opacity: .38; }
.calendar-dots { display: flex; gap: 4px; align-items: center; }
.calendar-mark { width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50%; color: white; font-style: normal; font-size: 11px; line-height: 1; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.status-done { background: #2c9b67 !important; }.status-progress { background: #d89b37 !important; }.status-skipped { background: #e05252 !important; }.status-incomplete { background: #8c6676 !important; }.status-planned { background: #676774 !important; }
.status-label { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; color: white; font-size: 12px; background: #676774; }
.day-panel .section-label { align-items: center; }
.day-panel .section-label h2 { margin: 0; }
.compact-empty { padding: 22px; border-radius: 12px; background: var(--surface-raised); color: var(--muted); text-align: center; }
.workout-card { border: 1px solid var(--border, #303036); background: var(--surface-raised); border-radius: 14px; padding: 14px; margin: 10px 0; }
.workout-card-head { justify-content: space-between; }
.workout-card-head h3 { display: inline-block; margin: 0 8px 6px 0; }
.workout-actions { margin-top: 12px; }
.session-exercises { display: grid; gap: 10px; margin: 14px 0; }
.session-exercise { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-raised); }
.session-art { width: 76px; height: 66px; overflow: hidden; border-radius: 9px; }
.session-art svg, .session-art img { width: 100%; height: 100%; object-fit: cover; }
.session-art img.builtin-art { object-fit: contain; }
.session-exercise h3, .session-exercise p { margin: 3px 0; }
.session-exercise p { color: var(--muted); font-size: 13px; }
.session-prescription { display: grid; grid-template-columns: repeat(5, minmax(58px, 1fr)); gap: 6px; margin-top: 10px; }
.session-prescription label { color: var(--muted); font-size: 11px; }
.session-prescription .field { min-width: 0; padding: 7px; margin-top: 3px; }
.exercise-check { display: grid; justify-items: center; gap: 5px; font-size: 12px; min-width: 76px; }
.exercise-check input { width: 22px; height: 22px; accent-color: #e3434b; }
.calendar-day:focus-visible, .calendar-day:focus-visible { outline: 3px solid #ff747a; outline-offset: 2px; }
@media (max-width: 620px) {
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .calendar-create { width: 100%; }
  .calendar-create .button { flex: 1; }
  .calendar-day { min-height: 55px; }
  .calendar-panel, .day-panel { padding: 12px; }
  .session-exercise { grid-template-columns: 54px minmax(0,1fr); }
  .session-art { width: 54px; height: 52px; }
  .session-prescription { grid-template-columns: repeat(3, minmax(50px, 1fr)); }
  .session-exercise .exercise-check, .session-exercise .template-reorder, .session-exercise > .status-label { grid-column: 2; justify-self: start; }
  .main-nav { overflow-x: auto; }
  .nav-button { min-width: 110px; }
}

.progress-period, .chart-panel, .history-panel, .goal-panel { background: var(--surface); border: 1px solid var(--border, #303036); border-radius: 18px; padding: 18px; margin: 16px 0; }
.progress-period { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.progress-period h2 { margin: 0 0 0 8px; text-transform: capitalize; font-size: 17px; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.progress-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.stat-card { display: grid; gap: 8px; background: var(--surface-raised); border: 1px solid var(--border, #303036); border-radius: 14px; padding: 14px; }
.stat-card > span { color: var(--muted); font-size: 13px; }
.stat-card > strong { font-size: 26px; }
.stat-card small { color: var(--muted); line-height: 1.4; }
.goal-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; }
.goal-panel h2 { margin: 4px 0; }
.goal-panel p { margin: 6px 0; color: var(--muted); }
.goal-form { display: flex; align-items: end; gap: 8px; }
.goal-form label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.goal-form .field { width: 80px; }
.goal-note { grid-column: 1 / -1; }
.progress-chart { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); align-items: end; gap: 6px; min-height: 190px; padding: 12px 4px 0; }
.chart-point { min-width: 0; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 6px; min-height: 180px; border: 0; border-radius: 10px; padding: 8px 4px; background: transparent; color: var(--text); cursor: pointer; }
.chart-label { overflow-wrap: anywhere; }
.chart-point:hover, .chart-point:focus-visible { background: var(--surface-raised); outline: 2px solid #ff747a; }
.chart-bar { display: block; width: 28px; max-height: 132px; border-radius: 7px 7px 2px 2px; background: #e3434b; }
.chart-label { color: var(--muted); font-size: 11px; text-align: center; }
.chart-value { font-size: 13px; font-weight: 700; }
.history-list { display: grid; gap: 8px; }
.history-card { background: var(--surface-raised); border-radius: 12px; }
.history-open { width: 100%; display: grid; grid-template-columns: minmax(140px,1fr) minmax(130px,2fr) auto auto; align-items: center; gap: 10px; text-align: left; color: var(--text); padding: 12px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.history-open:hover, .history-open:focus-visible { outline: 2px solid #ff747a; }
.history-date, .history-open small { color: var(--muted); }
@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .progress-period { align-items: flex-start; flex-direction: column; }
  .goal-panel { grid-template-columns: 1fr; }
  .goal-form { flex-wrap: wrap; }
  .history-open { grid-template-columns: 1fr auto; }
  .history-open strong { grid-column: 1; }
  .history-open .status-label { grid-column: 2; grid-row: 1; }
  .history-open small { grid-column: 2; grid-row: 2; }
}

.settings-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 14px 0; }
.settings-panel > p { color: var(--muted); line-height: 1.5; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 60px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.setting-row span { display: grid; gap: 4px; }
.setting-row small { color: var(--muted); }
.setting-row input { width: 24px; height: 24px; accent-color: var(--accent); }
.backup-actions { margin: 12px 0; }
.danger-panel { border-color: #69343a; }
.error-dot { background: var(--accent) !important; }
.workout-unsaved-notice { position: sticky; top: 0; z-index: 2; border-color: #a66d2d; box-shadow: 0 5px 16px #0008; }
@media (max-width: 620px) {
  .main-nav { flex-wrap: wrap; overflow: visible; }
  .nav-button { flex: 1 1 28%; min-width: 0; padding: 0 4px; }
}
@media (max-width: 420px) {
  .nav-button span { display: none; }
  .nav-button { font-size: 12px; }
  .progress-chart { grid-template-columns: repeat(7, minmax(0,1fr)); gap: 2px; }
  .chart-point { padding: 8px 1px; }
  .chart-label { font-size: 9px; }
  .settings-panel { padding: 14px; }
}

body[data-bot] .local-only { display: none; }
#sync-actions:not([hidden]) { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; padding:.75rem; border:1px solid var(--line); }

.workout-choices { max-height: 34vh; overflow-y: auto; align-content: start; }
.workout-choices [hidden] { display:none; }
.dialog-sync { padding:.5rem 1rem; display:flex; align-items:center; flex-wrap:wrap; gap:.4rem; color:var(--muted); font-size:.85rem; }
body[data-bot] {
  padding-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  padding-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
}
