/* ============================================================================
   UI STEP 8 (2026-10-12) — the phone: phone.js, and the phone halves of
   app.js (the Ask sheet, the drawer, the tab bar) and workbench.js (the
   Computer, in the sheet).
   ----------------------------------------------------------------------------
   The owner's Phone canvas (Phone.dc.html) is one screen: a chat under a top
   bar — the way out on the left, who is talking and the chat's name in the
   middle, a new chat on the right — the person's words as dark bubbles, each
   teammate's as a light bubble beside its lettered tile, an approval as a
   card with two full-width buttons, and a box at the foot above the home
   indicator. This file brings the Ask sheet to that screen and makes every
   page around it behave the way a phone's pages do: sheets rise from the foot
   and follow the thumb back down, the drawer slides back to its edge, the
   keyboard never covers the box, nothing sits under the tab bar or the home
   indicator, and every control a thumb reaches is 44px.

   Last in the cascade (index.html), so it is the final word at phone width
   and changes nothing above it: every rule is inside a width query or scoped
   to an element that only exists on a phone. Motion is the pack's tokens
   only — panel 240ms on the snap curve to arrive, 0.7 of that on the exit
   curve to leave, 4px and a fade for a page, and under reduced motion every
   move is an 80ms fade. Nothing with money in it springs.
   ============================================================================ */

@keyframes ph-fade-in { from { opacity: 0; } }
@keyframes ph-fade-out { to { opacity: 0; } }
@keyframes ph-view-in { from { opacity: 0; transform: translateY(4px); } }
/* The sheet's way down starts from wherever a drag let go of it (`--from`,
   set by app.js), so a sheet dragged half way does not jump back up first. */
@keyframes ph-sheet-down { from { transform: translateY(var(--from, 0px)); } to { transform: translateY(100%); } }
@keyframes ph-sheet-up { from { transform: translateY(100%); } }

/* The scrims are classes as well as ids, because motion.js plays an exit on a
   copy with the ids taken off: the copy has to look like what it copies. */
.scrim-layer { display: none; }

/* ---------- the drawer (≤820px, where the rail is an overlay) ---------------- */
@media (max-width: 820px) {
  .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 39;
    background: rgb(28 22 16 / .32);
    transition: opacity var(--dur-instant) linear;
  }
  .scrim-layer.is-entering { animation: ph-fade-in var(--dur-panel) var(--ease-snap) both; }
  .scrim-layer.is-leaving { animation: ph-fade-out calc(var(--dur-panel) * var(--dur-exit-scale)) var(--ease-exit) both; pointer-events: none; }

  /* Arrives over the panel duration on the snap curve, leaves at 0.7 of it on
     the exit curve. `visibility` waits for the slide out to finish, and is
     immediate on the way in — the rule SHELL-11 found (a drawer still
     `visibility: hidden` on its first frame cannot take focus). */
  #sidebar {
    transition:
      transform calc(var(--dur-panel) * var(--dur-exit-scale)) var(--ease-exit),
      visibility 0s linear calc(var(--dur-panel) * var(--dur-exit-scale));
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    padding-left: calc(10px + env(safe-area-inset-left));
    box-shadow: 0 0 0 1px var(--line), 12px 0 40px -24px rgb(28 22 16 / .35);
    overscroll-behavior: contain;
  }
  #app.nav-open #sidebar { transition: transform var(--dur-panel) var(--ease-snap), visibility 0s; }
  /* While a finger holds it, the drawer is where the finger is — no easing
     between the finger and the glass. */
  #sidebar.is-dragging, #app.nav-open #sidebar.is-dragging { transition: none; }
}

