/* Advanced view (D6). GENERATED part: design system components.css + themes.css, scoped under #advView and pruned to
   the classes advanced-view.js / history.js render (tools/advanced-css/build.js).
   Edit tools/advanced-css/pre.css + app.css, then rebuild; never edit this file by hand. */
/* ===== PRE (hand-written): base of the Advanced shell + neutralise legacy rules on shared class names ===== */
#advView{font:400 var(--t-body)/var(--lh-body) var(--f-ui);color:var(--c-ink);-webkit-font-smoothing:antialiased;font-synthesis:none}
#advView *{box-sizing:border-box}
/* style.css: .legend (old calendar footer), .avatar (old sidebar profile), .field margin */
#advView .legend{padding:0;border-top:0;font-size:.8125rem}
#advView .field{margin-bottom:0}

/* ===== generated ===== */
:where(#advView) *{box-sizing:border-box}
:where(#advView) button,:where(#advView) input{font:inherit;color:inherit}
:where(#advView) button{background:none;border:0;padding:0;cursor:pointer;text-align:inherit}
:where(#advView) a{color:inherit}
:where(#advView) h1,:where(#advView) h2,:where(#advView) h3,:where(#advView) p,:where(#advView) ol,:where(#advView) ul{margin:0;padding:0}
:where(#advView) ol,:where(#advView) ul{list-style:none}
:where(#advView) code{font-family:ui-monospace,Menlo,monospace;font-size:.92em}
#advView .i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
#advView :focus-visible{outline:3px solid var(--c-focus);outline-offset:2px}
#advView .spin{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){
#advView .spin{animation:none}
}
#advView :is(h1,h2,h3,.display,.h1,.h2,.h3,.wk-title){overflow-wrap:break-word;hyphens:auto}
#advView .h1{font:var(--w-title) var(--t-h1)/1.15 var(--f-display);letter-spacing:calc(var(--ls-display) / 3)}
#advView .h3{font:700 var(--t-h3)/1.3 var(--f-ui);display:flex;align-items:center;gap:var(--s-2)}
#advView .kicker{font:650 var(--t-cap)/var(--lh-cap) var(--f-label);letter-spacing:var(--ls-label);text-transform:var(--tt-label);color:var(--c-muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#advView .kicker .i{width:15px;height:15px}
#advView .meta{font-size:var(--t-sm);line-height:var(--lh-sm);color:var(--c-muted)}
#advView .fine{display:flex;gap:var(--s-2);font-size:var(--t-sm);color:var(--c-muted);line-height:var(--lh-sm)}
#advView .fine .i{width:17px;height:17px;margin-top:1px}
#advView .wordmark{display:inline-flex;flex-direction:column;justify-content:center;min-height:var(--tap);text-decoration:none;line-height:1}
#advView .wm-name{font:800 1.625rem/1 var(--f-display);letter-spacing:-1.2px;color:var(--c-ink)}
#advView .wm-tag{font:600 0.625rem/1 var(--f-label);letter-spacing:1.5px;text-transform:uppercase;color:var(--c-muted);margin-top:5px}
#advView .iconbtn{width:var(--tap);height:var(--tap);display:grid;place-items:center;border-radius:var(--r-ctl);color:var(--c-ink);flex-shrink:0}
#advView .iconbtn:hover{background:color-mix(in srgb,var(--c-ink) 7%,transparent)}
#advView .avatar{width:max(var(--tap),2.4em);height:max(var(--tap),2.4em);border-radius:50%;border:var(--bw-ctl) solid var(--c-ctl);background:var(--c-surface);font-weight:700;display:grid;place-items:center;flex-shrink:0}
#advView .desk{display:none}
#advView .btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--s-2);min-height:48px;padding:6px var(--s-4);border-radius:var(--r-ctl);border:var(--bw-ctl) solid transparent;font:650 0.9375rem/1.15 var(--f-ui);text-align:left;transition:background var(--dur) var(--ease),transform var(--dur) var(--ease),box-shadow var(--dur) var(--ease);position:relative}
#advView .btn .i{width:19px;height:19px}
#advView .btn-s{min-height:var(--tap);padding:4px var(--s-3);font-size:0.875rem}
#advView .btn-primary{background:var(--c-primary);color:var(--c-on-primary);font-weight:700;box-shadow:var(--sh-btn)}
#advView .btn-secondary{background:var(--c-surface);border-color:var(--c-ctl);color:var(--c-ink)}
#advView .btn-danger{background:var(--c-err-ink);color:var(--c-err-bg)}
#advView .btn-link{min-height:var(--tap);padding:4px 6px;text-decoration:underline;text-underline-offset:3px;color:var(--c-ink)}
#advView .btn:hover{background-image:linear-gradient(color-mix(in srgb,var(--c-ink) 8%,transparent) 0 0)}
#advView .btn-primary:hover,#advView .btn-danger:hover{background-image:linear-gradient(#ffffff26 0 0)}
#advView .btn:active,#advView .btn.is-active{transform:translateY(1px) scale(.985);box-shadow:none}
#advView .btn:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}
#advView .btn[aria-busy=true]{cursor:progress}
#advView .field{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin-bottom:var(--s-4);min-width:0}
#advView .field-l{font-weight:650;font-size:0.875rem}
#advView .field-box{--fb-bw:var(--bw-ctl);display:flex;align-items:center;gap:var(--s-2);min-height:52px;padding:0 4px 0 var(--s-3);border:var(--fb-bw) solid var(--c-ctl);border-radius:var(--r-ctl);background:var(--c-surface);position:relative}
#advView .field-box input{position:absolute;inset:calc(-1 * var(--fb-bw));width:calc(100% + 2 * var(--fb-bw));min-width:0;border:0;border-radius:var(--r-ctl);background:transparent;font-size:1rem;padding:0 var(--s-3);outline:0}
#advView .field-box input::placeholder{color:var(--c-muted);opacity:1}
#advView .field-box input:focus-visible{box-shadow:0 0 0 3px var(--c-focus)}
#advView .field:not(.is-error) .field-box:focus-within{border-color:var(--c-focus)}
#advView .seg{display:inline-grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:3px;padding:3px;border:var(--bw-ctl) solid var(--c-ctl);border-radius:calc(var(--r-ctl) + 4px);background:var(--c-surface)}
#advView .seg-o{min-height:var(--tap);min-width:44px;padding:4px 12px;border-radius:var(--r-ctl);font-weight:650;font-size:0.875rem;text-align:center;line-height:1.15}
#advView .seg-o[aria-checked=true]{background:var(--c-primary);color:var(--c-on-primary)}
#advView .seg-s .seg-o{min-height:36px;padding:2px 10px;font-size:0.8125rem}
#advView .seg-s{padding:3px}
#advView .seg-s .seg-o{position:relative}
#advView .seg-s .seg-o::after{content:'';position:absolute;inset:-4px -2px}
#advView .chips{display:flex;flex-wrap:wrap;gap:var(--s-2);margin:var(--s-2) 0}
#advView .chip{display:inline-flex;align-items:center;gap:6px;min-height:var(--tap);padding:0 14px;border-radius:var(--r-pill);border:var(--bw-ctl) solid var(--c-ctl);background:var(--c-surface);font-weight:600;font-size:0.875rem}
#advView .chip b{font-weight:800}
#advView .chip[aria-pressed=true]{background:var(--c-primary);border-color:var(--c-primary);color:var(--c-on-primary)}
#advView .chip:disabled{opacity:.45}
#advView .chip .i{width:17px;height:17px}
#advView .pill{display:inline-flex;align-items:center;gap:4px;font-style:normal;font-size:0.7812rem;font-weight:700;border-radius:var(--r-pill);padding:3px 9px;line-height:1.2;white-space:nowrap}
#advView .pill .i{width:14px;height:14px}
#advView .pill-done{background:var(--c-done-bg);color:var(--c-done-ink);border:var(--bw) solid var(--c-done-line);min-height:36px;padding:0 12px;font-size:0.875rem}
#advView .card{background:var(--c-surface);border:var(--bw) solid var(--c-line);border-radius:var(--r-card);box-shadow:var(--sh-card)}
#advView .banner{display:grid;grid-template-columns:22px minmax(0,1fr) auto;gap:4px var(--s-3);padding:var(--s-3);border-radius:var(--r-ctl);border:1.5px solid;margin-bottom:var(--s-3)}
#advView .banner>.i{width:22px;height:22px;margin-top:1px}
#advView .banner b{display:block;font-size:0.9375rem}
#advView .banner p{font-size:var(--t-sm);line-height:1.45;margin-top:2px}
#advView .banner-err{background:var(--c-err-bg);border-color:var(--c-err-line);color:var(--c-err-ink)}
#advView .banner-info{background:var(--c-surface-2);border-color:var(--c-line);color:var(--c-ink)}
#advView .banner-err .btn-link{color:inherit}
#advView .status-line{display:flex;align-items:center;gap:var(--s-2);color:var(--c-muted);font-size:0.875rem;margin-bottom:var(--s-3)}
#advView :where(dialog){margin:0;border:0;padding:0;color:inherit;max-width:none;max-height:none;inset:auto;width:auto;height:auto}
#advView dialog::backdrop{background:var(--c-scrim,#1f2b2466)}
#advView dialog:not([open]){display:none!important}
#advView .lrow-chev{color:var(--c-muted)}
#advView .steps{display:grid;gap:var(--s-3);counter-reset:s}
#advView .steps li{display:grid;grid-template-columns:minmax(30px,max-content) minmax(0,1fr);gap:var(--s-3);align-items:start}
#advView .step-n{width:30px;height:30px;border-radius:50%;background:var(--c-primary);color:var(--c-on-primary);display:grid;place-items:center;font:700 0.875rem/1 var(--f-ui)}
#advView .linkacts{display:flex;flex-wrap:wrap;gap:var(--s-2)}
@media (min-width:960px){
#advView .desk{display:block}
}
#advView .adv-main{padding:var(--s-3) var(--s-4) 96px;max-width:1080px}
#advView .adv-h{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--s-3)}
#advView .sidenav{display:none}
#advView .bnav{position:fixed;left:0;right:0;bottom:0;z-index:var(--z-bar);display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,3.75rem),1fr));font-size:1rem;background:var(--c-surface);border-top:var(--bw) solid var(--c-line);padding:4px 4px 22px}
#advView .bn-a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:52px;text-decoration:none;font-size:.75rem;font-weight:650;color:var(--c-muted);border-radius:var(--r-ctl);text-align:center;line-height:1.1}
#advView .bn-a .i{width:22px;height:22px}
#advView .bn-a.is-active{color:var(--c-ink);background:var(--c-surface-2)}
#advView .bn-a.is-active .i{color:var(--c-primary)}
#advView .tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-2);margin-bottom:var(--s-4)}
#advView .tile{background:var(--c-surface);border:var(--bw) solid var(--c-line);border-radius:var(--r-card);padding:var(--s-3);min-width:0;box-shadow:var(--sh-card)}
#advView .tile-ic{width:18px;height:18px;color:var(--c-muted)}
#advView .tile-l{font-size:.8125rem;font-weight:650;color:var(--c-muted);margin-top:4px;line-height:1.25}
#advView .tile-v{font:700 1.5rem/1.15 var(--f-data);margin:2px 0;overflow-wrap:anywhere}
#advView .tile-s{font-size:.75rem;color:var(--c-muted);line-height:1.3}
#advView .sec-h{margin:var(--s-2) 0}
#advView .agenda{display:grid;gap:var(--s-2)}
#advView .ag-i{display:grid;grid-template-columns:minmax(32px,max-content) minmax(0,1fr) auto;gap:var(--s-3);align-items:center;padding:var(--s-3);background:var(--c-surface);border:var(--bw) solid var(--c-line);border-left:4px solid var(--c-primary);border-radius:var(--r-ctl)}
#advView .ag-i.is-tennis{border-left-color:var(--c-tennis)}
#advView .ag-i.is-import{border-left-color:var(--c-ctl);border-left-style:dashed}
#advView .ag-n{width:28px;height:28px;border-radius:50%;border:1.5px solid currentColor;display:grid;place-items:center;font-weight:700;font-size:.875rem}
#advView .ag-n .i{width:16px;height:16px}
#advView .ag-i b{font-size:.9375rem;line-height:1.25}
#advView .actcard{margin-top:var(--s-4);padding:var(--s-3);display:flex;gap:var(--s-3);align-items:center}
#advView .actcard b{display:block}
#advView .src{display:inline-flex;align-items:center;gap:4px;font-size:.75rem;font-weight:700;padding:3px 8px;border-radius:var(--r-pill);border:1.5px solid var(--c-ctl);background:var(--c-surface);color:var(--c-ink);white-space:nowrap}
#advView .src .i{width:14px;height:14px}
#advView .cal-head{display:flex;align-items:center;justify-content:space-between;gap:var(--s-2);flex-wrap:wrap;margin-bottom:var(--s-2)}
#advView .cal-nav{display:flex;align-items:center;gap:2px}
#advView .cal-nav b{min-width:110px;text-align:center}
#advView .month{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}
#advView .mh{text-align:center;font:650 .75rem var(--f-label);color:var(--c-muted);padding:4px 0}
#advView .mday{min-height:52px;border-radius:var(--r-ctl);border:1px solid var(--c-line);background:var(--c-surface);display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:3px;padding:4px 1px;min-width:0}
#advView .mday.is-out{background:transparent;border-style:dashed;color:var(--c-muted)}
#advView .mday.is-today .md-n{background:var(--c-primary);color:var(--c-on-primary);border-radius:50%;width:24px;height:24px;display:grid;place-items:center}
#advView .mday.is-sel{border:2px solid var(--c-primary)}
#advView .md-n{font:650 .875rem var(--f-data)}
#advView .md-m{display:flex;gap:2px;align-items:center;flex-wrap:wrap;justify-content:center}
#advView .md-m small{font-size:.6875rem;font-weight:700}
#advView .cm{display:inline-block;width:8px;height:8px;flex-shrink:0}
#advView .cm-c{background:var(--c-primary);border-radius:2px}
#advView .cm-t{background:var(--c-tennis);border-radius:50%}
#advView .cm-g{border:2px solid var(--c-muted);border-radius:50%;background:transparent}
#advView .cm-m{border:1.5px dashed var(--c-muted);border-radius:2px}
#advView .cm.is-done{background:var(--c-done-ink);border-radius:2px;box-shadow:0 0 0 1.5px var(--c-done-bg)}
#advView .legend{display:flex;flex-wrap:wrap;gap:var(--s-2) var(--s-4);font-size:.8125rem;color:var(--c-muted);margin:var(--s-2) 0}
#advView .legend span{display:inline-flex;align-items:center;gap:6px}
#advView .seldays{margin-top:var(--s-3)}
#advView .seldays .h3{margin-bottom:var(--s-2)}
#advView .wkgrid{display:grid;gap:6px}
#advView .wkcol{display:grid;grid-template-columns:minmax(44px,max-content) minmax(0,1fr);gap:6px;align-items:start;padding:6px 0;border-bottom:1px solid var(--c-line)}
#advView .wkcol>*:not(.wkcol-h){grid-column:2}
#advView .wkcol-h{grid-row:1/span 4;display:flex;flex-direction:column;align-items:center;font-size:.75rem;color:var(--c-muted)}
#advView .wkcol-h b{font:700 1.125rem var(--f-data);color:var(--c-ink)}
#advView .wkcol.is-today .wkcol-h b{background:var(--c-primary);color:var(--c-on-primary);border-radius:50%;width:32px;height:32px;display:grid;place-items:center}
#advView .wkev{display:flex;align-items:center;gap:6px;min-height:44px;padding:4px 10px;border-radius:var(--r-ctl);background:var(--c-surface);border:var(--bw) solid var(--c-line);border-left:4px solid var(--c-primary);font-size:.875rem;font-weight:600;width:100%;text-align:left}
#advView .wkev .i{width:16px;height:16px;flex-shrink:0}
#advView .wkev-t{border-left-color:var(--c-tennis)}
#advView .wkev-t .i{color:var(--c-tennis)}
#advView .wkev-g{border-left:4px dashed var(--c-ctl)}
#advView .wkev.is-done{background:var(--c-done-bg);color:var(--c-done-ink)}
#advView .wk-empty{font-size:.8125rem;color:var(--c-muted);padding:12px 0}
#advView .chartcard{padding:var(--s-4);margin-bottom:var(--s-3)}
#advView .chart{display:grid;grid-template-columns:24px minmax(0,1fr);gap:6px;height:180px;margin:var(--s-4) 0 28px;position:relative}
#advView .ch-scale{display:none;font-size:.75rem;color:var(--c-muted);margin-top:4px}
#advView .ch-y{display:flex;flex-direction:column;justify-content:space-between;font-size:.6875rem;color:var(--c-muted);text-align:right;line-height:0;padding:0}
@media (max-width:359px){
#advView .chartcard{padding:var(--s-3)}
#advView .chart{grid-template-columns:minmax(0,1fr);gap:0}
#advView .ch-y{display:none}
#advView .ch-scale{display:block}
}
#advView .ch-plot{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;border-bottom:1px solid var(--c-ctl);background:linear-gradient(var(--c-line) 1px,transparent 1px) 0 0/100% 50%;position:relative}
#advView .ch-g{position:relative;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;background:none;border:0;padding:0;margin:0;font:inherit;color:inherit;cursor:pointer;min-width:0;border-radius:6px}
#advView .ch-g.is-sel .ch-bars{background:color-mix(in srgb,var(--c-ink) 7%,transparent);border-radius:6px 6px 0 0}
#advView .ch-g.is-sel .ch-x{color:var(--c-ink);font-weight:700}
#advView .ch-read{display:flex;flex-direction:column;gap:2px;margin-top:var(--s-3);padding:8px 10px;border-radius:var(--r-ctl);background:var(--c-surface-2);font-size:.8125rem;line-height:1.35}
#advView .ch-read small{color:var(--c-muted);font-size:.75rem}
#advView .ch-bars{display:flex;align-items:flex-end;gap:2px;height:100%;width:100%;justify-content:center}
#advView .ch-bars i{width:42%;max-width:18px;border-radius:4px 4px 0 0}
#advView .b-plan{border:1.5px solid var(--c-ctl);border-bottom:0;background:transparent}
#advView .b-done{background:var(--c-primary)}
#advView .ch-x{position:absolute;bottom:-22px;font-size:.6875rem;color:var(--c-muted)}
#advView .chartcard .btn-link{margin-top:var(--s-4);padding-left:0}
#advView .lg{display:inline-block;width:12px;height:12px;border-radius:3px}
#advView .lg-done{background:var(--c-primary)}
#advView .lg-plan{border:1.5px solid var(--c-ctl)}
#advView .hbars li{display:grid;grid-template-columns:20px minmax(96px,max-content) minmax(0,1fr) minmax(44px,max-content);gap:var(--s-2);align-items:center;min-height:40px}
#advView .hbars .i{width:18px;height:18px;color:var(--c-muted)}
#advView .hb-l{font-size:.875rem;font-weight:600}
#advView .hb-t{height:10px;background:var(--c-surface-2);border-radius:5px;overflow:hidden}
#advView .hb-t i{display:block;height:100%;background:var(--c-primary);border-radius:5px}
#advView .hbars .is-tennis .hb-t i{background:var(--c-tennis)}
#advView .hbars .is-tennis .i{color:var(--c-tennis)}
#advView .hbars b{font:700 .875rem var(--f-data);text-align:right}
#advView .importcard{margin-bottom:var(--s-3)}
#advView .imp-h{display:flex;gap:var(--s-3)}
#advView .imp-h>.i{margin-top:2px;color:var(--c-muted)}
#advView .acts{display:grid;margin-top:var(--s-2)}
#advView .act{display:grid;grid-template-columns:88px minmax(0,1fr) 20px;gap:var(--s-3);align-items:center;min-height:60px;border-bottom:1px solid var(--c-line);text-decoration:none}
#advView .act-t{display:flex;flex-direction:column}
#advView .act-t small{font-size:.8125rem;color:var(--c-muted)}
@media (max-width:360px){
#advView .bn-a{font-size:.6875rem}
#advView .tiles{grid-template-columns:1fr}
#advView .hbars li{grid-template-columns:20px minmax(80px,max-content) minmax(0,1fr) minmax(40px,max-content)}
#advView .act{grid-template-columns:76px minmax(0,1fr) 16px}
#advView .adv-main{padding-left:12px;padding-right:12px}
#advView .month{gap:0;margin:0 -6px}
#advView .mday{border-radius:0}
}
@media (min-width:960px){
#advView.adv{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:100vh}
#advView .sidenav{display:flex;flex-direction:column;gap:var(--s-4);background:var(--c-surface);border-right:var(--bw) solid var(--c-line);padding:var(--s-5) var(--s-3);position:sticky;top:0;height:100vh}
#advView .sidenav-top{padding:0 var(--s-2)}
#advView .sidenav nav{display:grid;gap:4px}
#advView .sn-a{display:flex;align-items:center;gap:var(--s-3);min-height:var(--tap);padding:0 var(--s-3);border-radius:var(--r-ctl);text-decoration:none;font-weight:650;color:var(--c-muted)}
#advView .sn-a.is-active{background:var(--c-surface-2);color:var(--c-ink);box-shadow:inset 3px 0 0 var(--c-primary)}
#advView .sn-acc{margin-top:auto;display:flex;gap:var(--s-2);align-items:center;padding:var(--s-3) var(--s-2) 0;border-top:1px solid var(--c-line)}
#advView .sn-acc small{display:block;color:var(--c-muted);font-size:.75rem}
#advView .bnav{display:none}
#advView .adv-main{padding:var(--s-6) var(--s-7);max-width:1180px;width:100%}
#advView .adv-h .avatar{display:none}
#advView .tiles{grid-template-columns:repeat(4,minmax(0,1fr))}
#advView .tiles-2{grid-template-columns:repeat(2,minmax(0,1fr));max-width:620px}
#advView .wk-below.desk{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:var(--s-4);margin-top:var(--s-4);align-items:start}
#advView .wk-below .card{padding:var(--s-4)}
#advView .wk-below .h3{margin-bottom:var(--s-2)}
#advView .wk-tot li{display:grid;grid-template-columns:20px minmax(110px,max-content) minmax(0,1fr);gap:var(--s-2);align-items:center;min-height:44px;border-top:1px solid var(--c-line);font-size:var(--t-body)}
#advView .wk-tot li .i{width:18px;height:18px;color:var(--c-muted)}
#advView .wk-tot li.is-tennis .i{color:var(--c-tennis)}
#advView .wk-tot b{font-weight:650}
#advView .adv-today{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:var(--s-5);align-items:start}
#advView .adv-side.desk{display:block;margin-top:var(--s-2)}
#advView .upcard{padding:var(--s-4)}
#advView .upcard .meta{margin-top:2px}
#advView .upbar{display:block;height:8px;border-radius:4px;background:var(--c-surface-2);margin:var(--s-2) 0 var(--s-3);overflow:hidden}
#advView .upbar i{display:block;height:100%;background:var(--c-primary)}
#advView .uplist li{display:grid;grid-template-columns:minmax(56px,max-content) minmax(0,1fr);gap:var(--s-2);padding:var(--s-2) 0;border-top:1px solid var(--c-line)}
#advView .up-d{font:650 .8125rem/2.2 var(--f-label);color:var(--c-muted)}
#advView .up-e{display:flex;gap:var(--s-2);align-items:flex-start;min-height:44px;padding:6px 8px;margin-bottom:4px;border-radius:var(--r-ctl);border-left:3px solid var(--c-primary);background:var(--c-surface-2);color:var(--c-ink);text-decoration:none}
#advView .up-e .i{width:16px;height:16px;margin-top:2px;flex-shrink:0}
#advView .up-e span{display:flex;flex-direction:column}
#advView .up-e small{color:var(--c-muted);font-size:var(--t-sm)}
#advView .up-t{border-left-color:var(--c-tennis)}
#advView .up-t .i{color:var(--c-tennis)}
#advView .up-rest{color:var(--c-muted);font-size:var(--t-sm);line-height:2.2}
#advView .upcard .btn-link{margin-top:var(--s-2);padding-left:0}
#advView .month{gap:6px}
#advView .mday{min-height:96px;align-items:flex-start;padding:8px}
#advView .md-m{justify-content:flex-start}
#advView .cm{width:10px;height:10px}
#advView .wkgrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
#advView .wkcol{display:flex;flex-direction:column;gap:6px;border:var(--bw) solid var(--c-line);border-radius:var(--r-card);padding:var(--s-2);background:var(--c-surface);min-height:230px}
#advView .wkcol-h{flex-direction:row;gap:6px;align-items:center;padding-bottom:6px;border-bottom:1px solid var(--c-line);width:100%}
#advView .wkcol.is-today{border:2px solid var(--c-primary)}
#advView .wkev{font-size:.8125rem;align-items:flex-start}
#advView .chart{height:260px}
#advView .chartcard{max-width:820px}
#advView .acts{max-width:820px}
#advView .importcard{max-width:820px}
}
#advView :is(.step-n,.os-n,.ag-n,.cav){min-width:1.9em;min-height:1.9em}
#advView .pill{max-width:100%;white-space:normal}
#advView .mday.is-today .md-n{width:auto;height:auto;min-width:max(24px,1.75em);min-height:max(24px,1.75em)}
#advView .wkcol.is-today .wkcol-h b{width:auto;height:auto;min-width:max(32px,1.8em);min-height:max(32px,1.8em)}
#advView .act{grid-template-columns:minmax(88px,max-content) minmax(0,1fr) 20px}
@media (max-width:360px){
#advView .act{grid-template-columns:minmax(76px,max-content) minmax(0,1fr) 16px}
}
#advView .act-t{min-width:0;overflow-wrap:break-word}
/* themes.css */
:root[data-tempo-theme=original] #advView .wm-name{color:var(--c-primary)}
:root[data-tempo-theme=mina] #advView .wm-name{font-family:var(--f-title);font-weight:500;letter-spacing:-.5px;color:var(--c-primary)}
:root[data-tempo-theme=mina] #advView :is(.h1,.h2,.h3,.display,.wk-title,.appbar-title,.dsec-h){font-family:var(--f-title);font-weight:500;letter-spacing:-.5px}
:root[data-tempo-theme=gym] #advView .h1{text-transform:uppercase}
:root[data-tempo-theme=gym] #advView .h3{font-family:var(--f-display);font-weight:400;text-transform:uppercase;letter-spacing:.6px}
:root[data-tempo-theme=gym] #advView .wm-name{font:400 1.625rem/1 'T4 BlackOps',Impact,sans-serif;letter-spacing:1px;text-transform:uppercase;color:var(--c-ink)}
:root[data-tempo-theme=gym] #advView .wm-name::before{content:'//';color:var(--c-accent);margin-right:4px}
:root[data-tempo-theme=gym] #advView .wm-tag{color:var(--c-primary);letter-spacing:3px}
:root[data-tempo-theme=gym] #advView .card.is-active{position:relative;padding-top:10px}
:root[data-tempo-theme=gym] #advView .card.is-active::before{content:'';position:absolute;left:0;right:0;top:0;height:10px;background:repeating-linear-gradient(-45deg,var(--c-primary) 0 12px,var(--c-bg) 12px 24px)}
:root[data-tempo-theme=gym] #advView .card.is-done::before{background:var(--c-line)}
:root[data-tempo-theme=gym] #advView .btn{font:600 0.875rem/1.15 var(--f-ui);text-transform:uppercase;letter-spacing:.8px}
:root[data-tempo-theme=gym] #advView .btn-primary{font:400 1.1875rem/1 var(--f-display);letter-spacing:1px;margin:0 4px 4px 0}
:root[data-tempo-theme=gym] #advView .seg-o,:root[data-tempo-theme=gym] #advView .chip{text-transform:uppercase;letter-spacing:.8px;font-size:0.8125rem}
:root[data-tempo-theme=gym] #advView .field-box{background:#0f110d}
:root[data-tempo-theme=gym] #advView .field-l{text-transform:uppercase;letter-spacing:2px;font-size:0.8125rem}
:root[data-tempo-theme=gym] #advView .banner p{font-family:var(--f-read)}
:root[data-tempo-theme=gym] #advView .step-n{border-radius:2px;font-family:var(--f-data)}
:root[data-tempo-theme=gym] #advView .avatar{border-radius:2px}
:root[data-tempo-theme=gym] #advView .avatar{font:400 1.125rem var(--f-display)}
:root[data-tempo-theme=halloween] #advView .h1{letter-spacing:.5px}
:root[data-tempo-theme=halloween] #advView .wm-name{font:400 1.875rem/1 var(--f-display);letter-spacing:.5px;color:var(--c-primary);display:inline-flex;align-items:center;gap:6px}
:root[data-tempo-theme=halloween] #advView .wm-name::before{content:'';width:18px;height:18px;background:var(--c-accent);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z'/%3E%3C/svg%3E") center/contain no-repeat}
:root[data-tempo-theme=halloween] #advView .wm-tag{color:var(--c-accent)}
:root[data-tempo-theme=halloween] #advView .card{border-color:color-mix(in srgb,var(--c-line) 75%,var(--c-skip-line))}
:root[data-tempo-theme=halloween] #advView .btn-primary{box-shadow:var(--sh-btn)}
:root[data-tempo-theme=halloween] #advView .step-n{background:var(--c-primary);color:var(--c-on-primary);font-family:var(--f-display);font-size:1.0625rem;font-weight:400}
:root[data-tempo-theme=funky] #advView .wm-name{font:400 1.875rem/1 var(--f-display);letter-spacing:0;color:var(--c-ink);text-shadow:2px 2px 0 var(--c-primary)}
:root[data-tempo-theme=funky] #advView .wm-tag{font-family:var(--f-label);text-transform:none;letter-spacing:.5px;color:var(--c-muted)}
:root[data-tempo-theme=funky] #advView .kicker{color:var(--c-link);font-weight:400;font-size:0.8125rem}
:root[data-tempo-theme=funky] #advView .card{border-color:var(--c-ink)}
:root[data-tempo-theme=funky] #advView .btn{font-family:var(--f-label);font-weight:400;letter-spacing:.3px}
:root[data-tempo-theme=funky] #advView .btn-primary,:root[data-tempo-theme=funky] #advView .btn-secondary,:root[data-tempo-theme=funky] #advView .btn-danger{border-color:var(--c-ink);box-shadow:var(--sh-btn);margin:0 3px 3px 0}
:root[data-tempo-theme=funky] #advView .btn-primary{font-size:1.125rem}
:root[data-tempo-theme=funky] #advView .seg,:root[data-tempo-theme=funky] #advView .chip,:root[data-tempo-theme=funky] #advView .field-box,:root[data-tempo-theme=funky] #advView .avatar{border-color:var(--c-ink)}
:root[data-tempo-theme=funky] #advView .seg-o,:root[data-tempo-theme=funky] #advView .chip,:root[data-tempo-theme=funky] #advView .field-l{font-family:var(--f-label);font-weight:400}
:root[data-tempo-theme=funky] #advView .step-n{background:var(--c-accent);color:var(--c-surface);font-family:var(--f-num);font-weight:400}
:root[data-tempo-theme=funky] #advView .pill{border:1.5px solid var(--c-ink)}
:root[data-tempo-theme=funky] #advView .banner{border-width:2.5px}
:root[data-tempo-theme=gym] #advView .bn-a,:root[data-tempo-theme=gym] #advView .sn-a{text-transform:uppercase;letter-spacing:1px}
:root[data-tempo-theme=gym] #advView .tile-v{color:var(--c-primary)}
:root[data-tempo-theme=gym] #advView .sn-a.is-active{box-shadow:inset 4px 0 0 var(--c-primary)}
:root[data-tempo-theme=halloween] #advView .tile,:root[data-tempo-theme=halloween] #advView .mday,:root[data-tempo-theme=halloween] #advView .wkcol{border-color:color-mix(in srgb,var(--c-line) 75%,var(--c-skip-line))}
:root[data-tempo-theme=halloween] #advView .tile-v{font-family:var(--f-ui)}
:root[data-tempo-theme=halloween] #advView .adv-h .h1{font-size:2.25rem}
:root[data-tempo-theme=funky] #advView .tile,:root[data-tempo-theme=funky] #advView .mday:not(.is-out),:root[data-tempo-theme=funky] #advView .wkcol,:root[data-tempo-theme=funky] #advView .ag-i,:root[data-tempo-theme=funky] #advView .wkev{border-color:var(--c-ink)}
:root[data-tempo-theme=funky] #advView .tile{box-shadow:var(--sh-btn)}
:root[data-tempo-theme=funky] #advView .tile-v{font-family:var(--f-num);font-weight:400}
:root[data-tempo-theme=funky] #advView .sidenav,:root[data-tempo-theme=funky] #advView .bnav{border-color:var(--c-ink);border-width:2.5px}
:root[data-tempo-theme=funky] #advView :is(.opt-ok,.eq-ok,.gen-ic,.bn-a.is-active .i){color:var(--c-ink)}
:root[data-tempo-theme=funky] #advView .wkev{border-left-color:var(--c-primary)}
:root[data-tempo-theme=funky] #advView .wkev-t{border-left-color:var(--c-tennis);background:var(--c-tennis-bg)}
:root[data-tempo-theme=funky] #advView :is(.wkev-g,.wkev-m){border-left-color:var(--c-ctl)}
:root[data-tempo-theme=funky] #advView :is(.auth-points .i,.empty-badge){color:var(--c-ink)}

/* ===== APP (hand-written) ===== */
/* ===== APP (hand-written): Advanced pieces the design previews draw as static links, app states, legacy widgets ===== */
/* nav items are real buttons (the previews use links) */
#advView :is(.bn-a,.sn-a){width:100%;background:none;border:0;font-family:inherit;cursor:pointer;line-height:1.15}
#advView .bn-a span{max-width:100%;overflow-wrap:anywhere;text-align:center}
#advView .bnav{padding-bottom:max(6px,env(safe-area-inset-bottom))}
#advView .sidenav .wordmark{min-height:0}
#advView .sn-acc>div{min-width:0;overflow-wrap:anywhere}
/* page header: title + save status, then the page action and the avatar */
#advView .adv-h{gap:var(--s-2) var(--s-3);flex-wrap:wrap;align-items:flex-start}
#advView .adv-h-t{min-width:0;flex:1 1 10em}
#advView .adv-h-t .h1:focus{outline:none}
#advView .adv-h-t .h1:focus-visible{outline:3px solid var(--c-focus);outline-offset:2px}
#advView .adv-status{margin-top:2px}
#advView .adv-h-act{display:flex;align-items:center;gap:var(--s-2);margin-left:auto}
#advView .adv-add{min-width:var(--tap)}
@media (max-width:519px){#advView .adv-add{padding:0;width:var(--tap)}#advView .adv-add-l{display:none}}
#advView .adv-demo{margin-bottom:var(--s-3)}
#advView .adv-demo .btn-link{min-height:0;padding:0;display:inline}
#advView .adv-tabs{margin-bottom:var(--s-3)}
#advView .btn-ghost{background:transparent;border-color:transparent;color:var(--c-ink)}
#advView .btn-ghost:hover{background:color-mix(in srgb,var(--c-ink) 7%,transparent)}
/* agenda rows: the title is the button that opens the workout; its hit area covers the whole row */
#advView .ag-i{position:relative}
#advView .ag-t{min-width:0}
#advView .ag-link{display:block;text-align:left;color:inherit;border-radius:var(--r-ctl)}
#advView .ag-link::after{content:'';position:absolute;inset:0;border-radius:inherit}
#advView .ag-link:focus-visible{outline:none}
#advView .ag-link:focus-visible::after{outline:3px solid var(--c-focus);outline-offset:2px;border-radius:var(--r-card)}
#advView :is(.ag-act,.ag-done){position:relative;z-index:1}
#advView .ag-done{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
#advView .ag-i>.lrow-chev{color:var(--c-muted)}
#advView .pill-skip{background:var(--c-skip-bg);color:var(--c-skip-ink);border:var(--bw) solid var(--c-skip-line);min-height:36px;padding:0 12px;font-size:.875rem}
#advView .ag-i.is-skipped{border-left-style:dashed}
#advView .ag-i:not(.is-import) .ag-n{flex-shrink:0}
#advView .actcard>div{min-width:0}
#advView .adv-order{margin-top:var(--s-2)}
#advView .adv-empty{padding:var(--s-4);display:grid;gap:var(--s-2);justify-items:start}
#advView .adv-err{margin:var(--s-3) 0}
#advView .adv-skel i{display:block;height:64px;border-radius:var(--r-card);background:var(--c-skeleton);margin-bottom:var(--s-2)}
#advView .adv-skel-t{min-height:6.5rem;background:var(--c-skeleton)}
#advView .status-line{display:flex;align-items:center;gap:var(--s-2)}
@media (prefers-reduced-motion:no-preference){#advView .adv-skel i,#advView .adv-skel-t{animation:advPulse 1.4s ease-in-out infinite}}
@keyframes advPulse{50%{opacity:.55}}
/* right column of desktop Today */
#advView .up-e{width:100%;text-align:left;font:inherit}
#advView .up-e span{min-width:0;overflow-wrap:break-word}
#advView .up-end{margin-top:var(--s-2)}
/* calendar */
#advView .cal-head{row-gap:var(--s-2)}
#advView .cal-nav b{min-width:0;flex:1 1 auto;overflow-wrap:break-word}
#advView .cal-tools{display:flex;flex-wrap:wrap;gap:4px}
#advView .mday{font:inherit;color:var(--c-ink)}
#advView .mday.is-out .md-n{color:var(--c-muted)}
#advView .sel-h{display:flex;align-items:center;justify-content:space-between;gap:var(--s-2);flex-wrap:wrap;margin-bottom:var(--s-2)}
#advView .sel-h .h3{margin:0}
#advView .seldays.card{padding:var(--s-4)}
#advView .sel-empty{padding:var(--s-2) 0}
#advView .wk-day{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:var(--tap);min-height:var(--tap);border-radius:var(--r-ctl);color:inherit;font:inherit}
#advView .wk-day span{font-size:.75rem;color:var(--c-muted)}
#advView .wkcol.is-sel .wk-day{background:var(--c-surface-2)}
#advView .wkev{text-align:left;width:100%;color:var(--c-ink)}
#advView .wkev>span{min-width:0;overflow-wrap:break-word}
#advView .wkev-g>span{display:flex;flex-direction:column}
#advView .wkev-g small{font-size:.75rem;color:var(--c-muted)}
#advView .wkev.is-skip{border-left-style:dashed;border-left-color:var(--c-skip-line);background:var(--c-skip-bg);color:var(--c-skip-ink)}
#advView .wkev.is-done{border-left-color:var(--c-done-line)}
#advView .wk-add{display:none}
@media (min-width:960px){
  #advView .wk-day{flex-direction:row;gap:6px;justify-content:flex-start;padding:0 6px}
  #advView .wkcol-h{padding-bottom:0}
  #advView .wk-add{display:grid;place-items:center;margin-top:auto;min-height:var(--tap);border:1px dashed var(--c-ctl);border-radius:var(--r-ctl);color:var(--c-ink);width:100%}
  #advView .wk-add:hover{background:color-mix(in srgb,var(--c-ink) 6%,transparent)}
}
/* stats */
#advView .chartcard .btn-link{display:inline-flex}
#advView .adv-table{width:100%;border-collapse:collapse;margin-top:var(--s-2);font-size:.9375rem}
#advView .adv-table caption{text-align:left;margin-bottom:var(--s-1,4px)}
#advView .adv-table :is(th,td){padding:8px 10px;border-bottom:1px solid var(--c-line);text-align:left}
#advView .adv-table td{font-family:var(--f-data)}
#advView .adv-sec{margin-top:var(--s-6)}
#advView .adv-sec-h{margin-bottom:var(--s-3)}
#advView .adv-weeknav{display:flex;flex-wrap:wrap;gap:4px;margin:var(--s-3) 0}
#advView .ch-g{min-height:var(--tap)}
/* history */
#advView .importcard{padding:var(--s-4);display:grid;gap:var(--s-3)}
#advView .imp-h>div{display:grid;gap:2px;min-width:0}
#advView .hist-key{display:grid;gap:var(--s-2)}
#advView .hist-gsteps{display:grid;gap:var(--s-2);margin-top:var(--s-3)}
#advView .hist-gsteps .steps{display:grid;gap:var(--s-2)}
#advView .hist-gsteps h3{display:flex;align-items:center;gap:var(--s-2)}
#advView .hist-filters{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s-2) var(--s-4);margin:var(--s-3) 0 0}
#advView .hist-year{display:inline-flex;align-items:center;gap:var(--s-2);font-weight:650}
#advView .hist-year select{min-height:var(--tap);padding:0 10px;border:var(--bw-ctl) solid var(--c-ctl);border-radius:var(--r-ctl);background:var(--c-surface);color:var(--c-ink);font:inherit;font-weight:600}
#advView .hist-chips{margin-bottom:var(--s-3)}
#advView .hist-sec,#advView .hist-empty,#advView .hist-preview{padding:var(--s-4);margin-bottom:var(--s-3);display:grid;gap:var(--s-2)}
#advView .hist-sec>.h3,#advView .hist-empty>.h3{margin:0}
#advView .hist-more{justify-self:start}
#advView .hist-how{padding:0 var(--s-4);margin-bottom:var(--s-3)}
#advView .hist-how-t{display:flex;align-items:center;flex-wrap:wrap;gap:var(--s-2);width:100%;min-height:var(--tap);padding:var(--s-2) 0;text-align:left;color:var(--c-ink)}
#advView .hist-how-t>.i{margin-left:auto}
#advView .hist-how-b[hidden]{display:none}
#advView .hist-how-b{display:grid;gap:var(--s-3);padding-bottom:var(--s-4)}
#advView .hist-how .steps,#advView .hist-empty .steps{display:grid;gap:var(--s-2)}
#advView .steps code{overflow-wrap:anywhere}
#advView .acts .act{min-height:60px}
#advView .act-t small{overflow-wrap:break-word}
#advView .tiles .tile-v{overflow-wrap:anywhere}
#advView .history-chart-scroll,#advView .history-table-scroll{max-width:100%}
/* legacy widgets mounted in the shell (TempoStats, strength progress, library, routines) keep their own CSS; only the gaps */
#advView .stats-root,#advView #strength-progress{min-width:0}
/* toast above the bottom nav (a11y.js measures the nav into --bar-h) */
#advView .wk-tot-m{margin-top:var(--s-4)}
#advView .wk-tot-m .wk-tot{padding:var(--s-4)}
#advView .wk-tot-m .wk-tot li{display:grid;grid-template-columns:20px minmax(0,1fr);column-gap:var(--s-2);align-items:start;padding:var(--s-2) 0;border-top:1px solid var(--c-line)}
#advView .wk-tot-m .wk-tot li .i{width:18px;height:18px;color:var(--c-muted);margin-top:2px}
#advView .wk-tot-m .wk-tot li b{grid-column:2;font-weight:650}
#advView .wk-tot-m .wk-tot li.is-tennis .i{color:var(--c-tennis)}
@media (min-width:960px){#advView .wk-tot-m{display:none}}
/* a done/skipped row keeps its title wide: the pill + Undo go under the title on phones */
@media (max-width:639px){#advView .ag-i:has(.ag-done){grid-template-columns:minmax(32px,max-content) minmax(0,1fr)}#advView .ag-i>.ag-done{grid-column:2;justify-content:flex-start}}
#advView .ag-done .pill-done{min-height:32px}
#advView .acts .act{padding:8px 0}
#advView .importcard+.hist-filters{margin-top:0}
/* strength summary + progress (legacy widgets) read at body size inside the shell */
#advView .strength-metrics span{font-size:.875rem}
#advView .strength-summary .summary-period{font-size:.875rem}
#advView .wkev.is-done .i{color:var(--c-done-ink)}
/* tiles never squeeze long values: 2 columns at 100 %, 1 column when the text is enlarged (R2, B7) */
@media (max-width:959px){#advView .tiles{grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr))}}
#advView .vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* legacy stats: names and values wrap instead of being cut (B7) */
#advView .st-prog-name strong,#advView .st-sport-name{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
#advView .st-heat-months{min-width:620px}
#advView .strength-progress-table{font-size:.875rem}
/* legacy .panel clips with overflow:hidden; its wide charts/tables already sit in their own horizontal scrollers */
#advView .panel{overflow:visible}
/* D6 gate fixes: long labels wrap instead of overflowing; focus ring sits on the focused control itself */
#advView .hbars li{grid-template-columns:20px minmax(80px,2fr) minmax(0,3fr) minmax(40px,max-content)}
#advView .hb-l{overflow-wrap:anywhere;min-width:0}
#advView .strength-metrics{grid-template-columns:repeat(auto-fit,minmax(min(9rem,100%),1fr))}
#advView .strength-metrics>div{border-right:0;overflow-wrap:anywhere}
#advView .strength-metrics span{overflow-wrap:anywhere}
#advView .ag-link:focus-visible{outline:3px solid var(--c-focus);outline-offset:2px}
#advView .ag-link:focus-visible::after{outline:none}
#advView .st-sport-filter{flex-wrap:wrap;overflow:visible}
#advView .st-sport-filter button{white-space:normal;min-height:var(--tap)}
#advView .wkev>span{min-width:0;overflow-wrap:anywhere}
#advView .wkev{padding:4px 12px}

#advView .acts .act-open{display:flex;align-items:center;gap:var(--s-3);width:100%;text-align:left;color:inherit;background:none;border:0;cursor:pointer}
#advView .acts .act-open .act-t{flex:1;min-width:0}
#advView .acts .act-open:hover .act-t b{text-decoration:underline}
#advView button.actcard{width:100%;text-align:left;font:inherit;color:inherit;cursor:pointer}
#advView button.wkev-g{text-align:left;font:inherit;color:inherit;cursor:pointer}
