/* AlgoLab mobile app (components/mobile/shell.py + the mobile idea apps sip_mobile.py / ltc_mobile.py).
   Every /assets stylesheet loads on every page, so EVERY rule here starts with #mb_root: nothing leaks into
   the desktop pages. Tokens as the desktop (components/pages/theme.py): panels rgba(0,0,0,.6), chips
   rgba(255,255,255,.06), text #e8e8e8, muted #9fb3c8, headings #cfefff, accent amber #f0a030, radius 10-16px.
   Touch targets >= 44px, safe-area insets, no horizontal scroll at 360-430px, inner scrollers contain
   their overscroll (pull-to-refresh only from the header). Transitions: transform / opacity only. */

#mb_root {
    --mb-panel: rgba(0, 0, 0, .55); --mb-chip: rgba(255, 255, 255, .06); --mb-line: rgba(255, 255, 255, .09);
    --mb-text: #e8e8e8; --mb-muted: #9fb3c8; --mb-head: #cfefff; --mb-acc: #f0a030; --mb-glow: #4be9fa;
    --mb-good: #3fbf7f; --mb-bad: #e66767;
    --mb-bg: linear-gradient(160deg, #010304 8%, #04161c 48%, #0a4c55 100%);
    /* clip, not hidden: an overflow:hidden box can still be scrolled by scrollIntoView (AIrene's), which
       slid the whole shell up; mb_shell.js also resets it for browsers without 'clip' */
    position: fixed; inset: 0; z-index: 1001; display: flex; flex-direction: column; overflow: hidden; overflow: clip;
    background: #020507; background-image: var(--mb-bg); color: var(--mb-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.4;
    -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
#mb_root *, #mb_root *::before, #mb_root *::after { box-sizing: border-box; }
#mb_root button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
#mb_root button:focus-visible, #mb_root input:focus-visible { outline: 2px solid var(--mb-glow); outline-offset: 2px; }
#mb_root .mb-hide { display: none !important; }

/* ---------- header ------------------------------------------------------------------------------- */
#mb_root .mb-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
                    padding: calc(10px + env(safe-area-inset-top)) 16px 8px; }
#mb_root .mb-hello { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 44px; cursor: pointer; }
#mb_root .mb-hello > div:last-child { min-width: 0; }
#mb_root .mb-hi { font-size: 1.15rem; font-weight: 650; color: var(--mb-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mb-hi-s { font-size: .78rem; color: var(--mb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mb-av { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center;
                  justify-content: center; font-weight: 700; font-size: .95rem; color: var(--mb-head);
                  background: linear-gradient(135deg, rgba(11,95,105,.9), rgba(75,233,250,.18));
                  border: 1px solid rgba(75,233,250,.35); }
#mb_root .mb-av.icon { color: var(--av, #4be9fa); background: rgba(255,255,255,.06); border-color: var(--av, #4be9fa); font-size: 1.1rem; }
#mb_root .mb-av.big { flex-basis: 72px; width: 72px; height: 72px; font-size: 1.5rem; }
#mb_root .mb-guide { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
                     min-width: 44px; height: 44px; padding: 0 14px; border-radius: 22px; font-size: .82rem;
                     color: var(--mb-head); background: rgba(75,233,250,.08); border: 1px solid rgba(75,233,250,.42); }
#mb_root .mb-guide:active { background: rgba(75,233,250,.18); }
#mb_root .mb-apptools .mb-guide { padding: 0; width: 44px; border-radius: 50%; }
#mb_root .mb-apptools .mb-guide .ag-orb { margin: 0; width: 11px; height: 11px; }

/* ---------- the scrolling area + views ------------------------------------------------------------ */
#mb_root .mb-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
                      -webkit-overflow-scrolling: touch; padding: 2px 16px calc(84px + env(safe-area-inset-bottom)); }
#mb_root .mb-view { display: none; }
#mb_root[data-view="home"] #mb_v_home, #mb_root[data-view="fav"] #mb_v_fav,
#mb_root[data-view="apps"] #mb_v_apps, #mb_root[data-view="account"] #mb_v_account { display: block; animation: mb-in .22s ease-out; }
@keyframes mb-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#mb_root .mb-h2 { font-size: 1.35rem; font-weight: 650; color: var(--mb-head); margin: 6px 0 2px; }
#mb_root .mb-sub { color: var(--mb-muted); font-size: .8rem; line-height: 1.45; margin: 2px 0 6px; }
#mb_root .mb-muted { color: #7f93a8; font-size: .74rem; line-height: 1.45; margin-top: 6px; }
#mb_root .mb-empty { color: var(--mb-muted); font-size: .84rem; padding: 14px; border: 1px dashed rgba(255,255,255,.14);
                     border-radius: 14px; text-align: center; }
