/* THE DECK SHELL ON PAGES (Steven 2026-11-09 19:30 to 19:35). Houses, a
   room and the shop wear the deck's shell in place of the old top bar:
   the logo top left at the old bar's size and place (the header's 40px
   mark, 16px in, 12px down, its purple number on the right shoulder), a
   tap opens the drawer; Market bottom left and + bottom right as on the
   deck. Drawn by components/_deck_shell.html when the page sets
   deck_shell_page; wired by static/js/shell/deck-shell-pages.js. Every
   rule is scoped to a page that carries the mark ([data-ds-page-mark]),
   so the deck itself does not change. Placing and framing only. */

/* ---- the strip where the bar was --------------------------------------- */
/* the old bar's row stays as an empty strip of the page's own background,
   the bar's 64px, so the page sits exactly where it sat and nothing runs
   under the logo */
.app-shell--deck-shell > .ds:has(> [data-ds-page-mark]) {
    grid-area: topbar;
    height: calc(var(--size-16) + env(safe-area-inset-top, 0px));
    background: var(--surface-app);
}
.app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) {
    /* pages are not cards: the discs sit in the window's corners */
    --ds-card-w: calc(100vw - 2 * var(--ds-slide-pad));
}

/* House identity shares the logo's top row, including when changing tabs. */
.ds-page-title {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + var(--space-3));
    left: calc(env(safe-area-inset-left, 0px) + var(--space-4) + var(--boh-rail-control-size, 40px) + var(--space-6));
    right: calc(env(safe-area-inset-right, 0px) + var(--space-4));
    z-index: var(--z-fab-above);
    height: var(--boh-rail-control-size, 40px);
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    line-height: 1;
    overflow: hidden;
}
/* A room has its own header in this same row. */
body.mobile-chat-open .ds-page-title { display: none; }

