@layer tokens, base, ui, shell, surface;
/* The phone shell (shells/phone): the original's floating bar (install.css phone-tabs), its places kit
   (phone-places.css: places, rows, cards, tabs grid) and the mobile window and run-dock rules. Kit
   classes (ph-*) are free for surfaces to use on the phone. */
@layer shell {
  .phone-tabs {
    display: none;
  }

  /* The bar (docs/mobile.md): a raised capsule floating over the bottom of the screen —
     Home · Tabs · the mark · Find (Find takes the right half, so the mark stays in the middle). The strip around it is the face's own colour, so the
     capsule reads as lifted off whatever shows above it. */
  .os-ui.is-mobile.has-phone-home .os-bar {
    overflow: visible;
    padding: 6px max(14px, env(safe-area-inset-right, 0px))
      max(8px, var(--os-mobile-safe-bottom)) max(14px, env(safe-area-inset-left, 0px));
    min-height: calc(76px + var(--os-mobile-safe-bottom));
    background: var(--ph-solid-face, var(--color-surface));
    border-top: 0;
  }

  .os-ui.is-mobile.has-phone-home .os-bar > :not(.phone-tabs) {
    display: none;
  }



  .os-ui.is-mobile.has-phone-home .phone-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    height: 64px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-surface-raised) 88%, transparent);
    border: var(--line-width) solid var(--color-border);
    box-shadow: 0 10px 30px var(--color-shadow-strong), 0 1px 2px var(--color-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
  }

  .phone-tabs__tab[data-place="find"] {
    grid-column: span 2;
  }

  .phone-tabs__tab {
    position: relative;
    display: flex;
    min-width: 0;
    height: 52px;
    margin: 0 2px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
    color: var(--color-ink-secondary);
    font: var(--weight-medium, 500) 11px / 1 var(--font-sans);
    -webkit-tap-highlight-color: transparent;
    transition: background var(--dur-control, 160ms) ease, color var(--dur-control, 160ms) ease;
  }

  .phone-tabs__tab.is-on {
    background: var(--color-wash);
    color: var(--color-accent-text);
  }

  .phone-tabs__tab:focus-visible {
    outline: var(--focus-outline);
    outline-offset: -4px;
  }

  /* Tabs: the open count inside the glyph's front card. */
  .phone-tabs__count {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
  }

  .phone-tabs__count > b {
    position: absolute;
    left: 7px;
    top: 9px;
    width: 13px;
    text-align: center;
    font: 600 9px / 10px var(--font-mono);
  }

  .phone-tabs__badge {
    position: absolute;
    top: 3px;
    left: calc(50% + 5px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--color-measure);
    color: var(--color-on-accent);
    font: 600 10px / 16px var(--font-mono);
    text-align: center;
  }

  .phone-tabs__badge[hidden] {
    display: none;
  }

  /* The middle slot: the mark on a raised disc over a soft pine glow (the rail's mark). */
  .phone-tabs__center {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
  }

  .phone-tabs__center::before {
    content: "";
    position: absolute;
    width: 76px;
    height: 76px;
    border-radius: var(--radius-pill);
    background: radial-gradient(circle, color-mix(in srgb, var(--color-accent-fill) 18%, transparent) 0%,
        transparent 68%);
    pointer-events: none;
  }

  .phone-tabs__center > .os-bar__button {
    position: relative;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin: 0;
    border-radius: var(--radius-pill);
    background: var(--color-surface-raised);
    border: var(--line-width) solid var(--color-border);
    box-shadow: 0 2px 8px var(--color-shadow);
    color: var(--color-ink);
  }

  /* The original measures 44px here: its touch-size rule wins over the 50px above. */
  .phone-tabs__center > .os-bar__button {
    width: 44px;
    height: 44px;
  }
  .phone-tabs__center > .os-bar__button .gm {
    width: 32px;
    height: 32px;
  }
  /* The phone home's places (install/phoneHome.js): Home (homePlace.js), Tabs (phoneTabs.js),
     Chats (phoneChats.js), Find (phoneFind.js), Schedule (phoneSchedule.js) and a task's page
     (phoneTasks.js). Phone only: the places mount inside the
     shell's `is-mobile` desktop, and the task page is a kit page (mobile-kit.css .mk-page).
     Amber (measure) is "needs you"; pine (act) is "working" and the one thing to press. */

  .phone-places {
    display: contents;
  }



  /* ---- a place: large title, then a scrolling body ----------------------------------------- */

  /* The face, always opaque: on glass the face colour is see-through, so it is laid over the
     (solid) desk colour. A place and a task page cover what is under them completely. */
  :root {
    --ph-solid-face: linear-gradient(var(--color-surface), var(--color-surface)) var(--color-bg);
  }

  .ph-place {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--ph-solid-face);
    color: var(--color-ink);
  }

  .ph-place[hidden] {
    display: none;
  }



  .ph-place__head {
    /* A long body must not squeeze the header. */
    flex: none;
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    min-height: 56px;
    padding: var(--space-3) var(--space-3) var(--space-2) var(--pt-gutter, 16px);
  }

  .ph-place__heading {
    display: grid;
    flex: 1 1 auto;
    justify-items: start;
    gap: var(--space-1);
    min-width: 0;
  }

  .ph-place__title {
    flex: 1 1 auto;
    margin: 0;
    font: 700 var(--pt-large-title, 28px) / 1.15 var(--font-display);
    letter-spacing: -0.01em;
  }

  .ph-place__body {
    position: relative;
    display: grid;
    flex: 1 1 auto;
    align-content: start;
    gap: var(--space-5);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-2) var(--pt-gutter, 16px)
      calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  }

  /* The think tank, above the title: one tap opens the switcher. */
  .ph-tank {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    max-width: 100%;
    min-height: 30px;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-fill);
    color: var(--color-ink-secondary);
    font: 500 var(--pt-footnote, 13px) / 1 var(--font-sans);
  }

  .ph-tank > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ph-me {
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
  }

  .ph-me .avatar {
    width: 40px;
    height: 40px;
  }

  .ph-link {
    min-height: 44px;
    padding: 0 var(--space-2);
    border: 0;
    background: none;
    color: var(--color-accent-text);
    font: 600 var(--pt-footnote, 13px) / 1 var(--font-sans);
    -webkit-tap-highlight-color: transparent;
  }

  .ph-link[hidden] {
    display: none;
  }

  .ph-round {
    display: grid;
    flex: none;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-fill);
    color: var(--color-ink);
  }

  .ph-round.is-primary {
    background: var(--color-accent-fill);
    color: var(--color-on-accent);
  }

  .ph-btn {
    display: inline-flex;
    justify-self: start;
    align-items: center;
    gap: var(--space-2);
    min-height: 40px;
    padding: 0 var(--space-4);
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-fill);
    color: var(--color-ink);
    font: 500 var(--pt-subhead, 14px) / 1 var(--font-sans);
  }

  .ph-btn.is-primary {
    background: var(--color-accent-fill);
    color: var(--color-on-accent);
    font-weight: 600;
  }

  .ph-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* ---- sections and cards ------------------------------------------------------------------ */

  .ph-section {
    display: grid;
    gap: var(--space-2);
  }

  .ph-section[hidden] {
    display: none;
  }

  .ph-section__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .ph-section__title {
    margin: 0 var(--space-1);
    color: var(--color-ink);
    font: 600 16px / 1.25 var(--font-display);
  }

  .ph-section--needs > .ph-section__title {
    color: var(--color-measure-text);
  }

  .ph-section--running > .ph-section__title {
    color: var(--color-accent-text);
  }

  .ph-card {
    display: grid;
    overflow: hidden;
    border: var(--line-width) solid var(--color-border-soft);
    border-radius: 16px;
    background: var(--color-surface-raised);
  }

  .ph-card:empty {
    display: none;
  }

  .ph-card--earlier {
    margin-top: var(--space-2);
  }

  .ph-earlier {
    justify-self: start;
  }

  /* ---- rows -------------------------------------------------------------------------------- */

  .ph-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: 60px;
    padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
    border: 0;
    background: var(--color-surface-raised);
    color: var(--color-ink);
    font: inherit;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }

  .ph-row + .ph-row::before {
    position: absolute;
    top: 0;
    right: 0;
    left: var(--space-4);
    z-index: 1;
    height: 1px;
    background: var(--color-border-soft);
    content: "";
  }

  button.ph-row:active,
  .ph-row__open:active {
    background: var(--color-fill);
  }

  .ph-row__when {
    flex: none;
    width: 62px;
    font: 600 var(--pt-footnote, 13px) / 1.2 var(--font-sans);
    font-variant-numeric: tabular-nums;
  }

  .ph-row.is-due .ph-row__when {
    color: var(--color-measure-text);
  }

  .ph-row__main {
    display: grid;
    flex: 1 1 auto;
    gap: 2px;
    min-width: 0;
  }

  .ph-row__open {
    align-self: stretch;
    align-content: center;
    margin: calc(-1 * var(--space-2)) 0;
    padding: var(--space-2) 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
  }

  .ph-row__title {
    overflow: hidden;
    font: 500 var(--pt-callout, 15px) / 1.3 var(--font-sans);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ph-row__title.is-done {
    color: var(--color-ink-faint);
    text-decoration: line-through;
  }

  .ph-row__meta {
    overflow: hidden;
    color: var(--color-ink-faint);
    font: 400 var(--pt-caption, 12px) / 1.3 var(--font-sans);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ph-row__meta.is-warn {
    color: var(--color-measure-text);
  }

  .ph-row__chevron,
  .ph-row__glyph {
    display: grid;
    flex: none;
    color: var(--color-ink-faint);
  }


  /* ---- quiet text -------------------------------------------------------------------------- */

  .ph-hint {
    margin: 0 var(--space-1);
    color: var(--color-ink-faint);
    font: 400 var(--pt-footnote, 13px) / 1.4 var(--font-sans);
  }

  .ph-empty {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-6) var(--space-4);
    text-align: center;
  }

  .ph-empty__title {
    margin: 0;
    font: 600 var(--pt-headline, 17px) / 1.3 var(--font-sans);
  }

  .ph-empty__text,
  .ph-loading,
  .ph-empty-line {
    margin: 0;
    color: var(--color-ink-faint);
    font: 400 var(--pt-subhead, 14px) / 1.4 var(--font-sans);
  }

  .ph-loading {
    padding: var(--space-6) 0;
    text-align: center;
  }
  /* ---- shared bits ------------------------------------------------------------------------- */

  /* A mono eyebrow: dates, group labels. */
  .ph-eyebrow {
    margin: 0;
    color: var(--color-ink-faint);
    font: 500 11px / 1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  /* A slim top row (Home): the think tank on the left, you on the right. */
  .ph-place__bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 56px;
    padding: var(--space-1) var(--space-3) 0 var(--pt-gutter, 16px);
  }

  .ph-place__bar > .ph-tank {
    min-height: 38px;
    margin-right: auto;
    color: var(--color-ink);
    font-weight: 600;
    font-size: 14px;
  }

  .ph-place__heading--row {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
  }

  .ph-place__count {
    color: var(--color-ink-faint);
    font: 400 13px / 1 var(--font-sans);
  }

  .ph-empty[hidden] {
    display: none;
  }

  .ph-place__head > .ph-btn {
    align-self: center;
  }

  .ph-place__head > .ph-btn[hidden],
  .ph-tabgrid[hidden] {
    display: none;
  }

  /* ---- Home -------------------------------------------------------------------------------- */

  .ph-home__title {
    display: grid;
    gap: var(--space-2);
    margin-bottom: calc(-1 * var(--space-2));
  }

  .ph-home__title > .ph-place__title {
    font-size: 26px;
    font-weight: 600;
  }

  .ph-places {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .ph-place-tile {
    position: relative;
    display: flex;
    min-width: 0;
    height: 76px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 4px;
    border: 0;
    border-radius: 14px;
    background: var(--color-surface-raised);
    box-shadow: 0 1px 2px var(--color-shadow);
    color: var(--color-ink);
    font: 500 12px / 1.1 var(--font-sans);
    -webkit-tap-highlight-color: transparent;
  }

  .ph-place-tile > svg {
    color: var(--kind);
  }

  .ph-place-tile > span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ph-place-tile:active {
    transform: scale(0.97);
  }

  .ph-place-tile__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--color-accent-fill);
    color: var(--color-on-accent);
    font: 600 10px / 18px var(--font-mono);
    text-align: center;
  }

  /* ---- Tabs -------------------------------------------------------------------------------- */

  .ph-tabs {
    background: var(--color-bg);
  }

  .ph-tabgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .ph-tabcard {
    position: relative;
    min-width: 0;
    border-radius: 18px;
    background: var(--color-surface-raised);
    box-shadow: 0 1px 2px var(--color-shadow);
    overflow: hidden;
  }

  .ph-tabcard__open {
    display: grid;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-ink);
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }

  .ph-tabcard__open:active {
    opacity: 0.85;
  }

  .ph-tabcard__pic {
    display: grid;
    height: 132px;
    place-items: center;
    overflow: hidden;
    background: color-mix(in srgb, var(--kind) 10%, var(--color-surface));
    color: var(--kind);
  }

  .ph-tabcard__pic.has-thumb {
    background: var(--color-surface);
  }

  .ph-tabcard__foot {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    padding: 10px 10px 12px;
  }

  .ph-tabcard__glyph {
    flex: none;
    color: var(--kind);
  }

  .ph-tabcard__text {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .ph-tabcard__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 500 13px / 1.2 var(--font-sans);
  }

  .ph-tabcard__kind {
    color: var(--color-ink-faint);
    font: 400 11px / 1.2 var(--font-mono);
  }

  /* × sits on the picture's corner: a full 44px target, a small visible disc. */
  .ph-tabcard__close {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-ink-secondary);
  }

  .ph-tabcard__close > svg {
    box-sizing: content-box;
    padding: 5px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-surface-raised) 86%, transparent);
    box-shadow: 0 1px 3px var(--color-shadow);
  }

  /* "Opened by Geist": a pine dot and a rule, as after the desktop bar's rule. */
  .ph-rule {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }

  .ph-rule .ph-section__title {
    margin: 0;
    font-size: 14px;
  }

  .ph-rule__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--color-accent-fill);
  }

  .ph-rule__line {
    flex: 1;
    height: var(--line-width);
    background: var(--color-border);
  }

  .ph-rule__meta {
    color: var(--color-ink-faint);
    font: 400 11px / 1 var(--font-mono);
  }

  /* ---- Find -------------------------------------------------------------------------------- */

  .ph-find__head {
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-3) var(--space-2) var(--pt-gutter, 16px);
  }

  .ph-find__field {
    display: flex;
    flex: 1;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    height: 44px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--color-surface-raised);
    box-shadow: 0 1px 2px var(--color-shadow), 0 0 0 var(--line-width) var(--color-border);
    color: var(--color-ink-secondary);
  }

  .ph-find__field:focus-within {
    box-shadow: 0 0 0 2px var(--color-accent-fill);
  }

  .ph-find__field > input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    color: var(--color-ink);
    /* 16px: iOS zooms into anything smaller. */
    font: 400 16px / 1.2 var(--font-sans);
    -webkit-appearance: none;
    appearance: none;
  }

  .ph-find__field > input::-webkit-search-cancel-button {
    -webkit-appearance: none;
  }

  .ph-find .ph-place__body {
    gap: var(--space-2);
  }

  .ph-find__head-label {
    margin: var(--space-3) var(--space-1) 0;
  }

  .ph-find__card {
    overflow: hidden;
  }

  .ph-find__row {
    display: flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 0;
    background: none;
    color: var(--color-ink);
    text-align: left;
    font: inherit;
  }

  .ph-find__row + .ph-find__row {
    border-top: var(--line-width) solid var(--color-border-soft);
  }

  .ph-find__row:active {
    background: var(--color-fill);
  }

  .ph-find__glyph {
    display: grid;
    flex: none;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--kind) 12%, transparent);
    color: var(--kind);
  }

  .ph-find__row mark {
    border-radius: 3px;
    background: var(--color-wash);
    color: inherit;
    font-weight: 600;
  }

  .ph-find__status {
    margin: 0;
    padding: 0 var(--pt-gutter, 16px) var(--space-3);
    color: var(--color-ink-faint);
    font: 400 13px / 1.3 var(--font-sans);
  }

  .ph-find__status:empty {
    display: none;
  }

  /* ---- Chats ------------------------------------------------------------------------------- */

  .ph-chats {
    background: var(--color-bg);
  }

  .ph-chats__host {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* Adopted out of the Assistant window (as the tab shell's sidebar adopts it): always shown. */
  .ph-chats__host > .assistant-sidebar {
    display: block;
    width: 100%;
    overflow: visible;
    opacity: 1;
    background: none;
    border: 0;
  }

  /* The time at each row's end, always shown; rename and delete are a swipe or a long-press away. */
  .ph-chats__host .assistant-sidebar__row .assistant-sidebar__meta {
    display: inline;
    margin-right: var(--space-2);
    color: var(--color-ink-faint);
    font: 400 12px / 1 var(--font-mono);
    letter-spacing: normal;
  }

  .ph-chats__host .assistant-sidebar__row .assistant-sidebar__more {
    display: none;
  }

  /* Each day's chats sit in one inset card, as Home's rows do. */
  .ph-chats__host .assistant-sidebar__list {
    padding-inline: var(--pt-gutter, 16px);
  }

  .ph-chats__host .assistant-sidebar__label {
    padding-inline: var(--space-1);
    background: none;
  }

  .ph-chats__host .assistant-sidebar__row {
    background: var(--color-surface-raised);
    border-bottom: var(--line-width) solid var(--color-border-soft);
  }

  .ph-chats__host .assistant-sidebar__label + .assistant-sidebar__row {
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
  }

  .ph-chats__host .assistant-sidebar__row:is(:last-child, :has(+ .assistant-sidebar__label)) {
    border-bottom: 0;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
  }

  .ph-chats__host .assistant-sidebar__top {
    padding-inline: var(--pt-gutter, 16px);
  }

  /* ---- the phone's frame (the original's os.css mobile rules) ------------------------------- */
  .os-ui.is-mobile {
    --os-gap: 0px;
    --os-window-radius: 0px;
    --os-window-bar-height: var(--pt-nav);
    --os-mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    position: fixed;
    inset: 0;
    height: 100dvh;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    isolation: isolate;
    color: var(--color-ink);
    background: var(--grad-desk);
    font-family: var(--font-sans);
  }
  .os-ui__background {
    position: absolute;
    inset: 0;
    background: var(--grad-desk);
    pointer-events: none;
  }
  .os-ui.is-mobile .os-desktop {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  }
  .os-ui.is-mobile .os-bar {
    position: relative;
    z-index: var(--z-panel);
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
  }
  .os-bar__button {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 40px;
    border-radius: var(--os-control-radius);
    color: var(--color-ink-secondary);
    transition: color var(--dur-control) var(--ease), background-color var(--dur-control) var(--ease), scale var(--dur-press) var(--ease);
  }
  .os-bar__button > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .voice-avatar {
    -webkit-touch-callout: none;
    touch-action: none;
    user-select: none;
  }
  .os-bar__button.voice-avatar > .gm {
    color: var(--color-ink);
  }

  /* A place that holds a surface: the surface fills what's under the bar (if any) and scrolls itself. */
  .ph-place__host {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }
  .ph-place__host > .surface-host {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }
  .ph-place__actions {
    display: contents;
  }
  .ph-tank-sheet .mk-sheet__body {
    padding: 0 var(--pt-gutter) var(--space-4);
  }
  .ph-row__avatar {
    flex: none;
  }

  /* ---- an open thing, full screen (the original's mobile os-window) ---------------------------- */
  .os-ui.is-mobile .os-window {
    position: absolute;
    inset: 0;
    z-index: 5;
    grid-template-rows: var(--pt-nav) minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--face-sheen), var(--grad-face);
  }
  .os-ui.is-mobile .os-window[hidden] {
    display: none;
  }
  .os-ui.is-mobile :is(.os-window__bar, .os-window__header) {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    gap: var(--space-1);
    padding: 0 var(--space-1) 0 var(--pt-gutter);
    background: var(--color-surface);
    background-image: var(--window-title-paint-active);
    border-bottom: var(--line-width) solid var(--color-border-soft);
    touch-action: pan-y pinch-zoom;
  }
  .os-ui.is-mobile .os-window__identity {
    gap: var(--space-1);
  }
  .os-ui.is-mobile .os-window__title {
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: var(--pt-headline);
    font-weight: var(--weight-semibold);
    line-height: 1.2;
  }
  .pn-titles {
    display: grid;
    min-width: 0;
    gap: 1px;
  }
  .pn-sub {
    margin: 0;
    overflow: hidden;
    color: var(--color-ink-secondary);
    font-size: var(--pt-caption);
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pn-sub[hidden] {
    display: none;
  }
  .pn-actions {
    display: flex;
    align-items: center;
  }
  .os-ui.is-mobile .os-window__body > .surface-host {
    display: flex;
    flex-direction: column;
  }

  /* ---- the Assistant's sheet over the bar (the original's run dock) ------------------------------ */
  .mk-sheet-layer.has-run-dock {
    bottom: var(--phone-bar-inset, 0px);
    overflow: hidden;
    pointer-events: none;
  }
  .mk-sheet.run-dock {
    pointer-events: auto;
    bottom: 0;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 52px - var(--phone-bar-inset, 0px));
    padding-bottom: 0;
    border-top: var(--line-width) solid var(--color-border-soft);
    box-shadow: 0 -12px 32px -10px var(--color-shadow-strong);
  }
  .mk-sheet.run-dock.is-full {
    top: env(safe-area-inset-top, 0px);
    max-height: none;
  }
  .run-dock__host {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
  }

  /* ---- the composer on a phone: no tray, + inside the field, Send only with words in it ---------- */
  :root[data-form="phone"] .assistant-composer > .chat__tray {
    display: none;
  }
  :root[data-form="phone"] .assistant-composer > .chat {
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 3px;
    border-radius: 20px;
    background: var(--color-surface-raised);
    box-shadow: inset 0 0 0 var(--line-width) var(--color-border-soft);
  }
  :root[data-form="phone"] .assistant-composer > .chat > .chat__input {
    flex: 1 1 auto;
    align-self: stretch;
    box-sizing: border-box;
    min-height: 34px;
    max-height: calc(22px * 5 + 12px);
    padding: 6px 4px;
    overflow-y: auto;
    font-size: var(--pt-body, 16px);
    line-height: 22px;
  }
  :root[data-form="phone"] .assistant-composer > .chat > :is(.chat__attach, .chat__mark, .chat__mic, .chat__send) {
    position: relative;
    display: grid;
    flex: none;
    width: 34px;
    height: 34px;
    box-shadow: none;
  }
  :root[data-form="phone"] .assistant-composer > .chat > .chat__attach {
    background: var(--color-fill);
    color: var(--color-ink);
  }
  :root[data-form="phone"] .assistant-composer > .chat > .chat__mark:not(.is-on) {
    background: transparent;
    color: var(--color-ink-secondary);
  }
  :root[data-form="phone"] .assistant-composer > .chat__pictures {
    margin: 0 4px 6px;
  }
  :root[data-form="phone"] .assistant-composer > .chat > .chat__mic {
    background: transparent;
    color: var(--color-ink-secondary);
  }
  :root[data-form="phone"] .assistant-composer > .chat:not(.has-draft) > .chat__send,
  :root[data-form="phone"] .assistant-composer > .chat.has-draft > .chat__mic {
    display: none;
  }

}
