/* The program frame for the office (Josh, 2026-11-26: "less like a web page and
   more like a program"). The office's layout unless a device chose Standard layout
   from the account menu (Josh, 2026-11-28: "i want the default to be the new
   layout"), and only on a window 1100px wide or more: `html.desk` is set before
   paint by the script at the top of base.html. Without it nothing here applies
   and the bar is exactly as it was.

   The bar's own markup is kept and laid out another way: the menus become a
   list down the left side that stays put, the open records, Back and Refresh,
   Messages, Alerts and the account menu share one strip across the top, and a
   status line runs along the bottom. The menu tabs are not drawn: the side list
   shows the open menu's pages. Colour means status only, as in Shop Mode
   (shop.css): a button is ink, and the brand rust marks where you are. Every
   colour is a token from app.css (rule 32). */

.deskgo, .deskstatus, .deskpal, .pagetools, .deskpeek { display: none; }

@media screen {
html.desk { --side-w: 232px; --strip-h: 40px; --stat-h: 26px; }
html.desk body { font: 14px/1.45 var(--fl-sans); padding: var(--strip-h) 0 var(--stat-h); }   /* the strip's room is the body's, so nothing above main can give it away */

/* ---------- the frame ---------- */
html.desk header.topbar { position: fixed; inset: 0; z-index: 500; display: grid; padding: 0; gap: 0;
  grid-template-columns: var(--side-w) minmax(0, 1fr) auto auto auto; grid-template-rows: var(--strip-h) minmax(0, 1fr);
  align-items: stretch; background: none; pointer-events: none; }
html.desk header.topbar > * { pointer-events: auto; }
html.desk header.topbar::before { content: ""; grid-column: 2 / -1; grid-row: 1; background: var(--bar-strip); pointer-events: auto; }
html.desk .topbar .worktabs { display: none !important; }

/* the side list */
html.desk .topbar .brand { grid-column: 1; grid-row: 1; margin: 0; padding: 0 14px; background: var(--ink);
  font: 700 18px/1 var(--fl-cond); letter-spacing: .03em; }
html.desk .topbar .brand-logo { height: 28px; }
html.desk header.topbar nav { grid-column: 1; grid-row: 2; display: block; background: var(--ink); overflow-y: auto;
  overscroll-behavior: contain; padding: 0 0 12px; scrollbar-width: thin; scrollbar-color: var(--bar-edge) var(--ink); }
html.desk .deskgo { display: flex; justify-content: space-between; align-items: center; width: calc(100% - 20px); margin: 2px 10px 8px;
  min-height: 34px; padding: 4px 10px; border: 1px solid var(--bar-edge); border-radius: 3px; background: var(--bar-strip);
  color: #d9dfe6; font: 400 13px/1.2 var(--fl-sans); cursor: pointer; }
html.desk .deskgo:hover { background: var(--bar-lit); }
html.desk .deskgo kbd, html.desk .deskstatus kbd { font: 600 12px/1 var(--fl-mono); border: 1px solid var(--bar-edge); border-radius: 3px; padding: 2px 5px; }
html.desk .topbar nav > a, html.desk .topbar nav > .navgrp > summary { display: block; padding: 7px 14px 7px 11px !important;
  font-size: 14px !important; border-bottom: 0; border-left: 3px solid transparent; color: #d9dfe6; }
html.desk .topbar nav > .navgrp { display: block; }
html.desk .topbar nav > a:hover, html.desk .topbar nav > .navgrp > summary:hover { background: var(--bar-lit); color: #fff; }
html.desk .topbar nav > .navgrp[open] > summary { color: #fff; font-weight: 600; border-bottom: 0; }
html.desk .topbar nav > a.active, html.desk .topbar nav > .navgrp > summary.active { color: #fff; font-weight: 600; border-left-color: var(--brand); }
html.desk .topbar nav .navmenu { position: static; min-width: 0; max-height: none !important; overflow: visible; background: none;
  border: 0; box-shadow: none; padding: 0 0 6px; }
html.desk .topbar nav .navmenu a { padding: 5px 12px 5px 26px; font-size: 13px; font-weight: 400; line-height: 1.35; white-space: normal;
  color: #d9dfe6; background: none; border-bottom: 0; }
html.desk .topbar nav .navmenu a:hover { background: var(--bar-lit); color: #fff; }
html.desk .topbar nav .navmenu a.current { background: var(--bar-lit); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
html.desk .topbar nav .navmenu .navmenu-sec { padding: 8px 12px 2px 26px; font: 600 12px/1.3 var(--fl-mono); letter-spacing: .06em;
  color: #aab4bf; background: none; border-bottom: 0; white-space: normal; }

/* the strip across the top: Back and Refresh, the open records, then Messages, Alerts and the account */
html.desk .topbar .rectabs { grid-column: 2; grid-row: 1; order: 0; flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
  margin: 0; padding: 0 8px 0 var(--back-w, 12px); border: 0; background: none; overflow: hidden; }
html.desk .topbar .rectabs[hidden] { display: none; }
html.desk .topbar .rectab a { min-height: 0; padding: 5px 2px 5px 10px; font-size: 13px; white-space: nowrap; }
html.desk .topbar .rectab-x { min-height: 0; padding: 0 7px; }
html.desk .topbar .bell { grid-row: 1; align-self: center; margin: 0 2px !important; padding: 6px 8px !important; font-size: 13px !important;
  display: inline-flex; align-items: center; min-height: 0; }
html.desk .topbar #chat-nav { grid-column: 3; }
html.desk .topbar #alerts-nav { grid-column: 4; }
html.desk .topbar .usermenu { grid-column: 5; grid-row: 1; align-self: center; margin-right: 6px; }
html.desk .topbar .usermenu > summary { padding: 6px 10px; font-size: 13px; border-bottom: 0; }
html.desk .backrow { position: fixed; top: 0; left: var(--side-w); z-index: 501; height: var(--strip-h); margin: 0; padding: 0 0 0 10px;
  gap: 4px; flex-wrap: nowrap; }
html.desk .backrow .btn { min-height: 28px; padding: 3px 9px; font-size: 13px; background: none; color: #d9dfe6; border-color: var(--bar-edge); white-space: nowrap; }
html.desk .backrow .btn:hover { background: var(--bar-lit); color: #fff; }

/* the status line */
html.desk .deskstatus { display: flex; align-items: center; gap: 18px; position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 440;
  height: var(--stat-h); padding: 0 12px; background: var(--bar-strip); color: #d9dfe6; font: 600 12px/1 var(--fl-mono); white-space: nowrap; overflow: hidden; }
html.desk .deskstatus .end { margin-left: auto; }
html.desk #chat-dock { bottom: calc(var(--stat-h) + 10px); }

/* ---------- the page inside the frame ---------- */
html.desk main { max-width: none; margin: 0 0 0 var(--side-w); padding: 12px 18px 24px; }
html.desk .announce { margin: 0 0 0 var(--side-w); }
html.desk main h1 { font: 700 24px/1.15 var(--fl-cond); margin: 0 0 6px; }
html.desk main > h1 { display: inline-block; vertical-align: middle; }
html.desk main h2 { font-size: 16px; margin: 16px 0 8px; }
html.desk main .panel { padding: 10px 14px; margin-bottom: 10px; border-radius: 4px; }
html.desk main th, html.desk main td { padding: 6px 10px; }
html.desk main th { font: 600 12px/1.3 var(--fl-mono); letter-spacing: .05em; }
html.desk main td { font-variant-numeric: tabular-nums; }
html.desk main button, html.desk main .btn { --brand: var(--ink); --brand-dark: #2b3746; min-height: 34px; padding: 6px 13px; border-radius: 3px; font-size: 14px; }
html.desk main .btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
html.desk main .btn.ghost { border-color: var(--line); }
html.desk main input, html.desk main select, html.desk main textarea { padding: 6px 9px; border-radius: 3px; }
html.desk main .filterbar.panel { padding: 6px 10px; margin-bottom: 8px; border-radius: 0; }
html.desk main .stat .num { color: var(--ink); font-family: var(--fl-mono); font-size: 26px; }

/* a page's own actions, on one line under its name */
html.desk .pagetools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
html.desk details.tooled > summary { display: none; }
html.desk details.tooled:not([open]) { display: none; }
html.desk .tooledbox:not(.open) { display: none; }
html.desk .tooledrow.open { margin: 0 0 10px !important; }   /* a title row's form, opened beneath the toolbar */
html.desk .deskoff { display: none; }   /* a button the toolbar already carries */

/* a list with the picked record beside it */
html.desk .desksplit { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 10px; align-items: start; }
html.desk .desksplit > .panel { margin-bottom: 0; }
html.desk .deskpeek { display: block; position: sticky; top: calc(var(--bar-h, 0px) + var(--sub-h, 0px));
  max-height: calc(100vh - var(--bar-h, 0px) - var(--sub-h, 0px) - var(--stat-h) - 12px); overflow: auto; }
html.desk .deskpeek h2 { font: 600 20px/1.2 var(--fl-mono); margin: 0; }
html.desk .deskpeek .kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 8px; margin: 10px 0; }
html.desk .deskpeek .kv dt { color: var(--muted); font-size: 12px; }
html.desk .deskpeek .kv dd { margin: 0; overflow-wrap: anywhere; }
html.desk .deskpeek .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
html.desk .deskpeek td, html.desk .deskpeek th { padding: 5px 6px; }
html.desk tr.rowpick { cursor: pointer; }
html.desk tr.rowpick > td:not(.wrap):not(:last-child) { white-space: nowrap; }
html.desk tr.rowpick > td.wrap { min-width: 170px; }
/* a column the record beside the list already shows is left off the list while the record is drawn */
@media (min-width: 1280px) { html.desk .desksplit .dh { display: none; } }
@media (max-width: 1500px) { html.desk .desksplit { grid-template-columns: minmax(0, 1fr) 320px; } }
html.desk .filterbar #pojob { max-width: 200px !important; }
html.desk tr.rowsel > td { background: #dfebf7; }   /* the .badge.info tint */
html.desk tr.rowsel > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- go to a page or an open record (Ctrl K) ---------- */
html.desk .deskpal { display: block; position: fixed; inset: 0; z-index: 900; background: rgba(16, 24, 40, .45); }
html.desk .deskpal[hidden] { display: none; }
html.desk .deskpal-box { width: min(560px, calc(100vw - 40px)); margin: 12vh auto 0; background: var(--panel); border: 1px solid var(--ink);
  border-radius: 4px; box-shadow: 0 16px 40px rgba(16, 24, 40, .35); overflow: hidden; }
html.desk .deskpal input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 14px; font: 400 16px/1.3 var(--fl-sans); outline: 0; }
html.desk .deskpal-list { max-height: 50vh; overflow-y: auto; }
html.desk .deskpal-list a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; color: var(--ink); text-decoration: none; }
html.desk .deskpal-list a span { color: var(--muted); font-size: 12px; white-space: nowrap; }
html.desk .deskpal-list a.on, html.desk .deskpal-list a:hover { background: #dfebf7; }
html.desk .deskpal-none { padding: 12px 14px; color: var(--muted); }
}
/* a window too narrow for a list and a record side by side keeps the list alone */
@media screen and (max-width: 1279px) {
  html.desk .desksplit { display: block; }
  html.desk .deskpeek { display: none; }
}
/* The menu down the side takes 232px of the window, so the production board's Manual
   actions fold as they do at 1240px once the page beside the menu is that narrow: at
   1280 and 1366 the controls ran off the right edge (2026-12-01). */
@media screen and (max-width: 1472px) {
  html.desk .bulk-row { grid-template-columns: 150px 1fr; }
  html.desk .bulk-ctl { grid-column: 1 / -1; justify-content: flex-start; }
}
/* at the narrowest window that draws a record beside its list, the list gives up no column to it */
@media screen and (min-width: 1280px) and (max-width: 1365px) {
  html.desk .desksplit { grid-template-columns: minmax(0, 1fr) 300px; }
  html.desk tr.rowpick > td.wrap { min-width: 120px; }
}
@media screen and (max-width: 1500px) {
  html.desk .deskpeek td, html.desk .deskpeek th { padding: 5px 3px; }
  html.desk .deskpeek th { letter-spacing: 0; }
}