/* ---------- the tab bar, the top bar, the pages (≤720px) ------------------- */
@media (max-width: 720px) {
  /* The top bar clears the status bar and the notch. */
  #topbar { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: calc(10px + env(safe-area-inset-left)); padding-right: calc(10px + env(safe-area-inset-right)); }
  /* The canvas's menu button: a 44px round target with the glyph alone, not a
     bordered square beside round neighbours. */
  #topbar #nav-toggle {
    width: 44px; height: 44px; padding: 0; justify-content: center;
    border-radius: 999px; border-color: transparent; background: transparent; box-shadow: none;
  }
  #topbar #nav-toggle .ic { width: 22px; height: 22px; }
  #topbar #nav-toggle:active { background: color-mix(in srgb, var(--text) 7%, transparent); }
  /* A disabled Stop beside an idle status is a control with nothing to stop.
     The composer has its own Stop while a turn runs, under the thumb; the top
     bar's comes back the moment there is something to stop. */
  #topbar #interrupt:disabled { display: none; }

  /* The drawer carries what the tab bar has no room for. Results and the
     Calendar (UI step 7) are pages, not settings, so they lead it — under the
     mark, above the team — and the rest of the destinations group stays off,
     because those are on the bar. Spaces joined them on 2026-10-27: it has
     no tab, so hiding its row left the Shop page's card as the only way in
     on a phone (found by the #259 review). It stays `hidden` while Spaces is
     off, so the drawer is unchanged there. Its clause in the divider rule
     changes nothing today, because Results and Calendar are never hidden; it
     is there so a lone Spaces row keeps the divider if either one ever is. */
  #sidebar .side-group { display: flex; }
  #sidebar .side-group > .side-item:not(#results-nav, #calendar-nav, #spaces-nav) { display: none; }
  #sidebar .side-group:has(> #results-nav:not([hidden]), > #calendar-nav:not([hidden]), > #spaces-nav:not([hidden])) {
    padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
  }

  /* The bar. Every item a full 44px, pressed the way a key is (.96 for the
     instant duration), lit over the quick one. */
  .tabbar-item {
    min-height: var(--tap-min, 44px);
    transition: background-color var(--dur-quick) var(--ease-snap), color var(--dur-quick) var(--ease-snap), transform var(--dur-instant) var(--ease-snap);
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar-item:active { transform: scale(.96); }
  .tabbar-ask .btn-play { transition: transform var(--dur-instant) var(--ease-snap); -webkit-tap-highlight-color: transparent; }
  .tabbar-ask .btn-play:active { transform: scale(.96); }
  /* The keyboard takes the bottom of the screen, so the bar steps out of its
     way rather than riding up on top of it. It is fixed, so nothing on the
     page moves when it goes or comes back. */
  #tabbar { transition: transform var(--dur-base) var(--ease-snap), visibility 0s; }
  :root.kb-open #tabbar {
    transform: translateY(calc(100% + 24px)); visibility: hidden;
    transition: transform calc(var(--dur-base) * var(--dur-exit-scale)) var(--ease-exit), visibility 0s linear calc(var(--dur-base) * var(--dur-exit-scale));
  }
  /* The bar floats 12px over the safe area; the page reserves that and the bar
     both, so the last row of any page scrolls clear of it. */
  #main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  /* A tab switch: the page arrives from 4px with a fade, 160ms — never a pane
     sliding across (the motion pack's tab switch). */
  #main.is-entering > section { animation: ph-view-in 160ms var(--ease-snap) backwards; }

  /* Today's box rides above the bar, never under it: the slot is sticky at the
     page's foot, and the page's foot is the bar's top. */
  #today-composer-slot, #shop-composer-slot { padding-bottom: 12px; }

  /* ---------- pages: a thumb's 44px, and nothing clipped ---------- */
  /* Today: the period chips and the panel's tabs. */
  .td-range button, .td-period button, .tdp-tab, .tdp-tabs [role="tab"] { min-height: 44px; }
  .tdp-watch { min-height: 44px; min-width: 64px; }
  .tdp-open { min-height: 48px; }
  /* Hire: the describe box shows its whole example — three lines, not one
     clipped mid-sentence. */
  .hire-describe textarea, #hire-describe { min-height: 96px; }
  /* Results and the Calendar: the month arrows, the view switch and the
     filters. */
  .cal-nav button, .cal-arrow, .cal-views button, [data-cal-view], .rs-filters button, .rs-chip { min-height: 44px; min-width: 44px; }
  /* Library: a file's small actions. */
  #files-view .pin, .file-card .pin, #recent-list .pin { min-width: 44px; min-height: 44px; }
  /* Team and Hire: a role's Hire or Settings, and a card's own buttons. */
  #cw-pane .hire-foot :is([data-add-preset], [data-preset-settings]) { min-height: 44px; padding-left: 16px; padding-right: 16px; }
  /* Customize: the ask line and the connections search, each a whole 44px
     row; the ask line's arrow keeps its 28px dot but takes a 44px press. */
  .cz-ask { min-height: 44px; box-sizing: border-box; }
  .cz-ask-go { position: relative; }
  .cz-ask-go::after { content: ""; position: absolute; inset: -8px; border-radius: 999px; }
  .conn-search { min-height: 44px; box-sizing: border-box; }
  /* Settings: its section chips and "Find a setting". */
  .set-nav-item { min-height: 44px; }
  .settings-form label.set-find { height: 44px; }
  /* Spending → Your monthly cap: a thumb's 44px for the field and both
     buttons, the field taking the row's width so the buttons sit under it, and
     16px type so the browser does not zoom the page when the field takes focus. */
  .settings-form #monthly-cap .mc-field { flex: 1 1 100%; }
  .settings-form #monthly-cap .mc-field input { height: 44px; font-size: 16px; }
  #monthly-cap .mc-acts { flex: 1 1 100%; }
  #monthly-cap .mc-acts > button { min-height: 44px; flex: 1 1 auto; }

  /* The rest the phone QA pass measured short of 44 (2026-10-14, at 430):
     each grows its press, not what it looks like, wherever the row allows. */
  /* Customize's tabs were 43. */
  .cz-tab { min-height: 44px; }
  /* The ask line's box was 30px inside its 44px row, so a tap on the row
     above or below the words missed it. The row's height moves to the box,
     over the row's 1px border too: the box has no fill to cover it with. */
  .cz-ask { padding-top: 0; padding-bottom: 0; }
  .cz-ask input { min-height: 44px; margin-top: -1px; margin-bottom: -1px; }
  /* Memory's search (40), Goals' new-goal box (39), the Search palette's box
     (27 inside a 55px row — the row's padding moves into the box). */
  #mem-search, .gd-newgoal input { min-height: 44px; }
  .pal-box { padding-top: 6px; padding-bottom: 6px; }
  .pal-box input { min-height: 44px; }
  /* A fold's word — an approval's "What will run" (22), a teammate's
     Advanced (21) — is the whole of its control. */
  .approval .ap-detail > summary, .cw-advanced > summary { min-height: 44px; padding-top: 11px; padding-bottom: 11px; }
  /* Settings' two links in running text — "Customize" in the intro and
     "Keyboard shortcuts" (22 each). The padding is the press; the negative
     margin gives it back, so the line they sit on does not grow. Shortcuts
     stays: a phone with a keyboard attached still has them. */
  #set-to-customize, #open-shortcuts { display: inline-block; padding-top: 11px; padding-bottom: 11px; margin-top: -11px; margin-bottom: -11px; }
  /* Welcome's "Skip for now" (34). */
  #welcome-skip { min-height: 44px; }
}

