/* dashboard/public/workspace/css/app.css — every remaining rule of
   docs/proposals/dashboard_workspace_v2_mockup.html's <style> block (the parts not moved to
   tokens.css), in the same order, per task-3-brief step 3: `.nav` becomes an anchor style
   (text-decoration:none, keeps color:var(--side-ink)); `.side nav` becomes `#nav`; the mockup's
   `.example` pill and old `.toast` rule are dropped; banner/skeleton/placeholder/toast rules for
   this task are appended at the end. */
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font:400 16px/1.45 var(--sans)}
button{font:inherit;color:inherit}
svg.i{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.mono{font-family:var(--mono);font-variant-numeric:tabular-nums}
.num{font-variant-numeric:tabular-nums}

.app{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh;min-height:100dvh}
/* ---------- sidebar ---------- */
.side{background:var(--side);color:var(--side-ink);display:flex;flex-direction:column;position:sticky;top:0;height:100vh;height:100dvh;border-right:1px solid var(--side-line)}
.brand{display:flex;align-items:center;gap:10px;padding:18px 18px 14px}
.brand .mark{width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#2447D6,#00806A);display:grid;place-items:center;font:600 16px var(--cond);color:#fff}
.brand b{font:600 18px/1.1 var(--cond);letter-spacing:.01em}
.brand small{display:block;font-size:14px;color:var(--side-ink-2)}
#nav{flex:1;overflow-y:auto;padding:4px 10px 10px}
.grp{font-size:12px;letter-spacing:.09em;text-transform:uppercase;color:var(--side-ink-2);padding:16px 10px 6px}
.nav{display:flex;align-items:center;gap:11px;width:100%;min-height:44px;padding:0 10px;border:0;background:none;border-radius:8px;cursor:pointer;text-align:left;font-size:15px;color:var(--side-ink);text-decoration:none}
.nav:hover{background:var(--side-2)}
.nav[aria-current="page"]{background:var(--side-2);box-shadow:inset 3px 0 0 #7D95FF}
.nav svg{color:var(--side-ink-2)} .nav[aria-current="page"] svg{color:#9DB0FF}
.nav .ct{margin-left:auto;font:500 14px var(--mono);min-width:26px;text-align:center;padding:1px 7px;border-radius:999px;background:var(--side-line);color:var(--side-ink)}
.nav .ct.hot{background:#2447D6;color:#fff}
.side .foot{border-top:1px solid var(--side-line);padding:12px 8px 14px;display:grid;gap:10px}
.ask{display:flex;align-items:center;justify-content:center;gap:8px;min-height:40px;border-radius:8px;border:1px solid #33443A;background:var(--side-2);cursor:pointer;font-size:15px}
.ask:hover{border-color:#7D95FF}
.chans{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
.chan{display:flex;flex-direction:column;align-items:center;gap:3px;padding:7px 0;border-radius:8px;color:var(--side-ink-2);font-size:14px;white-space:nowrap;text-decoration:none;border:1px solid transparent}
.chan:hover{color:var(--side-ink);border-color:var(--side-line)}
.meta{display:flex;align-items:center;justify-content:space-between;font-size:14px;color:var(--side-ink-2)}
.meta .btns{display:inline-flex;gap:4px}
.meta button{background:none;border:0;color:var(--side-ink-2);cursor:pointer;border-radius:6px;display:inline-grid;place-items:center;min-width:44px;min-height:44px}
.meta button:hover{color:var(--side-ink);background:var(--side-2)}
.meta a{display:inline-flex;align-items:center;min-height:44px}
.dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#43C9AC;margin-right:6px;vertical-align:1px}

/* ---------- main ---------- */
.main{min-width:0;display:flex;flex-direction:column}
.top{display:flex;align-items:center;gap:16px;padding:18px 28px 6px}
.top h1{margin:0;font:600 26px/1.15 var(--cond);letter-spacing:.005em;text-wrap:balance}
.top .sub{color:var(--ink-3);font-size:14px;margin-top:2px}
.top .grow{flex:1}
.kbd{font:500 14px var(--mono);border:1px solid var(--line);border-bottom-width:2px;border-radius:5px;padding:0 5px;color:var(--ink-3);background:var(--surface)}
.btn{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:0 14px;border-radius:8px;border:1px solid var(--line);background:var(--surface);cursor:pointer;font-size:15px;white-space:nowrap}
.btn:hover{border-color:var(--ink-3)}
.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.btn.primary:hover{filter:brightness(1.07)}
.btn.ghost{background:none;border-color:transparent;color:var(--ink-2)}
.btn.ghost:hover{background:var(--sunk)}

.bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px 28px 8px}
.search{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 10px 0 12px;border:1px solid var(--line);background:var(--surface);border-radius:8px;width:300px;max-width:100%;color:var(--ink-3)}
.search input{border:0;outline:0;background:none;flex:1;min-width:0;font:inherit;font-size:15px;color:var(--ink)}
.search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-tint)}
.facet{position:relative}
.facet>button{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 10px 0 12px;border:1px dashed var(--line);border-radius:8px;background:var(--surface);cursor:pointer;font-size:15px;color:var(--ink-2)}
.facet>button.on{border-style:solid;border-color:var(--accent);color:var(--ink);background:var(--accent-tint)}
.facet>button .n{font:500 14px var(--mono);background:var(--accent);color:var(--accent-ink);border-radius:999px;padding:0 6px}
.facet>button svg{width:15px;height:15px}
.pop{position:absolute;top:calc(100% + 6px);left:0;z-index:30;min-width:250px;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);padding:6px}
.pop h4{margin:4px 8px 6px;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);font-weight:500}
.opt{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:0 8px;border:0;background:none;border-radius:6px;cursor:pointer;font-size:15px;text-align:left}
.opt:hover{background:var(--sunk)}
.opt .box{width:18px;height:18px;border:1.5px solid var(--ink-3);border-radius:4px;display:grid;place-items:center;flex:none}
.opt[aria-checked="true"] .box{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.opt .box svg{width:13px;height:13px;stroke-width:3}
.opt .c{margin-left:auto;font:500 14px var(--mono);color:var(--ink-3)}
.opt.zero{color:var(--ink-3)}
.spacer{flex:1}
.toggle{display:inline-flex;align-items:center;gap:8px;font-size:14px;color:var(--ink-2);cursor:pointer;min-height:44px;padding:0 6px;background:none;border:0}
.sw{width:32px;height:18px;border-radius:999px;background:var(--line);position:relative;transition:background .15s}
.sw::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:var(--surface);transition:transform .15s}
.toggle[aria-checked="true"] .sw{background:var(--accent)}
.toggle[aria-checked="true"] .sw::after{transform:translateX(14px)}

.chips{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:0 28px 12px;min-height:8px}
.chip{display:inline-flex;align-items:center;gap:6px;font-size:14px;padding:3px 4px 3px 10px;border-radius:999px;background:var(--surface);border:1px solid var(--line)}
.chip b{font-weight:500}
/* I4: the chip remove button's own icon+padding box is ~20x20 (14px icon + 3px padding each
   side) — deliberately kept small so a chip stays a compact pill. The ::before pseudo-element
   expands the actual HIT AREA to >=44x44 (20 + 2*12 = 44) via a transparent inset, the standard
   small-visual/large-target technique, without growing what is drawn. */
.chip button{border:0;background:none;cursor:pointer;display:flex;padding:3px;border-radius:50%;color:var(--ink-3);position:relative}
.chip button::before{content:"";position:absolute;inset:-12px}
.chip button:hover{background:var(--sunk);color:var(--ink)}
.chip button svg{width:14px;height:14px}
.clear{display:inline-flex;align-items:center;background:none;border:0;color:var(--accent);cursor:pointer;font-size:14px;min-height:44px;padding:4px 6px}
.count{font-size:14px;color:var(--ink-3);margin-left:auto}

/* ---------- content + table ---------- */
.content{display:flex;gap:0;padding:0 28px 28px;min-height:0;align-items:flex-start}
.tablewrap{flex:1;min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:10px;overflow:auto}
table{width:100%;border-collapse:collapse;font-size:15px}
th{position:sticky;top:0;background:var(--sunk);text-align:left;font-weight:500;font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-3);padding:0 14px;height:40px;border-bottom:1px solid var(--line);white-space:nowrap;z-index:1}
/* I4: the sort button used to be a tiny inline element (all:unset shrank it to its own text+icon,
   ~83x19) sitting inside a 40px-tall header cell. It now fills the header cell's own box, so the
   whole cell height (already the >=40px-inside-a-table-cell floor) is clickable, not just the text. */
th button{all:unset;box-sizing:border-box;cursor:pointer;display:inline-flex;align-items:center;gap:4px;width:100%;height:100%;min-height:40px}
th button:hover{color:var(--ink)}
th button svg{width:13px;height:13px;opacity:.55}
th[aria-sort] button{color:var(--ink)} th[aria-sort] button svg{opacity:1}
td{padding:0 14px;height:52px;border-bottom:1px solid var(--line-2);white-space:nowrap;vertical-align:middle}
tr:last-child td{border-bottom:0}
tbody tr{cursor:pointer}
tbody tr:hover td{background:var(--hover)}
tbody tr[aria-selected="true"] td{background:var(--accent-tint)}
tbody tr[aria-selected="true"] td:first-child{box-shadow:inset 3px 0 0 var(--accent)}
td.r,th.r{text-align:right}
.id{font:500 14px var(--mono);color:var(--ink)}
.subl{display:block;font-size:14px;color:var(--ink-3);margin-top:1px}
/* task-4 (Needs you): the "What" column wraps -- td is white-space:nowrap by default above, so the
   cell content overrides it on itself; the row's fixed td height:52px is a minimum, not a cap, so a
   wrapped multi-line cell simply grows the row. */
.wrap{white-space:normal;word-break:break-word;line-height:1.35}
.pill{display:inline-flex;align-items:center;gap:5px;font-size:14px;font-weight:500;padding:2px 9px;border-radius:999px;line-height:1.5;white-space:nowrap}
.pill svg{width:13px;height:13px}
.p-s1{background:var(--s1-t);color:var(--s1)} .p-s2{background:var(--s2-t);color:var(--s2)} .p-s3{background:var(--s3-t);color:var(--s3)}
.p-msg{background:var(--msg-t);color:var(--msg)} .p-stale{background:var(--stale-t);color:var(--stale)} .p-n{background:var(--neutral-t);color:var(--ink-2)}
.test{font:600 12px var(--mono);letter-spacing:.06em;text-transform:uppercase;padding:1px 6px;border-radius:4px;border:1px dashed var(--ink-3);color:var(--ink-3);margin-left:8px;vertical-align:1px}
.meter{display:inline-flex;align-items:center;gap:8px}
.meter .track{width:70px;height:6px;border-radius:999px;background:var(--line-2);overflow:hidden}
.meter .fill{height:100%;background:var(--s3);border-radius:999px}
.meter .fill.part{background:var(--s2)}
.dots{display:inline-flex;gap:3px;margin-right:8px;vertical-align:middle}
.dots i{width:8px;height:8px;border-radius:50%;background:var(--line)}
.dots i.y{background:var(--s3)}
.rowbtn{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 11px;border-radius:7px;border:1px solid var(--line);background:var(--surface);font-size:14px;cursor:pointer}
.rowbtn:hover{border-color:var(--accent);color:var(--accent)}
.empty{padding:48px 20px;text-align:center;color:var(--ink-3)}

/* ---------- drawer ---------- */
/* YES-133 (spec §3): width/position/sticky/max-height move to #drawer-host .drawer (the wide
   overlay window, task-2.5's own section below) -- this base rule keeps only the card chrome. */
.drawer{background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden}
.dh{padding:18px 20px 12px;border-bottom:1px solid var(--line-2)}
.dh .row1{display:flex;align-items:center;gap:10px}
.dh .row1 .id{font-size:16px}
.dh h2{margin:6px 0 2px;font:600 22px/1.2 var(--cond)}
.dh .facts{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:14px;color:var(--ink-3)}
.iconbtn{border:0;background:none;cursor:pointer;display:grid;place-items:center;min-width:44px;min-height:44px;border-radius:8px;color:var(--ink-3)}
.iconbtn:hover{background:var(--sunk);color:var(--ink)}
/* YES-133: vertical tab rail (180px column at >=761px, task-2.5 .dbody below); the horizontal
   underline-tab rules and the .stages/.stg three-step tracker are retired with the stage bar. */
.dtabs{display:flex;flex-direction:column;gap:2px;padding:10px 8px;border-right:1px solid var(--line-2);border-bottom:0}
.dtabs button{border:0;background:none;cursor:pointer;text-align:left;min-height:44px;padding:0 12px;border-radius:8px;font-size:15px;color:var(--ink-3);box-shadow:none}
.dtabs button[aria-selected="true"]{background:var(--sunk);color:var(--ink);box-shadow:inset 3px 0 0 var(--accent)}
.db{overflow:auto;padding:16px 20px;flex:1}
.db h3{margin:4px 0 8px;font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);font-weight:500}
.grid{border:1px solid var(--line);border-radius:8px;overflow:auto;margin-bottom:18px}
.grid table{font-size:14px}
.grid th{height:34px;font-size:12px;position:static}
.grid td{height:42px;cursor:default}
.grid tr:hover td{background:none}
.best{color:var(--s3);font-weight:600}
.best::after{content:" best";font:500 12px var(--sans);letter-spacing:.04em;text-transform:uppercase;margin-left:2px}
.miss{color:var(--ink-3);font-style:italic}
.memo{color:var(--ink-3)}
.next{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border-radius:8px;background:var(--s2-t);margin-bottom:16px;font-size:15px}
.next svg{color:var(--s2);margin-top:2px}
.kv{display:grid;grid-template-columns:150px 1fr;gap:8px 12px;font-size:15px;margin:0 0 16px}
.kv dt{color:var(--ink-3)} .kv dd{margin:0}

/* YES-133 (spec §4): Pricing-Ready table, old-board layout (index.html .grid-tbl) rebuilt on
   Workspace tokens rather than copied -- the classic rules use the old board's own variables. */
.ptitle{margin:18px 0 8px;font:600 15px/1.2 var(--cond)}
.ptbl-wrap{overflow-x:auto;max-width:100%;border:1px solid var(--line-2);border-radius:8px}
.ptbl{width:100%;border-collapse:collapse;font-size:14px}
.ptbl th{color:var(--ink-3);font-weight:500;text-align:left;padding:8px 10px;font-size:12px;border-bottom:1px solid var(--line-2);white-space:nowrap}
.ptbl td{padding:8px 10px;border-bottom:1px solid var(--line-2);vertical-align:top}
.ptbl .gcol-part{position:sticky;left:0;background:var(--surface);z-index:1;min-width:170px}
.ptbl td.gcell{min-width:120px}
.ptbl .part-code{font-weight:600}
/* Accessibility floor (dashboard_ws_shell_test.js): no visible text under 14px outside the
   uppercase/letter-spaced eyebrow-label allow-list, so this meta/secondary text (condition, lead
   time, "was $X", coverage totals, the partial tag) stays at the table's own 14px base -- only
   .ptbl th (a header row, same allowance as the classic .grid th) is small. */
.ptbl .part-meta,.ptbl .g-prev,.ptbl .g-round,.ptbl .g-stale{color:var(--ink-3)}
.ptbl .g-prev{display:block}
.ptbl .g-empty{color:var(--ink-3);font-style:italic}
.ptbl .g-price{font-variant-numeric:tabular-nums}
.ptbl .g-best{color:var(--s3);font-weight:700}
.ptbl .g-variant+.g-variant{margin-top:4px}
.ptbl .g-sub{margin-top:4px;padding-top:4px;border-top:1px dashed var(--line-2);color:var(--ink-3)}
.ptbl tfoot td{border-top:2px solid var(--line-2);border-bottom:0;color:var(--ink-3)}
.ptbl .g-partial{color:var(--warn);font-weight:500}
.ptbl .g-partial-tag{font-weight:400}
.ptbl .g-cov-full{color:var(--s3)}
.ptbl td.g-pm{min-width:140px}

/* YES-133 (spec §5): Items tab -- one read-only card per row.raw.items[] entry. */
.itemcard{border:1px solid var(--line-2);border-radius:8px;padding:12px 14px;margin:0 0 12px}
.itemcard h4{margin:0 0 8px;font:600 14px/1.2 var(--cond);color:var(--ink-3)}
.itemcard .inote{color:var(--ink-2);font-style:italic}

/* YES-133 (spec §6): Supplier Quotes tab -- one card per supplier. */
.supcard{border:1px solid var(--line-2);border-radius:8px;padding:12px 14px;margin:0 0 12px}
.supcard .sh{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.supcard h4{margin:12px 0 4px;font:600 14px/1.2 var(--cond);color:var(--ink-3)}
.qlist{margin:0;padding-left:18px}
.qlist li{margin:4px 0}
.qnote{color:var(--ink-3);white-space:pre-wrap;overflow-wrap:anywhere}

.df{display:flex;gap:8px;padding:12px 20px;border-top:1px solid var(--line-2);background:var(--sunk)}
.df .grow{flex:1}

/* ---------- home ---------- */
.home{padding:4px 28px 28px;display:grid;gap:20px}
.kgroups{display:grid;grid-template-columns:3fr 3fr;gap:16px}
.kg{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:14px 16px 16px}
.kg h3{margin:0 0 10px;font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);font-weight:500}
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tile{all:unset;cursor:pointer;border-radius:8px;padding:10px 12px;background:var(--sunk);display:grid;gap:2px}
.tile:hover{box-shadow:inset 0 0 0 1px var(--accent)}
.tile:focus-visible{outline:2px solid var(--accent)}
.tile .v{font:600 34px/1 var(--cond);font-variant-numeric:tabular-nums}
.tile .l{font-size:14px;color:var(--ink-2)}
.tile .u{font-size:14px;color:var(--ink-3)}
.tile.t1 .v{color:var(--s1)} .tile.t2 .v{color:var(--s2)} .tile.t3 .v{color:var(--s3)} .tile.tq .v{color:var(--stale)} .tile.tm .v{color:var(--msg)}
/* YES-133 (spec §1): the Home page's own "Where requests are" funnel panel is removed, so
   .homecols holds only "Needs you now" -- single column at every width. */
.homecols{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:10px;overflow:hidden}
.panel .ph{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line-2)}
.panel .ph h3{margin:0;font:600 17px var(--cond)}
.nlist{list-style:none;margin:0;padding:0}
.nlist li{display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid var(--line-2);font-size:15px}
.nlist li:last-child{border-bottom:0}
.nlist .w{margin-left:auto;color:var(--ink-3);font-size:14px;white-space:nowrap}
@media (max-width:1180px){.kgroups{grid-template-columns:1fr}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---------- task-7: sidebar collapse to a rail (>=1180px) ----------
   `html.rail` (app.js's state.rail, persisted sandy_ws_rail). Labels are hidden VISUALLY only
   (views.js's navHtml still renders them, and each link carries its own aria-label/title so the
   accessible name survives) -- the count badge becomes a small dot (its digits stay in the DOM,
   aria-hidden, since the link's own aria-label already states "<label> (<n>)"). */
.side>.searchall{width:calc(100% - 20px);margin:2px 10px 6px}
@media (min-width:1180px){
  html.rail .side{width:64px}
  html.rail .app{grid-template-columns:64px minmax(0,1fr)}
  html.rail .brand{justify-content:center;padding:16px 0}
  html.rail .brand>div:last-of-type{display:none}
  html.rail .side>.searchall{justify-content:center;width:44px;margin:2px auto 6px;padding:0}
  html.rail .side>.searchall .navlabel,html.rail .side>.searchall .kbd{display:none}
  html.rail #nav{padding:4px 6px 10px}
  html.rail .grp{display:none}
  html.rail .nav{justify-content:center;gap:0;padding:0;position:relative}
  html.rail .nav .navlabel{display:none}
  html.rail .nav .ct{position:absolute;top:4px;right:6px;min-width:0;width:8px;height:8px;padding:0;border-radius:50%;overflow:hidden;font-size:0;line-height:0;background:var(--side-line)}
  /* M1 (fix round 1): a hot (needs-attention) rail dot must not be distinguished from a plain one by
     colour alone -- it is also larger, repositioned to stay centred on the same badge slot, and
     carries a ring (a token-coloured box-shadow, matching the sidebar's own background so it reads
     as an outline rather than a second colour) so the shape itself differs, not only the fill. */
  html.rail .nav .ct.hot{background:#2447D6;width:10px;height:10px;top:3px;right:5px;box-shadow:0 0 0 2px var(--side)}
  html.rail .side .foot{padding:10px 4px 14px}
  html.rail .chans{display:none}
  html.rail .meta{justify-content:center}
  html.rail .meta span:first-child,html.rail .meta a#classic{display:none}
}

/* ---------- task-7: mobile (<760px) -- the sidebar becomes a top bar + a "Menu" sheet ---------- */
.menubtn{display:none;margin-left:auto}
@media (max-width:760px){
  /* final-review I1: .app used to leave .side/.main as two implicit auto rows under min-height:100vh
     -- on a short (2-row) page the leftover height stretched .side's top bar to ~176px. Pinning the
     top-bar row to auto and handing the rest to the page row fixes that without touching min-height. */
  .app{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .side{position:sticky;top:0;height:auto;z-index:20;padding:0}
  .side .brand{padding:10px 14px}
  .side>.searchall,#nav,.side .foot{display:none}
  .menubtn{display:inline-flex}
  /* the open sheet: full-screen, brand/search/nav/foot all shown, stacked */
  .side.navopen{position:fixed;inset:0;height:100vh;height:100dvh;z-index:45;overflow:auto;display:block}
  .side.navopen .brand{padding:18px 18px 14px}
  .side.navopen>.searchall{display:flex;width:calc(100% - 20px)}
  .side.navopen #nav{display:block;padding:4px 10px 10px}
  .side.navopen .grp{width:100%}
  .side.navopen .foot{display:grid}
  .tiles{grid-template-columns:1fr 1fr}
}

/* ---------- task-7: the search palette (Ctrl+K / "Search everything") ---------- */
#palette-host:empty{display:none}
.modal.palette{width:min(640px,100%);max-height:80vh;padding:0;gap:0;overflow:hidden;display:flex;flex-direction:column}
.modal.palette .search{width:100%;min-height:56px;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:0 16px;flex:0 0 auto}
.modal.palette .search input{font-size:17px}
/* F8: #palette-results (views.js's paletteHtml — the flex child wrapping .plist, or the "Nothing
   matches"/hint paragraph) carried no rule of its own, so inside .modal.palette's flex column
   (max-height:80vh, overflow:hidden above) it sized to its content instead of the remaining space —
   a long result list grew past 80vh and was CLIPPED (overflow:hidden on the ancestor), not
   scrollable. flex:1 + min-height:0 makes it take the remaining column height and scroll within
   itself; .plist's own overflow:auto is dropped (kept only padding) so it does not fight the new
   scroll owner with a second, redundant scroll context. */
#palette-results{flex:1;min-height:0;overflow:auto}
.plist{padding:8px}
.pgrp h4{margin:10px 8px 4px;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);font-weight:500}
.popt{display:flex;flex-direction:column;gap:1px;width:100%;min-height:44px;justify-content:center;padding:6px 10px;border-radius:8px;text-decoration:none;color:inherit;cursor:pointer}
.popt:hover,.popt.active{background:var(--sunk)}
.popt[aria-selected="true"]{background:var(--accent-tint)}
.pot{font-size:15px}
.pos{font-size:14px}

/* ---------- task-3-brief appended rules: banners, skeleton, placeholder, toast ---------- */
.muted{color:var(--ink-3)}
.data-banner,.degraded-banner{display:none}
.data-banner.on{display:flex;gap:12px;align-items:flex-start;margin:16px 28px 0;padding:14px 16px;border-radius:10px;background:var(--stale-t);color:var(--stale);border:1px solid var(--stale)}
.degraded-banner.on{display:flex;gap:10px;align-items:center;margin:16px 28px 0;padding:10px 14px;border-radius:10px;background:var(--warn-t);color:var(--warn);border:1px solid var(--warn)}
.data-banner .db-txt{display:grid;gap:4px;flex:1}
.data-banner .db-hd{font-weight:600}
.data-banner .db-sub,.data-banner .db-det{font-size:14px;color:var(--ink-2)}
.data-banner .db-retry{min-height:44px;padding:0 16px;border-radius:8px;border:1px solid var(--stale);background:var(--surface);color:var(--stale);font-size:16px;cursor:pointer}
.skel{display:block;height:12px;border-radius:6px;background:var(--line-2);animation:skel 1.4s ease-in-out infinite}
@keyframes skel{0%,100%{opacity:1}50%{opacity:.55}}
.skel-note{padding:14px 28px 0;color:var(--ink-2)}
.ph{margin:24px 28px;padding:28px;border:1px dashed var(--line);border-radius:10px;background:var(--surface);color:var(--ink-2)}
.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--ink);color:var(--paper);padding:10px 16px;border-radius:8px;font-size:15px;box-shadow:var(--shadow);z-index:50}
.toast[hidden]{display:none}

/* ---------- task-2-brief appended rules: confirm dialog, Ask Sandy dialog, undo toast ---------- */
.modal-back{position:fixed;inset:0;background:rgba(9,14,11,.45);display:grid;place-items:center;z-index:60;padding:16px}
.modal-back[hidden]{display:none}
.modal{background:var(--surface);color:var(--ink);border-radius:12px;box-shadow:var(--shadow);width:min(480px,100%);padding:22px;display:grid;gap:12px}
.modal h2{margin:0;font:600 22px/1.2 var(--cond)}
.modal label{font-size:14px;color:var(--ink-2)}
.modal input,.modal textarea{font:inherit;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:var(--surface);color:var(--ink)}
.m-sub{margin:0;color:var(--ink-2)}
.m-err{margin:0;color:var(--stale);font-size:14px;min-height:1em}
.m-acts{display:flex;gap:8px;justify-content:flex-end}
.btn.danger{background:var(--stale);border-color:var(--stale);color:var(--surface)}
#toast button{margin-left:10px;min-height:44px;background:none;border:1px solid currentColor;color:inherit;border-radius:6px;padding:0 12px;cursor:pointer}

/* Fix round 1, finding 2: outcome styling for toast(msg, kind). "ok" keeps the base --ink/--paper
   ground (unchanged contrast, already >=4.5:1 in both themes since --ink/--paper are near-opposite
   ends of the ramp in tokens.css). "bad" adds a --stale-tinted left bar as a SECOND signal alongside
   the message text itself (every "bad" toast call already spells out the problem in words), so
   colour is never the only thing distinguishing the two. */
.toast.ok{background:var(--ink);color:var(--paper)}
.toast.bad{background:var(--ink);color:var(--paper);border-left:4px solid var(--stale)}

/* ---------- YES-133 (spec §3): drawer host -- the RFQ card is a wide overlay window at every
   width >=761px, full-screen below. #drawer-host sits inside .main, a SIBLING of #page
   (index.html), and IS the backdrop: fixed, full-viewport, a translucent scrim, flexed to push
   its one child (.drawer) to the right edge. Empty (no drawer open) collapses to nothing via
   :empty. Replaces the old >=1180 two-column grid layout (.main:has(#drawer-host…) /
   .main.has-drawer, each a fixed-width side column) and the <1180 floating-panel rule -- one
   frame at every width now, not three different layouts. */
#drawer-host:empty{display:none}
#drawer-host:not(:empty){position:fixed;inset:0;z-index:40;background:rgba(15,23,42,.28);display:flex;justify-content:flex-end;padding:12px max(12px, env(safe-area-inset-right)) 12px 12px}
#drawer-host .drawer{width:min(1040px,calc(100vw - 48px));height:100%;max-height:none;margin:0;position:relative;display:flex;flex-direction:column;overflow:hidden}
/* the two-column body: a 180px vertical tab rail (.dtabs, base rules above) beside the scrolling
   content pane (.db). */
.dbody{display:grid;grid-template-columns:180px minmax(0,1fr);flex:1;min-height:0}
.dbody .db{overflow:auto;min-height:0}
.backbtn{display:none}

/* task-7 / YES-133: the drawer is full-screen at <760px, not a floating card. The phone "← Back"
   control (detail.js's drawerHtml header) replaces #closeDrawer there; the tab rail stacks above
   the content instead of sitting beside it. */
@media (max-width:760px){
  #drawer-host:not(:empty){padding:0;background:none}
  #drawer-host .drawer{width:100%;border-radius:0}
  .dbody{display:flex;flex-direction:column}
  .dtabs{border-right:0;border-bottom:1px solid var(--line-2);padding:6px 8px}
  .backbtn{display:inline-flex;align-items:center;gap:6px;padding:0 12px 0 6px;font-weight:600;color:var(--ink)}
  #closeDrawer{display:none}
  .dh{position:sticky;top:0;background:var(--surface);z-index:1}
}

/* ---------- YES-128 task 2: phone (<760px) -- each list row reflows into a card. Same table DOM; the
   per-column roles come from pages.js (col.card) and are stamped on each cell by views.js tableHtml. ---------- */
@media (max-width:760px){
  .content{padding:0 12px 24px}
  .tablewrap{background:none;border:0;border-radius:0;overflow:visible}
  .tablewrap table,.tablewrap tbody{display:block;width:100%}
  .tablewrap thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;clip-path:inset(50%)}
  /* final-review M4: the header row above stays in the a11y tree (a screen reader still needs it),
     but keyboard/VoiceOver focus landing on one of its sort buttons must reveal it -- otherwise a
     focused control sits invisibly clipped to 1x1px. */
  .tablewrap thead:focus-within{position:static;width:auto;height:auto;overflow:visible;clip:auto;clip-path:none;white-space:normal}
  .tablewrap tbody tr{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin-bottom:10px}
  .tablewrap tbody tr[aria-selected="true"]{box-shadow:inset 3px 0 0 var(--accent)}
  .tablewrap td{display:block;height:auto;padding:0;border:0;white-space:normal;text-align:left;background:none!important;box-shadow:none!important}
  .tablewrap td[data-card="title"]{order:1;flex:1 1 auto;min-width:0;font-size:16px}
  .tablewrap td[data-card="badge"]{order:2;flex:0 1 auto;display:flex;flex-wrap:wrap;gap:4px;justify-content:flex-end}
  .tablewrap td[data-card="main"]{order:3;flex:1 1 100%;font-size:17px;overflow-wrap:anywhere}
  .tablewrap td[data-card="meta"]{order:4;flex:0 1 auto;font-size:15px;color:var(--ink-2)}
  .tablewrap td[data-card="meta"]::before{content:attr(data-label);color:var(--ink-3);margin-right:6px}
  .tablewrap td[data-card="actions"]{order:5;flex:1 1 100%;display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
  .tablewrap td[data-card="actions"] .rowbtn{flex:1 1 auto;justify-content:center;min-height:44px}
  .tablewrap td[data-card="hide"]{display:none}
  .tablewrap .empty{background:var(--surface);border:1px solid var(--line);border-radius:12px}
}

/* ---------- YES-128 task 3: the Filters sheet. Above 760px .fsheet is display:contents, so the bar lays
   out exactly as before; the phone-only pieces stay hidden there. ---------- */
.fsheet{display:contents}
.fbtn,.fsh,.fsort,.fback{display:none}
@media (max-width:760px){
  .bar{flex-wrap:nowrap;padding:10px 12px 6px}
  .bar .search{flex:1;width:auto;min-width:0}
  .fbtn{display:inline-flex;flex:none}
  .fbtn .n{font:500 14px var(--mono);background:var(--accent);color:var(--accent-ink);border-radius:999px;padding:0 6px}
  .fsheet{display:none}
  .bar.fopen .fsheet{display:flex;flex-direction:column;align-items:stretch;gap:8px;position:fixed;left:0;right:0;bottom:0;z-index:55;max-height:80vh;max-height:80dvh;overflow:auto;background:var(--surface);border-radius:16px 16px 0 0;box-shadow:var(--shadow);padding:8px 16px calc(16px + env(safe-area-inset-bottom))}
  .fsh{display:flex;align-items:center;justify-content:space-between;position:sticky;top:-8px;background:var(--surface);padding:8px 0;z-index:1}
  .fsh b{font:600 20px var(--cond)}
  /* final-review T3: space-between spreads all 3 children (label, count badge, chevron/switch) apart
     evenly; the label should hug the leading edge and only the trailing control (chevron or switch)
     should be pushed to the far side -- the count badge then sits naturally next to the label. */
  .fsheet .facet>button,.fsheet .toggle,.fsheet #views-btn{width:100%;justify-content:flex-start}
  .fsheet .toggle .sw,.fsheet .facet>button svg{margin-left:auto}
  .fsheet .spacer{display:none}
  .fsheet .pop{position:static;min-width:0!important;box-shadow:none;margin-top:6px}
  .fsort{display:block}
  .fsort h4{margin:10px 8px 4px;font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);font-weight:500}
  .fsort .opt[aria-pressed="true"]{background:var(--accent-tint);font-weight:500}
  .fback{display:block;position:fixed;inset:0;background:rgba(9,14,11,.45);z-index:54}
  .chips{flex-wrap:nowrap;overflow-x:auto;padding:12px 12px 10px;margin-top:-12px}
  .chips .chip,.chips .clear{flex:none}
}

/* ---------- YES-128 task 4: the drawer on phones ---------- */
@media (max-width:760px){
  html.drawer-open body{overflow:hidden}
  .dh{padding:14px 16px 10px}
  .db{padding:14px 16px}
  .kv{grid-template-columns:1fr;gap:2px 0}
  .kv dd{margin:0 0 10px}
  .nextbtn{display:none}
  .df{flex-wrap:wrap;padding:10px 12px calc(10px + env(safe-area-inset-bottom))}
  .df .grow{display:none}
  .df .btn{flex:1 1 auto;justify-content:center}
}

/* ---------- YES-128 task 5: phone floors, iOS insets, quick fixes ---------- */
@media (max-width:1179px){.railtoggle{display:none}}
.toast{bottom:calc(20px + env(safe-area-inset-bottom))}
/* final-review I3.1: env() is 0 on every device except a notched/rounded-corner phone in landscape
   (viewport-fit=cover), so these are no-ops on desktop, on portrait phones and in emulation -- they
   only matter once the sidebar/main sit beside a landscape notch. */
.side{padding-left:env(safe-area-inset-left)}
.main{padding-right:env(safe-area-inset-right)}
@media (max-width:760px){
  /* final-review I3.2: was top-only; a landscape notched phone also needs the left/right insets
     the global rules above add, restated here so this narrower rule still wins at phone widths. */
  .side{padding:env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left)}
  .side.navopen{padding-bottom:env(safe-area-inset-bottom)}
  .menubtn{background:var(--side-2);color:var(--side-ink);border-color:var(--side-line)}
  .menubtn:hover{border-color:var(--side-ink-2)}
  .top{flex-wrap:wrap;gap:8px 12px;padding:14px 12px 4px}
  .top h1{font-size:24px}
  .top:has(+ .bar) .sub{display:none}
  .home{padding:4px 12px 24px}
  .data-banner.on,.degraded-banner.on{margin:12px 12px 0}
  .ph{margin:16px 12px;padding:20px}
  .skel-note{padding:12px 12px 0}
  .nlist li{flex-wrap:wrap}
  .nlist li .wrap{overflow-wrap:anywhere}
  .toggle .sw{flex:none}
  .rowbtn,.ask{min-height:44px}
  .search input,input,select,textarea{font-size:16px}
  .pop h4,.fsort h4,.grp,.grid th,.test,.db h3,.kg h3{font-size:14px}
  /* final-review M1 (spec §2): the result count must stay readable while the chip row scrolls
     sideways -- pin it to the trailing edge instead of letting it scroll off with the chips. */
  .chips .count{flex:none;position:sticky;right:0;background:var(--paper);padding-left:8px}
  /* final-review M2: the "Name this view" input's inline min-height:40px sits below the 44px tap
     floor; the inline style needs !important to be overridden from a stylesheet rule. */
  .fsheet #view-name{min-height:44px!important}
  /* final-review M6: with the sheet open, the page behind it can still scroll (no lock) and iOS lets
     an over-scroll at the top/bottom of the sheet or the drawer body "chain" into the page behind. */
  html:has(.bar.fopen) body{overflow:hidden}
  .fsheet,.db{overscroll-behavior:contain}
}