#mb_root .mb-empty i { color: var(--mb-acc); }
#mb_root .mb-empty.bad { color: #ffd0cb; border-color: rgba(230,103,103,.5); }
#mb_root .mb-wait { color: var(--mb-muted); font-size: .82rem; padding: 12px 2px; }
#mb_root .mb-nomatch { display: none; }
#mb_root.mb-nomatch-on .mb-nomatch { display: block; }

#mb_root .mb-sec { margin: 18px 0 4px; }
#mb_root .mb-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin-bottom: 6px; }
#mb_root .mb-sec-t { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mb-muted); font-weight: 650; }
#mb_root .mb-sec-s { color: #7f93a8; font-size: .76rem; margin: -2px 0 8px; line-height: 1.4; }
#mb_root .mb-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -8px -4px; padding: 0 4px;
                    background: none; border: 0; color: var(--mb-acc); font-size: .78rem; font-weight: 600; }
#mb_root .mb-link i { font-size: .7rem; }
#mb_root .mb-morelink { width: 100%; min-height: 48px; margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
                        border-radius: 14px; background: var(--mb-chip); border: 1px solid var(--mb-line); color: var(--mb-text);
                        font-size: .84rem; text-align: left; }
#mb_root .mb-morelink span { flex: 1 1 auto; min-width: 0; }
#mb_root .mb-morelink i { color: var(--mb-muted); font-size: .8rem; }
#mb_root #mb_v_home.mb-searching .mb-morelink { display: none; }

/* ---------- search -------------------------------------------------------------------------------- */
#mb_root .mb-search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; margin: 6px 0 2px;
                      border-radius: 14px; background: var(--mb-chip); border: 1px solid var(--mb-line); color: var(--mb-muted); }
#mb_root .mb-search:focus-within { border-color: rgba(75,233,250,.5); }
#mb_root .mb-search-in { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: transparent;
                         color: var(--mb-text); font-size: 16px; /* 16px: no zoom on focus (iOS) */ }
#mb_root .mb-search-in::placeholder { color: #7f93a8; }
#mb_root #mb_v_home.mb-searching #mb_sec_algos { display: none; }
#mb_root .mb-list.mb-sdesk { display: none; margin-top: 10px; }
#mb_root #mb_v_home.mb-searching .mb-list.mb-sdesk { display: flex; }

/* ---------- app cards ----------------------------------------------------------------------------- */
#mb_root .mb-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 560px) { #mb_root .mb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#mb_root .mb-card { position: relative; border-radius: 16px; overflow: hidden; cursor: pointer; background: var(--mb-panel);
                    border: 1px solid var(--mb-line); transition: transform .15s ease, border-color .15s ease; }
#mb_root .mb-card:active { transform: scale(.985); border-color: rgba(240,160,48,.5); }
#mb_root .mb-cimg { position: relative; height: 136px; background-color: rgba(255,255,255,.04); background-size: cover;
                    background-position: center top; }
#mb_root .mb-cimg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.65)); }
#mb_root .mb-cbadge { position: absolute; left: 14px; bottom: -18px; z-index: 2; width: 40px; height: 40px; border-radius: 12px;
                      display: flex; align-items: center; justify-content: center; color: var(--mb-acc); font-size: 1.05rem;
                      background: #0c1a21; border: 1px solid rgba(240,160,48,.45); box-shadow: 0 4px 12px rgba(0,0,0,.5); }
#mb_root .mb-cbody { padding: 26px 14px 12px; }
#mb_root .mb-ckick { color: var(--mb-acc); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 650; }
#mb_root .mb-ctitle { color: var(--mb-head); font-size: 1.08rem; font-weight: 650; margin: 2px 0 4px; }
#mb_root .mb-cdesc { color: var(--mb-muted); font-size: .84rem; line-height: 1.45; }
#mb_root .mb-cgo { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 28px; color: var(--mb-acc);
                   font-size: .82rem; font-weight: 650; }
#mb_root .mb-cgo i { font-size: .75rem; }

