/* public/nav.css — v3.1193.0 (17 October 2026): the navigation lift (design brief A6), drawn by public/nav.js.
   Darren, 17 Oct 2026: "the methodology behind the app switcher and menu items … better UX as well as UI", and of the brief:
   "Please adhere to this on all aspects and update anything that doesn't conform."
   Theme colours only (tokens from theme.css); only opacity and transform animate (A1); every duration and curve is a token;
   prefers-reduced-motion turns them all to nothing (the block at the end). B3 — the sidebar's derived menu, .page-head,
   tables, fields and the frosted sign-in are left as they are: this file adds, it does not reskin. */


/* =====================================================================================================================
   A6.1 — THE ICON RAIL AND THE PHONE'S BOTTOM BAR: REMOVED (v3.1196.0, 17 October 2026)
   Darren, 18 Oct 2026: "I'm not so sure that the menu on the left is a good idea. I'm thinking we should remove that."
   Apps are reached one way now — sidebar → Platinum Apps → the All apps grid — and the two environments (a workspace,
   or the Office) are drawn by public/env.js and env.css.
   ===================================================================================================================== */

/* =====================================================================================================================
   A6.2 — "SEARCH OR JUMP TO… ⌘K" AND THE PALETTE
   ===================================================================================================================== */
.navk-trigger{display:inline-flex;align-items:center;gap:8px;height:36px;min-width:0;flex:0 1 230px;padding:0 6px 0 12px;
  border:1px solid var(--s-line);border-radius:var(--rad-pill);background:var(--s-sunk);color:var(--s-muted);cursor:pointer;
  font:inherit;font-size:var(--fs-sm);text-align:left;
  transition:border-color var(--dur-1) var(--ease-out),background-color var(--dur-1) var(--ease-out),color var(--dur-1) var(--ease-out)}
