/* ===== Tracker 2.0 shared shell styles (Colin, 2026-10-06): tokens, sidebar, phone bar, More menu, page transitions.
   Used by every tracker page on the tracker-2.0 branch (index, Operations, Prospecting, Settings). Scoped to html.ui2. */
/* iPhone (Colin, 2026-11-15): text stays the size the page asks for. Safari re-sizes text by itself when the phone turns
   sideways (playing a video full screen does that) and came back with every block of text enlarged. For every page. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html.ui2{--bg:#f5f6fa;--surface:#fff;--surface-2:#f8f7fc;--border:#e6e4f0;--text:#171528;--text-muted:#6b6785;--text-faint:#9d9ab4;--accent:#7c3aed;--accent-2:#a855f7;--accent-soft:#f4ecfe;--grad:linear-gradient(135deg,#7c3aed 0%,#a855f7 100%);--shadow:0 1px 2px rgba(23,21,40,.04),0 4px 14px rgba(124,58,237,.06)}
html.ui2[data-theme="dark"]{--bg:#0f0d18;--surface:#191527;--surface-2:#221c33;--border:#312a45;--text:#ece9f6;--text-muted:#a49fbd;--text-faint:#726b8c;--accent:#a78bfa;--accent-2:#c084fc;--accent-soft:#2a2140;--grad:linear-gradient(135deg,#a78bfa 0%,#c084fc 100%);--shadow:0 1px 3px rgba(0,0,0,.4)}
html.ui2 .u2-side,html.ui2 .u2-bottom,html.ui2 .u2-sheet{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}
html.ui2 .u2-side *,html.ui2 .u2-bottom *,html.ui2 .u2-sheet *{box-sizing:border-box}
html.ui2{--faint:#88839f;--accent-deep:#6d28d9;--soft:var(--accent-soft);--on-accent:#fff;--side-w:228px;
  --green:#6d28d9;--green-bg:#ede4ff;--amber:#a16207;--amber-bg:#fef3c7;--blue:#1d4ed8;--blue-bg:#dbeafe;--red:#b42318;--red-bg:#fee2e2}
html.ui2[data-theme="dark"]{--faint:#9890b1;--accent-deep:#c4b5fd;--on-accent:#171528;
  --green:#c3a4ff;--green-bg:#2f2147;--amber:#f4c368;--amber-bg:#3a2c0e;--blue:#7db0ff;--blue-bg:#122544;--red:#fca5a5;--red-bg:#3b1a1a}
html.ui2 body{font-size:14px;line-height:1.5}
html.ui2 body::before{display:none}
html.ui2 .u2-ic{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none;display:block}
html.ui2 .u2-side{position:fixed;top:0;bottom:0;left:0;width:var(--side-w);background:var(--surface);border-right:1px solid var(--border);padding:24px 14px 16px;display:flex;flex-direction:column;z-index:40}
html.ui2 .u2-brand{display:flex;gap:9px;align-items:center;margin:0 6px 22px;font-size:17px;font-weight:800;letter-spacing:-.6px;color:var(--text);text-decoration:none;cursor:pointer}
html.ui2 .u2-brand span{color:var(--accent)}
html.ui2 .u2-brand small{display:block;font-size:9px;font-weight:450;letter-spacing:0;color:var(--text-muted);margin-top:2px;white-space:nowrap}
html.ui2 .u2-mark{display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:var(--grad);color:#fff;flex:none;font-size:17px}
html.ui2 .u2-nav{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent}
html.ui2 .u2-group{margin-bottom:18px}
html.ui2 .u2-group>b{display:block;font-size:9px;letter-spacing:1px;text-transform:uppercase;font-weight:750;color:var(--text-muted);margin:0 12px 7px}
html.ui2 .u2-item{all:unset;box-sizing:border-box;width:100%;display:flex;align-items:center;gap:11px;padding:9px 12px;border-radius:9px;color:var(--text-muted);font-size:12.5px;font-weight:500;min-height:37px;margin:2px 0;cursor:pointer}
html.ui2 .u2-item:hover{background:var(--surface-2);color:var(--text)}
html.ui2 .u2-item:focus-visible{outline:3px solid var(--accent);outline-offset:1px}
html.ui2 .u2-item.on{background:var(--soft);color:var(--accent-deep);font-weight:650}
html.ui2 .u2-count{margin-left:auto;font-size:10px;font-weight:700;padding:1px 6px;min-width:21px;text-align:center;background:var(--surface-2);border:1px solid var(--border);border-radius:5px;color:var(--text-muted)}
html.ui2 .u2-item.on .u2-count{background:var(--surface)}
html.ui2 .u2-foot{flex-shrink:0;padding-top:8px}
html.ui2 .u2-studio{all:unset;box-sizing:border-box;width:100%;display:flex;align-items:center;gap:9px;border:1px solid var(--border);padding:11px 10px;border-radius:12px;margin:0 0 14px;color:var(--accent-deep);background:var(--surface-2);cursor:pointer}
html.ui2 .u2-studio b{display:block;font-size:11.5px}html.ui2 .u2-studio small{display:block;color:var(--text-muted);font-size:9.5px;margin-top:2px}
html.ui2 .u2-studio:hover{border-color:var(--accent)}
html.ui2 .u2-profile{display:flex;align-items:center;gap:9px;padding-top:13px;border-top:1px solid var(--border)}
html.ui2 .u2-profile b{font-size:11.5px;display:block;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.ui2 .u2-profile small{font-size:9.5px;color:var(--text-muted)}
html.ui2 .u2-av{width:32px;height:32px;display:inline-grid;place-items:center;background:var(--soft);color:var(--accent-deep);border-radius:9px;font-size:11px;font-weight:700;flex:none}
html.ui2 .u2-icbtn{all:unset;box-sizing:border-box;width:30px;height:30px;display:inline-grid;place-items:center;border-radius:8px;color:var(--text-muted);cursor:pointer}
html.ui2 .u2-icbtn:hover{background:var(--soft);color:var(--accent)}
/* Name on its own line, the buttons on the next (Colin, 2026-11-03: with the bell there are four buttons and the sign-out
   one was cut off at the sidebar's edge) */