/* stars (Dash buttons; the clientside callback on 'mb_favs' toggles .on) */
#mb_root .mb-star { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; display: inline-flex; align-items: center;
                    justify-content: center; padding: 0; font-size: 1.05rem; color: #dfe7ee;
                    background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.16); transition: transform .15s ease; }
#mb_root .mb-star:active { transform: scale(.9); }
#mb_root .mb-star .mb-s1 { display: none; }
#mb_root .mb-star.on .mb-s0 { display: none; }
#mb_root .mb-star.on .mb-s1 { display: inline; color: var(--mb-acc); animation: mb-pop .3s ease-out; }
@keyframes mb-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
#mb_root .mb-cimg .mb-star { position: absolute; top: 8px; right: 8px; z-index: 2; }
#mb_root .mb-row .mb-star, #mb_root .mb-fi .mb-star { background: transparent; border-color: transparent; }

/* ---------- favourites: strip (home) and list (tab) ------------------------------------------------ */
#mb_root .mb-strip { display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
                     scroll-snap-type: x proximity; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
#mb_root .mb-strip::-webkit-scrollbar { display: none; }
#mb_root .mb-strip .mb-fi { display: none; flex: 0 0 136px; scroll-snap-align: start; border-radius: 14px; overflow: hidden;
                            background: var(--mb-panel); border: 1px solid var(--mb-line); cursor: pointer; }
#mb_root .mb-strip .mb-fi.on { display: block; animation: mb-in .22s ease-out; }
#mb_root .mb-strip .mb-fi:active { transform: scale(.97); }
#mb_root .mb-fthumb { height: 76px; display: flex; align-items: center; justify-content: center; color: var(--mb-acc);
                      font-size: 1.35rem; background-color: rgba(255,255,255,.04); background-size: cover; background-position: center top; }
#mb_root .mb-ftitle { margin: 8px 10px 4px; font-size: .8rem; font-weight: 600; color: var(--mb-head); line-height: 1.25;
                      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.5em; }
#mb_root .mb-fchip { padding: 0 10px 8px; font-size: .66rem; color: var(--mb-muted); }
#mb_root .mb-strip .mb-fi:not(.desk) .mb-ftitle { margin-bottom: 10px; }

#mb_root .mb-list { display: flex; flex-direction: column; gap: 8px; }
#mb_root #mb_favlist { margin-top: 10px; }
#mb_root #mb_favlist .mb-fi { display: none; }
#mb_root #mb_favlist .mb-fi.on { display: flex; animation: mb-in .22s ease-out; }
#mb_root .mb-row, #mb_root #mb_favlist .mb-fi { align-items: center; gap: 12px; min-height: 64px; padding: 8px 4px 8px 8px;
                                                 border-radius: 14px; background: var(--mb-panel); border: 1px solid var(--mb-line); cursor: pointer; }
#mb_root .mb-row { display: flex; }
#mb_root .mb-row.desk, #mb_root .mb-fi.desk { opacity: .9; }
#mb_root #mb_favlist .mb-fthumb { flex: 0 0 56px; height: 56px; border-radius: 10px; font-size: 1.15rem; }
#mb_root .mb-rico { flex: 0 0 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
                    background: var(--mb-chip); color: var(--mb-muted); font-size: 1rem; }
#mb_root .mb-rbody { flex: 1 1 auto; min-width: 0; }
#mb_root .mb-rtitle { color: var(--mb-head); font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mb-rsub { color: var(--mb-muted); font-size: .76rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical; overflow: hidden; }
#mb_root .mb-rsub i, #mb_root .mb-fchip i { font-size: .68rem; margin-right: 2px; }

/* My algorithms (read-only) */
#mb_root .mb-row.algo { cursor: default; align-items: flex-start; padding: 10px 10px 10px 10px; }
#mb_root .mb-aico { flex: 0 0 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
                    color: var(--c); border: 1px solid var(--c); background: rgba(255,255,255,.04); }
#mb_root .mb-akpis { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
#mb_root .mb-akpi { font-size: .7rem; color: var(--mb-muted); }
#mb_root .mb-akpi b { color: var(--mb-head); font-size: .82rem; margin-right: 4px; }