.navk-trigger:hover{border-color:var(--s-line-hover);color:var(--s-ink);background:var(--s-panel)}
.navk-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.navk-trigger svg{width:16px;height:16px;flex:0 0 auto;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round}
.navk-lab{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.navk-kbd,.navk kbd{display:inline-flex;align-items:center;gap:2px;font:inherit;font-size:11px;font-weight:600;line-height:1;
  color:var(--s-muted);background:var(--s-panel);border:1px solid var(--s-line);border-bottom-width:2px;border-radius:6px;padding:3px 6px}
/* Staff also carry the everything-search box (Darren: "in the top bar, in the empty space, can we have a search box"), so
   beside it the trigger is the short form; the box keeps the room it was given. */
.apptop:has(#apptop-find:not([hidden])) .navk-trigger{flex:0 0 auto}
.apptop:has(#apptop-find:not([hidden])) .navk-trigger .navk-lab{display:none}
.apptop:has(#apptop-find:not([hidden])) .apptop-find{margin-left:10px}
@media (max-width:1180px){ .navk-trigger{flex-basis:auto} .navk-trigger .navk-lab{display:none} }
/* v3.1212.0 (bec1028 item 20) — Bec: "Why are there 3 different search bars?" With the sidebar on screen (wider than 900px),
   its Search (Ctrl K, 3.1204) IS this palette, so the top bar's own copy of it is left out. Darren, 28 Oct 2026 (BEC28-20):
   "There doesn't need to be a top ctrl k as it's already in the side bar. Remove that." So at every width: on a phone the
   sidebar's Search is in the menu drawer, and staff also have the top bar's everything-search. Where there is no sidebar
   Search (a screen without the menu), the chip stays as the way in. Ctrl K itself is unchanged. */
/* 3.1212.0 (full suite) — written as a sibling selector, not as a :has() on the body element, which made the browser re-check every
   element's style on every change to the page: with the enquiry board behind an open record, each redraw cost about 50 ms of
   style work instead of 5, and an attached email took a second to show on a phone (test/v312020becenq). The sidebar's Search
   (#sb-search) is in the page's own markup and is never hidden, so "the sidebar is there" is the same condition. */
.sidebar ~ .mainwrap .navk-trigger{display:none}
@media (max-width:600px){
  html body .navk-trigger{width:40px;height:40px;padding:0;justify-content:center;flex:0 0 auto;background:transparent;border-color:var(--s-line)}
  html body .navk-trigger .navk-kbd{display:none}
  /* A phone already has the everything-search's magnifier for staff; one magnifier, not two. */
  html body .apptop:has(#apptop-find:not([hidden])) .navk-trigger{display:none}
}

.navk-ov{position:fixed;inset:0;z-index:90;background:var(--s-glass);display:flex;align-items:flex-start;justify-content:center;
  padding:12vh 16px 16px;opacity:0;transition:opacity var(--dur-2) var(--ease-out)}
.navk-ov.on{opacity:1}
.navk-ov.off{opacity:0;transition-duration:calc(var(--dur-2) * .6);transition-timing-function:var(--ease-in)}
.navk{width:min(660px,100%);max-height:min(580px,78vh);display:flex;flex-direction:column;background:var(--s-raised);
  border:1px solid var(--s-line-2);border-radius:var(--rad-lg);box-shadow:var(--sh-3);overflow:hidden;
  transform:translateY(var(--rise)) scale(.985);transition:transform var(--dur-2) var(--ease-out)}
.navk-ov.on .navk{transform:none}
.navk-ov.off .navk{transform:translateY(var(--rise)) scale(.985);transition-duration:calc(var(--dur-2) * .6);transition-timing-function:var(--ease-in)}
.navk-top{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid var(--s-line-2)}
.navk-top > svg{width:20px;height:20px;flex:0 0 auto;stroke:var(--s-muted);fill:none;stroke-width:2;stroke-linecap:round}
.navk .navk-q,.navk .navk-q:focus,.navk .navk-q:hover{flex:1 1 auto;min-width:0;width:auto;height:auto;min-height:0;border:0;outline:0;
  box-shadow:none;background:transparent;color:var(--s-ink);font:inherit;font-size:var(--fs-lg);padding:4px 0;margin:0;border-radius:0}
.navk .navk-q::placeholder{color:var(--s-muted)}
.navk-list{flex:1 1 auto;min-height:0;overflow-y:auto;padding:6px 8px 8px;transition:opacity var(--dur-1) var(--ease-out)}
.navk-list.navk-dim .navk-g{opacity:.55;transition:opacity var(--dur-1) var(--ease-out)}
.navk-gh{padding:10px 10px 4px;font-size:11px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--s-muted)}
.navk-it{display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:var(--rad-in);cursor:pointer;color:var(--s-ink)}
.navk-it.on{background:var(--s-accent-soft)}
.navk-ic,.navk-dot{width:30px;height:30px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;
  border-radius:8px;background:var(--s-sunk);color:var(--s-muted)}
.navk-ic svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.navk-dot::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--orange)}
.navk-it.on .navk-ic{background:var(--s-panel);color:var(--blue-ink)}
.navk-it.on .navk-dot{background:var(--s-panel)}
.navk-t{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px}
.navk-t b{font-size:var(--fs-md);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.navk-t small{font-size:var(--fs-xs);color:var(--s-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.navk-t mark{background:var(--orange-soft);color:inherit;border-radius:3px;padding:0 1px}
.navk-go{flex:0 0 auto;font-size:var(--fs-sm);color:var(--blue-ink);opacity:0;transition:opacity var(--dur-1) var(--ease-out)}
.navk-it.on .navk-go{opacity:1}
.navk-state{display:flex;align-items:center;gap:10px;padding:12px 12px;font-size:var(--fs-sm);color:var(--s-muted)}
.navk-bad{color:var(--s-warn)}
.navk-empty{text-align:center;padding:34px 24px 30px;color:var(--s-muted)}
.navk-empty b{display:block;color:var(--s-ink);font-size:var(--fs-md);margin:12px 0 6px}
.navk-empty p{margin:0 auto;max-width:42ch;font-size:var(--fs-sm);line-height:1.5}
.navk-empty-ico{width:48px;height:48px;margin:0 auto;border-radius:50%;background:var(--s-sunk);display:flex;align-items:center;justify-content:center}
.navk-empty-ico svg{width:22px;height:22px;stroke:var(--s-muted);fill:none;stroke-width:2;stroke-linecap:round}
.navk-foot{display:flex;align-items:center;gap:16px;padding:9px 16px;border-top:1px solid var(--s-line-2);font-size:var(--fs-xs);color:var(--s-muted);
  background:var(--s-sunk)}
.navk-foot span{display:inline-flex;align-items:center;gap:5px}
.navk-foot .navk-foot-r{margin-left:auto}
.navk-spin{width:14px;height:14px;flex:0 0 auto;border-radius:50%;border:2px solid var(--s-line);border-top-color:var(--accent);
  animation:navk-spin .8s linear infinite}
@keyframes navk-spin{to{transform:rotate(360deg)}}
@media (max-width:600px){
  .navk-ov{padding:8px 8px 8px}
  .navk{max-height:calc(100dvh - 16px);border-radius:var(--rad)}
  .navk-foot{display:none}
  .navk-it{padding:10px 8px;min-height:48px}
}

/* =====================================================================================================================
   A6.3 — PINNED AND RECENT AT THE TOP OF THE MENU
   ===================================================================================================================== */
.nav-quick[hidden]{display:none !important}
.nav-quick{padding-bottom:6px;border-bottom:1px solid var(--s-line-2);margin-bottom:2px}
.nav-quick .nq-h{padding-top:4px;padding-bottom:4px}
.nav-quick .nq-h + .nq-item{margin-top:1px}
.nav-quick .nq-item{text-decoration:none}
.nav-quick .nq-item svg{stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;opacity:.8}
.nav-quick .nq-item .lab{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-quick .nq-pin svg{color:var(--blue-ink)}
.sidebar.collapsed .nav-quick .nq-h{display:none}

/* =====================================================================================================================
   A6.4 / A6.5 — THE MENU: "Do" and "Go to" drawn differently
   ===================================================================================================================== */
.am-items .am-sub{padding:8px 10px 3px;font-size:11px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--s-muted)}
.am-items .am-sub:first-child{padding-top:3px}
.am-items .tab.am-job::before{content:"";width:6px;height:6px;flex:0 0 auto;border-radius:50%;background:var(--orange);margin-right:-3px}

/* =====================================================================================================================
   A6.6 — THE WORKSPACE TILE AND "SWITCHING TO ACME…"
   ===================================================================================================================== */
.nav-ws-tile{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 auto;border-radius:7px;
  background:var(--b-500);color:var(--s-hero-ink);font-size:10.5px;font-weight:700;letter-spacing:.02em;line-height:1;font-style:normal}
.ws-btn .ws-ico.nav-ws-tile{font-size:10.5px}
.ws-item .nav-ws-tile{margin-right:8px;vertical-align:middle;background:var(--s-accent-soft);color:var(--blue-ink)}
.ws-item.active .nav-ws-tile{background:var(--b-500);color:var(--s-hero-ink)}
.navsw-ov{position:fixed;inset:0;z-index:95;background:var(--s-glass);display:flex;align-items:center;justify-content:center;
  opacity:0;transition:opacity var(--dur-2) var(--ease-out)}
.navsw-ov.on{opacity:1}
.navsw{display:flex;align-items:center;gap:14px;padding:18px 22px;background:var(--s-panel);border:1px solid var(--s-line-2);
  border-radius:var(--rad-lg);box-shadow:var(--sh-3);color:var(--s-ink);font-size:var(--fs-md);transform:translateY(var(--rise));
  transition:transform var(--dur-3) var(--ease-out)}
.navsw-ov.on .navsw{transform:none}
.navsw-tile{width:36px;height:36px;font-size:13px;border-radius:10px}

/* =====================================================================================================================
   A6.7 — COMFORTABLE / COMPACT (one html[data-density] attribute)
   ===================================================================================================================== */
.nav-density{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:16px 20px;margin-bottom:16px}
.nav-density h3{margin:0 0 2px;font-size:var(--fs-md)}
.nav-density .hint{margin:0}
.nav-seg{display:inline-flex;padding:3px;border-radius:var(--rad-pill);background:var(--s-sunk);border:1px solid var(--s-line-2)}
.nav-seg-b{border:0;background:transparent;color:var(--s-muted);font:inherit;font-size:var(--fs-sm);font-weight:600;padding:7px 16px;
  border-radius:var(--rad-pill);cursor:pointer;min-height:34px;
  transition:background-color var(--dur-1) var(--ease-out),color var(--dur-1) var(--ease-out),box-shadow var(--dur-1) var(--ease-out)}
.nav-seg-b[aria-checked="true"]{background:var(--s-panel);color:var(--s-ink);box-shadow:var(--sh-1)}
.nav-seg-b:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
@media (max-width:600px){ .nav-density{padding:14px 16px} .nav-seg{width:100%} .nav-seg-b{flex:1 1 0;min-height:40px} }
html[data-density="compact"]{--sp-2:6px;--sp-3:10px;--sp-4:12px;--sp-5:18px;--sp-6:24px}
html[data-density="compact"] th,html[data-density="compact"] td{padding-top:6px;padding-bottom:6px}
html[data-density="compact"] .sidebar .tab,html[data-density="compact"] .sidebar .navx{padding-top:5px;padding-bottom:5px}
html[data-density="compact"] .am-head{padding-top:5px;padding-bottom:5px}
html[data-density="compact"] .sb-grp .tab.am-item,html[data-density="compact"] .am-items .tab.am-item{padding-top:4px;padding-bottom:4px}
html[data-density="compact"] .dir-count{padding-top:8px;padding-bottom:8px}

/* =====================================================================================================================
   A6.8 — THE PHONE: "⋯" past two actions, tables as cards, a record's Reply by at the bottom
   ===================================================================================================================== */
.nav-more{display:none}
.nav-more svg{width:18px;height:18px;fill:currentColor}
.nav-more-pop{position:fixed;z-index:85;min-width:200px;max-width:calc(100vw - 16px);padding:6px;background:var(--s-panel);
  border:1px solid var(--s-line-2);border-radius:var(--rad);box-shadow:var(--sh-3);opacity:0;transform:translateY(calc(var(--rise) * -1));
  transition:opacity var(--dur-2) var(--ease-out),transform var(--dur-2) var(--ease-out)}
.nav-more-pop.on{opacity:1;transform:none}
.nav-more-it{display:block;width:100%;text-align:left;border:0;background:transparent;color:var(--s-ink);font:inherit;font-size:var(--fs-md);
  padding:11px 12px;border-radius:var(--rad-in);cursor:pointer;min-height:44px}
.nav-more-it:hover,.nav-more-it:focus-visible{background:var(--s-sunk);outline:0}
@media (max-width:600px){
  .view-head-actions.nav-folds > .nav-ovf{display:none !important}
  .view-head-actions.nav-folds > .nav-more{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:40px;padding:0 10px}
  /* The enquiry board and bookings: a row is a card — the first cell is its heading, the rest label: value. */
  table.nav-cards,table.nav-cards tbody{display:block;width:100%}
  table.nav-cards thead{display:none}
  table.nav-cards tbody tr{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;margin:0 0 10px;padding:12px 14px;
    background:var(--s-raised);border:1px solid var(--s-line-2);border-radius:var(--rad);box-shadow:var(--sh-1)}
  table.nav-cards tbody tr > td{display:grid;grid-template-columns:96px minmax(0,1fr);gap:10px;align-items:start;padding:3px 0;
    border:0;white-space:normal;max-width:none;min-width:0;overflow-wrap:anywhere}
  table.nav-cards tbody tr > td::before{content:attr(data-label);font-size:var(--fs-xs);font-weight:600;color:var(--s-muted);padding-top:2px}
  table.nav-cards tbody tr > td:not([data-label])::before,table.nav-cards tbody tr > td[data-label=""]::before{content:none}
  table.nav-cards tbody tr > td:not([data-label]),table.nav-cards tbody tr > td[data-label=""]{grid-template-columns:minmax(0,1fr)}
  table.nav-cards tbody tr > td[colspan]{grid-template-columns:minmax(0,1fr)}
  table.nav-cards tbody tr > td[colspan]::before{content:none}
  /* The enquiry board's first cell (the tick and the E-number) is the card's own top line; its urgency bar is the card's
     left edge rather than a stripe inside one cell. */
  table.nav-cards tbody tr > td.enq-tickcol{display:flex;align-items:center;gap:10px;box-shadow:none;padding-bottom:6px}
  table.nav-cards tbody tr.enq-urgent{box-shadow:inset 3px 0 0 var(--danger),var(--sh-1)}
  table.nav-cards tbody tr.enq-due{box-shadow:inset 3px 0 0 var(--warn),var(--sh-1)}
  table.nav-cards tbody tr.enq-ok{box-shadow:inset 3px 0 0 var(--ok),var(--sh-1)}
  .tablewrap:has(> table.nav-cards){overflow:visible;border:0;background:transparent;box-shadow:none}
  /* The enquiry filters scroll away with the page, as Tasks' filter box already does on a portrait phone (v3.1170): stuck,
     they were 285px of a 844px screen, and the cards slid underneath them. */
  html body #view-enquiries .enq-filterbar{position:static}
  /* A record's primary actions stay in reach: Reply by (Email · Text · Call) pins to the bottom of the enquiry. */
  .enq-modal .enq-rec-id > .rb{position:fixed;left:0;right:0;bottom:0;z-index:5;margin:0;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));
    background:var(--s-raised);border-top:1px solid var(--s-line-2);box-shadow:var(--sh-3);justify-content:center}
  .enq-modal .enq-rec-id > .rb .rb-btns{flex:1 1 auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .enq-modal .enq-rec-id > .rb .rb-b{justify-content:center;min-height:44px}
  .enq-modal .sheet-card{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  /* v3.1199.0 — "← Back to the bookings list" is a line of its own on a phone. Floated beside the × at 390px it sat on
     top of the enquiry's company name; in the flow it pushes the record down instead, and stays clear of the ×. */
  .enq-modal .enq-modal-back{position:static;display:inline-flex;max-width:calc(100% - 48px);margin:0 0 8px;white-space:normal;text-align:left}
}

/* =====================================================================================================================
   A1 — WITH REDUCED MOTION, NOTHING HERE MOVES (the app still works with none at all)
   ===================================================================================================================== */
@media (prefers-reduced-motion: reduce){
  .navk-trigger,.navk-ov,.navk,.navk-list,.navk-go,.navk-list.navk-dim .navk-g,.navsw-ov,.navsw,
  .nav-seg-b,.nav-more-pop{transition-duration:0ms !important}
  .navk-spin{animation-duration:1.6s}
}