/* The drawer's rows, a full 44px each: at 35px they were the smallest
   targets left on the phone, and the drawer is all targets. */
@media (max-width: 820px) {
  .rail .side-item { min-height: 44px; box-sizing: border-box; }
}

/* ---------- the Ask sheet (≤720px) ----------------------------------------- */
@media (max-width: 720px) {
  #sheet-scrim {
    display: block; position: fixed; inset: 0; z-index: 44;
    background: rgb(28 22 16 / .28);
  }
  .sheet-scrim { position: fixed; inset: 0; z-index: 44; background: rgb(28 22 16 / .28); }
  .sheet-scrim.is-leaving { display: block; }

  /* A page sheet: off the top by 10px and the status bar, so the dimmed page
     behind shows it is over something; lifted by the keyboard (`--kb`,
     phone.js) in a browser that slides the keys over the page. */
  #sheet {
    top: calc(10px + env(safe-area-inset-top)); bottom: var(--kb, 0px);
    background: var(--window-2);
    animation: ph-sheet-up var(--dur-sheet) var(--ease-sheet);
    --cl-gut: 38px; --cl-av: 30px;
  }
  #sheet.is-leaving { animation: ph-sheet-down calc(var(--dur-panel) * var(--dur-exit-scale)) var(--ease-exit) both; }
  /* No `animation: none` here: taking it off on the let-go replayed the
     opening, so the sheet dropped and rose again (phone QA, 2026-10-14).
     phone.js finishes the opening when a drag is claimed instead. */
  #sheet.is-dragging { transition: none; }

  /* The head: the grabber, then the canvas's top bar. */
  #sheet-head {
    padding: 4px 6px 4px; min-height: 44px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    touch-action: none; user-select: none; -webkit-user-select: none;
  }
  #sheet-grab { width: 36px; height: 5px; border-radius: 3px; margin: 2px auto 2px; }
  /* Kept for a reader; the grabber is the visible promise. */
  #sheet-hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sheet-bar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; }
  .sheet-ic {
    width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
    border: 0; border-radius: 999px; background: transparent; color: var(--text); cursor: pointer;
    transition: background-color var(--dur-instant) var(--ease-snap), transform var(--dur-instant) var(--ease-snap);
    -webkit-tap-highlight-color: transparent;
  }
  .sheet-ic .ic { stroke-width: 1.8; }
  .sheet-ic:active { background: color-mix(in srgb, var(--text) 7%, transparent); transform: scale(.96); }
  .sheet-ic:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
  .sheet-who { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
  .sheet-faces { display: flex; }
  .sheet-faces[hidden] { display: none; }
  #sheet .sheet-face {
    position: static; width: 24px; height: 24px; border-radius: 8px; font-size: 11px;
    box-shadow: 0 0 0 2px var(--window-2);
  }
  #sheet .sheet-face + .sheet-face { margin-left: -6px; }
  .sheet-title {
    max-width: 100%; font-size: 13.5px; font-weight: 500; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* ---- the conversation, as the canvas draws it ---- */
  #sheet-chat .stream { padding: 16px 14px 12px; gap: 14px; }
  /* Both sides at 16px (2026-11-17, were 15): the reading size on a phone,
     and the floor below which a long answer is the thing people zoom. */
  #sheet .stream .msg.user {
    align-self: flex-end; max-width: 82%;
    background: var(--btn-ink); color: var(--on-btn-ink); border: 0;
    border-radius: 18px 18px 6px 18px; padding: 10px 13px;
    font-size: 16px; line-height: 1.45;
  }
  #sheet .stream .msg.agent {
    align-self: flex-start; width: auto; max-width: calc(100% - var(--cl-gut));
    background: var(--paper); border: 0;
    border-radius: 6px 18px 18px 18px; padding: 10px 13px;
    font-size: 16px; line-height: 1.5;
  }
  #sheet .stream .msg.agent > :first-child { margin-top: 0; }
  #sheet .stream .msg.agent > :last-child { margin-bottom: 0; }
  /* Everything the other side shows sits right of its tile, as on a desktop
     (chat-shell.css), with the phone canvas's 38px gutter. */
  #sheet .stream > :not(.msg.user, .msg-actions.for-question, .turnbar, .brief, .who) { margin-left: var(--cl-gut); }
  #sheet .stream > :is(.steps, .coworker-card, .devy-card, .delegation, .approval, .failbar) { max-width: none; width: auto; align-self: stretch; }
  /* Who is speaking: the name over the bubble, the tile beside it. */
  #sheet .who { position: relative; padding-left: var(--cl-gut); gap: 0; margin: 4px 0 -9px; min-height: 18px; }
  #sheet .who-name { font-size: 12px; }
  #sheet .stream .who-av { position: absolute; left: 0; top: 23px; width: var(--cl-av); height: var(--cl-av); border-radius: 9px; font-size: 12px; }
  /* Tables: the quiet grid, scrolling inside the bubble. */
  #sheet .msg.agent .md-table { margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
  #sheet .msg.agent table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 0; border: 0; background: transparent; font-size: 13.5px; font-variant-numeric: tabular-nums; }
  #sheet .msg.agent th { font: 500 12px/1.3 var(--f-body); letter-spacing: normal; text-transform: none; color: var(--dim); text-align: left; padding: 9px 11px; background: var(--card-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
  #sheet .msg.agent td { padding: 9px 11px; border-bottom: 1px solid var(--line); }
  #sheet .msg.agent tr:last-child td { border-bottom: 0; }

  /* The approval: the canvas's card, two buttons sharing the width, each a
     full 44px. Approve and Reject keep their words and their order. */
  #sheet #needs-dock { padding: 2px 14px 8px; }
  #sheet #needs-dock > :is(.approval, .goal-ask, .nd-head) { margin: 0 0 0 var(--cl-gut); width: auto; max-width: none; align-self: stretch; box-shadow: none; }
  #sheet #needs-dock > .approval { border-radius: 14px; padding: 13px; }
  #sheet .approval .ap-actions { display: flex; gap: 8px; }
  #sheet .approval :is(.ap-yes, .ap-no) { flex: 1 1 0; min-height: 44px; border-radius: 10px; font-size: 14px; }
  /* With the keyboard up a waiting approval folds to one line (needs-dock.js),
     in the card's own colours: what it asks, ellipsed, and "Approve or reject"
     on the right. The model
     list's own fold (data-yield) wins where both apply, being the newer ask. */
  #needs-dock[data-fold]:not([data-yield]) > :not(.nd-fold) { display: none !important; }
  .nd-fold {
    display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 0 var(--cl-gut); padding: 5px 5px 5px 12px;
    border: 1px solid color-mix(in srgb, var(--fill-honey) 45%, var(--line)); border-radius: 14px;
    background: var(--honey-tint); color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
    animation: cl-rise var(--dur-quick) var(--ease-snap) both; -webkit-tap-highlight-color: transparent;
  }
  .nd-fold-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .nd-fold-act {
    flex: none; padding: 7px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
    background: color-mix(in srgb, var(--fill-honey) 22%, transparent); color: var(--sun-ink);
  }
  .nd-fold:active { transform: scale(.98); }
  .nd-fold:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

  /* ---- the foot: what is running, the chips, the box ---- */
  #sheet-foot { background: var(--window-2); border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  #sheet-tabs { padding: 8px 12px 6px; scrollbar-width: none; overscroll-behavior-x: contain; }
  #sheet-tabs::-webkit-scrollbar { display: none; }
  .schip {
    min-height: 44px;
    transition: background-color var(--dur-quick) var(--ease-snap), border-color var(--dur-quick) var(--ease-snap), color var(--dur-quick) var(--ease-snap), transform var(--dur-instant) var(--ease-snap);
    -webkit-tap-highlight-color: transparent;
  }
  .schip:active { transform: scale(.96); }
  #sheet-runstrip { min-height: 44px; }
  /* Above the home indicator, and only by as much as it needs: with the
     keyboard up the indicator is under the keys, so the box sits on them. */
  #sheet-dock { padding: 0 12px calc(12px + env(safe-area-inset-bottom)); }
  :root.kb-open #sheet-dock { padding-bottom: 8px; }
  #sheet-dock .composer { border-radius: 22px; }

  /* The workbench pane in the sheet — a run, a file, the Computer — gets the
     same side gutters as the stream and clears the foot. */
  #sheet-wb { padding: 12px 14px 16px; overscroll-behavior: contain; }

  /* ---- the stand-ins that ride the sheet down (app.js `closeSheet`) ---- */
  #sheet .sheet-standin:not(form) { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
  #sheet .sheet-standin .stream { overflow: hidden; }
}