/* ---------- panels, fields, pills, buttons (shell + app bodies) ------------------------------------ */
#mb_root .mb-panel { background: var(--mb-panel); border: 1px solid var(--mb-line); border-radius: 16px; padding: 14px; margin: 0 0 12px; }
#mb_root .mb-card-t { color: var(--mb-head); font-weight: 650; font-size: .98rem; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
#mb_root .mb-field { margin: 10px 0 0; min-width: 0; }
#mb_root .mb-k { color: var(--mb-muted); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
#mb_root .mb-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
#mb_root .mb-in { width: 100%; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--mb-line);
                  background: rgba(255,255,255,.05); color: var(--mb-text); font-size: 16px; color-scheme: dark; }
#mb_root .mb-in:focus { border-color: rgba(240,160,48,.7); outline: none; }
#mb_root .mb-inwrap { position: relative; }
#mb_root .mb-insym { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mb-muted); font-size: .9rem; pointer-events: none; }
#mb_root .mb-inwrap .mb-in { padding-left: 30px; }
#mb_root .mb-pills { display: flex; flex-wrap: wrap; gap: 8px; }
#mb_root .mb-pills label { position: relative; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 6px;
                           min-height: 44px; margin: 0; padding: 6px 12px; border-radius: 12px; cursor: pointer; text-align: center;
                           background: var(--mb-chip); border: 1px solid var(--mb-line); color: var(--mb-text); font-size: .86rem; line-height: 1.25;
                           transition: background .15s ease, border-color .15s ease; }
#mb_root .mb-pills input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
#mb_root .mb-pills label:has(input:checked) { background: rgba(240,160,48,.15); border-color: rgba(240,160,48,.75); color: #fff; }
#mb_root .mb-pills label:has(input:disabled) { opacity: .45; }
#mb_root .mb-btn { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px;
                   border-radius: 12px; font-weight: 650; font-size: .9rem; color: #f5d6a3;
                   background: rgba(240,160,48,.14); border: 1px solid rgba(240,160,48,.6); }
#mb_root .mb-btn:active { background: rgba(240,160,48,.26); }
#mb_root .mb-btn.danger { color: #ffd0cb; background: rgba(230,103,103,.10); border-color: rgba(230,103,103,.5); }
#mb_root .mb-btn .ag-orb { margin-right: 2px; }
#mb_root .mb-more summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 6px 0 0;
                            color: var(--mb-head); font-weight: 600; font-size: .88rem; cursor: pointer; }
#mb_root .mb-more summary::-webkit-details-marker { display: none; }
#mb_root .mb-more summary::after { content: '\25BE'; margin-left: auto; color: var(--mb-muted); transition: transform .2s ease; }
#mb_root .mb-more[open] > summary::after { transform: rotate(180deg); }
#mb_root .mb-more summary i { color: var(--mb-acc); }
#mb_root .mb-more.in summary { min-height: 36px; font-size: .8rem; color: var(--mb-muted); }
#mb_root .mb-note { color: #f5d6a3; font-size: .8rem; padding: 8px 12px; border-radius: 12px; margin-bottom: 10px;
                    background: rgba(240,160,48,.08); border: 1px solid rgba(240,160,48,.35); }

/* account */
#mb_root .mb-acc-hero { display: flex; align-items: center; gap: 14px; margin: 8px 0 14px; }
#mb_root .mb-acc-name { font-size: 1.2rem; font-weight: 650; color: var(--mb-head); }

/* ---------- bottom navigation ---------------------------------------------------------------------- */
#mb_root .mb-nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex;
                   padding: 0 4px env(safe-area-inset-bottom); background: rgba(5,11,15,.94); border-top: 1px solid var(--mb-line);
                   -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform .25s ease; }
#mb_root .mb-navb { flex: 1 1 0; min-width: 0; min-height: 60px; display: flex; flex-direction: column; align-items: center;
                    justify-content: center; gap: 4px; padding: 6px 2px; background: none; border: 0; color: var(--mb-muted);
                    font-size: .68rem; font-weight: 600; position: relative; }
#mb_root .mb-navb i { font-size: 1.15rem; transition: transform .2s ease; }
#mb_root .mb-navb span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mb-navb.on { color: var(--mb-acc); }
#mb_root .mb-navb.on i { transform: translateY(-1px) scale(1.08); }
#mb_root .mb-navb.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--mb-acc); }
#mb_root.mb-in-app .mb-nav { transform: translateY(110%); }

/* ---------- the app view (full screen) ------------------------------------------------------------- */
#mb_root .mb-app { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; overflow: clip; background: #020507;
                   background-image: var(--mb-bg); transform: translateX(100%); visibility: hidden;
                   transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s; }
