/* kik-phone-dock — the phone's dock (templates/partials/kik_phone_dock.html,
   phone-dock.js; Daniel, 2026-11-25: "exactly the way it looks on Android,
   including animations, scroll behaviour, application tabs that are embedded
   in the dock").

   The web's copy of the Android app's DockFrame and its parts
   (kikaron-app-android kit/DockTabs.kt, DockPlate.kt, DockFrost.kt). Every
   number below is Android's, in dp read as CSS px, and the comment beside it
   names the Kotlin it comes from. Change it there first.

   ONE COMPONENT, TWO SETS OF MEASURES. Everything that differs between One /
   Pro (flush) and Hub (floating) is a custom property on .kik-phone-dock; the
   two modifier classes only pick a set (phone-dock.md has the table). A page
   or a theme may set any of them itself:

     --kik-phone-dock-inset          off the screen's sides
     --kik-phone-dock-bottom         off the screen's foot
     --kik-phone-dock-radius         the box's corners
     --kik-phone-dock-row-radius     its top corners while a tab row stands on it
     --kik-phone-dock-plate-inset    the selection plate off the box
     --kik-phone-dock-plate-radius   the plate's corners
     --kik-phone-dock-plate-width    the plate's widest
     --kik-phone-dock-icon-size      an app's glyph
     --kik-phone-dock-labels         block (names under the icons) or none

   Phone widths only: the whole range the rail's old bottom bar covered
   (≤768px). Above it .kik-phone-dock is not painted at all. */

.kik-phone-dock { display: none; }

