/* ═══ The desk shell (docs/UI_SPEC.md section 5, 15–17) ═══════════════════════════════════════════════════
   core/nav.js puts .desk on #app unless the user chose Classic view; without .desk the classic hub tabs and sidebar of
   nav.css stay exactly as they were. Tokens only (tokens.css), so light, dark and Hindi come from the same rules.
     ≥1280      220 px grouped sidebar | 48 px top bar (crumbs + the one title, search, + New, Ask) over the screen
     1024–1279  208 px sidebar; the search and Ask shrink to icons below 1180 px
     768–1179   the sidebar starts folded into a 68 px strip (an icon and a word per group); [ opens it
     <768       no sidebar; top bar (title, search, Ask, avatar); bottom bar Today · 2 rows · + · Menu; the sidebar is the
                menu above the bottom bar (Menu closes it again) with 42 px rows, a header that stays and the words of
                each count on the row
   Rows are 30 px (28 px when the window is under 820 px tall); the list scrolls between the fixed switcher and the
   fixed footer with a visible thin scrollbar and a fade when more is below. */

.app.shell.desk {
  --sb-w: 220px;
  --tb-h: 48px;
  --sb-row: 30px;
  --sb-gh: 24px;
  --sb-hover: color-mix(in srgb, var(--ink) 6%, transparent);
  grid-template-columns: var(--sb-w) minmax(0, 1fr);
  grid-template-rows: var(--tb-h) minmax(0, 1fr);
  grid-template-areas: "rail top" "rail work";
}
.app.shell.desk.sb-mini { --sb-w: 68px; }
.app.shell.desk.copilot-open {
  grid-template-columns: var(--sb-w) minmax(0, 1fr) var(--copilot-width, min(40%, 560px));
  grid-template-areas: "rail top top" "rail work copilot";
}
@media (max-height: 819px) { .app.shell.desk { --sb-row: 28px; --sb-gh: 22px; } }