#mb_root.mb-in-app .mb-app { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
#mb_root .mb-appbar { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
                      background: rgba(5,11,15,.9); border-bottom: 1px solid var(--mb-line); }
#mb_root .mb-ib { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
                  background: transparent; border: 0; color: var(--mb-head); font-size: 1.1rem; }
#mb_root .mb-ib:active { background: var(--mb-chip); }
#mb_root .mb-apptitle { flex: 1 1 auto; min-width: 0; color: var(--mb-head); font-size: 1rem; font-weight: 650;
                        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mb-app.mb-busy .mb-apptitle[data-pending] { font-size: 0; }
#mb_root .mb-app.mb-busy .mb-apptitle[data-pending]::before { content: attr(data-pending); font-size: 1rem; }
#mb_root .mb-apptools { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
#mb_root .mb-apptools .mb-star { background: transparent; border-color: transparent; }
#mb_root .mb-appscroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto;
                         overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
                         padding: 12px 14px calc(28px + env(safe-area-inset-bottom)); }
#mb_root .mb-busy { position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; align-items: center;
                    justify-content: center; gap: 12px; color: var(--mb-muted); font-size: .85rem; background: rgba(2,6,9,.72); }
#mb_root .mb-app.mb-busy .mb-busy { display: flex; }
#mb_root .mb-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--mb-acc);
                    animation: mb-spin .8s linear infinite; }
@keyframes mb-spin { to { transform: rotate(360deg); } }

/* ---------- toast ---------------------------------------------------------------------------------- */
#mb_root .mb-toast { position: absolute; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 8;
                     padding: 12px 14px; border-radius: 14px; font-size: .86rem; color: var(--mb-text); pointer-events: none;
                     background: rgba(14,26,34,.97); border: 1px solid rgba(127,238,255,.35); box-shadow: 0 10px 30px rgba(0,0,0,.5);
                     opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
#mb_root .mb-toast.on { opacity: 1; transform: none; }

/* ---------- shared bits of the app bodies ---------------------------------------------------------- */
#mb_root .mb-intro { margin: 2px 2px 12px; }
#mb_root .mb-kicker { color: var(--mb-acc); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 650; }
#mb_root .mb-lead { color: #dfe7ee; font-size: .88rem; line-height: 1.5; margin: 4px 0 10px; }
#mb_root .mb-lead > i { color: var(--mb-acc); font-size: .75rem; }
#mb_root .mb-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
#mb_root .mb-tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#mb_root .mb-tile { min-width: 0; padding: 10px; border-radius: 12px; background: var(--mb-chip); }
#mb_root .mb-tile.sm { padding: 8px; }
#mb_root .mb-tv { color: var(--mb-head); font-size: 1.02rem; font-weight: 650; font-variant-numeric: tabular-nums;
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mb-tile.sm .mb-tv { font-size: .86rem; }
#mb_root .mb-tl { color: var(--mb-muted); font-size: .7rem; line-height: 1.3; margin-top: 2px; }
#mb_root .mb-ts { color: #7f93a8; font-size: .68rem; line-height: 1.3; margin-top: 3px; }
#mb_root .mb-hero { background: linear-gradient(160deg, rgba(240,160,48,.10), rgba(0,0,0,.55) 55%); border-color: rgba(240,160,48,.28); }
#mb_root .mb-hero-k { color: var(--mb-muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
#mb_root .mb-hero-v { color: #fff; font-size: 2.05rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; margin: 2px 0; }
#mb_root .mb-hero-s { color: var(--mb-muted); font-size: .78rem; }
#mb_root .mb-graph { width: 100%; margin-top: 6px; }
#mb_root .mb-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-bottom: 12px; border-radius: 14px;
                      font-size: .82rem; line-height: 1.45; color: #f5d6a3; background: rgba(240,160,48,.10); border: 1px solid rgba(240,160,48,.5); }
#mb_root .mb-banner i { color: var(--mb-acc); font-size: 1.1rem; margin-top: 2px; }
#mb_root .mb-foot { color: #7f93a8; font-size: .7rem; line-height: 1.45; padding: 4px 4px 12px; }
#mb_root .mb-loading { position: relative; }

/* DCA Companion (sip_mobile.py) */
#mb_root .mbs-lk-track { position: relative; height: 14px; margin: 12px 4px 6px; border-radius: 7px;
                         background: linear-gradient(90deg, rgba(230,103,103,.45), rgba(255,255,255,.08) 50%, rgba(63,191,127,.45)); }
