/* The phone app (Phase 27b): Phone & Notifications (frontend/src/shell/push/PushWindow.tsx).  Logical properties only. */
.psh{display:flex;flex-direction:column;gap:16px}
.psh-sec{display:flex;flex-direction:column;gap:10px}
.psh-sec h4{margin:0;font-size:13px;font-weight:700;color:var(--text-primary)}
.psh .int-lead,.psh .int-err{margin:0;padding-inline:0}
.psh-acts{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}
.psh-acts:empty{display:none}
.psh-note{margin:0;font-size:12.5px;color:var(--text-muted)}
.psh-here{margin-inline-start:8px;vertical-align:middle}
.psh .int-empty{margin:0}
/* GPS-fenced clock-in (frontend/src/pages/attendance): where a punch was made, the site form's Use My Location */
.at-where{display:inline-flex;align-items:center;gap:5px;flex-wrap:wrap}
.at-where svg{color:var(--accent);flex:none}
.at-where a{color:var(--accent);text-decoration:none;margin-inline-start:4px}
.at-where a:hover{text-decoration:underline}
.at-punch svg{margin-inline-start:4px;color:var(--accent)}
.at-fence{display:flex;align-items:center;gap:6px}
.ats-where{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.ats-where a{color:var(--accent);font-size:13px}

/* ── Touch screens (any width) ───────────────────────────────────────────────────────────────────────────────────
   No hover: controls that appear on hover are always shown (dimmed, so the resting look stays calm).  Tooltips come
   from a tap or a press-and-hold (kit/services/tooltip.ts), so a held button gives no browser callout.  Lists that
   already swap hover actions for a touch layout (.hov-acts, .hdl-acts, .cp-actions, .tl-act-del) keep their own rules. */
@media (hover:none){
  .ra-qact,.topo-box-actions,.osx-pm-acts,.osx .osx-go,.frc-tile .frc-star:not(.on){opacity:.75}
  .ww-ql-slot-acts{opacity:1;pointer-events:auto}
  .inp-kpi-ask,.apc-slot-plus{opacity:.75;transform:none}
  .kbl-card-more{opacity:1}
  .ra-row.open .ra-qact{opacity:0!important}
  button[data-tip],.icon-btn,.btn{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
}

/* ── Phones (≤ 600 px, Phase 27b slice 3) ─────────────────────────────────────────────────────────────────────────
   The menu leaves the screen and slides in from Menu on the phone bar (shell/menu/PhoneBar.tsx); the top bar keeps the
   title, the AI assistant, the bell, Audit Logs and the theme; list rows become cards (kit/DataTable.tsx `dt-cards`).  Tablets
   (601–768 px) keep the narrow rail of styles.css. */
.phone-bar{display:none}
@media (max-width:600px){
  :root{--pb-h:58px}
  .main-wrap,.main-wrap.sidebar-collapsed,#app.nsm-rail .main-wrap,#app.nsm-rail .main-wrap.sidebar-collapsed{margin-inline-start:0;height:100dvh}
  .sidebar,#app.nsm-rail .sidebar{transform:translateX(calc(-100% * var(--dir)));transition:transform .22s cubic-bezier(.4,0,.2,1);box-shadow:none;
    height:calc(100dvh - var(--pb-h) - env(safe-area-inset-bottom))}
  .sidebar.sidebar-open,#app.nsm-rail .sidebar.sidebar-open{transform:none;box-shadow:12px 0 40px rgba(2,6,23,.3)}
  .sidebar-overlay.open{display:block!important;z-index:99}
  .ns-peek{max-width:calc(100vw - var(--ns-rail-w,72px) - 12px);bottom:calc(var(--pb-h) + env(safe-area-inset-bottom))}
  .content-area{padding:12px 12px calc(var(--pb-h) + 16px + env(safe-area-inset-bottom))}

  /* the bar at the foot */
  .phone-bar{display:flex;position:fixed;inset-inline:0;bottom:0;z-index:101;height:calc(var(--pb-h) + env(safe-area-inset-bottom));
    padding:4px 4px env(safe-area-inset-bottom);background:var(--topbar-bg);border-top:1px solid var(--border);box-shadow:0 -6px 20px rgba(2,6,23,.06)}
  .pb-btn{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:0;background:none;
    color:var(--text-muted);font:inherit;font-size:10.5px;font-weight:600;cursor:pointer;border-radius:12px;-webkit-tap-highlight-color:transparent}
  .pb-btn.on{color:var(--accent)}
  .pb-btn.on .pb-ic{background:color-mix(in srgb, var(--accent) 12%, transparent)}
  .pb-ic{position:relative;width:44px;height:28px;border-radius:14px;display:flex;align-items:center;justify-content:center}
  .pb-ic svg{width:20px;height:20px}
  .pb-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .pb-badge{position:absolute;top:-4px;inset-inline-end:2px;min-width:17px;height:17px;padding:0 4px;box-sizing:border-box;border-radius:9px;
    background:var(--red);color:#fff;font-size:9.5px;font-weight:700;line-height:17px;text-align:center;border:2px solid var(--topbar-bg)}

  /* the top bar: the title shortens; what the phone bar or the menu already offers leaves */
  .topbar{padding:0 12px;gap:8px}
  .topbar-left{min-width:0;flex:1 1 auto}
  .topbar-title-row{min-width:0}
  .topbar-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .topbar-breadcrumb{display:none}
  #mobMenuBtn,#gsTrigger,#topbarPin,.help-topbar-btn,.topbar-divider{display:none!important}
  /* Audit Logs stays: it is in the top bar for everyone signed in and in no menu */
  #topbarTools>div{gap:6px!important;flex:none}

  /* lists: Columns / Export stay on computers; the count and the page's buttons share a row under the search */
  .ra-filter-bar .dt-btn-group,.dt-toolbar{display:none}
  .ra-filter-bar .bar-end{flex:0 1 auto;order:0;margin-inline-start:auto}
  .ra-filter-bar{flex-direction:row;flex-wrap:wrap;align-items:center}
  .ra-filter-bar>.ss,.ra-filter-bar .smart-search,.ra-filter-bar .ra-filter-search{flex:1 1 100%}
  .ra-filter-bar>.ra-fcnt{flex:0 1 auto}
  .at-clock-s{white-space:normal}

  /* record pages: the header's buttons wrap under the title; a card's own buttons drop under its heading; notices
     sit above the phone bar */
  .pr-hero{padding:16px}
  .pr-hero .pr-hero-acts{flex-wrap:wrap!important;flex-shrink:1;margin-inline-start:0;max-width:100%}
  .cqp-head{height:auto;min-height:58px;flex-wrap:wrap;row-gap:8px;padding:10px 16px}
  .toast-container{bottom:calc(var(--pb-h) + env(safe-area-inset-bottom) + 10px)}

  /* list tiles two to a row: a long note ends in … inside its tile */
  .hdl-tile-leg{max-width:100%;min-width:0;overflow:hidden}
  .hdl-tile-note{min-width:0;overflow:hidden;text-overflow:ellipsis}

  /* rows as cards */
  .table-wrap:has(> .data-table.dt-cards){overflow-x:visible}
  .data-table.dt-cards,.data-table.dt-cards>tbody,.data-table.dt-cards>tfoot{display:block;width:100%;min-width:0}
  .data-table.dt-cards>thead{display:none}
  .data-table.dt-cards>tbody>tr,.data-table.dt-cards>tfoot>tr{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:10px;row-gap:5px;
    padding:12px 14px;border-bottom:1px solid var(--border)}
  .data-table.dt-cards>tbody>tr:last-child{border-bottom:0}
  .data-table.dt-cards>tbody>tr>td,.data-table.dt-cards>tfoot>tr>td{grid-column:1 / -1;display:block;padding:0;border:0;min-width:0;
    max-width:none!important;width:auto!important;white-space:normal;text-align:start;background:none!important}
  /* a "Label  value" line: the label on the start side, whatever the cell holds stacked on the end side */
  .data-table.dt-cards>tbody>tr>td[data-label],.data-table.dt-cards>tfoot>tr>td[data-label]{display:grid;grid-template-columns:auto minmax(0,1fr);
    column-gap:12px;row-gap:0;align-items:baseline;justify-items:end;text-align:end}
  .data-table.dt-cards>tbody>tr>td[data-label]>*+*{margin-top:2px}
  .data-table.dt-cards>tbody>tr>td[data-label]::before,.data-table.dt-cards>tfoot>tr>td[data-label]::before{content:attr(data-label);grid-column:1;
    grid-row:1 / span 4;justify-self:start;max-width:40vw;text-align:start;font-size:12px;font-weight:500;color:var(--text-muted)}
  .data-table.dt-cards>tbody>tr>td:empty,.data-table.dt-cards>tfoot>tr>td:empty{display:none}
  .data-table.dt-cards>tbody>tr>td.dt-card-title{grid-column:1;font-weight:600;align-self:center}
  .data-table.dt-cards>tbody>tr>td.dt-card-tool+td.dt-card-title{grid-column:1}
  .data-table.dt-cards>tbody>tr>td.row-acts-cell{grid-column:2;grid-row:1;align-self:start;padding:0}
  .data-table.dt-cards>tbody>tr>td.dt-card-tool~td.row-acts-cell{grid-row:2}
  .data-table.dt-cards>tbody>tr>td[colspan]{display:block;text-align:start}
  .data-table.dt-cards>tbody>tr.dt-grp-row{display:block;padding:8px 14px}
  .data-table.dt-cards>tbody>tr>td>*{min-width:0;max-width:100%}
  .data-table.dt-cards>tbody>tr>td [style*="nowrap"]{white-space:normal!important}
}

/* ── Phones, the compact layer (≤ 600 px, 2026-12-01; UI_STANDARDS "Phones") ───────────────────────────────────────────
   A phone gets its own approach, not a squeezed computer page:
   - record headers put their buttons in one row above the title: the way back is an arrow (kit/BackButton.tsx), other
     plain buttons show their icons, the main button and the status menu keep their words;
   - list tiles shrink to label, figure and bar; list cards show four lines at a glance in two columns, the rest behind
     the card's More (kit/DataTable.tsx);
   - side panes fold to one bar once something is picked (kit/SidePane.tsx);
   - forms, confirmations and action menus rise from the foot of the screen as sheets (kit/ActionMenu.tsx's scrim);
   - a list bar's secondary buttons and How It Works show only their icons (the words stay their accessible names);
   - tab strips slide a picked tab into view and fade the edge that hides more (kit/services/tabDrag.ts). */
.data-table td.dt-card-more,.data-table td.dt-card-meta,.act-menu-scrim,.sp-ph-bar{display:none}
.rec-back-arr{display:inline-block}
[dir="rtl"] .rec-back-arr{transform:scaleX(-1)}   /* the way back points to the start side, right to left too */
@keyframes phSheetUp{from{transform:translateY(28px);opacity:.3}to{transform:none;opacity:1}}
@keyframes phFade{from{opacity:0}to{opacity:1}}
@media (max-width:600px){
  /* words that only need to be heard: kept for screen readers, gone from the screen */
  .ra-filter-bar .page-actions .btn:not(.btn-primary):has(> svg) > span,
  :is(.pr-hero-acts,.record-acts .page-actions,.x3-tb-r) > .btn:not(.btn-primary):has(> svg) > span,
  .ra-filter-bar .how-btn > span:last-child,.rec-back-l{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

  /* touch sizes: page buttons 40 high, small ones 34, icon buttons square; boxes never zoom the page (16px text) */
  .btn{height:40px}
  .btn-sm{height:34px}
  .icon-btn{width:36px;height:36px}
  .form-input,.ss-input,.sp-search input,textarea{font-size:16px}
  .content-area{padding-inline:10px}

  /* ─ list bars: search across the top; under it the count, then the buttons (secondary ones as icons) ─ */
  .ra-filter-bar{gap:8px}
  .ra-filter-bar .page-actions{flex-wrap:nowrap;gap:6px}
  .ra-filter-bar .page-actions .btn:not(.btn-primary):has(> svg){width:40px;padding:0;gap:0;flex:none}
  .ra-filter-bar .how-btn{width:30px;justify-content:center;padding:0}
  .ra-filter-bar > .how-btn{margin-inline-start:-4px}
  .ra-filter-bar > :is(.bar-end,.bar-actions,.page-actions),.ra-filter-bar > .how-btn ~ :is(.bar-end,.bar-actions,.page-actions){margin-inline-start:auto}
  .ra-filter-bar .bar-end,.ra-filter-bar .page-actions{justify-content:flex-end}
  .ra-filter-bar .how-btn .how-btn-ic svg{width:17px;height:17px}
  .ss-hint{display:none}

  /* ─ list tiles: two to a row (three when there are three), label · figure · bar; the legend stays on computers ─ */
  .hdl-tiles,.hdl-tiles.hdl-tiles-3{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:10px}
  .hdl-tiles:has(> .hdl-tile:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}
  .hdl-tiles:not(:has(> .hdl-tile:nth-child(3):last-child)) > .hdl-tile:last-child:nth-child(odd){grid-column:1 / -1}
  .hdl-tile{min-height:0;gap:8px;padding:10px 12px;border-radius:12px}
  .hdl-tile .ph-hic,.hdl-tile-leg{display:none}
  .hdl-tile-top{gap:6px}
  .hdl-tile-lbl{font-size:12px}
  .hdl-tile-n{font-size:20px}
  .hdl-tile-bar{height:4px}
  .hdl-tiles:has(> .hdl-tile:nth-child(3):last-child) .hdl-tile-top{flex-direction:column;align-items:flex-start;gap:4px}
  .hdl-tiles:has(> .hdl-tile:nth-child(3):last-child) .hdl-tile-lbl{width:100%}

  /* ─ list cards: title and row actions on top, then "label over value" lines two to a row ─ */
  .data-table.dt-cards>tbody>tr:not(.dt-grp-row){display:flex;flex-wrap:wrap;align-items:flex-start;column-gap:12px;row-gap:10px;padding:14px 16px}
  .data-table.dt-cards>tbody>tr>td.dt-card-tool{order:-3;flex:none}
  .data-table.dt-cards>tbody>tr>td.dt-card-title{order:-2;flex:1 1 55%;min-width:0;font-size:14px;line-height:1.3}
  .data-table.dt-cards>tbody>tr>td.row-acts-cell,.data-table.dt-cards>tbody>tr>td:has(> .row-acts){order:-2;flex:none;margin-inline-start:auto;align-self:flex-start}
  /* the meta line (columns with phone: 'meta'): who, when, a chip, a status dot, run together under the title, no labels */
  .data-table.dt-cards>tbody>tr>td.dt-card-hide{display:none}
  /* every item carries its dot before it; the inner box starts one dot early and the cell clips, so a line never
     begins with a dot however the items wrap */
  .data-table.dt-cards>tbody>tr>td.dt-card-meta{display:block;order:-1;flex:0 0 100%;min-width:0;overflow:hidden;
    margin-top:-4px;font-size:12.5px;line-height:1.3;color:var(--text-secondary)}
  .dt-meta-in{display:flex;flex-wrap:wrap;align-items:center;row-gap:6px;margin-inline-start:-19px}
  .dt-meta-in>.dt-meta{display:inline-flex;align-items:center;min-width:0;max-width:calc(100% - 19px)}
  .dt-meta-in>.dt-meta::before{content:"";flex:none;width:3px;height:3px;margin-inline:8px;border-radius:50%;background:var(--text-muted);opacity:.7}
  /* a status with its figure and bar (StatusCell) takes a line of its own under the rest */
  .dt-meta-in>.dt-meta:has(.st-cell,.st-bar){flex:0 0 calc(100% - 19px);order:1;margin-top:4px;margin-inline-start:19px}
  .dt-meta-in>.dt-meta:has(.st-cell,.st-bar)::before{display:none}
  .dt-meta-in>.dt-meta>.st-cell{width:100%}
  .dt-card-meta .badge{white-space:nowrap}
  .dt-meta-in>.dt-meta>*+*{margin-inline-start:6px}
  .data-table.dt-cards>tbody>tr>td[data-label]{display:flex;flex-direction:column;align-items:flex-start;gap:2px;flex:0 0 calc(50% - 6px);min-width:0;
    text-align:start;font-size:13px;line-height:1.35}
  .data-table.dt-cards>tbody>tr>td[data-label]::before{grid-row:auto;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
    font-size:11px;font-weight:600;letter-spacing:.01em}
  .data-table.dt-cards>tbody>tr>td[data-label]>*+*{margin-top:0}
  /* a status cell or bar reads across the card, under the paired lines */
  .data-table.dt-cards>tbody>tr>td[data-label]:has(.st-cell,.st-bar,.hdl-tile-bar){flex-basis:100%;order:1}
  .data-table.dt-cards>tbody>tr>td[data-label]:has(.st-cell)>.st-cell{width:100%}
  .data-table.dt-cards>tbody>tr:not(.dt-open)>td.dt-card-x:not(:has(.row-acts)){display:none}
  /* a cell that shows the row actions on hover (.hov-cell): the actions sit in the card's top corner, the value stays */
  .data-table.dt-cards>tbody>tr:has(> td.hov-cell){position:relative}
  .data-table.dt-cards>tbody>tr:has(> td.hov-cell)>td.dt-card-title{padding-inline-end:76px}
  .data-table.dt-cards td.hov-cell{position:static;overflow:visible}
  .data-table.dt-cards td.hov-cell .hov-acts{position:absolute;top:12px;inset-inline-end:14px;transform:none;margin:0;display:inline-flex;gap:4px;pointer-events:auto}
  .data-table.dt-cards td.hov-cell .hov-acts .icon-btn{width:36px;height:36px;opacity:1;transform:none}
  .data-table.dt-cards tr>td.hov-cell>.hov-t{opacity:1!important;transform:none!important}
  .data-table.dt-cards>tbody>tr>td.dt-card-more{display:block;order:2;flex:0 0 100%;margin-top:-2px}
  .dt-card-more button{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0;border:0;background:none;color:var(--accent);
    font:600 12.5px var(--font-body);cursor:pointer}
  .dt-card-more button::after{content:'';width:6px;height:6px;border:solid currentColor;border-width:0 1.6px 1.6px 0/* phys: a drawn down chevron, the same both ways */;transform:translateY(-2px) rotate(45deg);
    transition:transform .2s}
  .dt-card-more button[aria-expanded="true"]::after{transform:translateY(1px) rotate(-135deg)}

  /* ─ record headers: one row of buttons above the title, the way back at the start, the rest at the end ─ */
  .pr-hero:not(.mw-hero){flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:12px;padding:12px 14px 16px}
  .pr-hero .pr-hero-acts{order:-1;flex-wrap:nowrap!important;justify-content:flex-start;width:100%;max-width:100%;gap:6px;overflow-x:auto;scrollbar-width:none;
    padding-bottom:12px;border-bottom:1px solid color-mix(in srgb,var(--accent) 14%,var(--border))}
  .pr-hero .pr-hero-acts::-webkit-scrollbar,.record-acts .page-actions::-webkit-scrollbar{display:none}
  .pr-hero .pr-hero-acts>*,.record-acts .page-actions>*{flex:none}
  /* the first button (the way back) holds the start, the rest gather at the end; the main button gives up words first */
  .pr-hero .pr-hero-acts>:first-child,.record-acts .page-actions>:first-child{margin-inline-end:auto}
  .pr-hero .pr-hero-acts>.btn-primary,.record-acts .page-actions>.btn-primary{flex:0 1 auto;min-width:0}
  :is(.pr-hero-acts,.record-acts .page-actions)>.btn-primary>span{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .pr-hero-tile{display:none}
  .pr-hero-id{gap:12px}
  .pr-hero .pr-hero-title h1{font-size:20px;line-height:1.25}
  .pr-hero-title{gap:6px}
  .pr-pill{font-size:11px;padding:2px 8px}
  .pr-hero-sub{gap:6px;margin-top:6px;font-size:12.5px}
  .pr-hero-acts .btn,.pr-hero-acts .icon-btn,.pr-hero-acts .pr-status{height:38px}
  .pr-hero-acts .icon-btn{width:38px}
  .record-acts{min-height:0;padding-bottom:10px}
  .record-acts .page-actions{flex-wrap:nowrap;justify-content:flex-start;gap:6px;overflow-x:auto;scrollbar-width:none}
  /* a record page's figure tiles (invoice, bill, subscription): smaller icons; a tile's own button drops under its text */
  .fnp-tiles{gap:8px}
  .fnp-tile,.fnp-tile.has-ic{padding:12px;gap:10px}
  .fnp-tile-ic{width:34px;height:34px;border-radius:10px}
  .fnp-tile b{font-size:14.5px}
  .fnp-tile:has(> .fnp-tile-act){flex-wrap:wrap}
  .fnp-tile:has(> .fnp-tile-act) .fnp-tile-t{flex:1 1 calc(100% - 44px)}
  .fnp-tile-act{position:static;margin-inline-start:44px}
  :is(.pr-hero-acts,.record-acts .page-actions,.x3-tb-r) > .btn:not(.btn-primary):has(> svg):has(> span){width:38px;padding:0;gap:0}
  /* 360 views: a short title; pager at the start of one row of buttons; the identity card's facts two to a row */
  .x3-titlebar{gap:10px}
  .x3-tb-l>.x3-tile{display:none}
  .x3-h1{font-size:20px}
  .x3-tb-r{width:100%;flex-wrap:nowrap;justify-content:flex-start;gap:6px}
  .x3-tb-r>*{flex:none}
  .x3-tb-r>:first-child{margin-inline-end:auto}
  .x3-tb-r .btn,.x3-tb-r .icon-btn{height:38px}
  .x3-tb-r .icon-btn{width:38px}
  .x3-hero{padding:16px}
  .x3-bigav{width:52px;height:52px;border-radius:15px;font-size:18px}
  .x3-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 10px;margin-top:14px;padding-top:14px}
  .x3-fact{gap:8px}
  .x3-fact>.x3-tile{width:28px!important;height:28px!important}
  .x3-fact-v{font-size:13px}
  .rec-back{width:38px;padding:0;margin-inline-end:auto}
  .rec-back-arr{font-size:18px;line-height:1}
  .cdx-hero{padding:12px 14px 14px}
  .cdx-head{gap:12px}
  .cdx-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  .cdx-stat,.cdx-head .cdx-stat{min-width:0;padding:10px 12px}
  .cdx-stat+.cdx-stat{border-inline-start:0}
  .cdx-stat:nth-child(even){border-inline-start:1px solid var(--border)}
  .cdx-stat:nth-child(n+3){border-top:1px solid var(--border)}
  .cdx-stat-val{font-size:18px}
  .cdx-stat-main{min-height:26px}

  /* ─ side panes: folded to one bar while something is picked; the bar opens the list again ─ */
  .sp,.sp.sp-attached{max-height:min(60dvh,460px)}
  .sp.sp-ph-folded{max-height:none}
  .sp-head{height:auto;min-height:56px;padding-block:6px;padding-inline:14px 12px}
  .sp.sp-ph-can .sp-head-t{display:none}
  .sp-ph-bar{display:flex;align-items:center;gap:10px;flex:1 1 auto;min-width:0;min-height:44px;padding:0;border:0;background:none;font:inherit;
    text-align:start;color:var(--text-primary);cursor:pointer;-webkit-tap-highlight-color:transparent}
  .sp>.sp-ph-bar{flex:none;padding-inline:14px;min-height:56px;border-bottom:1px solid var(--border)}
  .sp-ph-t{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0}
  .sp-ph-t small{font-size:11px;font-weight:600;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sp-ph-t b{font-size:14.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sp-ph-chev{width:18px;height:18px;flex:none;color:var(--text-muted);transition:transform .2s}
  .sp-ph-bar[aria-expanded="true"] .sp-ph-chev{transform:rotate(180deg);color:var(--accent)}
  .sp.sp-ph-folded>:not(.sp-head):not(.sp-ph-bar){display:none}
  .sp.sp-ph-folded>.sp-head,.sp.sp-ph-folded>.sp-ph-bar{border-bottom:0}
  .sp-item{min-height:44px}

  /* ─ tab strips: tabs share the width while they fit, else keep their size and slide; the hidden side fades ─ */
  .tab-nav{border-radius:14px;margin-bottom:12px;scroll-snap-type:x proximity}
  .tab-btn{flex:1 0 auto;padding:8px 13px;font-size:12.5px;scroll-snap-align:center}
  .tab-nav.tn-more-e{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}
  .tab-nav.tn-more-s{-webkit-mask-image:linear-gradient(to right,transparent,#000 32px);mask-image:linear-gradient(to right,transparent,#000 32px)}
  .tab-nav.tn-more-s.tn-more-e{-webkit-mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent);
    mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}
  [dir="rtl"] .tab-nav.tn-more-e{-webkit-mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}
  [dir="rtl"] .tab-nav.tn-more-s{-webkit-mask-image:linear-gradient(to left,transparent,#000 32px);mask-image:linear-gradient(to left,transparent,#000 32px)}
  [dir="rtl"] .tab-nav.tn-more-s.tn-more-e{-webkit-mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent);
    mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent)}

  /* ─ forms and confirmations: a sheet from the foot of the screen; Cancel narrow, the main button wide ─ */
  .modal-overlay{padding:0;align-items:flex-end}
  .modal,.modal.modal-lg,.modal.modal-xl,.modal.modal-sm,.modal.modal-form,.modal.modal-confirm{max-height:calc(100dvh - 28px);border-bottom:0;
    border-start-start-radius:22px;border-start-end-radius:22px;border-end-start-radius:0;border-end-end-radius:0;animation:phSheetUp .28s cubic-bezier(.2,.8,.2,1)}
  .modal::before{content:'';display:block;flex:none;width:38px;height:4px;margin:8px auto 0;border-radius:2px;background:color-mix(in srgb,var(--text-muted) 40%,transparent)}
  .modal-footer{padding:12px 16px calc(12px + env(safe-area-inset-bottom));flex-wrap:nowrap}
  .modal-footer .btn{flex:1 1 0;height:44px;min-width:0}
  .modal-footer .btn-primary,.modal-footer .btn-danger{flex-grow:1.8}

  /* ─ action menus (row ⋯, record ⋯, status menus): a sheet over a dimmed page ─ */
  .act-menu-scrim{display:block;position:fixed;inset:0;z-index:1199;background:var(--modal-overlay);animation:phFade .2s ease}
  .hdl-menu.act-menu{left:8px!important/* phys: overrides the script's placement */;right:8px!important/* phys: overrides the script's placement */;
    top:auto!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;width:auto;min-width:0;max-width:none;max-height:72dvh;padding:8px;border-radius:20px;
    animation:phSheetUp .24s cubic-bezier(.2,.8,.2,1)}
  .act-menu .hdl-mi{min-height:50px;padding-block:10px}

  /* ─ dashboard: a short greeting, tiles two to a row ─ */
  .dx-welcome{padding:16px}
  .dx-welcome-hd .dx-eyebrow,.dx-welcome-sub{display:none}
  .dx-welcome-hd{justify-content:flex-end}
  .dx-welcome-title{font-size:20px;margin-top:4px}
  .dx-meta{margin-top:8px}
  .dx-welcome-search{margin-top:12px}
  .dx-tiles-bar{margin-top:14px}
  .dx-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .dx-tile{padding:12px;gap:6px;min-height:0}
  .dx-tile-val{font-size:24px}
  .dx-tile-hd .dx-eyebrow{letter-spacing:.8px}

  /* ─ My Work: the greeting tightens; quick actions become a grid of app-style shortcuts ─ */
  .mw-hero{padding:14px}
  .mw-hero-av{width:42px;height:42px;border-radius:13px;font-size:15px}
  .mw-hero-t h2{font-size:18px}
  .mw-hero-t p{font-size:12.5px}
  .mw-hero-acts{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding-top:12px}
  .mw-hero-acts .mw-q{flex-direction:column;height:auto;min-height:72px;padding:10px 4px;gap:6px;border-radius:14px;white-space:normal;text-align:center;
    font-size:11px;font-weight:600;line-height:1.2}
  .mw-hero-acts .mw-q svg{width:20px;height:20px}
  .mw-hero-acts .mw-q span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .mw-cols{grid-template-columns:minmax(0,1fr)}
}

/* Take Photo (kit/FileDrop.tsx `photo`, the claim's Expenses card): only where there is a camera to hand — a touch screen */
.fmd-cam,.xp-cam-btn{display:none}
.fmd-cam{margin-top:8px;align-self:flex-start}
@media (pointer:coarse){.fmd-cam,.xp-cam-btn{display:inline-flex}}
@media (max-width:600px){.xp-head-acts{flex-wrap:wrap;justify-content:flex-end}}

/* Record pages fold on phones (kit/services/phoneFold.ts): the first two cards stay open, later ones show their title
   bar with a chevron (and a row count when the body is one list); a tap opens them.  Wider windows ignore data-fold. */
@media (max-width:600px){
  [data-fold="closed"],[data-fold="open"],[data-fold="shown"]{position:relative}
  [data-fold="closed"]>:first-child,[data-fold="open"]>:first-child,[data-fold="shown"]>:first-child{position:relative;cursor:pointer;
    padding-inline-end:34px;min-height:24px;-webkit-tap-highlight-color:transparent}
  [data-fold="closed"]>:first-child::before,[data-fold="open"]>:first-child::before,[data-fold="shown"]>:first-child::before{content:"";
    position:absolute;inset-inline-end:8px;top:50%;width:7px;height:7px;margin-top:-6px;border:solid var(--text-muted);
    border-width:0 2px 2px 0/* phys: a drawn down chevron, the same both ways */;transform:rotate(45deg);transition:transform .18s ease,margin .18s ease}
  [data-fold="open"]>:first-child::before,[data-fold="shown"]>:first-child::before{transform:rotate(-135deg);margin-top:-2px}
  [data-fold="closed"]{cursor:pointer}
  [data-fold="closed"]>:not(:first-child){display:none!important}
  [data-fold="closed"]>:first-child{margin-bottom:0!important;border-bottom-color:transparent!important}
  [data-fold="closed"]>:first-child[data-fold-n]{padding-inline-end:64px}
  [data-fold="closed"]>:first-child[data-fold-n]::after{content:attr(data-fold-n);position:absolute;inset-inline-end:28px;top:50%;transform:translateY(-50%);
    min-width:22px;height:20px;padding-inline:6px;border-radius:10px;box-sizing:border-box;background:color-mix(in srgb,var(--accent) 11%,transparent);
    color:var(--accent);font-size:11.5px;font-weight:700;line-height:20px;text-align:center}
  [data-fold="shown"]>:not(:first-child){animation:phFade .2s ease}
}
/* Long unbroken text (formulas, keys, addresses) wraps on phones instead of pushing the page wider */
@media (max-width:600px){
  #contentArea code,#contentArea kbd{white-space:pre-wrap;overflow-wrap:anywhere}
  #contentArea .card,#contentArea .glass-card,#contentArea .cqp-card{overflow-wrap:break-word}
}
/* Phone sweep fixes (tests/qa/ui/phone_sweep.py): grid cards shrink to the screen, a bar's end wraps, long badges wrap */
@media (max-width:600px){
  .dp-list>*{min-width:0}
  .ra-filter-bar .bar-end{flex-wrap:wrap;flex-shrink:1;min-width:0;max-width:100%}
  .ra-filter-bar .bar-end>select,.ra-filter-bar .bar-end>.form-input{min-width:0;max-width:100%;flex:1 1 150px}
  .data-table.dt-cards .badge{max-width:100%;white-space:normal;height:auto;min-height:22px;text-align:start}
}
/* The phone menu's rail scrolls inside the window, and Setup + the person (Sign Out) stay pinned at its foot, so a short
   phone never hides them behind the phone bar */
@media (max-width:600px){
  #app.nsm-rail .sidebar .sidebar-nav{overflow:hidden;min-height:0}
  #app.nsm-rail .ns-rail{min-height:0;height:100%}
  #app.nsm-rail .ns-rail-foot{position:sticky;bottom:0;width:100%;z-index:1;
    background:linear-gradient(var(--sb-logo-bg, rgba(0,0,0,.18)),var(--sb-logo-bg, rgba(0,0,0,.18))),var(--sidebar-bg)}
}
@media (max-width:600px){
  .ra-filter-bar .bar-end .page-actions{flex-wrap:wrap;justify-content:flex-end;min-width:0;max-width:100%}
  .ra-filter-bar .bar-end .page-actions>select{min-width:0;max-width:100%;flex:1 1 150px}
  .dp-head>:not(.row-acts):not(.dp-acts){min-width:0;flex:1 1 auto}
  .hd-sla-row .badge{min-width:0;max-width:100%;height:auto;white-space:normal;text-align:end}
}
/* A grid drawn inline (style="display: grid") lets its items shrink to the screen, as the stylesheet grids above do */
@media (max-width:600px){
  #contentArea [style*="display: grid"]>*{min-width:0}
}
/* Audit logs on phones (pages/audit): a card is what happened, then "when · who · area"; a failure shows its red dot,
   success (nearly every row) says nothing; the resource and IP wait behind More */
@media (max-width:600px){
  .dt-card-meta .al-when span{display:none}
  .dt-card-meta .al-when small{font-size:inherit;color:inherit}
  .dt-card-meta .al-who{gap:6px}
  .dt-card-meta .al-who .hdl-av{width:20px;height:20px;font-size:8.5px}
  .dt-card-meta .al-who-t b{font-size:inherit;font-weight:600;max-width:160px}
  .dt-card-meta .al-who-t small{display:none}
  .dt-card-meta .al-chip{padding:1px 7px;font-size:10.5px}
  .dt-card-meta .al-st{padding:0;background:none;font-size:inherit}
  .dt-meta-in>.dt-meta:has(> .al-st.ok:only-child){display:none}
  .dt-card-meta .al-err{flex-basis:100%;max-width:100%;margin-top:2px}
  .al-table.dt-cards>tbody>tr>td.dt-card-title .al-act{font-size:14px;font-weight:600;white-space:normal}
}
/* Symmetry for list cards: the glance lines are even fact tiles (two to a row, three when a list asks for three, each
   row one height, one quiet tint), and the meta line's pills share one height */
@media (max-width:600px){
  .data-table.dt-cards>tbody>tr>td[data-label]{align-self:stretch;justify-content:flex-start;padding:8px 10px!important;border-radius:10px;
    background:color-mix(in srgb,var(--text-primary) 4%,transparent)!important}
  .data-table.dt-cards.dt-g3>tbody>tr>td[data-label]{flex:0 0 calc((100% - 24px) / 3)}
  .data-table.dt-cards>tbody>tr>td[data-label]::before{margin-bottom:1px}
  .dt-meta-in .badge,.dt-meta-in .al-chip,.dt-meta-in .al-st{height:22px;padding-block:0;box-sizing:border-box;line-height:1}
  .dt-meta-in .su-org-trial{margin-block:0;display:inline-flex}
  .data-table.dt-cards.dt-g1>tbody>tr>td[data-label]{flex:0 0 100%}
}