/* ---- 1. the logo ------------------------------------------------------- */
.ds-page-mark {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + var(--space-3));
    left: calc(env(safe-area-inset-left, 0px) + var(--space-4));
    z-index: var(--z-fab-above);      /* over a room's chat view and a house's tab bar, under panels */
    width: var(--boh-rail-control-size, 40px);
    height: var(--boh-rail-control-size, 40px);
}
/* the bar's black behind the yellow mark, as a round pocket */
.ds-page-mark::before {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--space-2));
    border-radius: var(--radius-full);
    background: var(--color-dark-900);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 4px 14px rgb(0 0 0 / 0.22);
    pointer-events: none;
}
.ds-page-mark > .ds-type {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.ds-page-mark > .ds-type::after {             /* the whole pocket takes the tap */
    content: "";
    position: absolute;
    inset: calc(-1 * var(--space-2));
    border-radius: var(--radius-full);
}
.ds-page-mark > .ds-type > .cf-mark { position: absolute; inset: 0; }
.ds-page-mark .ds-type__glyph { display: contents; }
.ds-page-mark .ds-type__glyph[hidden] { display: none; }
/* the mark and its number are the card frame's own piece (card-frame.css
   .cf-mark: the header's 40px logo, its 20px purple number on the shoulder) */

/* the discs ride over the page's own fixed bars too (a room's chat view,
   a house's tab bar, the shop's sheet), under the panels that open over a
   page */
.app-shell--deck-shell > .ds:has(> [data-ds-page-mark]) > .ds-fab { z-index: var(--z-fab-above); }

/* ---- 2. one + ---------------------------------------------------------- */
/* the page's own create button stands aside; the shell's + menu presses it */
.ds-page-has-create .app-shell--deck-shell .quick-create-fab,
.ds-page-has-create .app-shell--deck-shell .global-post-fab-surface { visibility: hidden; pointer-events: none; }
.ds-menu__row[hidden] { display: none; }
/* NO BLACK PLUS (everyone but a super admin, Steven 2026-11-11): the
   page's own create button stays on its page, one place up, right above
   the purple plus on its right edge, the purple plus's size, so the two
   never sit on each other (deck-shell-pages.js sets the class) */
.ds-page-own-create .app-shell--deck-shell .quick-create-fab {
    position: fixed;
    inset: auto var(--ds-row-right, 18px) calc(var(--ds-fab-bottom, 18px) + var(--ds-fab, 48px) + var(--space-3, 12px)) auto;
    width: var(--ds-fab, 48px);
    height: var(--ds-fab, 48px);
    z-index: var(--z-fab-above);
    /* the My agents disc's look (white, a gray ring, dark ink), so it never
       reads as a second purple plus */
    background: var(--color-white, #fff);
    color: var(--text-primary, #111);
    box-shadow: inset 0 0 0 var(--cf-hair, 1.5px) var(--border-strong, rgb(0 0 0 / 0.3));
}

/* ---- 3. the bottom line ------------------------------------------------ */
/* on a page the content scrolls clear of the two discs: its last row ends
   above the bottom line's band (below), as a card's words end above its
   bottom row */
.app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .main-area__content {
    padding-bottom: calc(var(--ds-dock-bottom) + var(--ds-dock-h) + var(--ds-dock-in-b) + var(--space-4));
}
/* THE BOTTOM LINE'S BAND (finish sweep, Steven 2026-11-09: no words under
   Market or the + at rest, the shop's "Things agents have delivered", a
   plan step's icon on a want page, a shop row's Get this under the + on a
   wide screen): at every width the bottom line is a band of the page's own
   colour, as tall as the line and its margins, that the page scrolls under.
   The discs ride on it. A room keeps its message box line (it is the band
   there). */
@media screen {
    .app-shell--deck-shell > .ds:has(> [data-ds-page-mark])::before {
        content: "";
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: calc(var(--z-fab-above) - 1);
        height: calc(var(--ds-dock-bottom) + var(--ds-dock-h) + var(--ds-dock-in-b));
        background: var(--ds-page-band, var(--surface-app));
        box-shadow: 0 -1px 0 var(--border-default, rgb(0 0 0 / 0.08));
        pointer-events: none;
    }
    .ds-page-composer .app-shell--deck-shell > .ds:has(> [data-ds-page-mark])::before,
    /* a page that is one card (the share page, a product's card) keeps
       the card's own bottom row on the line, as on the deck */
    .share-card-page .app-shell--deck-shell > .ds:has(> [data-ds-page-mark])::before,
    .pdp-card-page .app-shell--deck-shell > .ds:has(> [data-ds-page-mark])::before { content: none; }
    /* over the shop's sheet as the discs are; drawn before them, so under them */
    body.drawer-layout .app-shell--deck-shell > .ds:has(> [data-ds-page-mark])::before { z-index: calc(var(--z-utility-overlay) + 1); }
    /* a house's tab bar sits on the line, over the band */
    .app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .house-mobile-bottom-nav { z-index: var(--z-fab-above); }
}
/* a room: Market, the message box, +, one height on one line; the box
   leaves room for a disc on each side (deck-shell-pages.js lines the
   discs up on it) */
.ds-page-composer .app-shell--deck-shell :is(.chat-input-wrapper, .mobile-chat-input-wrapper) {
    box-sizing: border-box;
    min-height: var(--ds-dock-h);
    margin-left: calc(var(--ds-dock-h) + var(--ds-dock-gap));
    margin-right: calc(var(--ds-dock-h) + var(--ds-dock-gap));
}
.ds-page-composer .app-shell--deck-shell .main-area__content { padding-bottom: 0; }
/* a second disc above the + (a super admin's black plus, or a page's own
   button kept for everyone else; Steven 2026-11-11): the page's last row
   scrolls clear of that one too */
html:not(.ds-page-composer) .app-shell--deck-shell:has(> .ds[data-ds-admin] > [data-ds-page-mark]) .main-area__content,
html.ds-page-own-create:not(.ds-page-composer) .app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .main-area__content,
html.ds-page-own-fail:not(.ds-page-composer) .app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .main-area__content {
    padding-bottom: calc(var(--ds-dock-bottom) + var(--ds-dock-h) + var(--ds-dock-in-b) + var(--ds-fab) + var(--space-3) + var(--space-4) + var(--ds-fab-lift, 0px));
}
/* a room on a phone: the line runs edge to edge, so the box keeps room for
   its words between the two discs, at the discs' 48px */
@media (max-width: 767px) {
    .ds-page-composer .app-shell--deck-shell .mobile-chat-input-area { padding-left: var(--space-2); padding-right: var(--space-2); }
    .ds-page-composer .app-shell--deck-shell .mobile-chat-input-wrapper {
        gap: var(--space-1);
        padding: calc((var(--ds-dock-h) - 36px) / 2) var(--space-2);
    }
    .ds-page-composer .app-shell--deck-shell .mobile-chat-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* a house on a phone: Market, the house's tab bar, +, one height on one
   line (the bar keeps its own centring and its hide when a room opens) */
@media (max-width: 767px) {
    .app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .house-mobile-bottom-nav {
        bottom: var(--ds-dock-bottom);
        width: calc(100vw - 2 * (var(--ds-dock-side) + var(--ds-dock-h) + var(--ds-dock-gap)));
        height: var(--ds-dock-h);
    }
    .app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .house-mobile-bottom-nav__tabs {
        height: 100%;
        align-items: stretch;
    }
    /* Same capsule shape, inset evenly on all sides of the outer capsule. */
    .app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .house-mobile-bottom-nav__item {
        border-radius: inherit;
        min-height: 0;
    }
    /* between the two discs the tabs keep their words; the small drawings
       beside the words step aside so no word is cut */
    .app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .house-mobile-bottom-nav__item > :is(iconify-icon, svg) { display: none; }
    /* a room's own header (the back arrow, the room's name) starts right of the logo */
    .app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .mobile-chat-header {
        padding-left: calc(var(--space-4) + var(--boh-rail-control-size, 40px) + var(--space-2) + var(--space-3));
        min-height: calc(var(--size-16) + env(safe-area-inset-top, 0px));
    }
}

/* ---- the shop (a drawer page: its own dark bar, the Toll Bench name and
   its X) ------------------------------------------------------------------ */
/* no strip: the shop's own bar is the top line, and the logo (the bag with
   the heart) takes the bar's mark's place, the same 40px at the same spot;
   the logo and the discs ride over the shop's sheet, under anything that
   opens over the shop (an item's page) */
body.shop-page.drawer-layout .app-shell--deck-shell > .ds:has(> [data-ds-page-mark]) { height: 0; }
body.drawer-layout .ds-page-mark,
body.drawer-layout .app-shell--deck-shell > .ds:has(> [data-ds-page-mark]) > .ds-fab { z-index: calc(var(--z-utility-overlay) + 1); }
/* THE MARKET'S ROUND, on /shop (Steven 2026-11-12: "the market needs to have
   the same button as these pages"): the shell's logo stands where the bar's
   round count button is (components/_market_bar.html, which steps aside
   here) and wears its look: the white round, the stack of cards in the
   page's dark ink (components/_cards_mark.html), the number on its
   shoulder; a tap opens the drawer */
body.shop-page.drawer-layout .shop-chrome .market-bar__count { visibility: hidden; }
body.shop-page.drawer-layout .ds-page-mark {
    top: calc(var(--mb-top, 4px) + var(--mb-mark, 18px));
    left: calc(var(--mb-left, 4px) + var(--mb-mark, 18px));
    color: var(--text-primary, #111);
}
body.shop-page.drawer-layout .ds-page-mark::before {
    inset: calc((40px - var(--mb-round, 75px)) / 2);
    background: none;                 /* the bar's scoop is its round (market-bar.css THE BLACK CURVES ROUND THE ROUND) */
    box-shadow: none;
}
body.shop-page.drawer-layout .ds-page-mark .ds-type__glyph .tb-cards-mark { width: 40px; height: 40px; color: var(--text-primary, #111); }

/* ---- a want page and its step pages: the fail button --------------------
   It sat where the shell's + sits; it steps aside (still on the page, so
   its sheet and its confirm step are the same) and the + menu's "Fail this
   agent" row presses it (deck-shell-pages.js). */
.ds-page-has-fail #fail-dot { visibility: hidden !important; pointer-events: none !important; }
/* everyone but a super admin: the fail button keeps its own place, one
   place up, right above the purple plus (deck-shell-pages.js) */
.ds-page-own-fail #fail-dot {
    inset: auto var(--ds-row-right, 18px) calc(var(--ds-fab-bottom, 18px) + var(--ds-fab, 48px) + var(--space-3, 12px)) auto;
    width: var(--ds-fab, 48px);
    height: var(--ds-fab, 48px);
}

/* ---- a public page (feed/_market_header.html with the card layout) ------
   The shell stands where the header was, in the page's flow (.ds-market-host
   wraps it, so the shell's tokens reach it); the page's last row scrolls clear
   of the bottom line's band. */
.ds-market-host { display: block; }
@media screen {
    body:has(.ds-market-host) { padding-bottom: 112px; }   /* the band (about 84px) and a margin; the shell tokens live inside the host */
}

/* ---- a page's own bottom bar (the ready target's checkout, .sl-foot) ----
   It rides the bottom line: over the band, under the two discs, its button
   between them at their height (finish sweep 2026-11-09: "Get this" sat
   under the band and the discs). */
@media (max-width: 899px) {
    body:has(.app-shell--deck-shell > .ds > [data-ds-page-mark]) .sl-foot {
        /* over the band and level with the discs, but see-through and
           letting taps through outside its button, so the discs show and
           answer */
        z-index: calc(var(--z-utility-overlay) + 1);
        background: transparent;
        border-top: 0;
        box-shadow: none;
        pointer-events: none;
        padding-left: calc(var(--ds-dock-side, 18px) + var(--ds-dock-h, 48px) + var(--ds-dock-gap, 8px) - var(--space-2));
        padding-right: calc(var(--ds-dock-side, 18px) + var(--ds-dock-h, 48px) + var(--ds-dock-gap, 8px) - var(--space-2));
        padding-bottom: var(--ds-dock-bottom, 17.5px);
    }
    body:has(.app-shell--deck-shell > .ds > [data-ds-page-mark]) .sl-foot > * { pointer-events: auto; }
    body:has(.app-shell--deck-shell > .ds > [data-ds-page-mark]) .sl-foot .sl-foot__go {
        box-sizing: border-box;
        min-height: 0;
        height: var(--ds-dock-h, 48px);
    }
}
/* on a wide screen that bar sits in the middle, clear of the corner discs,
   and keeps its own look; the band stands aside there */
@media (min-width: 900px) {
    body:has(.sl-foot) .app-shell--deck-shell > .ds:has(> [data-ds-page-mark])::before { content: none; }
}

/* ---- the Market disc over a scrolling page ------------------------------ */
/* NO LIVE BLUR OVER A SCROLLING PAGE (Steven 2026-11-11, iPhone, the Market:
   "When I scroll these sorta glytch like shake"). On the deck the card under
   the Market disc holds still; on a page the whole page slides under it, and
   a backdrop-filter re-blurs that on every frame, a frame behind on iPhone.
   On pages the disc is the same white round with its gray ring, solid enough
   to read over words, nothing blurred through. The deck is unchanged. */
.app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .ds-fab--agent {
    background: color-mix(in srgb, var(--color-white) 92%, transparent);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .ds-fab--agent:hover {
    background: var(--color-white);
}

/* ---- THE X (Steven 2026-11-11, late night) -------------------------------
   One X for every page over the feed (components/_page_close.html,
   js/shell/page-close.js): top right, the corner mark's size and row (the
   logo's 40px, 12px down, 16px in, safe-area aware), a round of the page's
   own colour with a hairline ring so it reads over anything scrolling
   under it, a stroke-only X the bullseye's weight. Fixed, so it stays at
   every scroll position; over everything on its page (the shop's sheet
   too) and under an open dialog (the top layer). The whole round, and a
   margin round it, takes the tap. */
.ds-page-x {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + var(--space-3, 12px));
    right: calc(env(safe-area-inset-right, 0px) + var(--space-4, 16px));
    z-index: calc(var(--z-utility-overlay, 9400) + 3);
    box-sizing: border-box;
    width: var(--boh-rail-control-size, 40px);
    height: var(--boh-rail-control-size, 40px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full, 9999px);
    background: var(--surface-app, #fff);
    color: var(--text-primary, #111);
    box-shadow: 0 0 0 1px var(--border-default, rgb(0 0 0 / 0.12)), 0 4px 14px rgb(0 0 0 / 0.14);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.ds-page-x::after {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--space-2, 8px));
    border-radius: inherit;
}
.ds-page-x:hover { background: var(--surface-hover, var(--surface-app, #fff)); }
.ds-page-x:focus-visible { outline: 2px solid var(--color-primary, #7c3aed); outline-offset: 3px; }
.ds-page-x__glyph { display: block; width: 22px; height: 22px; pointer-events: none; }
@media print { .ds-page-x { display: none; } }

/* ---- THE PAGE FRAME (worker C, Steven 2026-11-11, late night) ------------
   "it's still got that corner look in it with the icon. The card part can
   be gone on the bottom right. So the lines just basically extend from the
   top left-hand corner all the way across. And then the bottom goes down
   the one side all the way down. And just keeps on going. It just never
   turns into a card."
   One look for every page over the feed (components/_deck_shell.html
   .ds-page-frame): the card's own frame (card-frame.css .cf: the 5px white
   band between its two 1px dark gray lines, the round pocket at the top
   left with the card's own curve), held at the card's own inset from the
   window's top left and running off the right edge and off the bottom, so
   it never closes. Fixed: the side line keeps going as the page scrolls.
   The top (the strip above and inside the top line down past the pocket)
   is the page's own colour and stays put; the page scrolls under it. The
   logo sits in the pocket where a card's mark sits, the title on its row,
   the X (components/_page_close.html) at the row's other end.
   A room (body.mobile-chat-open) keeps the frame too: its own header (the
   back arrow, the room's name) starts under the frame's top. */
:root {
    --ds-pf-in: var(--space-1, 4px);                 /* a card's inset on a phone (deck-shell.css --ds-slide-pad) */
    --ds-pf-head: 80px;                              /* the pocket (75) and the band's margin under it */
    --ds-pf-mark: 18px;                              /* the mark's place in the pocket (card-frame.css --cf-mark-x: 37.5 + 0.5 - 20) */
    --ds-pf-top: calc(env(safe-area-inset-top, 0px) + var(--ds-pf-in));
    --ds-pf-left: calc(env(safe-area-inset-left, 0px) + var(--ds-pf-in));
    --ds-pf-bg: var(--ds-page-band, var(--surface-app, #fff));
}
@media (min-width: 768px) {
    :root { --ds-pf-in: var(--space-3, 12px); }
}
.ds-page-frame {
    position: fixed;
    top: var(--ds-pf-top);
    left: var(--ds-pf-left);
    right: -64px;                                     /* the top line runs off the right edge */
    bottom: -64px;                                    /* the side line runs off the bottom */
    z-index: calc(var(--z-fab-above) - 1);           /* over the page, under the logo, the title, the X and the discs */
    pointer-events: none;
}
/* the open card: no right and no bottom side, the top left corner only */
.ds-page-frame > .cf {
    border-right-width: 0;
    border-bottom-width: 0;
    border-radius: var(--cf-a) 0 0 0;
}
.ds-page-frame > .cf::before {
    border-right-width: 0;
    border-bottom-width: 0;
    border-radius: var(--cf-a) 0 0 0;
}
/* the top that stays put, and the margin outside the side line: the page's
   own colour, under the lines */
.ds-page-frame::before,
.ds-page-frame::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: calc(-1 * var(--ds-pf-top));
    left: calc(-1 * var(--ds-pf-left));
    background: var(--ds-pf-bg);
}
.ds-page-frame::before { right: 0; height: calc(var(--ds-pf-top) + var(--ds-pf-head)); }
.ds-page-frame::after { bottom: 0; width: var(--ds-pf-left); }

/* the logo in the pocket, as on a card: black line work on the white */
.ds-page-frame ~ .ds-page-mark {
    top: calc(var(--ds-pf-top) + var(--ds-pf-mark));
    left: calc(var(--ds-pf-left) + var(--ds-pf-mark));
    color: var(--cf-ink, #030308);
}
.ds-page-frame ~ .ds-page-mark::before { content: none; }
/* the title across the top, between the pocket and the X */
.ds-page-frame ~ .ds-page-title {
    top: calc(var(--ds-pf-top) + var(--ds-pf-mark));
    left: calc(var(--ds-pf-left) + 75px + var(--space-3, 12px));
    right: calc(env(safe-area-inset-right, 0px) + var(--space-4, 16px) + var(--boh-rail-control-size, 40px) + var(--space-3, 12px));
    display: block;
    line-height: var(--boh-rail-control-size, 40px);
    white-space: nowrap;
    text-overflow: ellipsis;
}
/* the X on the logo's row */
.ds-page-frame ~ .ds-page-x {
    top: calc(var(--ds-pf-top) + var(--ds-pf-mark));
}
/* the page starts under the top that stays put, and right of the side line */
.app-shell--deck-shell > .ds:has(> .ds-page-frame) {
    height: calc(var(--ds-pf-top) + var(--ds-pf-head));
}
.app-shell--deck-shell:has(> .ds > .ds-page-frame) .main-area {
    padding-left: calc(var(--ds-pf-left) + 6px);
}
/* A ROOM KEEPS THE FRAME (Steven 2026-11-11: the frame on every page over
   the feed): the corner, the title (the house) and the X stay on the top
   row and the two lines run on; the room's own view (its back arrow, its
   name, its words, its message box) starts under the top that stays put
   and right of the side line. */
body.mobile-chat-open .ds-page-frame ~ .ds-page-title { display: block; }
body.mobile-chat-open:has(.ds-page-frame) #mobile-view-chat {
    box-sizing: border-box;
    padding-top: calc(var(--ds-pf-top) + var(--ds-pf-head));
    padding-left: calc(var(--ds-pf-left) + 6px);
}
@media (max-width: 767px) {
    body.mobile-chat-open:has(.ds-page-frame) .app-shell--deck-shell:has(> .ds > [data-ds-page-mark]) .mobile-chat-header {
        padding-left: var(--space-3, 12px);
        min-height: 0;
    }
}
@media print { .ds-page-frame { display: none; } }

/* ---- PAGES OVER THE FEED (worker C, Steven 2026-11-11, late night) -------
   ONE NAME, NEVER A CLASS: the layer is styled by its id (#ds-over) only.
   `ds-over` is also a class deck-shell.js puts on <body> while a card's
   Details sheet or its work (Review, Choose, a step) is up; a rule on the
   class here hid the whole page then (Steven 2026-11-12: "I clicked review
   and a blank screen came up").
   "each page is OVER the feed. So it needs to happen super fast, like it
   was preloaded." The layer the feed keeps for them (components/
   _deck_shell.html #ds-over, js/shell/page-over.js): laid out at full size
   at all times, so a page kept ready in it draws while it waits, and
   hidden until a tap shows it. Over the feed and its two discs, under the
   Market's panel and every dialog (the tray opens over it). The page
   frame, the logo, the title and the X sit over the page that shows. */
#ds-over {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-utility-overlay, 9400) - 1);
    visibility: hidden;
    pointer-events: none;
    contain: strict;
}
#ds-over.is-open {
    visibility: visible;
    pointer-events: auto;
    background: var(--ds-pf-bg);
}
/* the frame's pieces over the page: the same rules as a page's own
   (THE PAGE FRAME above), here inside the layer */
#ds-over > .ds-page-frame,
#ds-over > .ds-page-mark,
#ds-over > .ds-page-title { position: absolute; }
#ds-over > .ds-page-frame { z-index: 2; }
#ds-over > .ds-page-mark,
#ds-over > .ds-page-title { z-index: 3; }
#ds-over > .ds-page-x { z-index: 4; }
/* ONE X, ALWAYS (Steven 2026-11-12): the layer's X is gone whenever its
   page is (never a white X left over the Market's own) */
#ds-over:not(.is-open) .ds-page-x { display: none !important; }
#ds-over > .ds-page-title[hidden] { display: none; }
.ds-over__pages {
    position: absolute;
    inset: 0;
    z-index: 1;
}
/* a page kept ready: drawn at full size, shown only when it is the one */
.ds-over__pages > * {
    position: absolute;
    inset: 0;
    visibility: hidden;
}
#ds-over.is-open .ds-over__pages > .is-shown { visibility: visible; }
.ds-over__frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: transparent;
}
/* while the page under the frame draws: the frame, the logo, the title
   and the X are already there, on the page's own colour, and a quiet line
   under the title says it is coming */
#ds-over.is-waiting > .ds-page-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 32px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.35;
    animation: ds-over-wait 0.9s ease-in-out infinite alternate;
}
@keyframes ds-over-wait { from { transform: translateX(0); } to { transform: translateX(48px); } }
@media (prefers-reduced-motion: reduce) { #ds-over.is-waiting > .ds-page-title::after { animation: none; } }
/* the feed's own discs stay under a page over the feed */
html.ds-over-open .app-shell--deck-shell > .ds > .ds-fab { visibility: hidden; }

/* THE PASSPORT'S PAGE (Steven 2026-11-11: "the passport should be like a
   page also"): the Passport as it was on its card (feed/_passport_book_card.html),
   now a page under the frame: it scrolls under the top that stays put and
   starts right of the side line; no card edge of its own. */
.ds-over__page--passport {
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: calc(var(--ds-pf-top) + var(--ds-pf-head)) 0 0 calc(var(--ds-pf-left) + 6px);
    box-sizing: border-box;
    background: var(--ds-pf-bg);
}
.ds-over__page--passport > .passport-feed-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    background: var(--color-dark-900);
    color: var(--text-inverse);
    font-family: var(--font-body);
}
.ds-over__page--passport .passport-feed-card > .tb-card__inner { flex: 1 0 auto; border-radius: 0; }

/* INSIDE A FRAME OVER THE FEED (deck-shell-pages.js sets html.ds-in-over):
   the feed draws the corner, the title and the X over the page, so the
   page's own stand aside (its top keeps its room) */
html.ds-in-over .ds-page-frame > .cf,
html.ds-in-over .ds-page-mark,
html.ds-in-over .ds-page-title,
html.ds-in-over .ds-page-x { visibility: hidden; }

/* MESSAGES IN THE FRAME (worker C): on the feed the Messages zone wears the
   page frame (page-over.js puts the frame and the one X in it): its own
   purple bar becomes the frame's top row on the page's own colour, its
   envelope sits in the pocket where a page's logo sits, its title on the
   row, + MESSAGE before the X. dm.js keeps its hooks (the title, the
   action button). */
#zone-messages[data-ds-framed] { position: relative; background: var(--ds-pf-bg); }
#zone-messages[data-ds-framed] > .ds-page-frame { position: absolute; z-index: 2; }
#zone-messages[data-ds-framed] > .utility-bar {
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    height: calc(var(--ds-pf-top) + var(--ds-pf-head));
    padding: var(--ds-pf-top) calc(env(safe-area-inset-right, 0px) + var(--space-4, 16px) + var(--boh-rail-control-size, 40px) + var(--space-3, 12px)) 0 calc(var(--ds-pf-left) + 75px + var(--space-3, 12px));
    align-items: flex-start;
    background: transparent;
    color: var(--text-primary);
    border: 0;
    box-shadow: none;
}
#zone-messages[data-ds-framed] .toll-bench-header__identity { height: calc(var(--ds-pf-mark) * 2 + var(--boh-rail-control-size, 40px)); }
#zone-messages[data-ds-framed] .toll-bench-brand {
    position: absolute;
    top: calc(var(--ds-pf-top) + var(--ds-pf-mark));
    left: calc(var(--ds-pf-left) + var(--ds-pf-mark));
    width: var(--boh-rail-control-size, 40px);
    height: var(--boh-rail-control-size, 40px);
    border: 0;
    color: var(--cf-ink, #030308);
}
#zone-messages[data-ds-framed] .toll-bench-brand__glyph { width: 30px; height: 30px; font-size: 30px; }
#zone-messages[data-ds-framed] .toll-bench-header__title {
    color: var(--text-primary);
    font-size: var(--text-xl);
    line-height: var(--boh-rail-control-size, 40px);
}
#zone-messages[data-ds-framed] .toll-bench-header__right { height: calc(var(--ds-pf-mark) * 2 + var(--boh-rail-control-size, 40px)); }
#zone-messages[data-ds-framed] .toll-bench-header-action {
    background: var(--surface-primary, #fff);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--border-default, rgb(0 0 0 / 0.12));
}
#zone-messages[data-ds-framed] .utility-bar__close { display: none !important; }
#zone-messages[data-ds-framed] .ds-page-x { top: calc(var(--ds-pf-top) + var(--ds-pf-mark)); }
#zone-messages[data-ds-framed] > :not(.ds-page-frame):not(.utility-bar) {
    position: relative;
    z-index: 1;
    margin-left: calc(var(--ds-pf-left) + 6px);
}

/* THE MARKET OVER THE FEED KEEPS THE PURPLE PLUS (Steven 2026-11-11: the
   plus opens "What do you want for your life?" over whatever is on
   screen): with the Market's panel open over the feed, the deck's discs
   ride over it as they do on /shop (THE SHOP above), and the plus opens
   the want page over the panel. */
body:has(#panel-utility.fullscreen-panel--open #zone-shop.utility-zone--active) .app-shell--deck-shell > .ds > .ds-fab {
    z-index: calc(var(--z-utility-overlay, 9400) + 1);
}


/* THE AGENT CARD'S ROUND, by its address (/agents/<handle>, cards/agent_page.html;
   Steven 2026-11-12: "For the agent card I want there to be the clubs agent
   symbol in the corner ... (it should be the round circle.)"): the shell's
   logo is the Passport's floating white round with the agent's club (the
   type mark 'agent', components/_cards_mark.html agent_mark) in the page's
   dark ink, its number on the shoulder; no corner curve under it. */
body.agent-page .ds-page-frame > .cf .cf__pocket { visibility: hidden; }
body.agent-page:not(.mobile-chat-open) .ds-page-frame ~ .ds-page-mark::before {
    content: "";
    inset: calc((40px - 75px) / 2);
    border-radius: var(--radius-full, 9999px);
    background: var(--surface-primary, #fff);
    box-shadow: 0 0 0 1px var(--border-subtle, rgb(0 0 0 / 0.06)), 0 4px 14px rgb(0 0 0 / 0.14);
}
.ds-page-mark .ds-type__glyph .tb-agent-mark { width: 40px; height: 40px; color: var(--cf-ink, #030308); }

/* ---- A PAGE, NOT A CARD (Steven 2026-11-12, the agent page and the
   receipt: "why isnt this an actual pace?"; "These are terrible.") ------
   A page whose body carries .ds-page-plain wears the site's navigation
   every page has (the round button top left, Market, the purple +) and
   nothing of a card: no frame, no strip, no X (it sets deck_shell_frame
   false). The round top left is the card pocket's own round on its own:
   white, the 75px of the frame's pocket, at the frame's place, the mark in
   black line work; the page runs up under it. */
body.ds-page-plain .app-shell--deck-shell > .ds:has(> [data-ds-page-mark]) { height: 0; }
body.ds-page-plain .ds-page-mark {
    top: calc(var(--ds-pf-top) + var(--ds-pf-mark));
    left: calc(var(--ds-pf-left) + var(--ds-pf-mark));
    color: var(--cf-ink, #030308);
}
body.ds-page-plain .ds-page-mark::before {
    inset: calc((var(--boh-rail-control-size, 40px) - 75px) / 2);
    background: var(--surface-primary, #fff);
    box-shadow: 0 0 0 1.5px rgb(3 3 8 / 0.12), 0 6px 18px rgb(3 3 8 / 0.14);
}

/* ---- INSIDE A HOUSE (Steven 2026-11-13) --------------------------------- */
/* "for the signal house here, I want the icon in the corner to be the house
   icons that used to be in the book of houses drawer": the round in the
   pocket wears the house's own icon, as the drawer's rail drew it (a round
   crop of the house's black line icon on white, rail-nav.css
   .boh-rail__house-img), with a hairline so it reads on the white pocket.
   The bullseye stays for a house with none. Here and over the feed
   (#ds-over's mark, js/shell/page-over.js). */
.cf-mark .cf-glyph--house {
    width: var(--cf-mark, 40px);
    height: var(--cf-mark, 40px);
    border-radius: var(--radius-full, 9999px);
    object-fit: cover;
    background: var(--color-white, #fff);
    box-shadow: 0 0 0 1px rgb(15 23 42 / 0.14);
}
/* "The count for the house should be the number of messages you have in
   your house": no number at 0 */
.cf-mark .cf-mark__badge[hidden] { display: none; }

/* the Topics tab carries the house's unread, every room together, in the
   rows' purple (house-detail.css .channel-item__badge), on the tab's
   shoulder so the word keeps its room */
.house-mobile-bottom-nav__item:has(> .house-mobile-bottom-nav__count) { position: relative; overflow: visible; }
.house-mobile-bottom-nav__count {
    position: absolute;
    top: -3px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-full, 9999px);
    background: var(--indicator-unread, #5534a5);
    box-shadow: 0 0 0 2px var(--color-white, #fff);
    color: var(--color-white, #fff);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: var(--font-semibold, 600);
    font-style: normal;
    letter-spacing: 0;
    line-height: 1;
    pointer-events: none;
}
.house-mobile-bottom-nav__count[hidden] { display: none; }