#mb_root .mbs-lk-band { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; background: rgba(144,133,233,.55); }
#mb_root .mbs-lk-you { position: absolute; top: -5px; width: 4px; height: 24px; margin-left: -2px; border-radius: 2px;
                       background: #fff; box-shadow: 0 0 8px rgba(75,233,250,.9); }
#mb_root .mbs-lk-lab { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
#mb_root .mbs-lk-lab > div { display: flex; flex-direction: column; font-size: .68rem; color: var(--mb-muted); line-height: 1.25; min-width: 0; }
#mb_root .mbs-lk-lab b { color: var(--mb-head); font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mbs-lk-lab .mid { text-align: center; align-items: center; }
#mb_root .mbs-lk-lab .end { text-align: right; align-items: flex-end; }
#mb_root .mbs-st { padding: 8px 0; border-top: 1px solid var(--mb-line); }
#mb_root .mbs-st-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .86rem; color: var(--mb-text); }
#mb_root .mbs-st-h b { font-variant-numeric: tabular-nums; }
#mb_root .mbs-st-bar { position: relative; height: 6px; margin: 6px 0 4px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
#mb_root .mbs-st-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #3987e5, #9fb3c8); }
#mb_root .mbs-st-fill.dd { background: linear-gradient(90deg, #e66767, #f0a030); }
#mb_root .mbs-lv { padding: 8px 0; border-top: 1px solid var(--mb-line); }
#mb_root .mbs-lv:first-of-type { border-top: 0; }
#mb_root .mbs-lv-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .82rem; line-height: 1.3; }
#mb_root .mbs-lv-h b { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
#mb_root .mbs-lv-track { position: relative; height: 12px; margin-top: 6px; border-radius: 6px; background: rgba(255,255,255,.05); }
#mb_root .mbs-lv-rng { position: absolute; top: 4px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); }
#mb_root .mbs-lv-bar { position: absolute; top: 2px; height: 8px; border-radius: 4px; }
#mb_root .mbs-lv-bar.good { background: var(--mb-good); }
#mb_root .mbs-lv-bar.bad { background: var(--mb-bad); }
#mb_root .mbs-lv-zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255,255,255,.45); }

/* Apps tab: the desktop apps in the rows of the learning path (app_catalog.py) */
#mb_root .mb-path { margin: 14px 0 8px; padding-left: 10px; border-left: 3px solid var(--mb-acc); }
#mb_root .mb-path:first-of-type { margin-top: 4px; }
#mb_root .mb-path-t { font-weight: 650; font-size: .9rem; color: var(--mb-head); }
#mb_root .mb-path-s { color: #7f93a8; font-size: .72rem; line-height: 1.35; }

/* Account: the app colour (components/mobile/look.py) */
#mb_root .mb-sws { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; }
#mb_root .mb-sw { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center;
                  justify-content: center; font-size: .8rem; color: rgba(255,255,255,.85); border: 2px solid rgba(255,255,255,.16);
                  background: linear-gradient(160deg, #04161c, var(--sw)); }
#mb_root .mb-sw.on { border-color: var(--mb-acc); box-shadow: 0 0 0 3px rgba(240,160,48,.28); }
#mb_root .mb-colpick { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 2px 12px 2px 2px;
                       border-radius: 24px; background: var(--mb-chip); border: 1px solid var(--mb-line); font-size: .86rem; cursor: pointer; }
#mb_root .mb-colpick .mb-sw.pick { background: conic-gradient(#e66767, #f0a030, #5fbf6a, #4be9fa, #5b8def, #9a6ee0, #e66767); }
#mb_root .mb-colpick .mb-sw.pick.on { background: var(--sw); }
#mb_root .mb-colin { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* Look-Through Clocks (ltc_mobile.py + mb_clocks.js) */
#mb_root .mbl-set > summary { margin: 0; }
#mb_root .mbl-set > summary > i { flex: 0 0 auto; }
#mb_root .mbl-sum-t { flex: 0 0 auto; }
#mb_root .mbl-sum-v { flex: 1 1 auto; min-width: 0; color: var(--mb-muted); font-size: .74rem; font-weight: 400; text-align: right;
                      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mbl-own { margin-top: 6px; }