/* YES-133: the Needs-you message drawer carries a few lines only -- keep it a narrow window
   inside the wide overlay host (phones stay full-screen via the <=760px rule). */
@media (min-width:761px){#drawer-host .drawer[aria-label="Message details"]{width:min(560px,calc(100vw - 48px))}}

/* ---------- YES-135: Ask-again matrix (Supplier Quotes tab) + its confirm popup ----------
   All text >=14px (the accessibility floor); checkbox cells are >=40px tall (table-cell floor). */
.askm{margin:0 0 20px}
.am-banner{margin:0 0 12px;padding:10px 12px;border-radius:8px;background:var(--warn-t);color:var(--warn);border:1px solid var(--warn)}
.am-wrap{overflow-x:auto;max-width:100%;border:1px solid var(--line-2);border-radius:8px}
.amtbl{width:100%;border-collapse:collapse;font-size:14px}
.amtbl th,.amtbl td{padding:4px 10px;border-bottom:1px solid var(--line-2);vertical-align:top;text-align:left}
.amtbl th{position:static;height:auto;font-size:14px;font-weight:500;letter-spacing:0;text-transform:none;white-space:normal;color:var(--ink-2);background:transparent}
.am-acts .btn:disabled{opacity:.5;cursor:not-allowed}
.amtbl .am-row,.amtbl .am-corner{position:sticky;left:0;background:var(--surface);z-index:1;min-width:170px}
.am-sup{font-weight:600;color:var(--ink)}
.am-meta{color:var(--ink-3);font-weight:400}
.am-all,.am-cell label{display:flex;align-items:center;gap:8px;min-height:40px;cursor:pointer}
.amtbl input[type=checkbox]{width:20px;height:20px;min-height:0;flex:none;margin:0;accent-color:var(--accent)}
.amtbl input[type=checkbox]:disabled{cursor:default}
.am-quoted,.am-declined,.am-recent,.am-unknown{color:var(--ink-3)}
.am-quoted label,.am-declined label,.am-recent label,.am-unknown label{cursor:default}
.am-new{color:var(--s1)}
.am-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.am-legend{margin:8px 0 12px}
.am-acts{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.am-add{border:1px solid var(--line-2);border-radius:8px;padding:12px 14px;display:grid;gap:8px}
.am-add input{font:inherit;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:var(--surface);color:var(--ink)}
.am-addlist{list-style:none;margin:0;padding:0;display:grid;gap:6px;max-height:260px;overflow:auto}
.am-addlist .btn{width:100%;justify-content:space-between;white-space:normal;text-align:left;gap:12px}
.am-outcome{margin:0 0 12px;padding:10px 12px;border-radius:8px;border:1px solid var(--line);border-left:4px solid var(--s3)}
.am-outcome.bad{border-left-color:var(--stale)}
.am-outcome p{margin:0}
.am-outcome ul,.am-plines,.am-pitems{margin:6px 0 0;padding-left:18px}
.am-plines{list-style:none;padding:0;display:grid;gap:12px}
.am-pline{margin:0;font-weight:500}
.am-pl.refused .am-pline{color:var(--stale)}
.askm-modal{width:min(560px,100%);max-height:90vh;overflow:auto}
/* YES-135: Ask-again matrix flag ON => the old direct-send Ask-again controls are hidden (the matrix is the only way to re-ask) */
.askmatrix-on [data-act="ask-part"],.askmatrix-on [data-act="ask-missing"]{display:none !important}

/* ---------- t9-sidebar / t9-accounts (prototype, Guy 10-21) ---------- */
.brand-collapse{display:none}
html.t9-sidebar .brand .mark{display:none}
html.t9-sidebar .brand{padding:16px 10px 12px 18px}
html.t9-sidebar .brandname{flex:1;min-width:0}
html.t9-sidebar .brand-collapse{display:inline-grid;place-items:center;flex:none;width:44px;height:44px;border:0;background:none;color:var(--side-ink-2);border-radius:8px;cursor:pointer}
html.t9-sidebar .brand-collapse:hover{background:var(--side-2);color:var(--side-ink)}
html.t9-sidebar.rail .brand{justify-content:center;padding:12px 0}
@media (max-width:1179px){html.t9-sidebar .brand-collapse{display:none}}
.acct{display:grid;gap:6px}
.acct-h{font-size:12px;letter-spacing:.09em;text-transform:uppercase;color:var(--side-ink-2);padding:0 4px}
.acct-row{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
.acct-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:44px;padding:6px 0;border-radius:8px;border:1px solid transparent;background:none;color:var(--side-ink-2);font-size:13px;cursor:pointer;white-space:nowrap}
.acct-btn:hover{color:var(--side-ink);border-color:var(--side-line);background:var(--side-2)}
.acct-enoch{display:flex;align-items:center;gap:4px;font-size:13px;color:var(--side-ink-2);padding:0 4px}
.acct-enoch>span{flex:1}
.acct-mini{display:inline-grid;place-items:center;width:44px;height:44px;border-radius:8px;border:1px solid transparent;background:none;color:var(--side-ink-2);cursor:pointer}
.acct-mini:hover{color:var(--side-ink);border-color:var(--side-line);background:var(--side-2)}
html.t9-accounts .side .foot .chans{display:none}
html.rail .acct{display:none}
