:root{color-scheme:light;--bg:#f5f7f5;--bg-rgb:245,247,245;--paper:#fff;--paper-rgb:255,255,255;--ink:#101a12;--ink-rgb:16,26,18;--muted:#5a675d;--line:rgba(16,26,18,.13);--accent:#00d632;--accent-ink:#04210d;--accent-soft:#dbf7e3;--complete:#dcedff;--complete-ink:#214e78;--danger:#b63843;--next:#00a82a;--next-fill:#e6fbe9;--next-ink:#04210d;--tile:#e4f6e9;--tile-ink:#12351c;--shadow:0 0 0 1px rgba(16,26,18,.08),0 14px 34px rgba(20,40,25,.06)}
:root[data-theme="dark"]{color-scheme:dark;--bg:#0b0f0c;--bg-rgb:11,15,12;--paper:#141a15;--paper-rgb:20,26,21;--ink:#f2f6f2;--ink-rgb:242,246,242;--muted:#9fb3a3;--line:rgba(242,246,242,.14);--accent:#00d632;--accent-ink:#04210d;--accent-soft:#0f2e1b;--complete:#23394e;--complete-ink:#bcdfff;--danger:#ff8b94;--next:#3ddb5f;--next-fill:#0f3a1f;--next-ink:#05240f;--tile:#16241a;--tile-ink:#e9f6ec;--shadow:0 0 0 1px rgba(242,246,242,.105),0 18px 46px rgba(0,0,0,.3)}
:root[data-palette="classic"]{--bg:#f7f6f2;--bg-rgb:247,246,242;--paper:#fff;--paper-rgb:255,255,255;--ink:#171716;--ink-rgb:23,23,22;--muted:#6f6d67;--line:rgba(23,23,22,.13);--accent:#f26522;--accent-ink:#fff;--accent-soft:#fff0e8;--complete:#dcedff;--complete-ink:#214e78;--danger:#b63843;--next:#23834e;--next-fill:#e3f8e9;--next-ink:#fff;--tile:#f6ede6;--tile-ink:#171716;--shadow:0 0 0 1px rgba(23,23,22,.08),0 14px 34px rgba(43,38,29,.055)}
:root[data-theme="dark"][data-palette="classic"]{--bg:#11151b;--bg-rgb:17,21,27;--paper:#1d242d;--paper-rgb:29,36,45;--ink:#f3f6fb;--ink-rgb:243,246,251;--muted:#a8b5c5;--line:rgba(227,237,251,.17);--accent:#ff9565;--accent-ink:#201108;--accent-soft:#392b24;--complete:#23394e;--complete-ink:#bcdfff;--danger:#ff8b94;--next:#78e4a3;--next-fill:#183a2b;--next-ink:#102519;--tile:#222a33;--tile-ink:#f3f6fb;--shadow:0 0 0 1px rgba(248,247,242,.105),0 18px 46px rgba(0,0,0,.28)}
:root[data-palette="pastel"]{--bg:#fffbea;--bg-rgb:255,251,234;--paper:#fffdf5;--paper-rgb:255,253,245;--ink:#171716;--ink-rgb:23,23,22;--muted:#64645b;--line:rgba(23,23,22,.13);--accent:#b94e17;--accent-ink:#fff;--accent-soft:#ffe9ca;--complete:#dcedff;--complete-ink:#214e78;--danger:#b63843;--next:#247348;--next-fill:#d9f7df;--next-ink:#fff;--tile:#fdf3dd;--tile-ink:#171716;--shadow:0 0 0 1px rgba(23,23,22,.08),0 14px 34px rgba(43,38,29,.055)}
:root[data-theme="dark"][data-palette="pastel"]{--bg:#11151b;--bg-rgb:17,21,27;--paper:#1d242d;--paper-rgb:29,36,45;--ink:#f3f6fb;--ink-rgb:243,246,251;--muted:#a8b5c5;--line:rgba(227,237,251,.17);--accent:#ff9565;--accent-ink:#201108;--accent-soft:#392b24;--complete:#23394e;--complete-ink:#bcdfff;--danger:#ff8b94;--next:#78e4a3;--next-fill:#183a2b;--next-ink:#102519;--tile:#222a33;--tile-ink:#f3f6fb;--shadow:0 0 0 1px rgba(248,247,242,.105),0 18px 46px rgba(0,0,0,.28)}
:root[data-palette="pastel"]:not([data-theme="dark"]) .exercise-card.tone-0{background:#fff1ad}
:root[data-palette="pastel"]:not([data-theme="dark"]) .exercise-card.tone-1{background:#e5dcfa}
:root[data-palette="pastel"]:not([data-theme="dark"]) .exercise-card.tone-2{background:#d9f1e3}
:root[data-palette="pastel"]:not([data-theme="dark"]) .exercise-card.tone-3{background:#ffe0cb}
:root[data-palette="ocean"]{--bg:#f3f6fa;--bg-rgb:243,246,250;--paper:#fff;--paper-rgb:255,255,255;--ink:#0e1a2b;--ink-rgb:14,26,43;--muted:#5b6675;--line:rgba(14,26,43,.13);--accent:#2f80ff;--accent-ink:#fff;--accent-soft:#e1edff;--complete:#dcedff;--complete-ink:#214e78;--danger:#b63843;--next:#1f9d57;--next-fill:#e0f5e8;--next-ink:#fff;--tile:#e4ecf7;--tile-ink:#0e1a2b;--shadow:0 0 0 1px rgba(14,26,43,.08),0 14px 34px rgba(20,42,80,.06)}
:root[data-theme="dark"][data-palette="ocean"]{--bg:#0a1018;--bg-rgb:10,16,24;--paper:#121a26;--paper-rgb:18,26,38;--ink:#eef4fc;--ink-rgb:238,244,252;--muted:#93a5bb;--line:rgba(238,244,252,.14);--accent:#5c9dff;--accent-ink:#06121f;--accent-soft:#13273f;--complete:#23394e;--complete-ink:#bcdfff;--danger:#ff8b94;--next:#4ade80;--next-fill:#12301f;--next-ink:#05240f;--tile:#16202e;--tile-ink:#eef4fc;--shadow:0 0 0 1px rgba(238,244,252,.105),0 18px 46px rgba(0,0,0,.3)}
:root[data-palette="mono"]{--bg:#fafafa;--bg-rgb:250,250,250;--paper:#fff;--paper-rgb:255,255,255;--ink:#111;--ink-rgb:17,17,17;--muted:#5c5c5c;--line:rgba(17,17,17,.14);--accent:#111;--accent-ink:#fff;--accent-soft:#e8e8e8;--complete:#dceeff;--complete-ink:#18384f;--danger:#b63843;--next:#15803d;--next-fill:#e4f4e8;--next-ink:#fff;--tile:#efefef;--tile-ink:#111;--shadow:0 0 0 1px rgba(17,17,17,.08),0 14px 34px rgba(0,0,0,.06)}
:root[data-theme="dark"][data-palette="mono"]{--bg:#0a0a0a;--bg-rgb:10,10,10;--paper:#161616;--paper-rgb:22,22,22;--ink:#f5f5f5;--ink-rgb:245,245,245;--muted:#a3a3a3;--line:rgba(245,245,245,.16);--accent:#f5f5f5;--accent-ink:#0a0a0a;--accent-soft:#262626;--complete:#23394e;--complete-ink:#bcdfff;--danger:#ff8b94;--next:#4ade80;--next-fill:#173322;--next-ink:#05240f;--tile:#1d1d1d;--tile-ink:#f5f5f5;--shadow:0 0 0 1px rgba(245,245,245,.105),0 18px 46px rgba(0,0,0,.3)}
.set-row.next{background:var(--next-fill);box-shadow:0 0 0 2px var(--next)}
.set-row.next .check{background:var(--next);color:var(--next-ink)}
.set-row.done{background:var(--complete);opacity:1}
.set-row.done input{background:transparent;color:var(--complete-ink);box-shadow:none}
.set-row.done .set-tag:not(.type-f){background:transparent;color:var(--complete-ink)}
.set-row.done .check{background:var(--complete-ink);color:var(--complete)}
.set-row:not(.done):not(.next){opacity:.82}
.set-row.saving::after,.set-row.save-error::after{content:"";position:absolute;width:6px;height:6px;right:2px;top:2px;border-radius:50%;background:var(--accent)}
.set-row.save-error{outline:2px dashed var(--danger);outline-offset:2px}
.set-row.save-error::after{background:var(--danger)}
:root[data-theme="dark"] .set-tag.type-f{background:#54313f;color:#ffd3df}
button:active{scale:.96}
button:focus-visible{outline:2px solid var(--next);outline-offset:3px}
.set-row input:focus{box-shadow:0 0 0 2px var(--next)}
.set-actions{display:grid;grid-template-columns:1fr;gap:.5rem;margin-top:.4rem}
.set-row{transition:transform .16s ease,opacity 170ms ease,background-color 170ms ease,box-shadow 170ms ease}
.set-row.swiping{transition:none}
.row-remove{position:absolute;top:0;bottom:0;left:calc(100% + .35rem);z-index:2;width:4.4rem;border:0;border-radius:11px;background:var(--danger);color:#fff;font-size:.78rem;font-weight:750;opacity:0;pointer-events:none;transition:opacity .15s ease}
:root[data-theme="dark"] .row-remove{color:#3a0d12}
.set-row.swiping .row-remove,.set-row.swiped .row-remove{opacity:1;pointer-events:auto}
@media (hover:hover) and (pointer:fine){
.set-row .row-remove{left:calc(100% + .3rem);top:50%;bottom:auto;width:2rem;height:2rem;border-radius:50%;font-size:0;transform:translateY(-50%)}
.set-row .row-remove::after{content:"−";position:absolute;inset:0;display:grid;place-items:center;font-size:1.1rem}
.set-row:hover .row-remove{opacity:1;pointer-events:auto}
}
.drag-handle{display:grid;place-items:center;flex:0 0 auto;width:2.75rem;height:2.75rem;margin-left:-.6rem;border:0;border-radius:11px;background:transparent;color:var(--muted);cursor:grab;touch-action:none}
.drag-handle svg{width:1.1rem;height:1.1rem;fill:currentColor}
.exercise-card.dragging{position:relative;z-index:6;box-shadow:0 18px 44px rgba(0,0,0,.28);cursor:grabbing}
.training-pill{position:fixed;z-index:11;left:50%;bottom:calc(5rem + env(safe-area-inset-bottom));transform:translateX(-50%);max-width:calc(100% - 48px);padding:.62rem 1.15rem;border:0;border-radius:999px;background:var(--accent);color:var(--accent-ink);font-size:.8rem;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 12px 28px rgba(var(--ink-rgb),.28)}
.session-banner{position:fixed;z-index:30;top:calc(.6rem + env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:.7rem;max-width:calc(100% - 40px);padding:.6rem .95rem;border-radius:999px;background:var(--paper);color:var(--ink);font-size:.78rem;font-weight:650;box-shadow:var(--shadow)}
.session-banner button{padding:.35rem .8rem;border:0;border-radius:999px;background:var(--accent);color:var(--accent-ink);font-weight:750}
.sheet-head .icon-button{flex:0 0 auto;width:2.75rem;height:2.75rem}
#history-subtitle{margin:.2rem 0 0;font-size:.74rem}
.history-actions{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
#history-delete-button{grid-column:1/-1}
.history-dialog{height:min(92dvh,900px);max-height:calc(100dvh - 20px);overflow:hidden;margin:auto}
.history-dialog #history-form{display:flex;flex-direction:column;height:100%;max-height:100%;min-height:0;overflow:hidden;gap:.7rem}
.history-dialog .sheet-head,.history-dialog .history-actions{flex:0 0 auto}
.history-scroll{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding:2px}
.exercise-actions-button{min-width:44px;min-height:44px;display:grid;place-items:center;padding:8px;border:0;border-radius:12px;background:var(--accent-soft);color:var(--ink);flex-shrink:0;touch-action:manipulation}
.exercise-actions-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#exercise-actions-dialog button{min-height:44px}
#exercise-actions-dialog button:disabled{opacity:.35;cursor:not-allowed}
.exercise-picker-dialog{height:min(90dvh,820px);max-height:calc(100dvh - 20px);overflow:hidden}
.exercise-picker-dialog .sheet{display:flex;flex-direction:column;height:100%;max-height:100%;min-height:0;overflow:hidden}
.exercise-picker-dialog .sheet>label,.exercise-picker-dialog .sheet-head,.exercise-picker-dialog .dialog-actions,#exercise-picker-controls{flex:0 0 auto}
.exercise-picker-results{flex:1 1 0;min-height:100px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;display:grid;align-content:start;gap:8px;padding:3px}
.exercise-picker-option{display:flex;justify-content:space-between;align-items:center;text-align:left;gap:12px;min-height:60px;width:100%;padding:12px;border:0;border-radius:12px;box-shadow:0 0 0 1px var(--line);background:var(--panel,var(--bg));color:var(--ink)}
.exercise-picker-option>span:first-child{display:grid;gap:4px;min-width:0}
.exercise-picker-option strong{overflow-wrap:anywhere;font-size:.95rem}.exercise-picker-option small{color:var(--muted);font-size:.76rem}
.exercise-picker-option:disabled{opacity:.5}.exercise-picker-option:active{scale:.96}.exercise-picker-option:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.exercise-picker-option.selected{box-shadow:0 0 0 2px var(--next);background:var(--next-fill)}
#workout-action-confirm.danger{background:#c63642;color:#fff}
.plain-action{min-height:44px;padding:12px;border:0;background:transparent;color:var(--muted);font-size:17px}
#exercise-picker-hint{font-size:.78rem;margin:.5rem 0}#exercise-picker-error:empty{display:none}
.exercise-tools .guide-button{min-height:44px}
.history-scroll .history-detail{display:grid;overflow:visible;min-height:0}
.history-scroll .history-meta-edit{margin-bottom:.8rem}
.history-actions button{min-height:44px;padding:.55rem .75rem}
.history-actions #history-save-button{grid-column:1/-1}
.history-detail.editing .history-set-row,.history-detail.editing .history-set-head{grid-template-columns:minmax(4.5rem,1.2fr) minmax(0,1fr) minmax(0,1fr) 44px}
.history-remove-set,.history-undo-set{min-width:44px;min-height:44px;border:0;border-radius:10px;background:var(--accent-soft);color:var(--danger);font-weight:700}
.history-remove-exercise{margin-top:.55rem;color:var(--danger)}
.history-set-row.pending-delete>select,.history-set-row.pending-delete>input,.history-set-row.pending-delete>.history-remove-set{display:none}
.history-set-row.pending-delete>.history-undo-set{display:block!important;grid-column:1/-1;font-size:.875rem}
.history-exercise.pending-delete>.history-muscles,.history-exercise.pending-delete>.history-set-head,.history-exercise.pending-delete>.history-set-row,.history-exercise.pending-delete>.history-exercise-volume{display:none}
.history-exercise.pending-delete{box-shadow:0 0 0 1px var(--danger)}
.set-actions{grid-template-columns:1fr 1fr}
.remove-set{min-height:48px;border:0;border-radius:12px;background:transparent;color:var(--muted);font-size:.875rem;font-weight:650}
#remove-set-options{display:grid;gap:.6rem;max-height:55dvh;overflow-y:auto;padding:1px}
.remove-set-option{display:flex;align-items:center;justify-content:space-between;min-height:64px;width:100%;padding:.75rem;border:0;border-radius:12px;background:var(--paper);color:var(--ink);box-shadow:0 0 0 1px var(--line);text-align:left}
.remove-set-option>span:first-child{display:grid;gap:.25rem}
.remove-set-option small{color:var(--muted);font-size:.875rem}

/* Native Lift parity: LiftColors, SetRow, ExerciseArtwork and SessionControls. */
:root:not([data-theme="dark"]){--bg:#f2f9f3;--bg-rgb:242,249,243;--tile:#e4f5e8;--tile-ink:#04210d}
:root[data-palette="classic"]:not([data-theme="dark"]){--bg:#faf8f1;--bg-rgb:250,248,241;--accent:#bf501d;--tile:#f3ede2;--tile-ink:#1c1c1e}
:root[data-palette="pastel"]:not([data-theme="dark"]){--bg:#fffbea;--bg-rgb:255,251,234;--paper:#fff;--paper-rgb:255,255,255;--tile:#fff3cf;--tile-ink:#1c1c1e}
:root[data-palette="ocean"]:not([data-theme="dark"]){--bg:#f3f6fa;--bg-rgb:243,246,250;--tile:#e3ebf5;--tile-ink:#1c1c1e}
:root[data-palette="mono"]:not([data-theme="dark"]){--bg:#fafafa;--bg-rgb:250,250,250;--tile:#f0f0f0;--tile-ink:#1c1c1e}
:root[data-theme="dark"]{--tile:#18241b;--tile-ink:#f5f5f5}
:root[data-theme="dark"][data-palette="classic"],:root[data-theme="dark"][data-palette="pastel"]{--bg:#07090d;--bg-rgb:7,9,13;--paper:#11161d;--paper-rgb:17,22,29;--accent-ink:#fff;--tile:#1a212b}
:root[data-theme="dark"][data-palette="ocean"]{--tile:#182234}
:root[data-theme="dark"][data-palette="mono"]{--tile:#1e1e1e}
:root[data-palette]{--next:#237747;--next-fill:#e2f7e7;--next-ink:#237747;--complete:#dcedff;--complete-ink:#214e78;--accent-soft:color-mix(in srgb,var(--accent) 14%,transparent)}
:root[data-theme="dark"][data-palette]{--next:#78e4a3;--next-fill:#183a2b;--next-ink:#78e4a3;--complete:#23394e;--complete-ink:#bcdfff;--tile-ink:#f5f5f5;--accent-soft:color-mix(in srgb,var(--accent) 24%,transparent)}
body{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:17px}
.topbar h1{font-size:34px;font-weight:700;line-height:1.12;letter-spacing:-.035em}
.exercise-head h2,.history-card-title strong,.library-card strong,.exercise-picker-option strong{font-size:17px;line-height:1.25}
.exercise-head p,.set-count,.library-card small,.exercise-picker-option small,.history-card-title small,.history-preview,.history-stats,.workout-status,#history-subtitle{font-size:13px;line-height:1.35}
.set-labels{font-size:11px;letter-spacing:.04em}
.set-labels,.set-row{grid-template-columns:44px minmax(0,1fr) minmax(0,1fr) 44px;gap:8px}
.set-row{min-height:48px;padding:2px;border-radius:10px;font-variant-numeric:tabular-nums}
.set-row input{height:44px;min-height:44px;background:transparent;box-shadow:none;font-size:17px;font-weight:400;border-radius:8px}
.set-tag,.check{width:44px;height:44px;min-height:44px;border-radius:10px;font-size:17px}
.set-tag:not(.type-f){background:transparent}
.check{background:transparent;font-size:26px;font-weight:400}
.set-row.next .check{background:transparent;color:var(--next)}
.set-row.done .check{background:transparent;color:var(--complete-ink);font-size:22px}
.set-row:not(.done):not(.next){opacity:1;background:rgba(var(--paper-rgb),.65)}
.set-row.done:focus-within{opacity:1}
.exercise-head{align-items:center;gap:10px}
.exercise-heading{flex:1 1 0;min-width:0}
.exercise-heading h2{overflow-wrap:anywhere}
.exercise-tools{align-self:center;gap:4px}
.exercise-actions-button,.nav-arrow,.guide-button{min-width:44px;min-height:44px;display:grid;place-items:center;line-height:1}
.exercise-actions-button{background:transparent;color:var(--muted)}
.nav-arrow{font-size:28px;padding:0 0 3px}
.guide-button{font-size:13px;padding:8px 10px}
.swap-undo button{min-height:44px}
.finish,.cancel-workout{width:100%;min-height:50px;padding:12px 16px;border:0;border-radius:999px;font-size:17px;line-height:26px;font-weight:600;box-shadow:none}
.cancel-workout{margin-top:12px;background:rgba(255,59,48,.08);color:#ff3b30}
:root[data-theme="dark"] .cancel-workout{background:rgba(255,59,48,.16)}
#workout-action-dialog{border-radius:28px;max-height:calc(100dvh - 20px);overflow-y:auto;background:var(--paper)}
#workout-action-dialog .sheet{gap:18px;padding:24px}
#workout-action-title{margin:0;font-size:22px;line-height:1.25}
#workout-action-message{margin:0;font-size:17px;line-height:1.4}
#workout-action-confirm,#workout-action-confirm.danger{min-height:50px;border-radius:999px;background:#ff3b30;color:#fff;font-size:17px;font-weight:600;box-shadow:none}
#workout-action-keep{min-height:44px;padding:10px;border:0;background:transparent;box-shadow:none;color:var(--muted);font-size:17px}
.library-card{grid-template-columns:56px minmax(0,1fr) auto;min-height:72px;gap:12px;border-radius:16px;box-shadow:0 0 0 1px var(--line)}
.library-image{flex:0 0 56px;width:56px;height:56px;border-radius:8px;outline:1px solid rgba(0,0,0,.1);outline-offset:-1px}
:root[data-theme="dark"] .library-image{outline-color:rgba(255,255,255,.1)}
.library-image img{width:400%;max-width:none}
.exercise-picker-option{min-height:72px;background:var(--paper);gap:12px}
.exercise-picker-option>.library-image{display:block}
.exercise-picker-option>.exercise-picker-copy{flex:1 1 0;min-width:0;display:grid;gap:4px}
.exercise-picker-option.selected{background:var(--next-fill)}
.exercise-search select{width:100%;min-height:44px;padding:8px 12px;border:0;border-radius:10px;background:var(--paper);color:var(--ink);box-shadow:0 0 0 1px var(--line);font-size:17px}
@media(hover:hover) and (pointer:fine){.set-row .row-remove{width:44px;height:44px}}
/* Profile access follows the existing settings sheet and theme. */
.google-signin{margin-top:1rem;min-height:44px}
#forgot-password-note{margin:0}
#profile-dialog .sheet{max-height:calc(100dvh - 40px);overflow-y:auto}
.profile-access-row{display:grid;gap:.65rem;padding:1rem 0;border-bottom:1px solid var(--line)}
.profile-access-row:last-child{border-bottom:0;padding-bottom:0}
.profile-access-row h4{margin:0;color:var(--ink);font-size:1rem}
.profile-access-row input{margin-bottom:0;min-width:0}
.profile-access-actions{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
.profile-access-actions button{min-width:0}
.reset-link-result{display:grid;gap:.5rem}
.profile-access-status{margin:0!important;color:var(--muted);min-height:1.2rem}
.profile-access-status.error{color:var(--danger)}
.profile-access-row button:disabled{opacity:.5;cursor:wait}

/* Hex tokens from iOS Sky.swift and AuraHome.swift. Layout overrides come last. */
:root[data-layout="sky"][data-layout] {
  color-scheme:dark;
  --deep:#203f49;--mint:#d2f3e1;--sun:#ffefd0;
  --ink2:rgba(255,255,255,.94);--ink3:rgba(255,255,255,.90);
  --mesh-0:#254959;--mesh-1:#31596b;--mesh-2:#466474;
  --mesh-3:#4c797e;--mesh-4:#64898a;--mesh-5:#5b7e81;
  --mesh-6:#536e67;--mesh-7:#718878;--mesh-8:#3f655f;
  --scale-0:#385761;--scale-1:#527d8c;--scale-2:#7aaeb7;
  --scale-3:#a6cecb;--scale-4:#cbded1;--scale-5:#f2e6bc;
  --ring:linear-gradient(to top right,#a8d8d4,#fff,var(--sun));
  --bg:var(--deep);--bg-rgb:32,63,73;--paper:#31596b;--paper-rgb:49,89,107;
  --ink:#fff;--ink-rgb:255,255,255;--muted:var(--ink3);--line:rgba(255,255,255,.25);
  --accent:var(--sun);--accent-ink:var(--deep);--accent-soft:#385761;
  --complete:var(--mint);--complete-ink:var(--deep);--danger:#ff8b94;
  --next:var(--mint);--next-fill:#385761;--next-ink:var(--deep);
  --tile:#385761;--tile-ink:#fff;--shadow:0 0 0 1px var(--line),0 3px 8px rgba(32,63,73,.12);
}
:root[data-layout="aura"][data-layout] {
  color-scheme:dark;
  --lavender:#b9a6ff;--peach:#ffc2a0;--peach-ink:#ffc7a3;--indigo:#5b5bd6;
  --mint:#a9e3d4;--violet:#b9adff;
  --ink2:rgba(243,241,236,.62);--ink3:rgba(243,241,236,.45);
  --scale-0:#262a36;--scale-1:#38407a;--scale-2:#5a5fd0;
  --scale-3:#9b87f2;--scale-4:#e6b3e8;--scale-5:#ffcfae;
  --ring:linear-gradient(to top right,#6670ff,#b79cff,#ffcaa6);
  --avatar-on:linear-gradient(to bottom right,#8d84f5,#f2b8a2);
  --day-on:linear-gradient(to bottom right,#8d84f5,#c9a3f0);
  --callout-on:linear-gradient(to bottom right,#9b87f2,#c9a8f2);
  --toggle-on:linear-gradient(to right,#6670ff,#b79cff);
  --bg:#0b0a12;--bg-rgb:11,10,18;--paper:#262a36;--paper-rgb:38,42,54;
  --ink:#f3f1ec;--ink-rgb:243,241,236;--muted:var(--ink2);--line:rgba(255,255,255,.07);
  --accent:var(--lavender);--accent-ink:#0b0a12;--accent-soft:#38407a;
  --complete:var(--mint);--complete-ink:#0b0a12;--danger:#ff8b94;
  --next:var(--peach);--next-fill:#262a36;--next-ink:#0b0a12;
  --tile:#262a36;--tile-ink:var(--ink);--shadow:0 0 0 1px var(--line),0 18px 46px rgba(0,0,0,.3);
}

/* Cross-cutting layout guard: independent of tab visibility and preferred mode.
   Repeated layout specificity outranks Standard's theme + palette selectors. */
:root:is([data-layout="sky"],[data-layout="aura"]) {
  color-scheme:dark;
  --layout-card-radius:14px;--layout-control-radius:12px;--layout-chip-radius:5px;
  --danger-soft:color-mix(in srgb,var(--danger) 16%,transparent);
}
:root[data-layout="sky"][data-layout] {
  --toggle-on:var(--ring);--avatar-on:var(--ring);--day-on:var(--ring);--callout-on:var(--ring);
}
:root:is([data-layout="sky"],[data-layout="aura"]) body {background:var(--bg);color:var(--ink)}
:root:is([data-layout="sky"],[data-layout="aura"]) :is(.danger,.cancel-workout) {background:var(--danger-soft);color:var(--danger)}
:root:is([data-layout="sky"],[data-layout="aura"]) #workout-action-dialog {border-radius:var(--layout-card-radius);background:var(--paper)}
:root:is([data-layout="sky"],[data-layout="aura"]) #workout-action-confirm.danger {background:var(--danger);color:var(--bg)}
:root:is([data-layout="sky"],[data-layout="aura"]) :is(.set-tag.type-d,.set-tag.type-w) {background:var(--accent-soft);color:var(--ink)}
:root:is([data-layout="sky"],[data-layout="aura"]) .set-tag.type-f {background:var(--danger-soft);color:var(--danger)}
:root:is([data-layout="sky"],[data-layout="aura"]) .toast.bad {background:var(--danger);color:var(--bg)}
:root:is([data-layout="sky"],[data-layout="aura"]) :is(.small-button,.guide-button,.swap-undo,.type-options>button) {border-radius:var(--layout-control-radius)}
:root:is([data-layout="sky"],[data-layout="aura"]) :is(.muscle-list,.history-muscles) span {border-radius:var(--layout-chip-radius)}

/* Session controls: quiet emphasis and a consistent paired set toolbar. */
#workout-view .exercise-card:has(.set-row.next),
#workout-view .exercise-card:focus-within {outline:1px solid var(--accent);outline-offset:-1px}
#workout-view .exercise-rename {display:block;max-width:100%;min-height:44px;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;overflow-wrap:anywhere}
#workout-view .exercise-rename small {font-size:.75rem;font-weight:500;color:var(--muted);white-space:nowrap}
#workout-view .exercise-rename-form {display:flex;flex-wrap:wrap;gap:.4rem}
#workout-view .exercise-rename-form input {width:100%;min-width:0;min-height:44px;padding:.5rem;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);font-size:1rem}
#workout-view .exercise-rename-form button {min-width:44px;min-height:44px;padding:.5rem;border:0;border-radius:10px;background:var(--accent-soft);color:var(--ink)}
#workout-view .set-actions {display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
#workout-view :is(button,input) {touch-action:manipulation}
#workout-view button {transition:background-color 120ms ease,opacity 120ms ease,transform 120ms ease}
#workout-view button:focus-visible {outline:2px solid var(--accent);outline-offset:2px}
#workout-view button:disabled {opacity:.45;cursor:default}
#workout-view button:not(:disabled):active {transform:translateY(1px);opacity:.75}
@media (hover:hover) {
  #workout-view :is(.add-set,.remove-set,.guide-button,.exercise-actions-button,.exercise-rename):not(:disabled):hover {background:var(--accent-soft);color:var(--ink)}
}
@media (prefers-reduced-motion:reduce) {#workout-view button {transition:none}}

/* Native-sized close targets and restrained session chrome. */
dialog .sheet-head .icon-button {display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;border:1px solid var(--line);border-radius:12px;background:var(--accent-soft);color:var(--ink);font-size:24px;line-height:1;transition:opacity 120ms ease,background-color 120ms ease}
dialog .sheet-head .icon-button:active {opacity:.65}
dialog .sheet-head .icon-button:focus-visible {outline:2px solid var(--accent);outline-offset:2px}
#workout-view .exercise-card:has(.set-row.next) {border-width:1px;box-shadow:none;outline:none}
#workout-view .exercise-order-controls {display:flex;gap:4px;align-items:center}
#workout-view .exercise-order-controls button {min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:12px;background:var(--accent-soft);color:var(--ink)}
#workout-view .exercise-head {row-gap:8px}
#workout-view .set-actions {margin-top:10px;align-items:stretch}
@media (hover:hover) {dialog .sheet-head .icon-button:hover {background:var(--line)}}
@media (prefers-reduced-motion:reduce) {dialog .sheet-head .icon-button {transition:none}}

/* Picker rows must grow with wrapped names; never shrink into the scroll viewport. */
#prompt-dialog.exercise-picker-dialog #exercise-picker-results {
  display:flex;flex-direction:column;align-items:stretch;gap:8px;
  min-height:0;overflow-y:auto;overflow-x:hidden;
}
#prompt-dialog.exercise-picker-dialog .exercise-picker-option {
  flex:0 0 auto;height:auto;min-height:80px;align-items:center;
}
#prompt-dialog.exercise-picker-dialog .exercise-picker-copy {flex:1 1 auto;min-width:0}
#prompt-dialog.exercise-picker-dialog .exercise-picker-option > .library-image {flex:0 0 56px;align-self:center}
#prompt-dialog.exercise-picker-dialog .exercise-picker-option > span:last-child {flex:0 0 auto;max-width:70px}
#prompt-dialog.exercise-picker-dialog .exercise-picker-copy :is(strong,small) {display:block;white-space:normal;overflow-wrap:anywhere}
