/* Gym Neon: midnight surfaces and a single electric-blue accent. */
:root { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #f1f5ff; background: #080c17; font-synthesis: none; line-height: 1.5; --ink: #f1f5ff; --muted: #a7b7ce; --line: #293952; --accent: #64adff; --surface: #111b2b; --primary-gradient: linear-gradient(115deg, #0865e8, #1644d9); color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 0 0, #247cff22, transparent 50%), radial-gradient(ellipse at 100% 32%, #287eff1c, transparent 45%), #080c17; }
button, input, textarea { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; color: inherit; cursor: pointer; min-height: 48px; touch-action: manipulation; transition: background .15s, transform .15s; }
button:active { transform: translateY(1px); }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #73abff; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.5rem); font-weight: 760; letter-spacing: -.055em; line-height: 1.08; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; }
label { display: block; margin-bottom: 8px; font-size: .875rem; font-weight: 650; }
input, textarea { min-width: 0; width: 100%; background: #0b1422; border: 1px solid #526786; border-radius: 12px; color: var(--ink); padding: 13px 15px; font-size: 1rem; min-height: 54px; scroll-margin: 24px 0 170px; }
input::placeholder, textarea::placeholder { color: #90a2bd; }
input:focus, textarea:focus { background: #15243b; border-color: #73abff; box-shadow: 0 0 0 1px #73abff44, 0 0 20px #408cff33; }
input[aria-invalid=true] { border: 2px dashed #96c5ff; background: #152d50; }
.muted, .optional-label { color: var(--muted); }
.optional-label { font-weight: 400; }
.app-header { display: flex; align-items: center; gap: 20px; min-height: calc(84px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) max(28px, env(safe-area-inset-right, 0px)) 0 max(28px, env(safe-area-inset-left, 0px)); background: #080c17; color: #f1f5ff; border-bottom: 1px solid #26354c; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.7rem; font-weight: 800; letter-spacing: -.055em; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.brand-description { font-size: .8rem; font-weight: 400; color: #a7b7ce; letter-spacing: .01em; }
.brand-divider { width: 1px; height: 24px; background: #293952; margin: 0 8px; }
.local-badge { margin-left: auto; min-width: 108px; font-size: .75rem; font-weight: 650; color: #b4d6ff; text-align: right; text-shadow: 0 0 12px #3a8cff66; }
.app-header .text-button { border: 1px solid #354763; border-radius: 12px; color: #edf4ff; padding: 0 16px; }
main { max-width: 1120px; margin: auto; padding: 32px 32px calc(140px + env(safe-area-inset-bottom, 0px)); min-height: calc(100dvh - 84px); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.calendar-page > .page-heading { position: relative; isolation: isolate; overflow: hidden; padding: 38px; border: 1px solid #46628b; border-radius: 26px; background: radial-gradient(ellipse at 105% 100%, #145bc570, transparent 60%), radial-gradient(ellipse at 65% 0, #3476d95c, transparent 65%), linear-gradient(120deg, #102037, #151e2c); color: #fff; box-shadow: 0 0 22px #3284ff38, 14px 8px 42px #287eff1c; }
.calendar-page > .page-heading::before { content: ''; position: absolute; z-index: -1; inset: auto 18px 0; height: 4px; background: linear-gradient(90deg, #4992ff, #5398ff 55%, #287eff); box-shadow: 0 0 10px #5297ffcc, 0 0 28px #287eff80; }
.calendar-page > .page-heading::after { content: ''; position: absolute; z-index: -1; width: 260px; height: 260px; right: -125px; top: -130px; border: 25px solid #63a1ff26; border-radius: 50%; box-shadow: 0 0 0 24px #287eff20, 0 0 0 48px #599bff14; pointer-events: none; }
.calendar-page .eyebrow { color: var(--accent); text-shadow: 0 0 16px #3686ff80; }
.calendar-page .intro { color: #b7c9e3; }
.calendar-page h1 { max-width: 650px; }
.eyebrow { font-size: .7rem; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; color: #73abff; margin-bottom: 12px; }
.intro { margin-top: 14px; color: var(--muted); }
.small-note { position: relative; flex-shrink: 0; font-size: .8rem; line-height: 1.8; color: #b7c9e3; padding: 22px 0 22px 30px; border-left: 1px solid #475b78; }
.small-note strong { text-shadow: 0 0 14px #287eff70; color: var(--accent); font-size: 1.1rem; }
.calendar-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 0 0 1px #3988ff12, 0 0 30px #237bff18; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 24px; gap: 12px; }
.calendar-toolbar h2 { font-size: 1.5rem; font-weight: 720; }
.month-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.today-button { border: 1px solid #3e5b87; background: #132541; color: #a6caff; border-radius: 12px; padding: 0 18px; font-size: .85rem; font-weight: 650; }
.icon-button { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 12px; font-size: 1.7rem; line-height: 1; background: #1b2a40; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 18px; gap: 6px; }
.weekdays { padding-bottom: 10px; }
.weekdays span { text-align: center; color: var(--muted); font-size: .75rem; font-weight: 650; }
.weekdays span:nth-last-child(-n+2) { color: var(--accent); text-shadow: 0 0 12px #287eff55; }
.calendar-grid { padding-bottom: 18px; }
.day { position: relative; min-width: 0; min-height: 96px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; border: 1px solid transparent; border-radius: 14px; }
@media (hover:hover) { .day:hover { background: #1d2f49; border-color: #5480c3; } .primary:hover { background: #0865e8; } .routine-card:hover { border-color: #8bb9ff; } }
.day-number { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; font-size: .95rem; font-weight: 650; border-radius: 10px; }
.outside { color: #8998ae; }
.is-today { border-color: #69a5ff; box-shadow: inset 0 0 20px #4d94ff44, 0 0 12px #4d94ff44; }
.is-today .day-number { background: #0865e8; color: #fff; box-shadow: 0 0 8px #1682ff, 0 0 22px #0865e888; }
.has-workout { background: linear-gradient(145deg, #23334c, #1e2a3b); }
.day-workout { font-size: .73rem; font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #bdd7ff; }
.draft-label { color: #83b5ff; }
.workout-dot, .draft-dot { display: none; width: 5px; height: 5px; border-radius: 50%; background: #9cc4ff; }
.draft-dot { background: transparent; border: 1px solid #83b5ff; }
.calendar-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; border-top: 1px solid var(--line); padding: 18px; font-size: .75rem; color: var(--muted); }
.calendar-legend > span { display: flex; align-items: center; gap: 7px; }
.calendar-legend i { width: 9px; height: 9px; border-radius: 3px; }
.workout-dot { box-shadow: 0 0 9px #8bb9ff99; }
.legend-today { box-shadow: 0 0 9px #3888ff80; background: var(--accent); } .legend-saved { background: #9cc4ff; } .legend-draft { border: 1px solid #83b5ff; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); margin-top: 22px; font-size: .75rem; }
.app-nav { position: fixed; z-index: 5; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; width: min(380px, calc(100% - 32px)); padding: 7px; border-radius: 22px; border: 1px solid #3b5171; background: #101c2ded; color: #b6c6df; box-shadow: 0 12px 32px #00000066, 0 0 24px #3888ff33; backdrop-filter: blur(16px); }
.app-nav button { display: flex; flex: 1; justify-content: center; align-items: center; gap: 9px; font-size: .875rem; border-radius: 16px; min-height: 52px; }
.app-nav button[aria-current] { color: #fff; background: var(--primary-gradient); font-weight: 750; box-shadow: 0 2px 18px #5b9dff66; }
.app-nav svg { width: 20px; height: 20px; }
.editor-page { max-width: 780px; margin: auto; }
.back-button { display: flex; align-items: center; gap: 9px; padding: 0; font-size: .875rem; color: var(--muted); margin-bottom: 14px; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.editor-heading h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.day-tag { font-size: .7rem; font-weight: 700; letter-spacing: .12em; white-space: nowrap; background: #152743; color: #9ec5ff; padding: 9px 12px; border-radius: 9px; }
.workout-name { margin-bottom: 28px; }
.workout-name input { background: var(--surface); font-size: 1.15rem; font-weight: 650; min-height: 62px; border-radius: 16px; }
.section-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-toolbar h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.count-badge { padding: 3px 9px; border-radius: 8px; font-size: .75rem; background: #243042; color: #b9d5ff; }
.add-button { padding: 0 16px; border: 1px solid #59759e; background: #212f43; color: #d7e7ff; border-radius: 13px; font-size: .875rem; font-weight: 650; }
.exercise-list { display: grid; gap: 24px; }
.exercise-card, .routine-exercise { --card-accent: var(--accent); --card-glow: #3888ff30; --card-tint: #132744; background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--card-accent); border-radius: 22px; overflow: hidden; box-shadow: 0 -3px 18px var(--card-glow), inset 0 1px 14px var(--card-glow); }
.exercise-top { display: flex; align-items: center; gap: 12px; padding: 24px; }
.exercise-index { display: flex; align-items: center; justify-content: center; width: 40px; height: 44px; border-radius: 12px; flex-shrink: 0; color: var(--card-accent, var(--accent)); background: var(--card-tint, #132744); font-weight: 750; font-size: .85rem; }
.exercise-title { flex: 1; min-width: 0; }
.exercise-title h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
.exercise-title > span { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; }
.text-button { font-size: .875rem; font-weight: 650; padding: 0 10px; color: #90bcff; }
.exercise-history { margin: 0 24px 18px; padding: 14px; border: 1px solid #35465f; border-radius: 15px; background: #122034; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; font-weight: 750; margin-bottom: 12px; }
.history-heading > span { font-size: .65rem; font-weight: 500; color: #a7b7ce; text-transform: uppercase; letter-spacing: .08em; }
.history-sessions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.history-session:only-child { grid-column: 1 / -1; }
.history-session + .history-session { border-left: 1px solid #35465f; padding-left: 12px; }
.history-date { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.history-date time { font-size: .8rem; font-weight: 750; color: #a8cbff; }
.history-session + .history-session .history-date time { color: #b7d4ff; }
.history-date > span { font-size: .7rem; color: #a7b7ce; }
.exercise-history ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.exercise-history li { font-size: .85rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.exercise-history li > span:first-child { display: block; color: #a7b7ce; font-size: .7rem; font-weight: 400; }
.history-exercise-note, .exercise-history li > .history-set-note { display: block; white-space: pre-wrap; overflow-wrap: anywhere; color: #afbed5; font-size: .8rem; font-weight: 400; margin: 6px 0; }
.no-history { margin: 0 24px 16px; color: var(--muted); font-size: .8rem; }
.sets-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; padding: 0 24px 20px; }
.sets-table th { text-align: left; color: #b6c5db; font-size: .8rem; font-weight: 600; padding: 0 5px; }
.sets-table th:first-child { width: 44px; padding-left: 0; }
.sets-table th > span:not(.set-number) { color: #a7b7ce; font-size: .75rem; }
.sets-table td { padding: 0 5px; }
.sets-table td:last-child { padding-right: 0; }
.sets-table .set-row > td, .sets-table .set-row > th { padding-top: 10px; }
.sets-table input { text-align: center; font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; padding: 12px 5px; min-height: 58px; }
.sets-table input[data-field="weight"] { color: #b1d0ff; }
.sets-table input[data-field="reps"] { color: #cce0ff; }
.set-number { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #203047; color: #b1d0ff; }
.primary, .secondary, .danger-button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; border-radius: 13px; padding: 13px 20px; font-size: .9rem; font-weight: 700; min-height: 52px; }
.primary { background: var(--primary-gradient); color: #fff; box-shadow: 0 4px 20px #428eff66; }
.secondary { border: 1px solid #3c506d; background: var(--surface); }
.danger-button { color: #579aff; }
.danger-button.filled { background: #1644d9; color: #fff; border: 2px solid #81baff; }
.save-bar { position: sticky; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 24px; padding: 16px 18px; border-radius: 18px; background: #142339; color: #edf4ff; box-shadow: 0 6px 22px #00000040; }
.save-bar strong { display: block; font-size: .875rem; }
.save-bar div > span { display: block; font-size: .75rem; color: #b6c5db; margin-top: 3px; }
.delete-workout { display: block; margin: 18px auto; padding: 8px 16px; color: #579aff; font-size: .85rem; text-decoration: underline; text-underline-offset: 4px; }
.empty-state, .empty-exercises { text-align: center; padding: 48px 24px; border: 1px solid var(--line); background: var(--surface); border-radius: 22px; }
.empty-state h2 { font-size: 1.5rem; }
.empty-state p { max-width: 460px; color: var(--muted); margin: 14px auto 26px; }
.empty-exercises p { font-weight: 700; margin-bottom: 8px; }
.empty-exercises span { font-size: .875rem; color: var(--muted); }
.empty-symbol { display: flex; align-items: center; justify-content: center; width: 66px; height: 66px; border-radius: 20px; margin: 0 auto 22px; color: #94bfff; background: #213148; font-size: 2rem; }
.empty-actions { display: grid; gap: 12px; max-width: 290px; margin: auto; }
.routine-list { display: grid; gap: 14px; }
.routine-card { display: flex; align-items: center; gap: 16px; min-width: 0; width: 100%; text-align: left; background: var(--surface); padding: 22px; border: 1px solid var(--line); border-radius: 19px; }
.routine-card-copy { flex: 1; min-width: 0; }
.routine-card-copy strong { display: block; font-size: 1.1rem; overflow-wrap: anywhere; }
.routine-card-copy > span { display: block; color: var(--muted); font-size: .85rem; margin-top: 5px; }
.routine-icon { padding: 8px 14px; border-radius: 12px; background: #213148; color: #b7d4ff; font-size: 1.5rem; }
.reorder-actions { border-top: 1px solid var(--line); padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.reorder-actions > span { margin-right: auto; color: var(--muted); font-size: .8rem; }
.reorder-actions .secondary { min-height: 44px; padding: 8px 12px; }
.template-note, .field-hint { color: var(--muted); font-size: .85rem; margin-top: 14px; }
.picker-list .routine-card { padding: 16px; }
.picker-empty .primary { margin-top: 18px; }
.note-editor { min-width: 0; }
.note-editor summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 0; cursor: pointer; font-size: .8rem; color: #a4c8ff; touch-action: manipulation; }
.note-editor summary::-webkit-details-marker { display: none; }
.note-editor summary::before { content: '+'; width: 16px; flex-shrink: 0; font-size: 1.1rem; text-align: center; }
.note-editor[open] summary::before { content: '−'; }
.note-caption { flex-shrink: 0; }
.note-preview { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: .75rem; }
.note-editor[open] .note-preview { display: none; }
.note-content { padding-bottom: 14px; }
.note-content label { overflow-wrap: anywhere; }
.note-content textarea { min-height: 96px; max-height: 220px; resize: vertical; }
.note-hint { display: block; font-size: .75rem; color: var(--muted); margin-top: 5px; }
.exercise-note { margin: -4px 24px 14px; border-bottom: 1px solid var(--line); }
.sets-table .set-note-row > td { padding: 0 0 4px; }
.set-note-row .note-editor { border-bottom: 1px solid #293952; }
.set-note-row:last-child .note-editor { border-bottom: 0; }
.storage-error { background: #172232; color: #a6caff; border: 1px solid #4172bc; padding: 16px; border-radius: 12px; margin-top: 18px; font-size: .875rem; }
.form-error { color: #579aff; font-weight: 700; margin-top: 12px; font-size: .875rem; }
.loading { padding: 70px 0; text-align: center; color: var(--muted); }
dialog { width: calc(100% - 28px); max-width: 490px; max-height: calc(100dvh - 28px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); padding: 28px; overflow: auto; box-shadow: 0 25px 90px #00000088; }
dialog::backdrop { background: #02050bc9; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.dialog-heading h2 { font-size: 1.4rem; }
dialog label { margin-top: 18px; }
#exercise-count { max-width: 120px; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }
.confirm-copy { color: var(--muted); }
#notification { position: fixed; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translate(-50%, 12px); z-index: 10; max-width: min(520px, calc(100% - 32px)); width: max-content; padding: 14px 18px; background: #142339; color: var(--ink); border: 1px solid #526e98; border-radius: 14px; font-size: .85rem; box-shadow: 0 6px 24px #00000055; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
#notification.visible { opacity: 1; transform: translate(-50%, 0); }
.diary-panel { max-width: 530px; margin: 24px auto; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; }
.diary-panel h1 { font-size: 2.2rem; margin-bottom: 20px; }
.diary-panel p { margin-bottom: 16px; }
.diary-panel form, .diary-actions { display: grid; gap: 12px; }
.diary-panel form { margin: 22px 0 8px; }
.diary-panel label { margin: 0; }
dialog .diary-panel { margin: 0; padding: 0; border: 0; }
.diary-check { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.diary-check input { width: 22px; min-height: 22px; height: 22px; flex-shrink: 0; margin: 0; }
.diary-pending .app-nav { display: none; }
@media(max-width:700px) {
  .app-header { gap: 10px; min-height: calc(74px + env(safe-area-inset-top, 0px)); padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
  .brand { gap: 9px; font-size: 1.5rem; }
  .brand-mark { width: 35px; height: 35px; border-radius: 10px; }
  .brand-description, .brand-divider, .small-note { display: none; }
  .local-badge { font-size: .65rem; max-width: 82px; line-height: 1.35; text-align: right; }
  .app-header .text-button { font-size: .75rem; padding: 0 10px; min-height: 44px; white-space: nowrap; }
  main { padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(140px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .calendar-page > .page-heading { padding: 26px 24px; border-radius: 22px; margin-bottom: 20px; }
  .calendar-page h1 { font-size: 2rem; max-width: none; }
  .intro { font-size: .875rem; max-width: 230px; }
  .calendar-toolbar { padding: 18px 13px 16px; gap: 8px; }
  .calendar-toolbar h2 { font-size: 1.15rem; }
  .icon-button { width: 44px; height: 44px; min-height: 44px; }
  .today-button { min-height: 44px; padding: 0 12px; }
  .weekdays, .calendar-grid { padding-left: 7px; padding-right: 7px; gap: 3px; }
  .weekdays span { font-size: .7rem; }
  .day { min-height: 59px; padding: 7px 1px; align-items: center; gap: 6px; border-radius: 11px; }
  .day-number { width: 28px; height: 28px; font-size: .875rem; }
  .day-workout { display: none; } .workout-dot, .draft-dot { display: block; }
  .calendar-legend { gap: 8px 14px; font-size: .65rem; padding: 15px 8px; }
  .calendar-legend > span { gap: 5px; }
  .calendar-legend i { width: 7px; height: 7px; }
  .page-footer { font-size: .65rem; }
  .back-button { margin-bottom: 12px; }
  .editor-heading h1 { font-size: 2.1rem; }
  .day-tag { display: none; }
  .section-toolbar h2 { font-size: .95rem; }
  .add-button { padding: 0 12px; font-size: .8rem; }
  .exercise-top { padding: 20px 16px; gap: 10px; }
  .exercise-title h2 { font-size: 1.05rem; }
  .exercise-title > span { font-size: .8rem; }
  .exercise-index { width: 34px; height: 40px; }
  .text-button { min-height: 44px; }
  .exercise-history { margin: 0 16px 18px; padding: 12px; }
  .history-sessions { gap: 10px; }
  .history-session + .history-session { padding-left: 10px; }
  .exercise-history li { font-size: .8rem; }
  .exercise-note { margin: -4px 16px 14px; }
  .no-history { margin: 0 16px 16px; }
  .sets-table { padding: 0 16px 16px; }
  .sets-table th { font-size: .8rem; }
  .sets-table th:first-child { width: 38px; }
  .note-editor summary { flex-wrap: wrap; gap: 3px 6px; }
  .note-preview { flex-basis: 100%; padding-left: 22px; }
  .save-bar { position: static; flex-wrap: wrap; gap: 10px; padding: 14px; }
  .save-bar > div { width: 100%; }
  .save-bar .primary { width: 100%; }
  .save-bar div > span { font-size: .7rem; }
  .save-bar strong { font-size: .8rem; }
  .is-editing .save-bar { position: static; }
  .routine-card { padding: 18px 16px; gap: 12px; }
  .reorder-actions { padding: 12px 16px; }
  .reorder-actions > span { width: 100%; }
  .reorder-actions button { flex: 1; }
  dialog { padding: 22px; top: calc(var(--visible-top, 0px) + 12px); bottom: auto; margin: 0 auto; max-height: calc(var(--visible-height, 100dvh) - 24px); }
  .dialog-actions button { flex: 1; }
  .diary-panel { padding: 22px; }
}
@media(max-width:359px) { .calendar-toolbar h2 { width: 100%; } .history-sessions { grid-template-columns: 1fr; } .history-session + .history-session { padding: 12px 0 0; border-left: 0; border-top: 1px solid #35465f; } }
.keyboard-open .app-nav { display: none; }
.keyboard-open .save-bar { position: static; }
.keyboard-open main { padding-bottom: calc(var(--keyboard-height, 0px) + 130px); }
@media(prefers-reduced-motion:reduce) { * { scroll-behavior: auto !important; transition: none !important; } }



.calendar-toolbar h2::first-letter { text-transform: uppercase; }


/* ---- Progreso (sección añadida) ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-nav:has(button:nth-child(3)) { width: min(420px, calc(100% - 32px)); gap: 4px; }
.app-nav:has(button:nth-child(3)) button { gap: 7px; padding: 0 6px; }
.progress-page { display: grid; gap: 18px; }
.progress-page > .page-heading { margin-bottom: 4px; }
.progress-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.progress-tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; min-width: 0; }
.progress-tile-label { font-size: .75rem; font-weight: 650; color: var(--muted); }
.progress-tile-value { font-size: 1.75rem; font-weight: 720; letter-spacing: -.03em; line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
.progress-tile-detail { font-size: .75rem; color: var(--muted); }
.progress-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px; min-width: 0; box-shadow: 0 0 0 1px #3988ff12, 0 0 30px #237bff12; }
.progress-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 16px; }
.progress-card-sub { font-size: .8rem; color: var(--muted); }
.progress-select { width: 100%; min-height: 54px; padding: 0 44px 0 15px; font: inherit; font-size: 1rem; font-weight: 650; color: var(--ink); background-color: #0b1422; background-image: linear-gradient(45deg, transparent 50%, #a7b7ce 50%), linear-gradient(135deg, #a7b7ce 50%, transparent 50%); background-position: calc(100% - 24px) 50%, calc(100% - 18px) 50%; background-size: 6px 6px; background-repeat: no-repeat; border: 1px solid #526786; border-radius: 12px; appearance: none; }
.progress-select:focus-visible { outline: 3px solid #73abff; outline-offset: 3px; }
.metric-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.metric-tab { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #354763; color: #b6c6df; font-size: .85rem; font-weight: 650; white-space: nowrap; }
.metric-tab[aria-pressed=true] { color: #fff; border-color: transparent; background: var(--primary-gradient); }
.metric-tab:disabled { opacity: .35; }
.metric-note { margin-top: 10px; font-size: .78rem; color: var(--muted); }
.chart { position: relative; margin-top: 8px; min-height: 120px; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; }
.chart svg:focus { outline: none; }
.chart svg:focus-visible { outline: 3px solid #73abff; outline-offset: 4px; border-radius: 8px; }
.chart .grid { stroke: #22324a; stroke-width: 1; }
.chart .baseline { stroke: #3b4f6d; stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .value-label { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart .bar { fill: #3b6db0; }
.chart .bar-current { fill: #64adff; }
.chart .bar-hover { fill: #ffffff0d; }
.chart .line { fill: none; stroke: #64adff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: #64adff; fill-opacity: .1; stroke: none; }
.chart .dot { fill: #64adff; stroke: var(--surface); stroke-width: 2; }
.chart .dot-focus { fill: #9cc8ff; }
.chart .crosshair { stroke: #8fa4c2; stroke-width: 1; }
.chart .hit { fill: transparent; outline: none; cursor: pointer; }
.chart-tip { position: absolute; left: 0; top: 0; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 12px; background: #1c2b42; border: 1px solid #3b5171; box-shadow: 0 10px 24px #0008; pointer-events: none; white-space: nowrap; }
.chart-tip strong { font-size: .95rem; color: var(--ink); }
.chart-tip span { font-size: .75rem; color: var(--muted); }
.chart-empty { padding: 36px 8px; text-align: center; color: var(--muted); font-size: .9rem; }
.exercise-records { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.exercise-records div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: #0d1625; border: 1px solid #22324a; min-width: 0; }
.exercise-records span, .exercise-records small { font-size: .72rem; color: var(--muted); }
.exercise-records strong { font-size: 1rem; color: var(--ink); overflow-wrap: anywhere; }
.progress-table { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }
.progress-table summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--accent); font-size: .85rem; font-weight: 650; }
.progress-table table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.progress-table th { text-align: left; font-size: .72rem; font-weight: 650; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.progress-table td { padding: 10px 6px; border-bottom: 1px solid #1d2a3e; }
.progress-table th:last-child, .progress-table td:last-child { text-align: right; }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pr-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #0d1625; border: 1px solid #22324a; }
.pr-badge { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; background: #1b3a66; color: #9cc8ff; }
.pr-copy, .pr-value { display: flex; flex-direction: column; min-width: 0; }
.pr-copy { flex: 1; }
.pr-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-copy span, .pr-value span { font-size: .75rem; color: var(--muted); }
.pr-value { align-items: flex-end; text-align: right; }
.pr-empty { font-size: .9rem; }
@media(max-width:700px) {
  .progress-page > .page-heading h1 { font-size: 2rem; }
  .progress-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .progress-tile { padding: 14px; border-radius: 18px; }
  .progress-tile-value { font-size: 1.4rem; }
  .progress-card { padding: 16px; border-radius: 22px; }
  .metric-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exercise-records { gap: 6px; }
  .exercise-records div { padding: 10px; }
}
@media(max-width:380px) {
  .app-nav:has(button:nth-child(3)) button { flex-direction: column; gap: 2px; font-size: .75rem; }
}