html.ui2 .u2-profile{flex-wrap:wrap;row-gap:4px}
html.ui2 .u2-profile>div{flex:1 1 calc(100% - 41px);min-width:0}
html.ui2 .u2-profile b{max-width:100%}
html.ui2 .u2-profile .u2-icbtn{width:28px;height:28px}
html.ui2 .u2-profile .u2-icbtn:first-of-type{margin-left:35px}
html.ui2 .u2-profile .u2-icbtn+.u2-icbtn{margin-left:-5px}

html.ui2 .u2-bottom{display:none}
html.ui2 .u2-bottom{view-transition-name:u2bottom}
::view-transition-old(u2bottom),::view-transition-new(u2bottom){animation:none}
html.ui2 #viewAsBar.u2-va-docked{position:static!important;left:auto!important;bottom:auto!important;z-index:auto!important;box-shadow:none!important;margin:0 0 10px!important;width:100%;box-sizing:border-box;flex-wrap:wrap;background:var(--surface-2)!important}
html.ui2 .u2-sheet #viewAsBar.u2-va-docked{margin:4px 0 0!important}
html.ui2 #viewAsBar.u2-va-docked select{min-width:0;flex:1}
html.ui2 #viewAsBar .u2-va-mini{display:none}
html.ui2 #viewAsBar.u2-va-floating > :not(.u2-va-mini){display:none!important}
html.ui2 #viewAsBar.u2-va-floating{padding:5px 6px 5px 12px!important;border-radius:999px!important;gap:0!important}
html.ui2 #viewAsBar.u2-va-floating .u2-va-mini{display:inline-flex;align-items:center;gap:10px;font-size:12px;font-weight:650;color:var(--accent-deep)}
html.ui2 #viewAsBar.u2-va-floating.u2-va-strip{position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:auto!important;width:auto!important;max-width:none!important;height:44px;box-sizing:border-box!important;margin:0!important;border:0!important;border-bottom:1px solid var(--border)!important;border-radius:0!important;padding:0 8px 0 16px!important;background:var(--accent-soft,#f1eaff)!important;box-shadow:none!important;z-index:501!important;display:flex!important;align-items:center}
html.ui2 #viewAsBar.u2-va-strip .u2-va-mini{flex:1;justify-content:space-between;min-width:0}
html.ui2 #viewAsBar.u2-va-strip .u2-va-what{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.ui2 #viewAsBar.u2-va-strip .u2-va-exit{background:transparent;color:var(--accent-deep,#6d28d9);padding:13px 10px;border-radius:8px}
html.u2-va-stripped #clientPreviewFrame{top:44px!important;height:calc(100% - 44px)!important}
html.ui2 #viewAsBar .u2-va-exit{all:unset;cursor:pointer;font-size:12px;font-weight:700;color:#fff;background:var(--accent,#7c3aed);padding:5px 10px;border-radius:999px}
html.ui2 .u2-sheet{position:fixed;inset:0;z-index:400;background:#0f0d1870;backdrop-filter:blur(3px);display:none;align-items:flex-end}
html.ui2 .u2-sheet.open{display:flex}
html.ui2 .u2-sheet>div{background:var(--surface);width:100%;max-height:82dvh;overflow:auto;border-radius:20px 20px 0 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom))}
html.ui2 .u2-sheet h3{font-size:15px;margin:2px 4px 14px;display:flex;justify-content:space-between;align-items:center}
html.ui2 .u2-sheet .u2-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-bottom:14px}
html.ui2 .u2-sheet .u2-item{border:1px solid var(--border);min-height:48px}
html.ui2 .u2-sheet .u2-group>b{margin-left:4px}
html.ui2 a.u2-item,html.ui2 a.u2-studio{text-decoration:none}
html.ui2 .u2-sub{margin:2px 0 6px 28px;border-left:1px solid var(--border);padding-left:8px;display:flex;flex-direction:column}
html.ui2 .u2-subitem{all:unset;box-sizing:border-box;cursor:pointer;font-size:12px;color:var(--text-muted);padding:7px 10px;border-radius:8px}
html.ui2 .u2-subitem:hover{background:var(--surface-2);color:var(--text)}
html.ui2 .u2-subitem.on{color:var(--accent-deep);font-weight:650;background:var(--soft)}
html.ui2 .u2-sheet .u2-sub{margin:0 0 14px;border:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
html.ui2 .u2-sheet .u2-subitem{border:1px solid var(--border);min-height:44px;display:flex;align-items:center;padding:0 12px}
/* page-to-page: a soft cross-fade instead of a blank flash (Chrome/Edge/Safari; others just navigate) */
/* (2026-10-12) page-to-page crossfade switched off: it got cut short on slow or redirecting loads and looked like a glitch / double load */
::view-transition-old(root),::view-transition-new(root){animation-duration:.18s}
html.ui2 .u2-side{view-transition-name:u2side}
::view-transition-old(u2side),::view-transition-new(u2side){animation:none}
@media(max-width:1200px){html.ui2{--side-w:206px}}
@media(max-width:960px){
  html.ui2 .u2-side{display:none}
  html.ui2 .u2-bottom{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-around;gap:3px;border-top:1px solid var(--border);background:var(--surface);z-index:45;padding:7px 8px calc(7px + env(safe-area-inset-bottom))}
  html.ui2 .u2-bottom a{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex:1;min-width:0;align-items:center;justify-content:center;flex-direction:column;gap:4px;color:var(--text-muted);font-size:10px;font-weight:550;padding:5px 2px;min-height:48px;border-radius:10px;position:relative;text-align:center;overflow-wrap:anywhere}
  html.ui2 .u2-bottom a:focus-visible{outline:3px solid var(--accent);outline-offset:-2px}
  html.ui2 .u2-bottom a.on{background:var(--soft);color:var(--accent-deep)}
  html.ui2 .u2-bottom .u2-ic{width:20px;height:20px}
  html.ui2 .u2-bottom .u2-badge{position:absolute;top:3px;right:calc(50% - 18px);background:var(--accent);color:#fff;font-size:9px;font-weight:700;border-radius:99px;padding:0 5px;line-height:15px}
}
@media(min-width:961px) and (max-height:820px){html.ui2 .u2-group{margin-bottom:12px}html.ui2 .u2-item{min-height:33px;padding-top:7px;padding-bottom:7px}html.ui2 .u2-brand{margin-bottom:16px}}
@media(prefers-reduced-motion:reduce){html.ui2 *{transition:none!important;animation:none!important}::view-transition-group(*){animation:none!important}}

/* ---------- the other tracker pages: make room for the sidebar, drop their own back/menu ---------- */
@media(min-width:961px){html.ui2.u2-page.u2-hasside body{padding-left:var(--side-w)!important}}
@media(max-width:960px){html.ui2.u2-page.u2-hasside body{padding-bottom:84px!important}}
html.ui2.u2-page .trk-back{display:none!important}
/* Prospecting: its own left menu now lives in the shared sidebar */
html.ui2.u2-page aside.side{display:none!important}
/* Prospecting draws itself in a full-screen layer (#prOv): start it after the sidebar, end it above the phone bar */
@media(min-width:961px){html.ui2.u2-page.u2-hasside #prOv{left:var(--side-w)!important}}
@media(max-width:960px){html.ui2.u2-page.u2-hasside #prOv{bottom:calc(63px + env(safe-area-inset-bottom))!important}}
html.ui2.u2-page #prOv{z-index:35!important}
html.ui2.u2-page .u2-side{z-index:41}
/* the admin "View as" switcher, on every page: clear of the sidebar and the phone bar */
html.ui2 #viewAsBar{left:auto!important;right:16px!important;bottom:16px!important}
@media(max-width:960px){html.ui2 #viewAsBar{bottom:84px!important;right:10px!important}}
/* Operations (tasks.html): its own top bar (logo, role chip, Prospecting link) is replaced by the shared sidebar */
html.ui2.u2-page.u2-hasside .top:has(.logo),html.ui2.u2-inframe .top:has(.logo){display:none!important}
/* inside the tracker the parent already shows the View-as switcher */
html.ui2.u2-inframe #viewAsBar{display:none!important}
/* docked View as: label + role picker on one row, the Phone button underneath (the sidebar is narrow) */
html.ui2 #viewAsBar.u2-va-docked{display:grid!important;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px 8px;padding:8px 10px!important}
html.ui2 #viewAsBar.u2-va-docked select{width:100%;min-width:90px}
html.ui2 #viewAsBar.u2-va-docked > button{grid-column:1/-1;justify-content:center}
html.ui2 #viewAsBar.u2-va-docked > button[style*="display:none"]{display:none!important}
html.ui2 .u2-av{overflow:hidden}html.ui2 .u2-av .u2-av-img{width:100%;height:100%;object-fit:cover;display:block}
/* Workspace side menu (2026-10-17): return link above the workspace's own sections; rows reuse .u2-item */
html.ui2 .u2-ws-back{color:var(--text-muted);margin:0 0 12px}
html.ui2 .u2-ws-back:hover{color:var(--accent-deep)}
html.ui2 .u2-ws-group button.u2-item{text-align:left}