/* ---------- the other sheets: Settings and every dialog, the model list, a
   calendar day (≤720px) -------------------------------------------------------
   Each already rose from the foot. Now each has the grabber it promises, goes
   back down the way it came — from where a drag let go, at 0.7 of its
   entrance on the exit curve — and puts its ✕ at a thumb's 44px. */
@keyframes ph-pop-down { from { transform: translateY(var(--from, 0px)); } to { opacity: 0; transform: translateY(calc(var(--from, 0px) + 16px)); } }
@media (max-width: 720px) {
  dialog[open] { animation: ph-sheet-up var(--dur-sheet) var(--ease-sheet); }
  dialog[open]::backdrop { animation: ph-fade-in var(--dur-panel) var(--ease-snap); }
  dialog.is-leaving { animation: ph-sheet-down calc(var(--dur-panel) * var(--dur-exit-scale)) var(--ease-exit) both; }
  dialog.is-leaving::backdrop { animation: ph-fade-out calc(var(--dur-panel) * var(--dur-exit-scale)) var(--ease-exit) both; }
  /* A dragged dialog has no `animation: none` either, for the sheet's reason
     above: Settings went 106 → 380 → 122 on a short drag's let-go. */
  .dlg-head::before { width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; }
  .dlg-head .x, .setup-x { width: 44px; height: 44px; border-radius: 999px; }

  .model-pop:not(.over-dock) { padding-top: 22px; border-radius: 18px 18px 0 0; overscroll-behavior: contain; }
  .model-pop:not(.over-dock)::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 5px; margin-left: -18px;
    border-radius: 3px; background: var(--line-2);
  }
  .model-pop:not(.over-dock).is-leaving { animation: ph-sheet-down calc(var(--dur-panel) * var(--dur-exit-scale)) var(--ease-exit) both; }
  .model-pop.is-dragging, .cal-pop.is-dragging { animation: none; }

  .cal-pop { overscroll-behavior: contain; }
  .cal-pop-head { padding-top: 20px; }
  .cal-pop-head::before {
    content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px;
    border-radius: 3px; background: var(--line-2);
  }
  .cal-pop.is-leaving { animation: ph-pop-down calc(var(--dur-panel) * var(--dur-exit-scale)) var(--ease-exit) both; }
  .cal-pop-x { width: 44px; height: 44px; }
}