/* ─── Sidebar ─── */
.app.shell > .sb { display: none; }
.app.shell.desk > .sb {
  grid-area: rail; position: relative; z-index: 30; display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--bg); border-right: 1px solid var(--line);
}
.app.shell.desk > .sb[hidden] { display: none; }
.sb svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sb button { font: inherit; color: inherit; }
.sb-top { flex: none; display: flex; align-items: center; gap: 2px; height: var(--tb-h); padding: 0 6px; }
.org {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 6px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; text-align: left;
}
.org:hover, .org[aria-expanded="true"] { background: var(--sb-hover); }
.org:focus-visible, .sb .ni:focus-visible, .sb .gt:focus-visible, .sb .gall:focus-visible, .sb .gfold:focus-visible, .sb .ib:focus-visible, .sb .me:focus-visible, .sb .mx:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.org > svg { width: 14px; height: 14px; color: var(--muted); }
.logo { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--brand); }
.logo img { width: 17px; height: 17px; display: block; filter: brightness(0) invert(1); }
/* the logo is its own link to the home screen (Today); the name beside it opens the company and year menu */
.sb-home { margin: 0 2px 0 6px; transition: filter var(--dur-1, .12s) ease; }
.sb-home:hover { filter: brightness(1.08); }
.sb-home:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sb-home + .org { padding-left: 4px; }
.app.shell.desk.sb-mini .sb-home { margin: 0; }
.app.shell.desk.sb-mini .sb-top .org { display: none; }
.logo.sm { width: 22px; height: 22px; border-radius: 6px; }
.logo.sm img { width: 14px; height: 14px; }
.org-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.org-n { font: 600 13px/16px var(--font-ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-b { font: 400 12px/15px var(--font-ui); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb .ib {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--muted); cursor: pointer;
}
.sb .ib:hover { background: var(--sb-hover); color: var(--ink); }
.sb-close { display: none !important; }

.sb-nav {
  flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 0 8px 6px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.sb-nav.more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.sb-find { display: none; }
.sb .ni {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: var(--sb-row); padding: 0 8px; border: 0; border-radius: 7px;
  background: none; color: var(--ink-2); font: 400 14px/20px var(--font-ui); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.sb .ni > svg { color: var(--muted); }
.sb .ni:hover { background: var(--sb-hover); color: var(--ink); }
.sb .ni:hover > svg { color: var(--ink-2); }
.sb .ni[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--line), var(--e1); }
.sb .ni[aria-current="page"] > svg { color: var(--accent); }
.sb .ni.pin > svg { width: 14px; height: 14px; margin: 0 1px; color: var(--warn); fill: color-mix(in srgb, var(--warn) 25%, transparent); }
.sb .ni .lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb .ni .nc, .sb-fly .nc { flex: none; display: inline-flex; align-items: center; gap: 3px; margin-left: -4px; }
.sb .ni .nc:empty, .sb-fly .nc:empty { display: none; }
.sb .ni .why { display: none; }
.sb .nr { position: relative; }
.sb .nadd {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 24px; height: 22px;
  border-radius: 5px; background: var(--surface); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line-2); opacity: 0; pointer-events: none;
}
.sb .nadd svg { width: 14px; height: 14px; }
.sb .nadd:hover { color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-line); }
.sb .nadd:focus-visible { opacity: 1; pointer-events: auto; outline: none; box-shadow: var(--focus-ring); }
.sb .nr:has(.nadd:focus-visible) .ni .nc { visibility: hidden; }
@media (hover: hover) { .sb .nr:hover .nadd { opacity: 1; pointer-events: auto; } .sb .nr:hover .ni .nc { visibility: hidden; } }
.sb .n, .sb-fly .n, .sb-tip .n {
  font: 500 12px/18px var(--font-ui); font-variant-numeric: tabular-nums; color: var(--muted); padding: 0 2px; white-space: nowrap;
}
.sb .n.late, .sb-fly .n.late, .gp .n.late { color: var(--crit-text); background: var(--crit-soft); border-radius: var(--r-pill); padding: 0 6px; font-weight: 600; }
.gp .n { font: 500 12px/18px var(--font-ui); font-variant-numeric: tabular-nums; color: var(--muted); padding: 0 2px; white-space: nowrap; }
/* a row with too little room: the total stays, its late part becomes a red dot */
.sb .ni.tight .n.part { display: none; }
.sb .ni.tight.has-late .n.tot { position: relative; padding-right: 9px; }
.sb .ni.tight.has-late .n.tot::after { content: ""; position: absolute; right: 1px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--crit); }
/* where you are: another screen of a group, under its rows; the Reports or Settings row of a screen of theirs */
.sb .ni.tmp { height: 26px; padding-left: 12px; font-size: 13px; }
.sb .ni.tmp > svg { width: 12px; height: 12px; color: var(--accent); }
.sb .ni.near { background: var(--sb-hover); color: var(--ink); }
.blk { padding-top: 0; }
.sg { margin-top: 8px; }
.gh { display: flex; align-items: center; gap: 0; height: var(--sb-gh); }
.sb .gfold {
  flex: none; display: inline-grid; place-items: center; width: 16px; height: 20px; margin-left: -4px; padding: 0; border: 0; border-radius: 4px;
  background: none; color: var(--muted); cursor: pointer;
}
.sb .gfold svg { width: 12px; height: 12px; transition: transform var(--t-fast); }
.sb .sg.off .gfold svg { transform: rotate(-90deg); }
.sb .gfold:hover { color: var(--ink); background: var(--sb-hover); }
.sb .gt {
  flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 6px 0 2px; border: 0; border-radius: 5px;
  background: none; color: var(--ink-2); font: 600 12px/16px var(--font-ui); letter-spacing: .01em; text-align: left; cursor: pointer; white-space: nowrap;
}
.sb .gt.plain { cursor: default; }
.sb .gt:not(.plain):hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.sb .sg.here .gt { color: var(--ink); }
.sb .gcnt { display: none; }
.sb .sg.off .gcnt { display: inline-flex; }
.sb .gall {
  flex: none; display: inline-flex; align-items: center; gap: 1px; height: 22px; padding: 0 3px 0 6px; border: 0; border-radius: 5px;
  background: none; color: var(--muted); font: 500 12px/16px var(--font-ui); cursor: pointer; white-space: nowrap;
}
.sb .gall:hover { color: var(--accent-text); }
.sb .gall svg { width: 12px; height: 12px; }
.sb .gall:hover, .sb .gall[aria-expanded="true"], .sb .gt[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }
.sb .sg.off .gi { display: none; }
.sb-hint {
  position: fixed; z-index: 85; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 260px; padding: 10px 12px;
  border: 1px solid var(--accent-line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--e2); color: var(--ink-2); font-size: 13px; line-height: 18px;
}
.sb-hint::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; background: var(--surface); border-left: 1px solid var(--accent-line); border-bottom: 1px solid var(--accent-line); transform: rotate(45deg); }
.sb-hint b { color: var(--ink); font-weight: 600; }
.sb-hint .btn { margin-top: 4px; }
.sb-hint[hidden] { display: none; }
.sb-foot {
  flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 2px; padding: 4px 8px 6px; border-top: 1px solid var(--line);
}
.sb-foot > [data-row="reports"] { grid-column: 1; grid-row: 1; }
.sb-foot > [data-row="settings"] { grid-column: 2; grid-row: 1; }
.sb-foot > [data-row="allscreens"] { grid-column: 1 / -1; grid-row: 2; }
.sb-foot > .me { grid-column: 1 / -1; grid-row: 3; }
.sb-foot > .ni { padding: 0 6px; gap: 8px; }
/* the fold button sits at the end of the All screens row */
.sb-foot > .sb-fold { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; z-index: 1; }
.sb .me {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 40px; margin-top: 2px; padding: 0 6px 0 4px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; text-align: left;
}
.sb .me:hover, .sb .me[aria-expanded="true"] { background: var(--sb-hover); }
.sb .me > svg { width: 14px; height: 14px; color: var(--muted); }
.av {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--ink);
  font: 600 12px/1 var(--font-ui);
}
.me-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-n { font: 500 13px/16px var(--font-ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-r { font: 400 12px/15px var(--font-ui); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the strip the sidebar folds into ([, the panel button): an icon and a word per row and group */
.sb-strip { display: none; }
.app.shell.desk.sb-mini .sb-nav, .app.shell.desk.sb-mini .org-t, .app.shell.desk.sb-mini .org > svg,
.app.shell.desk.sb-mini .sb-foot .ni, .app.shell.desk.sb-mini .me-t, .app.shell.desk.sb-mini .me > svg { display: none; }
.app.shell.desk.sb-mini .sb-top { justify-content: center; padding: 0; }

.app.shell.desk.sb-mini .org { flex: none; width: 44px; justify-content: center; padding: 0; }
.app.shell.desk.sb-mini .sb-strip {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 0 6px; overflow-y: auto; scrollbar-width: none;
}
.app.shell.desk.sb-mini .sb-strip::-webkit-scrollbar { display: none; }
.app.shell.desk.sb-mini .sb-foot { order: 3; align-items: center; padding: 4px 0 8px; }
.app.shell.desk.sb-mini .sb-strip { order: 2; }
.app.shell.desk.sb-mini .sb-foot { display: flex; flex-direction: column; }
.app.shell.desk.sb-mini .sb .me, .app.shell.desk.sb-mini .me { width: 44px; justify-content: center; padding: 0; }
.sb .mx {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 60px; padding: 6px 2px 5px; border: 0; border-radius: 8px;
  background: none; color: var(--ink-2); text-decoration: none; cursor: pointer;
}
.sb .mx > svg { width: 18px; height: 18px; }
.sb .mx .mw { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px/14px var(--font-ui); }
.sb .mx:hover, .sb .mx[aria-expanded="true"] { background: var(--sb-hover); color: var(--ink); }
.sb .mx[aria-current="page"], .sb .mx.here { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--e1); }
.sb .mx[aria-current="page"] > svg, .sb .mx.here > svg { color: var(--accent); }
/* the count sits at the icon's top-right corner, leaving the icon readable ("83" no longer covers it) */
.sb .mb { position: absolute; top: 1px; left: calc(50% + 5px); right: auto; }
.sb .mb .n { display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--surface-3); color: var(--ink); font: 600 11px/16px var(--font-ui); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.sb .mb .n, .app.shell.desk .bb-tab .bb-n .n { position: relative; }
/* the total, with a red dot when some of it is past its due date */
.sb .mb .n.has-late::after, .app.shell.desk .bb-tab .bb-n .n.has-late::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--crit); box-shadow: 0 0 0 2px var(--bg);
}
.msep { width: 28px; height: 1px; margin: 4px 0; background: var(--line); flex: none; }

/* ─── Top bar: crumbs and the one title · search · + New · Ask ─── */
.app.shell.desk > .topbar {
  grid-area: top; height: var(--tb-h); gap: 12px; padding: 0 12px 0 20px; background: var(--surface); backdrop-filter: none;
  border-bottom: 1px solid var(--line); z-index: 25;
}
.app.shell.desk .hub-tabs, .app.shell.desk .topbar > .spacer, .app.shell.desk #chat-btn, .app.shell.desk .me-chip, .app.shell.desk #theme-btn,
.app.shell.desk #logout-btn, .app.shell.desk .nav-toggle, .app.shell.desk .top-brand, .app.shell.desk #ui-desk-btn { display: none !important; }
.app.shell #ui-desk-btn[hidden], .app.shell #agent-st[hidden], .app.shell #top-avatar[hidden], .app.shell #new-split[hidden] { display: none !important; }
.app.shell.desk .topbar .pagebar {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 0; background: none; overflow: hidden; white-space: nowrap;
}
.app.shell.desk .topbar .pagebar > * { order: 0; }
.app.shell.desk .topbar .pagebar .crumbs { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 2px; overflow: hidden; font-size: 14px; color: var(--muted); }
.app.shell.desk .topbar .pagebar .crumbs:empty { display: none; }
.crumbs .crumb {
  flex: 0 1 auto; min-width: 32px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 4px; margin: 0 -2px; border: 0; border-radius: 4px; background: none;
  color: var(--muted); font: 400 14px/20px var(--font-ui); text-decoration: none; cursor: pointer;
}
.crumbs .crumb:hover, .crumbs .crumb[aria-expanded="true"] { color: var(--ink); background: var(--sb-hover); }
.crumbs svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--line-2); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.app.shell.desk .topbar .pagebar h1 { flex: 0 0 auto; max-width: 70%; min-width: 0; margin: 0; font: 600 15px/20px var(--font-ui); color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.app.shell.desk .topbar .page-meta { flex: none; margin-left: 6px; color: var(--muted); font-size: 13px; }
.app.shell.desk .topbar .page-meta:empty { display: none; }
.app.shell.desk .topbar .fav-btn { flex: none; width: 26px; height: 26px; }
.app.shell.desk .search-btn {
  flex: 0 1 400px; width: auto; min-width: 0; height: 32px; margin: 0; padding: 0 6px 0 10px; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted);
  font: 400 13px/20px var(--font-ui); box-shadow: none; cursor: text;
}
.app.shell.desk .search-btn:hover { border-color: var(--line-2); color: var(--ink-2); box-shadow: none; }
.app.shell.desk .search-btn span { display: inline; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.app.shell.desk .search-btn kbd { display: inline-block; margin-left: auto; font: 500 11px/16px var(--font-mono); padding: 0 5px; border-radius: var(--r-xs); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.app.shell.desk .top-r { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.new-split { display: inline-flex; flex: none; }
.new-split .btn.btn-primary { height: 32px; font-size: 13px; gap: 6px; }
.new-split .nb-main { border-radius: var(--r-sm) 0 0 var(--r-sm); padding: 0 10px 0 10px; text-decoration: none; }
.new-split .nb-more { border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 0 7px; border-left: 1px solid color-mix(in srgb, var(--accent-ink) 35%, transparent); }
.new-split .nb-more[aria-expanded="true"] { background: var(--accent-hover); }
.new-split svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.agent-st {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  background: var(--ai-soft); color: var(--ai-text); border: 1px solid var(--ai-line); font: 500 13px/1 var(--font-ui); cursor: pointer; white-space: nowrap;
}
.agent-st svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.agent-st:hover { border-color: var(--ai); }
.agent-st:focus-visible, .new-split .btn:focus-visible, .crumbs .crumb:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.agent-st .n:empty { display: none; }
/* The account sits at the right of the top bar (Settings is in its menu); on a phone it is the round avatar */
.app.shell.desk .top-avatar {
  display: flex; align-items: center; gap: 8px; width: auto; height: 40px; padding: 0 8px 0 4px; border-radius: 8px; background: none; text-align: left;
}
.app.shell.desk .top-avatar:hover, .app.shell.desk .top-avatar[aria-expanded="true"] { background: var(--sb-hover); color: var(--ink); }
.app.shell.desk .top-avatar .me-t { max-width: 150px; }
.app.shell.desk .top-avatar > svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1279px) { .app.shell.desk .top-avatar .me-t { display: none; } }
/* Reports is a row of the sidebar under Today (core/nav.js sbTop): on a wide screen the footer keeps only the fold
   button; on a phone Reports stays one of the menu's footer tiles */
@media (min-width: 768px) {
  .app.shell.desk .sb-foot > .ni, .app.shell.desk .sb-foot > .me { display: none; }
  .app.shell.desk .sb-foot { display: flex; justify-content: flex-end; padding: 4px 8px; }
}
@media (max-width: 767px) {
  .app.shell.desk .sb-nav .blk > [data-row="reports"] { display: none; }
}
@media (max-width: 767px) {
  .app.shell.desk .top-avatar { gap: 0; height: 40px; padding: 0 4px; }
  .app.shell.desk .top-avatar .me-t, .app.shell.desk .top-avatar > svg { display: none; }
}
.avatar {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: var(--surface-3); color: var(--ink); font: 600 12px/1 var(--font-ui); cursor: pointer;
}
.avatar:hover { background: var(--line-2); }
.avatar:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.avatar[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }

/* ─── The screen: one header row, compact rows ─── */
.app.shell.desk > .app-workspace {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "main";
}
.app.shell.desk > .app-workspace > .main { padding: 12px 20px 48px; background: var(--surface); }
.app.shell.desk > .app-workspace > .bottom-bar { display: none; }
.app.shell.desk > .app-workspace > .sidebar { display: none; }
/* the screen's own heading row gave its title to the top bar (nav.js adoptHeader): what is left is one slim row; the
   row may sit inside the view's own wrapper (.acc-root, .ewb2, .ops-root) */
.app.shell.desk .screen .page-h.ph-done { min-height: 0; margin: 0 0 10px; padding: 0; border: 0; align-items: center; gap: 8px; }
.app.shell.desk .screen .page-h.ph-done .ph-dup { display: none; }
.app.shell.desk .screen .page-h.ph-done .ph-sub { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 20px; }
.app.shell.desk .screen .page-h.ph-empty { display: none; }
/* the record page's number is the top bar's title (nav.js recordTitle): who it is, the status and the verbs stay in its row */
.app.shell.desk .screen .rec-title > .ph-dup { display: none; }
.app.shell.desk .screen .rec-title.ph-only-who { display: none; }
.app.shell.desk .screen .ph-same { display: none; }
.app.shell.desk .screen .page-h.ph-done .actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
/* a list: the search and filters and the buttons share one row */
.app.shell.desk .screen.screen-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: start; }
.app.shell.desk .screen.screen-list > * { grid-column: 1 / -1; min-width: 0; }
.app.shell.desk .screen.screen-list > .toolbar.tb-with-ph { grid-column: 1; grid-row: 1; margin-bottom: 10px; }
.app.shell.desk .screen.screen-list > .page-h.ph-with-tools { grid-column: 2; grid-row: 1; margin: 0; }
/* "+ New" in the top bar is this list's new button (a phone has no top-bar "+ New": the list keeps its own there) */
@media (min-width: 768px) { .app.shell.desk #list-actions #btn-new { display: none; } }
/* the role desk under the top bar: the top bar already says the date and carries "+ New" (the bottom bar's + on a phone) */
.app.shell.desk .desk[data-role] .dh-date, .app.shell.desk .desk[data-role] .newmenu { display: none; }
/* on the bidding screens "+ New" in the top bar is New bidding: the screen's own button is not shown twice */
@media (min-width: 768px) { .app.shell.desk:has(#new-split:not([hidden]) #new-main[href="#/v/bidding/new"]) .bd-new { display: none; } }
/* a list narrower than its columns leaves out the low-value ones first (nav.js fitTable) */
.app.shell.desk .tbl .fit-off { display: none; }
.app.shell.desk .tbl .fit-cut { display: block; max-width: 11em; overflow: hidden; text-overflow: ellipsis; }
.app.shell.desk .toolbar { gap: 6px; }
.app.shell.desk .toolbar input[type=search], .app.shell.desk .toolbar select, .app.shell.desk .toolbar input[type=date], .app.shell.desk .toolbar input[type=number] { height: 30px; font-size: 13px; }
.app.shell.desk .toolbar input[type=search] { width: 184px; } /* five filters and the search fit one row beside the buttons (LR / Bilty) */
.app.shell.desk .toolbar select { max-width: 150px; }
/* the list's count sits beside the title (nav.js copies it into the top bar) */
.app.shell.desk .toolbar #list-count.in-title { display: none; }
.app.shell.desk .tbl th { padding: 7px 10px; font: 500 12px/16px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--muted); background: var(--surface-2); }
.app.shell.desk .tbl td { padding: 7px 10px; line-height: 20px; }
.app.shell.desk .pager { padding: 6px 2px; }
body.density-cozy .app.shell.desk .tbl td { padding-top: 12px; padding-bottom: 12px; }
.app.shell.desk .card { box-shadow: none; }
.app.shell.desk .card:hover { box-shadow: none; }

/* the existing Today page (views/hubs, views/inbox) until the desks replace it: two-line tasks, no zero tiles */
/* the Today page's quick actions: only those "+ New" does not offer (nav.js hubActions) */
.app.shell.desk .hub-root .hub-actions:not(.ha-left) { display: none; }
.app.shell.desk .hub-root .hub-actions a[hidden] { display: none; }
.app.shell.desk .hub-root .hub-actions { margin-bottom: 8px; }
.app.shell.desk .tk-head .btn.xs { margin-left: 8px; }
.app.shell.desk .tk-others { margin: 6px 0 0; }
.app.shell.desk .hub-root .hub-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 10px; }
.app.shell.desk .hub-root .hub-kpis .is-zero { display: none; }
/* the page's own buttons (Refresh) share the row of the tiles instead of a row of their own */
@media (min-width: 768px) {
  .app.shell.desk .hub-root:has(> .page-h.ph-done):has(> .hub-kpis) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: start; }
  .app.shell.desk .hub-root:has(> .page-h.ph-done):has(> .hub-kpis) > * { grid-column: 1 / -1; min-width: 0; }
  .app.shell.desk .hub-root:has(> .page-h.ph-done):has(> .hub-kpis) > .page-h.ph-done { grid-column: 2; grid-row: 1; margin: 0; }
  .app.shell.desk .hub-root:has(> .page-h.ph-done):has(> .hub-kpis) > .hub-kpis { grid-column: 1; grid-row: 1; }
}
.app.shell.desk .hub-root .kpi { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; padding: 7px 12px; }
.app.shell.desk .hub-root .kpi .l { order: 2; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.app.shell.desk .hub-root .kpi .v { order: 1; font-size: 18px; line-height: 24px; font-weight: 600; }
.app.shell.desk .hub-root .kpi .d { order: 3; width: 100%; }
.app.shell.desk .hub-root .card-h { padding: 8px 12px; }
.app.shell.desk .hub-root .card-b { padding: 8px 12px; }
/* when something waits, only what waits; when every queue is clear, the clear ones quietly (what was checked) */
.app.shell.desk .hub-root .hub-queues:has(.hub-q:not(.zero)) li:has(> .hub-q.zero) { display: none; }
.app.shell.desk .hub-root .hub-q { padding: 5px 6px; }
.app.shell.desk .hub-root .hub-q.zero .hub-q-dot { background: var(--line-2); box-shadow: none; } /* red and amber only where work waits */
.app.shell.desk .tk-head { margin: 0 0 4px; gap: 8px; }
.app.shell.desk .tk-head b { font-size: 16px; }
.app.shell.desk .tk-chain { padding: 6px 10px; margin: 0 0 4px; }
.app.shell.desk .tk { grid-template-columns: 88px minmax(0, 1fr) auto; gap: 0 12px; padding: 4px 8px 4px 6px; }
.app.shell.desk .tk-n { display: none; }
.app.shell.desk .tk-v b { font-size: 14px; line-height: 20px; font-family: var(--font-ui); text-align: right; }
.app.shell.desk .tk-v { text-align: right; }
.app.shell.desk .tk-v small, .app.shell.desk .tk-goods { display: none; }
.app.shell.desk .tk-m { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.app.shell.desk .tk-m::before { content: ""; order: 2; flex-basis: 100%; height: 0; } /* the line break between the two lines */
.app.shell.desk .tk-t { order: 1; flex: 0 1 auto; max-width: 62%; min-width: 0; flex-wrap: nowrap; gap: 6px; font-weight: 500; white-space: nowrap; overflow: hidden; line-height: 20px; }
.app.shell.desk .tk-t .pill { padding: 0 6px; line-height: 18px; }
.app.shell.desk .tk-s { order: 1; flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 20px; }
.app.shell.desk .tk-r { order: 3; flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 20px; }
.app.shell.desk .tk-o { order: 3; flex: none; display: flex; margin: 0; flex-wrap: nowrap; line-height: 20px; }
.app.shell.desk .tk-own { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.app.shell.desk .tk-o .btn.xs, .app.shell.desk .tk-a .btn.xs { height: 22px; padding: 0 8px; font-size: 12px; }
.app.shell.desk .tk-checks { order: 4; flex-basis: 100%; margin: 0; }
.app.shell.desk .tk-a { flex-wrap: nowrap; }

/* ─── Overlays: hover card of a count, strip flyout, group panel, company, + New and account menus ─── */
.sb-tip {
  position: fixed; z-index: 95; width: 300px; padding: 10px 12px; border-radius: var(--r-md); background: var(--ink); color: var(--bg);
  box-shadow: var(--e2); font-size: 13px; line-height: 18px;
}
.sb-tip[hidden] { display: none; }
.sb-tip .tip-h b { font-weight: 600; }
.sb-tip ul { margin: 6px 0 0; padding: 0; list-style: none; }
.sb-tip li { position: relative; margin: 3px 0; padding-left: 14px; }
.sb-tip li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }
.sb-tip li.late::before { background: var(--crit); opacity: 1; }
.sb-tip a { color: inherit; text-decoration: none; }
.sb-tip a:hover { text-decoration: underline; }
.sb-tip .tip-f { margin-top: 6px; font-size: 12px; opacity: .8; }
.sb-fly { width: 270px; padding: 6px; }
.sb-fly[hidden] { display: none; }
.sb-fly .ml { font-weight: 600; color: var(--ink-2); }
.sb-fly .mi { min-height: 32px; padding: 5px 8px; justify-content: flex-start; gap: 10px; }
.sb-fly .mi svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sb-fly .mi .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-fly .mi[aria-current="page"] { background: var(--sel); }
.sb-fly .fwhy { margin: -2px 0 4px 34px; color: var(--ink-2); font-size: 12px; line-height: 16px; }
.sb-fly .mall { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; color: var(--accent-text); font-size: 13px; }
.sb-fly .mall svg { margin-left: auto; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; }

.sb-panel {
  position: fixed; z-index: 90; display: flex; flex-direction: column; width: min(860px, calc(100vw - 244px)); max-height: calc(100vh - 16px);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--e3), var(--highlight); overflow: hidden;
}
.sb-panel[hidden] { display: none; }
.sb-panel svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sb-panel .ph { flex: none; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); }
.sb-panel .ph-t { min-width: 0; display: flex; flex-direction: column; }
.sb-panel .ph-t b { font-size: 15px; line-height: 20px; color: var(--ink); }
.sb-panel .ph-t .muted { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.sb-panel .pfind { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; width: 260px; max-width: 45%; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); }
.sb-panel .pfind input { flex: 1; min-width: 0; height: 30px; border: 0; outline: 0; background: none; color: var(--ink); font: 400 13px var(--font-ui); }
.sb-panel .pfind:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sb-panel .ib { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; }
.sb-panel .ib:hover { background: var(--surface-2); }
.sb-panel .pmake { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; }
.sb-panel .pmake .btn svg { width: 14px; height: 14px; }
.sb-panel .pb { flex: 1; min-height: 0; overflow: auto; padding: 6px 10px 12px; }
:is(.sb-panel, .gp) .pg { margin: 12px 8px 2px; font: 600 13px/18px var(--font-ui); color: var(--ink); }
:is(.sb-panel, .gp) .pg:first-child { margin-top: 4px; }
:is(.sb-panel, .gp) .pcols { column-width: 240px; column-gap: 12px; }
:is(.sb-panel, .gp) :is(.pcols, .ps, .pi, .pg, .pmore)[hidden] { display: none; }
:is(.sb-panel, .gp) .ps { margin-top: 6px; break-inside: avoid-column; }
:is(.sb-panel, .gp) .ps.long { break-inside: auto; }
:is(.sb-panel, .gp) .ps h4 { break-after: avoid-column; margin: 0; padding: 6px 8px 2px; font: 600 12px/16px var(--font-ui); color: var(--muted); }
:is(.sb-panel, .gp) .pi { display: flex; align-items: center; border-radius: 6px; break-inside: avoid; } /* a screen and its line stay in one column */
:is(.sb-panel, .gp) .pi:hover, :is(.sb-panel, .gp) .pi:focus-within { background: var(--surface-2); }
:is(.sb-panel, .gp) .pi > a { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 4px 8px; color: var(--ink); text-decoration: none; border-radius: 6px; }
:is(.sb-panel, .gp) .pi.slim > a { padding-top: 3px; padding-bottom: 3px; }
:is(.sb-panel, .gp) .pi > a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
:is(.sb-panel, .gp) .pl { font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(.sb-panel, .gp) .pi.slim .pl { font-size: 13px; color: var(--ink-2); }
:is(.sb-panel, .gp) .pi.side .pl { font-weight: 500; }
:is(.sb-panel, .gp) .pd { font-size: 12px; line-height: 16px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(.sb-panel, .gp) .pin-dot { margin-left: 4px; color: var(--accent-text); font-weight: 700; }
:is(.sb-panel, .gp) .pmore {
  display: flex; align-items: center; gap: 6px; width: 100%; margin: 8px 0 2px; padding: 6px 8px; border: 0; border-top: 1px dashed var(--line-2);
  background: none; color: var(--accent-text); font: 500 13px/18px var(--font-ui); text-align: left; cursor: pointer;
}
:is(.sb-panel, .gp) .pmore small { color: var(--muted); font-size: 12px; font-weight: 400; }
:is(.sb-panel, .gp) .pmore svg { width: 14px; height: 14px; transition: transform var(--t-fast); }
:is(.sb-panel, .gp) .pmore[aria-expanded="true"] svg { transform: rotate(90deg); }
:is(.sb-panel, .gp) .pmore:hover { background: var(--surface-2); }
:is(.sb-panel, .gp) .pmore:focus-visible { outline: none; box-shadow: var(--focus-ring); }
:is(.sb-panel, .gp) .pm { padding-top: 2px; }

/* a hub's page in the desk (nav.js deskHubPage): what waits, + New, find, the screens */
.gp { max-width: 1180px; }
.gp svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.gp-wait { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.gp-wait[hidden] { display: none; }
.gp-wait h3 { margin: 0 0 4px; font: 600 13px/18px var(--font-ui); color: var(--ink); }
.gp-wait ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.gp-wait li { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.gp-wait .gw-row { flex: none; display: inline-flex; align-items: baseline; gap: 8px; padding: 3px 4px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.gp-wait .gw-row:hover { background: var(--surface); }
.gp-wait .gw-row b { font-weight: 500; }
.gp-wait .nc { flex: none; display: inline-flex; gap: 3px; }
.gp-wait .gw { min-width: 0; color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-wait .gw a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.gp-wait .gw a:hover { color: var(--accent-text); }
.gp-make { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.gp-make .btn svg { width: 14px; height: 14px; }
.gp-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; }
.gp .gp-find { display: inline-flex; align-items: center; gap: 8px; width: 300px; max-width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); }
.gp .gp-find input { flex: 1; min-width: 0; height: 30px; border: 0; outline: 0; background: none; color: var(--ink); font: 400 13px var(--font-ui); }
.gp .gp-find:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gp .pnone { padding: 12px 8px; }

/* "Skip to the page": the first stop of Tab, shown only while it has the focus */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 200; padding: 8px 12px; border: 1px solid var(--accent-line); border-radius: var(--r-sm); background: var(--surface); color: var(--accent-text); font: 500 13px/18px var(--font-ui); }
.skip-link:focus, .skip-link:focus-visible { top: 8px; outline: none; box-shadow: var(--focus-ring); }
.sb-panel .pstar, .gp .pstar { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 2px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; opacity: .45; }
.sb-panel .pi:hover .pstar, .gp .pi:hover .pstar, .sb-panel .pstar:focus-visible, .gp .pstar:focus-visible, .sb-panel .pstar.on, .gp .pstar.on { opacity: 1; }
@media (hover: none) { .sb-panel .pstar, .gp .pstar { opacity: .8; } }
.sb-panel .pstar.on svg, .gp .pstar.on svg { fill: var(--warn); stroke: var(--warn); }
.sb-panel .pstar:focus-visible, .gp .pstar:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sb-panel .pnone { padding: 12px 8px; }
.sb-panel .pf { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 12px; line-height: 16px; }
.sb-panel .pf span { display: inline-flex; align-items: center; gap: 4px; }
.sb-panel .pf svg { width: 12px; height: 12px; }
.sb-panel .pf .pf-r { margin-left: auto; }

.org-menu { width: 300px; }
.org-menu[hidden], .new-menu[hidden] { display: none; }
.org-menu .mt-row { display: flex; align-items: center; gap: 10px; padding: 4px 10px 6px; }
.menu .mt { display: flex; flex-direction: column; min-width: 0; line-height: 18px; }
.menu .mt b { font-weight: 600; color: var(--ink); }
.menu .mt small { font-size: 12px; line-height: 16px; color: var(--ink-2); }
.menu .mi svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.new-menu { width: 320px; max-height: calc(100vh - 64px); overflow-y: auto; }
.new-menu .mi { justify-content: flex-start; min-height: 32px; padding: 6px 10px; }
.nm-ai { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 2px 2px 6px; }
.nm-t { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid var(--ai-line); border-radius: 8px; background: var(--ai-soft); color: var(--ai-text); text-align: left; cursor: pointer; font: inherit; }
.nm-t svg { width: 16px; height: 16px; margin-top: 1px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nm-t b { display: block; font-size: 13px; line-height: 18px; font-weight: 600; }
.nm-t small { display: block; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.nm-t:hover { border-color: var(--ai); }
.nm-t:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.user-menu { width: 300px; max-height: calc(100vh - 16px); overflow-y: auto; }
.user-menu .um-h { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.user-menu .um-h b { display: block; font-size: 14px; line-height: 20px; }
.user-menu .um-h small { display: block; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.user-menu .mi { justify-content: flex-start; gap: 10px; min-height: 34px; padding: 6px 10px; }
.user-menu .mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 10px; }
.user-menu .mrl { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; }
.user-menu .mrl svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.user-menu .seg button { height: 26px; padding: 0 8px; font-size: 13px; }

/* ─── Phone bottom bar and the + sheet (reuses nav.css .sheet-back / .sheet-card) ─── */
.app.shell.desk .bb-tab { position: relative; font: 500 12px/16px var(--font-ui); min-height: 44px; gap: 2px; color: var(--ink-2); text-decoration: none; }
.app.shell.desk .bb-tab[aria-current="page"], .app.shell.desk .bb-tab[aria-expanded="true"] { color: var(--accent-text); }
.app.shell.desk .bb-tab .bb-n { position: absolute; top: 2px; left: calc(50% + 4px); font-style: normal; }
.app.shell.desk .bb-tab .bb-n .n { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--surface); font: 600 12px/18px var(--font-ui); text-align: center; }
.app.shell.desk .bb-tab .bb-n .n.late { background: var(--crit); color: var(--crit-ink); }
.bb-ring { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -20px; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: var(--e2); }
.bb-ring svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.2; }
.create-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.create-tiles .ct {
  display: flex; align-items: flex-start; gap: 10px; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: 500 14px/20px var(--font-ui); text-align: left; text-decoration: none; cursor: pointer;
}
.create-tiles .ct:hover { background: var(--surface-2); }
.create-tiles .ct svg { width: 20px; height: 20px; flex: none; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.create-tiles .ct b { display: block; font-weight: 600; }
.create-tiles .ct small { display: block; font-size: 12px; line-height: 16px; color: var(--ink-2); font-weight: 400; }
.create-tiles .ct.ai { background: var(--ai-soft); border-color: var(--ai-line); color: var(--ai-text); }
.sheet-card .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 10px; }

/* ─── 1024–1279: a narrower sidebar; below 1180 the search and Ask become icons ─── */
@media (max-width: 1279px) {
  .app.shell.desk { --sb-w: 208px; }
  .app.shell.desk.sb-mini { --sb-w: 68px; }
  .app.shell.desk > .topbar { padding-left: 16px; gap: 10px; }
  .app.shell.desk > .app-workspace > .main { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 1279px) {
  /* a task row keeps its buttons: "Nobody has it yet" goes (Take it says it), its words stay in the tooltip */
  .app.shell.desk .tk-own.free > span { display: none; }
  /* a list's search and filters stay on one row */
  .app.shell.desk .toolbar input[type=search] { width: 160px; }
  .app.shell.desk .toolbar select { max-width: 128px; }
  .app.shell.desk .tbl th, .app.shell.desk .tbl td { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 1179px) {
  .app.shell.desk .search-btn { flex: none; width: 36px; padding: 0; justify-content: center; }
  .app.shell.desk .search-btn span, .app.shell.desk .search-btn kbd { display: none; }
  .agent-st { width: 36px; padding: 0; justify-content: center; }
  .agent-st .lbl, .agent-st .n { display: none; }
}
/* 768–1279: the agent panel overlays the page from the right instead of taking a third column (the screen keeps its width) */
@media (min-width: 768px) and (max-width: 1279px) {
  .app.shell.desk.copilot-open { grid-template-columns: var(--sb-w) minmax(0, 1fr); grid-template-areas: "rail top" "rail work"; }
  .app.shell.desk > .copilot-dock {
    position: fixed; top: var(--tb-h); right: 0; bottom: 0; z-index: 70; grid-area: auto;
    width: min(var(--copilot-width, 420px), calc(100vw - var(--sb-w) - 48px)); box-shadow: var(--e3), var(--highlight);
  }
}

/* ─── Phone (<768): bottom bar, the sidebar as the full-screen menu ─── */
@media (max-width: 767px) {
  .app.shell.desk, .app.shell.desk.copilot-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 52px minmax(0, 1fr);
    grid-template-areas: "top" "work";
    height: 100vh; height: 100dvh;
  }
  .app.shell.desk.copilot-open { grid-template-rows: 52px minmax(34vh, 40%) minmax(0, 1fr); grid-template-areas: "top" "copilot" "work"; }
  .app.shell.desk > .sb { display: none; }
  /* the menu sits above the bottom bar (Menu closes it again, so does the phone's Back); its header stays on top */
  .app.shell.desk.sb-open > .sb {
    display: flex; position: fixed; top: 0; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 80; width: auto;
    border-right: 0; border-bottom: 1px solid var(--line); --sb-row: 42px; --sb-gh: 30px; overflow-y: auto; overscroll-behavior: contain;
  }
  .app.shell.desk.sb-open .sb-close { display: inline-grid !important; width: 44px; height: 44px; }
  .app.shell.desk.sb-open .sb-top { position: sticky; top: 0; z-index: 2; order: 0; height: 56px; padding: 0 6px 0 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .app.shell.desk.sb-open .sb-nav { order: 3; flex: none; overflow: visible; padding-bottom: 16px; -webkit-mask-image: none; mask-image: none; }
  /* Reports, All screens and Settings on the first screen, under the search, as three tiles; the account is the top-bar avatar */
  .app.shell.desk.sb-open .sb-foot { order: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 8px 8px; border-top: 0; }
  .app.shell.desk.sb-open .sb-foot > .ni {
    grid-row: 1; grid-column: auto; flex-direction: column; justify-content: center; gap: 2px; height: 56px; padding: 4px; border: 1px solid var(--line);
    border-radius: var(--r-md); background: var(--surface); font-size: 13px; line-height: 16px; text-align: center;
  }
  .app.shell.desk.sb-open .sb-foot > .ni .lbl { flex: none; max-width: 100%; }
  .app.shell.desk.sb-open .sb-foot > .me, .app.shell.desk.sb-open .sb-foot > .sb-fold { display: none; }
  .app.shell.desk.sb-open .sb-find {
    order: 1; flex: none; display: flex; align-items: center; gap: 10px; width: auto; height: 44px; margin: 8px 8px 8px; padding: 0 12px; border: 1px solid var(--line-2);
    border-radius: var(--r-md); background: var(--surface); color: var(--muted); font: 400 15px/20px var(--font-ui); text-align: left; cursor: pointer;
  }
  .app.shell.desk.sb-open .sb-find svg { width: 18px; height: 18px; }
  .app.shell.desk.sb-open .sb-find:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  .app.shell.desk .sb .ni { font-size: 15px; gap: 12px; padding: 0 10px; }
  .app.shell.desk .sb .ni > svg { width: 18px; height: 18px; }
  .app.shell.desk .sb .ni.has-cnt { height: auto; min-height: 48px; flex-wrap: wrap; row-gap: 0; padding-top: 4px; padding-bottom: 4px; }
  .app.shell.desk .sb .ni .why { display: block; flex: 0 0 calc(100% - 30px); margin-left: 30px; font-size: 12px; line-height: 16px; color: var(--ink-2); white-space: normal; }
  .app.shell.desk .sb .ni .why:empty { display: none; }
  .app.shell.desk .sb .gt, .app.shell.desk .sb .gall { font-size: 13px; height: 28px; }
  .app.shell.desk .sb .gfold { width: 28px; height: 28px; }
  .app.shell.desk .sb-strip, .app.shell.desk .sb .nadd { display: none !important; }
  .app.shell.desk .sb-foot .sb-fold { display: none; }
  .app.shell.desk > .topbar { gap: 4px; padding: 0 8px 0 var(--gutter); }
  .app.shell.desk .topbar .pagebar .crumbs, .app.shell.desk .topbar .fav-btn { display: none; }
  .app.shell.desk .topbar .pagebar { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
  .app.shell.desk .topbar .pagebar h1 { max-width: 100%; font-size: 16px; }
  .app.shell.desk .topbar .page-meta { margin: 0; font-size: 12px; line-height: 15px; }
  .app.shell.desk .search-btn { flex: none; width: 40px; height: 40px; margin: 0; padding: 0; justify-content: center; border: 0; background: transparent; color: var(--ink-2); }
  .app.shell.desk .search-btn svg { width: 20px; height: 20px; }
  .app.shell.desk .search-btn span, .app.shell.desk .search-btn kbd { display: none; }
  .app.shell.desk .top-r { flex: none; gap: 2px; }
  .app.shell.desk .new-split { display: none !important; }
  .agent-st { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .agent-st .lbl, .agent-st .n { display: none; }
  .app.shell.desk .top-avatar { display: grid; margin-left: 4px; }
  .app.shell.desk > .app-workspace { grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "main" "bottom"; }
  .app.shell.desk > .app-workspace > .main { padding: 12px var(--gutter) 24px; }
  .app.shell.desk > .app-workspace > .bottom-bar {
    grid-area: bottom; position: relative; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
  }
  /* a role that creates nothing (viewer, driver) has no + */
  .app.shell.desk > .app-workspace > .bottom-bar[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app.shell.desk > .app-workspace > .bottom-bar[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app.shell.desk > .app-workspace > .bottom-bar[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sb-panel { inset: 0 !important; width: auto; max-height: none; border-radius: 0; border: 0; }
  .sb-panel .pfind { width: auto; max-width: none; flex: 1; }
  .sb-panel .ph { flex-wrap: wrap; }
  .sb-panel .ph-t { flex: 1 1 100%; }
  .sb-panel .pf .pf-r { display: none; }
  .user-menu, .org-menu, .new-menu { width: auto; left: 8px !important; right: 8px; }
  .app.shell.desk .screen.screen-list { display: block; }
  /* a list on a phone keeps its New (and Quick LR); importing and exporting CSV files is desk work */
  .app.shell.desk #list-actions #btn-import, .app.shell.desk #list-actions #btn-export { display: none; }
  /* a list's filters slide sideways on a phone instead of stacking five rows high */
  .app.shell.desk .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)) 8px; padding: 0 var(--gutter) 2px; }
  .app.shell.desk .toolbar::-webkit-scrollbar { display: none; }
  .app.shell.desk .toolbar > * { flex: none; }
  .app.shell.desk .toolbar input[type=search] { width: 64vw; }
  .app.shell.desk .toolbar .spacer { display: none; }
  /* the existing Today rows as short cards: what and for whom on the left, ₹ and the one button on the right; a row
     with several buttons puts them on a line of their own */
  .app.shell.desk .tk { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "m v" "m a"; gap: 2px 10px; padding: 7px 10px 7px 12px; align-items: start; }
  .app.shell.desk .tk:has(.tk-a > :nth-child(2)) { grid-template-areas: "m v" "a a"; }
  .app.shell.desk .tk-v { grid-area: v; }
  .app.shell.desk .tk-m { grid-area: m; display: block; }
  .app.shell.desk .tk-t { font-size: 14px; }
  .app.shell.desk .tk-s { white-space: nowrap; font-size: 13px; line-height: 18px; }
  .app.shell.desk .tk-r, .app.shell.desk .tk-o, .app.shell.desk .tk-checks { display: none; }
  .app.shell.desk .tk-a { grid-area: a; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
  .app.shell.desk .tk-a .btn.xs { height: 32px; padding: 0 12px; font-size: 13px; }
  .app.shell.desk .hub-root .hub-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app.shell.desk .hub-root > .page-h.ph-done, .app.shell.desk .tk-chain, .app.shell.desk .chain-card { display: none; } /* Refresh and the set-up offer (with its Not now) stay on the desktop */
  .app.shell.desk .hub-root .kpi .l { font-size: 12px; }
}

@media print {
  .app.shell.desk > .sb, .app.shell.desk .bottom-bar, .user-menu, .sb-panel, .sb-fly, .sb-tip { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .sb .gfold svg { transition: none; }
}