@media (width <= 768px) {
    /* ── THE MEASURES ─────────────────────────────────────────────────── */
    .kik-phone-dock {
        /* The ink and the page, the theme's. */
        --kik-phone-dock-ink: var(--pat-button-text-colour, light-dark(#1F2937, #e5e7eb));
        --kik-phone-dock-page: var(--colour-base-background, light-dark(#FAFAF8, #1f1f1f));

        /* One / Pro, flush (DockMeasures; DockFrame with floating = false). */
        --kik-phone-dock-inset: 0px;
        --kik-phone-dock-bottom: 0px;
        --kik-phone-dock-radius: 0px;
        --kik-phone-dock-row-radius: 0px;
        /* The plate 56 tall, 4 of air under it (dock = plate.height + 4). */
        --kik-phone-dock-item-height: 56px;
        --kik-phone-dock-air: 4px;
        /* The safe area INSIDE the band: edge to edge, the gesture bar's
           height is the dock's (bottom = navBar). */
        --kik-phone-dock-safe: var(--kik-safe-bottom, 0px);
        /* Ground above the icons when nothing stands on it (headroom 8). */
        --kik-phone-dock-headroom: 8px;
        /* The plates start and end where the tabs above them do (rowSide). */
        --kik-phone-dock-side: 12px;
        --kik-phone-dock-row-side: 12px;
        --kik-phone-dock-row-top: 12px;
        --kik-phone-dock-row-bottom: 12px;
        /* The selection: the Kikaron app's capsule (plate = 62 × 56). */
        --kik-phone-dock-plate-inset: 0px;
        --kik-phone-dock-plate-width: 62px;
        --kik-phone-dock-plate-height: 56px;
        --kik-phone-dock-plate-radius: 28px;
        --kik-phone-dock-item-max: 62px;
        /* Its larger line icon alone (DockGlyph 31). */
        --kik-phone-dock-icon-size: 31px;
        --kik-phone-dock-labels: none;

        /* The tabs' box (box 48) and its pill (box - 8). */
        --kik-phone-dock-tabs-height: 48px;

        /* Android's clocks. iOS's spring under the plate (DockBubble:
           response 0.42, damping 0.68) and under the ground's morph
           (DockFloatGround.morph: response 0.42, damping 0.82), sampled. */
        --kik-phone-dock-spring: linear(0, 0.059, 0.196, 0.366, 0.537, 0.69, 0.815, 0.911, 0.978, 1.021, 1.044, 1.053, 1.053, 1.047, 1.039, 1.029, 1.02, 1.013, 1.007, 1.003, 1, 0.998, 0.997, 0.997, 1);
        --kik-phone-dock-spring-time: 0.6s;
        --kik-phone-dock-morph: linear(0, 0.049, 0.161, 0.3, 0.441, 0.572, 0.684, 0.776, 0.849, 0.904, 0.943, 0.971, 0.989, 1.001, 1.007, 1.01, 1.011, 1.011, 1.009, 1.008, 1.006, 1.005, 1.004, 1.002, 1);
        --kik-phone-dock-morph-time: 0.55s;
        /* The dock's slide (DockSlide: 0.25 s ease in and out). */
        --kik-phone-dock-slide: 0.25s cubic-bezier(0.42, 0, 0.58, 1);
        /* The tabs' morph (the web's: 0.3 s on Material's standard curve). */
        --kik-phone-dock-tab-morph: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Hub, floating (DockFrame with floating = true; KikShell.dockFloating). */
    .kik-phone-dock--floating {
        /* DockFloat: iOS's own tab bar's 21 off the sides; off the foot the
           same, or the gesture bar's height and 8 more. */
        --kik-phone-dock-inset: 21px;
        --kik-phone-dock-bottom: max(21px, calc(var(--kik-safe-bottom, 0px) + 8px));
        /* A capsule (floatRadius = dockHeight / 2), its top corners the
           row's pill's (rowRadius 28) with a row on it. */
        --kik-phone-dock-radius: 31px;
        --kik-phone-dock-row-radius: 28px;
        --kik-phone-dock-item-height: 62px;
        --kik-phone-dock-air: 0px;
        --kik-phone-dock-safe: 0px;
        --kik-phone-dock-headroom: 0px;
        --kik-phone-dock-side: 0px;
        --kik-phone-dock-row-side: 4px;
        --kik-phone-dock-row-top: 4px;
        --kik-phone-dock-row-bottom: 0px;
        /* The neutral plate: 4 off the box all round, at most 96 wide, its
           corners concentric with the box's. */
        --kik-phone-dock-plate-inset: 4px;
        --kik-phone-dock-plate-width: 96px;
        --kik-phone-dock-plate-height: 54px;
        --kik-phone-dock-plate-radius: 27px;
        --kik-phone-dock-item-max: none;
        /* Its icon over its name, iOS's measures (glyph 26, name 10). */
        --kik-phone-dock-icon-size: 26px;
        --kik-phone-dock-labels: block;
    }

    /* ── THE OLD BAR IS GONE ON A PHONE ───────────────────────────────── */
    /* The rail stays in the page (the dock hands its taps to the rail's own
       launchers), unpainted. */
    body:is([data-global-nav="side"], [data-global-nav="compact"]) #global-nav-side {
        display: none !important;
    }

    /* ── THE FRAME ────────────────────────────────────────────────────── */
    body:is([data-global-nav="side"], [data-global-nav="compact"]) .kik-phone-dock {
        display: block;
        position: fixed;
        z-index: 999;
        left: var(--kik-phone-dock-inset);
        right: var(--kik-phone-dock-inset);
        bottom: calc(var(--kik-phone-dock-bottom) + var(--kik-phone-dock-lift, 0px));
        pointer-events: none;
        color: var(--kik-phone-dock-ink);
        -webkit-tap-highlight-color: transparent;
        /* The keyboard: the dock goes (alpha 120 ms). */
        transition: opacity 0.12s linear;
    }

    /* Kikaron Hub: what lies behind the floating dock fades to nothing
       towards the screen's foot (DockSoftEdge), from 28 over the box. */
    .kik-phone-dock-fade {
        position: absolute;
        left: calc(-1 * var(--kik-phone-dock-inset));
        right: calc(-1 * var(--kik-phone-dock-inset));
        bottom: calc(-1 * var(--kik-phone-dock-bottom));
        top: -28px;
        pointer-events: none;
        background: linear-gradient(to bottom,
            color-mix(in srgb, var(--kik-phone-dock-page) 0%, transparent) 0%,
            color-mix(in srgb, var(--kik-phone-dock-page) 85%, transparent) 45%,
            var(--kik-phone-dock-page) 100%);
        transition: transform var(--kik-phone-dock-slide), opacity 0.12s linear;
    }

    .kik-phone-dock-box {
        position: relative;
        pointer-events: auto;
        display: grid;
        grid-template-rows: 0fr auto;
        padding-top: var(--kik-phone-dock-headroom);
        transition:
            grid-template-rows var(--kik-phone-dock-morph-time) var(--kik-phone-dock-morph),
            padding-top var(--kik-phone-dock-morph-time) var(--kik-phone-dock-morph),
            transform var(--kik-phone-dock-slide);
    }

    /* ── THE GROUND ───────────────────────────────────────────────────── */
    /* One / Pro: the rail's glass (DeskGlass: blur 60, saturation 2.5, the
       wash 0x73 white / sand), the soft shadow along its top (edgeShadow, 14
       tall, 5 % / 14 %) and its top edge - the hairline in the light, a
       subtle light line in the dark (kikDockGlass). */
    .kik-phone-dock-ground {
        position: absolute;
        inset: 0;
        z-index: 0;
        background: light-dark(rgb(255 255 255 / 0.45), rgb(47 43 40 / 0.45));
        -webkit-backdrop-filter: blur(60px) saturate(2.5);
        backdrop-filter: blur(60px) saturate(2.5);
        box-shadow: inset 0 1px 0 light-dark(color-mix(in srgb, var(--kik-phone-dock-ink) 15%, transparent), rgb(255 255 255 / 0.10));
        border-radius: var(--kik-phone-dock-radius);
        transition: border-radius var(--kik-phone-dock-morph-time) var(--kik-phone-dock-morph), opacity 0.2s linear;
    }
    .kik-phone-dock--flush .kik-phone-dock-ground::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;
        height: 14px;
        pointer-events: none;
        background: linear-gradient(to bottom, transparent, light-dark(rgb(0 0 0 / 0.05), rgb(0 0 0 / 0.14)));
    }
    /* Hub: the frosted ground (frostedGround: blur 24, saturation 4, the veil
       0x9E white / 0x80 sand), ringed (1 px, black 12 % / white 10 %), a
       very light soft shadow all round kept outside its edge (18 blur, 2
       down, 13 % / 34 %), no hairline. */
    .kik-phone-dock--floating .kik-phone-dock-ground {
        background: light-dark(rgb(255 255 255 / 0.62), rgb(47 43 40 / 0.5));
        -webkit-backdrop-filter: blur(24px) saturate(4);
        backdrop-filter: blur(24px) saturate(4);
        box-shadow:
            inset 0 0 0 1px light-dark(rgb(0 0 0 / 0.12), rgb(255 255 255 / 0.10)),
            0 2px 18px light-dark(rgb(0 0 0 / 0.13), rgb(0 0 0 / 0.34));
    }
    .kik-phone-dock--floating.has-row .kik-phone-dock-ground {
        border-radius: var(--kik-phone-dock-row-radius) var(--kik-phone-dock-row-radius) var(--kik-phone-dock-radius) var(--kik-phone-dock-radius);
    }

    /* ── THE ROW ON THE DOCK (an app's tabs) ──────────────────────────── */
    /* Coming, the ground makes room in a spring and then the row comes in
       (160 ms later, 260 ms); going, the row goes first, down and out
       (200 ms), and then the ground contracts (DockFrame's rowShare /
       rowIn). The slot's 0fr → 1fr is the room; the row's own fade and
       10 px drop is the coming and going. */
    .kik-phone-dock-row-slot {
        position: relative;
        z-index: 1;
        min-height: 0;
        overflow: hidden;
        /* The tooltip over a held tab stands above the box: the slot clips
           only while it is opening or closing. */
    }
    .kik-phone-dock.has-row .kik-phone-dock-box {
        grid-template-rows: 1fr auto;
        padding-top: 0px;
    }
    .kik-phone-dock.has-row.is-row-settled .kik-phone-dock-row-slot { overflow: visible; }
    .kik-phone-dock-row {
        display: flex;
        align-items: flex-end;
        padding: var(--kik-phone-dock-row-top) var(--kik-phone-dock-row-side) var(--kik-phone-dock-row-bottom);
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.2s cubic-bezier(0.4, 0, 1, 1), transform 0.2s cubic-bezier(0.4, 0, 1, 1), padding var(--kik-phone-dock-slide);
    }
    .kik-phone-dock.has-row .kik-phone-dock-row {
        opacity: 1;
        transform: none;
        transition: opacity 0.26s cubic-bezier(0, 0, 0.2, 1) 0.16s, transform 0.26s cubic-bezier(0, 0, 0.2, 1) 0.16s, padding var(--kik-phone-dock-slide);
    }

    /* ── THE APPS ─────────────────────────────────────────────────────── */
    .kik-phone-dock-apps {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        /* The Kikaron app's row (DockSpacing): the first and last plate as
           far in as the tabs above them, an equal share of the room between
           the apps. Kikaron Hub's: an equal share each (weight 1). */
        justify-content: space-between;
        box-sizing: content-box;
        height: var(--kik-phone-dock-item-height);
        padding: 0 var(--kik-phone-dock-side) calc(var(--kik-phone-dock-air) + var(--kik-phone-dock-safe));
        margin: 0;
        list-style: none;
        touch-action: pan-y;
        transition: opacity 0.2s cubic-bezier(0.4, 0, 1, 1) 0.08s, transform var(--kik-phone-dock-slide);
    }

    .kik-phone-dock-app {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 0 1 var(--kik-phone-dock-item-max);
        min-width: 0;
        height: var(--kik-phone-dock-item-height);
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
        color: var(--kik-phone-dock-ink);
        text-decoration: none;
        font: inherit;
        /* A launcher, not a text link: no pointer (house rule), and no iOS
           link preview or selection callout on a held finger. */
        cursor: default;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        transition: color 0.2s linear;
    }
    .kik-phone-dock--floating .kik-phone-dock-app {
        flex: 1 1 0;
        /* iOS's names and icons stand a point over the box's middle. */
        padding-bottom: 2px;
        box-sizing: border-box;
    }
    .kik-phone-dock-app[hidden],
    .kik-phone-dock-app[data-over-cap] { display: none; }
    /* A tablet held upright: as many more as the dock's width holds at a
       phone's spacing, about 72 a slot, Home, the recent app and Apps
       counted (DockFrame's cap). */
    @media (width >= 600px) {
        .kik-phone-dock-app[data-over-cap]:not([data-pin="7"], [data-pin="8"]) { display: flex; }
    }
    @media (width >= 700px) {
        .kik-phone-dock-app[data-over-cap] { display: flex; }
    }

    .kik-phone-dock-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        box-sizing: border-box;
        width: var(--kik-phone-dock-icon-size);
        height: var(--kik-phone-dock-icon-size);
        color: inherit;
        line-height: 0;
    }
    .kik-phone-dock--floating .kik-phone-dock-icon {
        /* 29 tall around the 26 glyph, as iOS's tab bar. */
        height: 29px;
    }
    .kik-phone-dock-icon svg,
    .kik-phone-dock-icon img {
        display: block;
        width: var(--kik-phone-dock-icon-size);
        height: var(--kik-phone-dock-icon-size);
    }
    .kik-phone-dock-icon > img.kik-site-icon {
        border-radius: 24%;
        object-fit: cover;
    }
    /* A filled glyph is coloured through fill, an outline through its
       stroke (the rail's two recipes, keyed on the same split). The lines
       at the rail's and the bars' one width, a little heavier on the
       Kikaron app's dock (thicker). */
    .kik-phone-dock-icon.app-icon:not(.kik-app-icon) * { fill: currentColor !important; }
    /* Every app in the dock's own ink, the chosen one in its lifted colour,
       never each app's colour (Android's DockItem; Daniel, 2026-11-25): the
       app icon's own rule would paint it in --app-colour. */
    .kik-phone-dock-icon.kik-app-icon { --kik-app-icon-ink: currentColor; }
    .kik-phone-dock-icon.app-icon svg #dots { fill: transparent !important; }
    .kik-phone-dock-icon.rail-icon { --kik-app-icon-stroke-width: 1.75; }
    /* The Kikaron app's dock draws the line alone; Kikaron Hub's lays a
       light fill under it, as its neighbours' glyphs have (appPlates: the
       glyph's own colour at 18 %). */
    .kik-phone-dock { --app-icon-fill-opacity: 0%; }
    .kik-phone-dock--floating { --app-icon-fill-opacity: 18%; }
    .kik-phone-dock--floating .kik-phone-dock-icon.rail-icon { --kik-app-icon-stroke-width: 1.6; }
    /* The hub's mark is its own picture, in its own colours. */
    .kik-phone-dock-mark img { border-radius: 22%; object-fit: contain; }
    .kik-phone-dock-mark > .app-icon { display: contents; }

    .kik-phone-dock-label {
        display: var(--kik-phone-dock-labels);
        margin-top: 2px;
        max-width: 100%;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: clip;
        /* Ten points, whatever the system's text size, as iOS's tab bar. */
        font-size: 10px;
        line-height: 12px;
        font-weight: 600;
        color: inherit;
    }

    /* The app under the plate, on either dock, in its lifted colour (dockInk):
       the app's colour, moved only as far as it takes to read - darkened in
       the light, lifted and paled in the dark. */
    .kik-phone-dock-app {
        --kik-phone-dock-lift: light-dark(
            color-mix(in oklab, var(--app-colour, var(--colour-accent)) 72%, black),
            color-mix(in oklab, var(--app-colour, var(--colour-accent)) 52%, white));
    }
    .kik-phone-dock-app.is-on { color: var(--kik-phone-dock-lift); }

    /* The counter on a favourite (Mail's unread, Messages'). */
    .kik-phone-dock-badge {
        position: absolute;
        top: 4px;
        left: calc(50% + 6px);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        background: var(--colour-alert, #dc2626);
        color: #fff;
        border-radius: 999px;
        font-size: 10px;
        line-height: 1;
        font-weight: 600;
        pointer-events: none;
    }

    /* The menu of the app on screen: a hidden trigger the tap on it pulls
       (phone-dock.js), over the item so the menu opens from there. */
    .kik-phone-dock-menu {
        position: absolute;
        top: 0;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
        overflow: hidden;
    }

    /* The line before the app on screen that is not pinned, in the middle
       of its gap (1 × 28; Hub 30), 18 % of the ink. Placed by phone-dock.js. */
    .kik-phone-dock-line {
        position: absolute;
        z-index: 1;
        top: calc((var(--kik-phone-dock-item-height) - 28px) / 2);
        left: 0;
        width: 1px;
        height: 28px;
        background: color-mix(in srgb, var(--kik-phone-dock-ink) 18%, transparent);
        transform: translateX(var(--kik-phone-dock-line-x, 0px));
    }
    .kik-phone-dock--floating .kik-phone-dock-line {
        top: calc((var(--kik-phone-dock-item-height) - 30px) / 2);
        height: 30px;
    }
    .kik-phone-dock-line[hidden] { display: none; }

    /* ── THE PLATE ────────────────────────────────────────────────────── */
    /* One plate that goes from app to app (DockPlate): the Kikaron app's
       capsule in the app's colour (15 % / 24 %), Kikaron Hub's neutral plate
       round the icon and its name (the ink at 8 % / black at 34 %). It
       stretches along its way and settles with iOS's wobble; a finger
       sliding along the dock takes it along (phone-dock.js sets --plate-x,
       --plate-w and --plate-stretch). */
    .kik-phone-dock-plate {
        position: absolute;
        z-index: 0;
        top: calc((var(--kik-phone-dock-item-height) - var(--kik-phone-dock-plate-height)) / 2);
        left: 0;
        width: var(--plate-w, 0px);
        height: var(--kik-phone-dock-plate-height);
        border-radius: var(--kik-phone-dock-plate-radius);
        background: light-dark(
            color-mix(in srgb, var(--plate-colour, transparent) 15%, transparent),
            color-mix(in srgb, var(--plate-colour, transparent) 24%, transparent));
        opacity: 0;
        /* The place and the stretch apart, each on its own clock: the
           place on the spring, the stretch rounding up again on a quicker
           one (0.3 s response, 0.6 damping). */
        translate: var(--plate-x, 0px) 0;
        scale: calc(var(--plate-lift, 1) * (1 + var(--plate-stretch, 0))) calc(var(--plate-lift, 1) * (1 - var(--plate-stretch, 0) * 0.45));
        transition:
            translate var(--kik-phone-dock-spring-time) var(--kik-phone-dock-spring),
            width var(--kik-phone-dock-spring-time) var(--kik-phone-dock-spring),
            scale 0.4s var(--kik-phone-dock-spring),
            background-color 0.24s linear,
            opacity 0.12s linear;
        pointer-events: none;
    }
    .kik-phone-dock--floating .kik-phone-dock-plate {
        background: light-dark(color-mix(in srgb, var(--kik-phone-dock-ink) 8%, transparent), rgb(0 0 0 / 0.34));
    }
    .kik-phone-dock.is-live .kik-phone-dock-plate.is-shown { opacity: 1; }
    /* The first placing, and a finger on it: no glide - the plate is where
       it is (snapTo); the finger's own speed is the stretch. */
    .kik-phone-dock-plate.is-snap {
        transition: background-color 0.24s linear, opacity 0.12s linear;
    }
    .kik-phone-dock.is-scrubbing .kik-phone-dock-plate {
        transition: scale 0.12s linear, width 0.2s ease, background-color 0.24s linear, opacity 0.12s linear;
    }
    .kik-phone-dock.is-scrubbing .kik-phone-dock-plate { --plate-lift: 1.1; }

    /* ── body:is(:has(.application-body.state-on.kik-active-pane.focus-document .document-body.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(.application-body.state-on.kik-active-pane.focus-sidebar .sidebar-content.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(#portal-content-pane.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)):not(:has(#app-space.state-on))):not(:has(.kik-phone-dock.is-fresh))ED: SCROLLED DOWN ────────────────────────────────────────── */
    /* Only the reader's scroll counts: the scroll classes are pat-scroll-box's,
       their direction scroll-hysteresis.js's (it flips only after 24 px the
       other way, as Android's 6 dp run does), the top of a box always "up" -
       pulling at the top shows the dock. Keyed on the pane in front and on a
       box that can scroll at all, for the reasons global-nav-side.css gave
       the old bar (a parked app's box, an empty folder's rubber band). Pure
       CSS: the selector below is the whole of it. */

    /* With no row: off the screen, the dock and all, in the dock's slide. */
    body:is(:has(.application-body.state-on.kik-active-pane.focus-document .document-body.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(.application-body.state-on.kik-active-pane.focus-sidebar .sidebar-content.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(#portal-content-pane.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)):not(:has(#app-space.state-on))):not(:has(.kik-phone-dock.is-fresh)) .kik-phone-dock:not(.has-row) .kik-phone-dock-box,
    body:is(:has(.application-body.state-on.kik-active-pane.focus-document .document-body.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(.application-body.state-on.kik-active-pane.focus-sidebar .sidebar-content.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(#portal-content-pane.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)):not(:has(#app-space.state-on))):not(:has(.kik-phone-dock.is-fresh)) .kik-phone-dock:not(.has-row) .kik-phone-dock-fade {
        transform: translateY(calc(100% + var(--kik-phone-dock-bottom) + 60px));
    }
    /* One / Pro with a row: the row slides down to the dock's place and stays
       (rowDown = dock + room); the icons go with the ground's foot out of
       sight. */
    body:is(:has(.application-body.state-on.kik-active-pane.focus-document .document-body.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(.application-body.state-on.kik-active-pane.focus-sidebar .sidebar-content.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(#portal-content-pane.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)):not(:has(#app-space.state-on))):not(:has(.kik-phone-dock.is-fresh)) .kik-phone-dock--flush.has-row .kik-phone-dock-box {
        transform: translateY(calc(var(--kik-phone-dock-item-height) + var(--kik-phone-dock-air)));
    }
    body:is(:has(.application-body.state-on.kik-active-pane.focus-document .document-body.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(.application-body.state-on.kik-active-pane.focus-sidebar .sidebar-content.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(#portal-content-pane.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)):not(:has(#app-space.state-on))):not(:has(.kik-phone-dock.is-fresh)) .kik-phone-dock--flush.has-row .kik-phone-dock-apps {
        transform: translateY(calc(var(--kik-phone-dock-item-height) + 60px));
    }
    /* Hub with a row: the box closes round the row's tabs and stays at its
       foot, the two one capsule (reduced): no room left round the tabs, the
       icons gone quickly (120 ms), back after the box has opened. */
    .kik-phone-dock--floating .kik-phone-dock-apps {
        transition: opacity 0.2s cubic-bezier(0.4, 0, 1, 1) 0.08s, height var(--kik-phone-dock-slide), padding var(--kik-phone-dock-slide);
    }
    body:is(:has(.application-body.state-on.kik-active-pane.focus-document .document-body.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(.application-body.state-on.kik-active-pane.focus-sidebar .sidebar-content.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(#portal-content-pane.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)):not(:has(#app-space.state-on))):not(:has(.kik-phone-dock.is-fresh)) .kik-phone-dock--floating.has-row .kik-phone-dock-apps {
        height: 0;
        padding: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.12s cubic-bezier(0, 0, 0.2, 1), height var(--kik-phone-dock-slide), padding var(--kik-phone-dock-slide);
    }
    body:is(:has(.application-body.state-on.kik-active-pane.focus-document .document-body.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(.application-body.state-on.kik-active-pane.focus-sidebar .sidebar-content.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(#portal-content-pane.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)):not(:has(#app-space.state-on))):not(:has(.kik-phone-dock.is-fresh)) .kik-phone-dock--floating.has-row .kik-phone-dock-row {
        padding: 0;
    }
    body:is(:has(.application-body.state-on.kik-active-pane.focus-document .document-body.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(.application-body.state-on.kik-active-pane.focus-sidebar .sidebar-content.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(#portal-content-pane.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)):not(:has(#app-space.state-on))):not(:has(.kik-phone-dock.is-fresh)) .kik-phone-dock--floating.has-row .kik-phone-dock-ground {
        border-radius: calc(var(--kik-phone-dock-tabs-height) / 2);
    }
    body:is(:has(.application-body.state-on.kik-active-pane.focus-document .document-body.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(.application-body.state-on.kik-active-pane.focus-sidebar .sidebar-content.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)), :has(#portal-content-pane.kik-scrollable:is(.scroll-position-bottom, .scroll-down):not(.scroll-position-top)):not(:has(#app-space.state-on))):not(:has(.kik-phone-dock.is-fresh)) .kik-phone-dock--floating .kik-phone-dock-tabs {
        background: transparent;
        box-shadow: none;
    }

    /* The keyboard is up: the dock is gone (120 ms), the fade with it - it
       does not ride up on the keys. phone-dock.js says when (.is-kb): a
       text field with the focus AND the screen's height taken by the keys.
       Not the focus alone (until 2026-11-25): a keyboard put away with the
       phone's back gesture leaves the field focused, and the dock stayed
       gone until something else took the focus (Daniel: "I often lose the
       dock completely after the soft keyboard has been up"). */
    .kik-phone-dock.is-kb {
        opacity: 0;
        pointer-events: none;
    }
    .kik-phone-dock.is-kb * {
        pointer-events: none !important;
    }

    /* Nothing to dock over: an office editor full screen, the phone
       carousel's switcher (its own stage, no dock on Android either), a
       single-app client. */
    body:has(:is(.collabora-editor-shell, .onlyoffice-editor-shell)) .kik-phone-dock,
    body.kik-pac-switch:not(:has(.kik-pac-front)) .kik-phone-dock,
    html.kik-single-app .kik-phone-dock,
    html body[data-kik-single-app] .kik-phone-dock {
        display: none !important;
    }

    /* ── WHAT RESTS ON THE DOCK, AND WHAT RUNS ON UNDER IT ───────────── */
    body:is([data-global-nav="side"], [data-global-nav="compact"]) {
        /* The dock's whole height over the screen's foot, as the pane's
           bottom inset (DockFrame's inset: ground + lift): the content runs
           on under the frosted dock and its last line clears it.
           phone-dock.js keeps --kik-phone-dock-row-height current. */
        --kik-phone-dock-footprint: calc(var(--kik-phone-dock-band-height, 68px) + var(--kik-phone-dock-row-height, 0px) + var(--kik-safe-bottom, 0px));
        /* What sits ON the dock (a chat composer): 10 of air over it. */
        --kik-dock-clearance: calc(var(--kik-phone-dock-footprint) + 10px);
        --kik-phone-dock-band-height: 68px;
    }
    body[data-global-nav="side"] {
        /* Hub: 62 of box, the air under it (bottom), no safe area of its own. */
        --kik-phone-dock-band-height: calc(62px + max(21px, calc(var(--kik-safe-bottom, 0px) + 8px)) - var(--kik-safe-bottom, 0px));
    }
    body:has(.kik-phone-dock.has-row) {
        --kik-phone-dock-row-height: 72px;
    }
    body[data-global-nav="side"]:has(.kik-phone-dock.has-row) {
        --kik-phone-dock-row-height: 52px;
    }

    /* The media player's chip, while something plays: a disc standing on
       the dock's top edge at its trailing end (media-player.js seats it
       here on a phone). */
    #kik-phone-dock > .kik-media-player-chip {
        position: absolute !important;
        top: auto !important;
        inset-inline-start: auto !important;
        inset-inline-end: 12px !important;
        bottom: calc(100% + 10px) !important;
        width: 46px;
        height: 46px;
        border-radius: 23px;
        pointer-events: auto;
    }

    /* A held tab's name over the box (IconTabs' Tooltip). */
    .kik-phone-dock-tip {
        position: absolute;
        z-index: 3;
        left: 0;
        bottom: calc(100% + 10px);
        height: 38px;
        padding: 0 16px;
        display: flex;
        align-items: center;
        border-radius: 19px;
        background: var(--tip-colour, var(--colour-accent));
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        white-space: nowrap;
        box-shadow: 0 4px 16px rgb(0 0 0 / 0.18);
        transform: translateX(calc(var(--tip-x, 0px) - 50%));
        opacity: 0;
        pointer-events: none;
        transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.16s linear;
    }
    .kik-phone-dock-tip.is-shown { opacity: 1; }
    .kik-phone-dock-tip.is-landing {
        transform: translateX(calc(var(--tip-x, 0px) - 50%)) translateY(calc(10px + 38px + 5px));
        box-shadow: none;
        background: transparent;
        transition: transform var(--kik-phone-dock-tab-morph), background-color var(--kik-phone-dock-tab-morph), box-shadow var(--kik-phone-dock-tab-morph), opacity 0.16s linear;
    }
}

/* ── THE TABS ON THE DOCK (IconTabs) ──────────────────────────────────── */
/* Icons in a glass capsule, the chosen one unfolded to its word on a pill of
   its own colour (IconTabs.swift; Daniel, 2026-10-17). phone-dock.js builds
   them from the app's own strip and sets each tab's width and the pill's
   place; the CSS draws them and moves them on the web's morph. */
@media (width <= 768px) {
    .kik-phone-dock-tabs {
        position: relative;
        flex: 1 1 auto;
        min-width: 0;
        height: var(--kik-phone-dock-tabs-height);
        border-radius: calc(var(--kik-phone-dock-tabs-height) / 2);
        /* See-through, the frost under it showing (tabsGround), its 0.5
           outline; on a reduced dock the box is the tabs' ground. */
        background: light-dark(rgb(255 255 255 / 0.42), rgb(43 39 35 / 0.62));
        box-shadow: inset 0 0 0 0.5px light-dark(color-mix(in srgb, var(--kik-phone-dock-ink) 15%, transparent), color-mix(in srgb, var(--kik-phone-dock-ink) 20%, transparent));
        transition: background-color var(--kik-phone-dock-slide), box-shadow var(--kik-phone-dock-slide);
        touch-action: none;
    }
    .kik-phone-dock-tabs.is-scrolling {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        touch-action: pan-x;
    }
    .kik-phone-dock-tabs.is-scrolling::-webkit-scrollbar { display: none; }
    .kik-phone-dock-tabs-inner {
        position: relative;
        display: flex;
        align-items: center;
        height: 100%;
        padding: 0 4px;
        width: max-content;
        min-width: 100%;
        box-sizing: border-box;
    }
    .kik-phone-dock-pill {
        position: absolute;
        top: 4px;
        left: 0;
        height: calc(var(--kik-phone-dock-tabs-height) - 8px);
        width: var(--pill-w, 0px);
        border-radius: 999px;
        background: var(--pill-colour, var(--colour-accent));
        transform: translateX(var(--pill-x, 0px));
        transition:
            transform var(--kik-phone-dock-tab-morph),
            width var(--kik-phone-dock-tab-morph),
            background-color var(--kik-phone-dock-tab-morph);
    }
    .kik-phone-dock-tabs.is-held .kik-phone-dock-pill {
        transition-duration: 0.22s;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }
    .kik-phone-dock-tab {
        position: relative;
        z-index: 1;
        flex: 0 0 auto;
        display: grid;
        place-items: center;
        width: var(--tab-w, 40px);
        height: calc(var(--kik-phone-dock-tabs-height) - 8px);
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
        color: var(--kik-phone-dock-ink);
        font: inherit;
        cursor: default;
        overflow: visible;
        transition: width var(--kik-phone-dock-tab-morph), color var(--kik-phone-dock-tab-morph);
    }
    .kik-phone-dock-tab > * { grid-area: 1 / 1; }
    .kik-phone-dock-tab-icon {
        display: flex;
        width: 20px;
        height: 20px;
        transition: opacity var(--kik-phone-dock-tab-morph), transform var(--kik-phone-dock-tab-morph);
    }
    .kik-phone-dock-tab-icon svg { width: 20px; height: 20px; }
    .kik-phone-dock-tab-word {
        font-size: 15px;
        line-height: 20px;
        font-weight: 600;
        white-space: nowrap;
        opacity: 0;
        transition: opacity var(--kik-phone-dock-tab-morph);
    }
    /* The chosen tab: its word on the pill, its icon folded away. */
    .kik-phone-dock-tab.is-on { color: var(--pill-ink, #fff); }
    .kik-phone-dock-tab.is-on .kik-phone-dock-tab-icon { opacity: 0; transform: scale(0.6); }
    .kik-phone-dock-tab.is-on .kik-phone-dock-tab-word { opacity: 1; }
    /* A row of words alone (TextTabs): every tab shows its word. */
    .kik-phone-dock-tabs.is-words .kik-phone-dock-tab-word { opacity: 1; }
    .kik-phone-dock-tabs.is-words .kik-phone-dock-tab { padding: 0 14px; }
    /* Held: every tab folds to its icon (the tooltip names the one under
       the finger); the hovered one wears the pill. */
    .kik-phone-dock-tabs.is-held .kik-phone-dock-tab.is-on { color: var(--kik-phone-dock-ink); }
    .kik-phone-dock-tabs.is-held .kik-phone-dock-tab .kik-phone-dock-tab-icon { opacity: 1; transform: none; }
    .kik-phone-dock-tabs.is-held:not(.is-words) .kik-phone-dock-tab .kik-phone-dock-tab-word { opacity: 0; }
    .kik-phone-dock-tabs.is-held .kik-phone-dock-tab.is-over { color: var(--pill-ink, #fff); }
    /* Something unread behind it: the blue dot under the icon. */
    .kik-phone-dock-tab-dot {
        align-self: end;
        width: 5px;
        height: 5px;
        margin-bottom: 3px;
        border-radius: 50%;
        background: var(--colour-link, #009ee2);
    }
    .kik-phone-dock-tab.is-on .kik-phone-dock-tab-dot { display: none; }

    /* The app's own strip, while it stands on the dock: not twice. */
    .kik-phone-dock-hoisted { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .kik-phone-dock,
    .kik-phone-dock * {
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
}