/* ---------- Scout's browser at phone width (item 63 b, live-browser.js) ---- */
@media (max-width: 720px) {
  /* The whole width of the conversation: the speaker's gutter would leave a
     picture of a web page 300px wide on a 390px phone. */
  #sheet #stream > .lb, #sheet #stream > .lb-slot { margin-left: 0; max-width: none; width: auto; align-self: stretch; }
  /* A thumb's size, every control (the platform minimum is 44px). */
  .lb-head { min-height: 52px; padding: 4px 4px 4px 12px; }
  .lb-btn { min-height: 44px; min-width: 44px; justify-content: center; padding: 0 10px; }
  /* "Open in a new tab" is its icon here (its name stays its label): the
     words would push the title to nothing at 390px. */
  .lb-open .lb-word { display: none; }
  /* Full screen over the app, inside the safe areas: the head under the
     status bar's inset, the frame above the home indicator's. */
  .lb.is-expanded.is-phone {
    inset: 0; width: auto; height: auto; border: 0; border-radius: 0; box-shadow: none;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--card);
  }
  .lb.is-expanded.is-phone .lb-screen { border-top: 1px solid var(--line); }
}

/* ---------- reduced motion: every move an 80ms fade ------------------------ */
@media (prefers-reduced-motion: reduce) {
  @media (max-width: 820px) {
    #sidebar, #app.nav-open #sidebar {
      transform: none; transition: opacity 80ms linear, visibility 0s linear 80ms;
    }
    #sidebar { opacity: 0; }
    #app.nav-open #sidebar { opacity: 1; transition: opacity 80ms linear, visibility 0s; }
    .scrim-layer.is-entering { animation: ph-fade-in 80ms linear both; }
    .scrim-layer.is-leaving { animation: ph-fade-out 80ms linear both; }
  }
  @media (max-width: 720px) {
    #sheet { animation: ph-fade-in 80ms linear; }
    #sheet.is-leaving { animation: ph-fade-out 80ms linear both; }
    dialog[open], dialog[open]::backdrop { animation: ph-fade-in 80ms linear; }
    dialog.is-leaving, dialog.is-leaving::backdrop { animation: ph-fade-out 80ms linear both; }
    .model-pop:not(.over-dock).is-leaving, .cal-pop.is-leaving { animation: ph-fade-out 80ms linear both; }
    #main.is-entering > section { animation: ph-fade-in 80ms linear backwards; }
    #tabbar, :root.kb-open #tabbar { transition: none; }
    .tabbar-item, .tabbar-ask .btn-play, .schip, .sheet-ic { transition: none; }
    .tabbar-item:active, .tabbar-ask .btn-play:active, .schip:active, .sheet-ic:active, .nd-fold:active { transform: none; }
    .nd-fold { animation: ph-fade-in 80ms linear both; }
  }
}