#mb_root .mbl-own .mb-pills { margin-top: 10px; }
#mb_root .mbl-live { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: .72rem; color: var(--mb-muted); margin-bottom: 6px; }
#mb_root .mbl-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mb-good); box-shadow: 0 0 8px var(--mb-good);
                         animation: mb-blink 1.6s ease-in-out infinite; }
#mb_root .mbl-live-t { color: var(--mb-good); font-weight: 650; margin-right: auto; }
#mb_root .mbl-key { display: inline-flex; align-items: center; gap: 5px; }
#mb_root .mbl-sw { display: inline-block; width: 12px; height: 6px; border-radius: 3px; }
#mb_root .mbl-sw.a { background: #28c878; }
#mb_root .mbl-sw.e { background: rgba(240,160,48,.75); }
@keyframes mb-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
#mb_root .mbc { padding: 10px 0; border-top: 1px solid var(--mb-line); }
#mb_root .mbc:first-child { border-top: 0; }
#mb_root .mbc-h { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--mb-text); }
#mb_root .mbc-i { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
                  font-size: .75rem; color: var(--c); background: rgba(255,255,255,.05); border: 1px solid var(--c); }
#mb_root .mbc-l { flex: 1 1 auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mbc-sp { flex: 0 0 auto; color: var(--mb-muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
#mb_root .mbc-n { margin: 4px 0 4px 34px; color: #fff; font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
                  white-space: nowrap; overflow: hidden; font-size: 1.15rem; font-weight: 650; }
#mb_root .mbc.big .mbc-n { font-size: 1.6rem; }
#mb_root .mbc-n .cu { color: var(--mb-muted); font-weight: 500; }
#mb_root .mbc-n .ce { color: #dfe7ee; }
#mb_root .mbc-n .sx { color: var(--c); font-size: .62em; font-weight: 600; margin-left: 1px; }
#mb_root .mbc-m { display: flex; height: 4px; margin-left: 34px; border-radius: 2px; overflow: hidden; background: rgba(255,255,255,.06); }
#mb_root .mbc-m .a { background: #28c878; }
#mb_root .mbc-m .e { background: rgba(240,160,48,.75); }
#mb_root .mbc-e { margin: 4px 0 0 34px; color: #7f93a8; font-size: .66rem; font-variant-numeric: tabular-nums;
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the three statements: an accordion, one page open at a time (mb_clocks.js); the page itself is the
   desktop stage's section (ltc_clocks.js LTC.renderPart, classes ltc-* of ltc_style.css) made narrow here */
#mb_root .mbl-clockcard { padding-left: 12px; padding-right: 12px; }
#mb_root .mbl-acc-s { border-top: 1px solid var(--mb-line); }
#mb_root .mbl-acc-h { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 6px 2px; text-align: left;
                      background: none; border: 0; color: var(--mb-text); }
#mb_root .mbl-acc-i { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center;
                      justify-content: center; font-size: .82rem; color: var(--mb-muted); background: rgba(255,255,255,.05);
                      border: 1px solid var(--mb-line); transition: color .2s ease, border-color .2s ease; }
#mb_root .mbl-acc-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#mb_root .mbl-acc-t { font-weight: 650; font-size: .95rem; color: var(--mb-head); }
#mb_root .mbl-acc-sub { color: var(--mb-muted); font-size: .68rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mbl-acc-ch { flex: 0 0 auto; color: var(--mb-muted); font-size: .8rem; transition: transform .22s ease; }
#mb_root .mbl-acc-s.open .mbl-acc-ch { transform: rotate(180deg); }
#mb_root .mbl-acc-s.open .mbl-acc-i { color: var(--mb-acc); border-color: rgba(240,160,48,.6); }
#mb_root .mbl-acc-s.open .mbl-acc-sub { white-space: normal; }
#mb_root .mbl-acc-b { display: none; padding: 2px 0 12px; }
#mb_root .mbl-acc-s.open .mbl-acc-b { display: block; animation: mb-in .24s ease-out; }
#mb_root .mbl-acc-b .ltc-sec { background: none; border: 0; border-radius: 0; padding: 0; }
#mb_root .mbl-acc-b .ltc-sec + .ltc-sec { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--mb-line); }
#mb_root .mbl-acc-b .ltc-sec:not(.ltc-speeds) > .ltc-sec-h { display: none; }      /* the accordion header says it */
#mb_root .mbl-acc-b .ltc-txt { right: 0; }
#mb_root .mbl-acc-b .ltc-name { font-size: .72rem; }
#mb_root .mbl-acc-b .ltc-clock.big .ltc-name { font-size: .72rem; letter-spacing: .2px; }
#mb_root .mbl-acc-b .ltc-speed { font-size: .6rem; }
#mb_root .mbl-acc-b .ltc-num { font-size: .92rem; overflow: hidden; }
#mb_root .mbl-acc-b .ltc-clock.big .ltc-num { font-size: 1.08rem; }
#mb_root .mbl-acc-b .ltc-meter, #mb_root .mbl-acc-b .ltc-clock.big .ltc-meter { width: 100%; max-width: none; min-width: 0; }
#mb_root .mbl-acc-b .ltc-estp { position: static; display: block; margin-top: 2px; font-size: .58rem; white-space: nowrap;
                                overflow: hidden; text-overflow: ellipsis; }