/* ---------- the bar's More (sidebar slice 5, 2026-10-29) -----------------
   Slice 5 drew one bar per mode here, each item naming its modes in
   `data-modes` and the mode on #app taking the others away. The Agent | Work
   switch was retired on 2026-10-31 (it only hid places and turned on the Ask
   Scout companion, which is now on everywhere), so every item is drawn and
   the attribute and its rules went with it. */
#more-sheet { display: none; }

@media (max-width: 720px) {
  /* The raised slot takes the 2px a side the tab buttons pad with, so every
     slot of the bar is one width and the bar balances (ui:flows phone-bars). */
  .tabbar-ask { padding: 0 2px; }
  #more-scrim { z-index: 46; }
  /* Rises from the bar: anchored to the bottom edge above the bar's own
     layer, so it reads as coming out of the More it was opened from. */
  #more-sheet {
    display: flex; flex-direction: column;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 47;
    max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--window-2, var(--surface)); border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px -24px rgb(28 22 16 / .45);
    padding: 0 8px calc(12px + env(safe-area-inset-bottom));
    animation: ph-sheet-up var(--dur-sheet) var(--ease-sheet);
  }
  #more-sheet[hidden] { display: none; }
  #more-sheet.is-leaving { animation: ph-sheet-down var(--dur-quick) var(--ease-exit) both; pointer-events: none; }
  #more-sheet.is-dragging { transition: none; }
  /* The swipe target clears 44px, as the Ask sheet's head does. */
  #more-head { min-height: 44px; padding: 6px 8px 2px; box-sizing: border-box; touch-action: none; }
  .more-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 4px auto 8px; }
  #more-title { margin: 0 8px 4px; font-size: var(--t-sm, 13px); font-weight: 600; color: var(--dim); }
  #more-list { display: flex; flex-direction: column; }
  .more-item {
    display: flex; align-items: center; gap: 12px; min-height: 44px; box-sizing: border-box;
    width: 100%; padding: 0 12px; border: 0; border-radius: 12px; background: none;
    font: inherit; font-size: 15px; color: var(--text); text-align: left; cursor: pointer;
  }
  .more-item:active, .more-item:focus-visible { background: var(--card-2, var(--surface-2)); }
  .more-item .ic { width: 20px; height: 20px; flex: none; color: var(--dim); }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  #more-sheet { animation: ph-fade-in 80ms linear; }
  #more-sheet.is-leaving { animation: ph-fade-out 80ms linear both; }
}