#mb_root .mbl-acc-b .ltc-ico { font-size: .72rem; }
#mb_root .mbl-acc-b .ltc-sp-grid { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 4px 6px; }
#mb_root .mbl-acc-b .ltc-sp-grid > :nth-child(5n + 3) { display: none; }           /* per day: not on the phone */
#mb_root .mbl-acc-b .ltc-sp-v { font-size: .68rem; }
#mb_root .mbl-acc-b .ltc-sp-n { font-size: .7rem; white-space: normal; line-height: 1.2; }
#mb_root .mbl-acc-b .ltc-sp-h { font-size: .54rem; letter-spacing: .2px; }
#mb_root .mbl-acc-b .ltc-tower { gap: 6px; margin-top: 2px; }
#mb_root .mbl-acc-b .ltc-blk { padding: 4px 6px; }
#mb_root .mbl-acc-b .ltc-blk-h { flex-wrap: wrap; gap: 2px 5px; font-size: .66rem; }
#mb_root .mbl-acc-b .ltc-blk-l { flex: 1 1 60%; }
#mb_root .mbl-acc-b .ltc-blk-v { flex: 1 1 100%; padding-left: 19px; font-size: .68rem; }
#mb_root .mbl-acc-b .ltc-blk-p { margin-left: 19px; font-size: .58rem; }
#mb_root .mbl-acc-b .ltc-bsstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* history picker + holdings list */
#mb_root .mb-dd .Select-control { background: rgba(255,255,255,.06) !important; border: 1px solid rgba(255,255,255,.14) !important;
                                  border-radius: 10px !important; min-height: 40px; }
#mb_root .mb-dd .Select-value-label, #mb_root .mb-dd .Select-placeholder { color: var(--mb-text) !important; font-size: .84rem; line-height: 38px !important; }
#mb_root .mb-dd .Select-menu-outer { background: #141a21 !important; border: 1px solid rgba(255,255,255,.15) !important; border-radius: 10px !important;
                                     z-index: 30 !important; }
#mb_root .mb-dd .VirtualizedSelectOption { color: var(--mb-text); font-size: .84rem; }
#mb_root .mb-dd .VirtualizedSelectFocusedOption { background: rgba(240,160,48,.18) !important; }
#mb_root .mb-dd .Select-arrow { border-top-color: var(--mb-muted) !important; }
#mb_root .mbl-hos { margin-top: 4px; }
#mb_root .mbl-ho { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--mb-line); }
#mb_root .mbl-ho-l { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; }
#mb_root .mbl-ho-n { color: var(--mb-muted); font-size: .74rem; }
#mb_root .mbl-ho-r { flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; }
#mb_root .mbl-ho-v { font-size: .84rem; font-weight: 600; }
#mb_root .mbl-ho-s { color: var(--mb-muted); font-size: .68rem; }
#mb_root .mbl-bs-row { margin-top: 10px; }
#mb_root .mbl-bs-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.05); }
#mb_root .mbl-bs-seg { height: 100%; min-width: 2px; border-right: 1px solid rgba(0,0,0,.45); }
#mb_root .mbl-legend { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 4px 0 8px; }
#mb_root .mbl-lg { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--mb-muted); }
#mb_root .mbl-lg b { margin-left: auto; color: var(--mb-text); font-weight: 600; font-variant-numeric: tabular-nums; }
#mb_root .mbl-lg-l { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mb_root .mbl-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
    #mb_root *, #mb_root *::before, #mb_root *::after { animation: none !important; transition: none !important; }
}
