/* Shell for the MKS console.

   Retuned 2026-10-22 from the Figma Make pass on the console brief. What that
   file actually proposed, once its tokens were read rather than its pictures
   looked at, was a warmer and flatter version of what we already had: the
   sidebar was already dark, the grid already 210/176/content, the body
   already 13px, the fonts already IBM Plex. So this is a token change, not a
   rewrite — which is the whole reason the tokens exist.
   
   Two things from that file were deliberately NOT taken:
     - it sets 8-9px type in 29 places. That is a mockup aesthetic; Thai
       script needs more height than Latin at the same size and the warehouse
       reads this on a laptop at arm's length.
     - it sets min-width:1180px, which would drop the phone layout the
       dispatch page depends on.
   
   Accent is terracotta, replacing packing-tape orange. It is darker than the
   orange was, so --sig-ink flips from near-black to white: the "go" button
   paints text on the accent and would otherwise lose contrast. */
:root{
  /* Warmer than the zinc greys this started with — paper, not screen. */
  --paper:#f5f4f2; --dots:transparent; --sheet:#ffffff; --ink:#1b1917; --ink2:#55514c; --mut:#78736c;
  --line:#e4e0da; --line2:#f1efeb;
  --sig:#a0522d; --sig-deep:#8a4424; --sig-ink:#fffaf7; --sel:#fbf2ec; --sel-line:#e8cdba;
  --hot:#b3261e; --hot-bg:#fcefed;
  --warm:#a46516; --warm-bg:#fbf4e4;
  /* Green stays, and only here. It is the word "confirmed", not the brand —
     a success state in any other hue has to be read instead of recognised. */
  --ok:#25714a; --ok-bg:#ebf4ef;
  --con:#1f1b18; --con-fg:#f6f3f0; --con-mut:#a9a099;
  /* Flatter. The design leans on borders and uses no shadow at all; the one
     place depth still earns its keep is the drawer sliding over the list. */
  --sh:0 1px 2px rgb(27 25 23 / .05);
  --sh-lg:0 16px 40px -14px rgb(27 25 23 / .22),0 4px 10px -4px rgb(27 25 23 / .10);
  --r:8px; --r-sm:5px;
  --disp:"Mitr","IBM Plex Sans Thai",sans-serif;
  color-scheme:light;
}
:root[data-theme=dark]{
  --paper:#13110f; --dots:transparent; --sheet:#1b1815; --ink:#f1efec; --ink2:#c0b9b1; --mut:#968d85;
  --line:#2e2a26; --line2:#231f1c;
  --sig:#cd8c6a; --sig-deep:#e0a483; --sig-ink:#241106; --sel:#2b1d14; --sel-line:#5e3d2a;
  --hot:#eb8983; --hot-bg:#3a2321;
  --warm:#e2ad61; --warm-bg:#39301f;
  --ok:#7bc99c; --ok-bg:#1c3429;
  --con:#100e0c; --con-fg:#f1efec; --con-mut:#8d857d;
  --sh:0 1px 2px rgb(0 0 0 / .45);
  --sh-lg:0 16px 40px -12px rgb(0 0 0 / .7),0 4px 10px -4px rgb(0 0 0 / .5);
  color-scheme:dark;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;color:var(--ink);background:var(--paper);
  font:400 13px/1.5 "IBM Plex Sans Thai",system-ui,-apple-system,sans-serif;
  -webkit-font-smoothing:antialiased}
a{color:var(--sig-deep);text-decoration:none}
a:hover{text-decoration:underline}
.mono{font-family:"IBM Plex Mono",ui-monospace,Menlo,monospace;font-variant-numeric:tabular-nums}
.num{text-align:right;font-family:"IBM Plex Mono",ui-monospace,Menlo,monospace;
  font-variant-numeric:tabular-nums;white-space:nowrap}

/* ---------- shell ---------- */
.shell{display:grid;grid-template-columns:216px 1fr;min-height:100vh}
/* A list page gets a third column for its filters (see public/rail.js). */
.shell.railed{grid-template-columns:216px 212px 1fr}
.side{background:var(--con);color:var(--con-fg);display:flex;flex-direction:column;
  position:sticky;top:0;height:100vh}
/* align-items:baseline does not centre the group — it pins it to the top of the
   container, which left the wordmark jammed against the window edge. Centre the
   block, and let an inner flex do the baseline work between the two words.
   The height matches .bar so the two rules under them line up across the seam. */
.brand{display:flex;align-items:center;gap:.6rem;padding:0 1rem;height:66px;flex:none;
  color:var(--con-fg);text-decoration:none;border-bottom:1px solid rgb(255 255 255 / .07)}
.brand:hover{text-decoration:none}
.brand .mark{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;flex:none;
  background:var(--sig);color:var(--sig-ink);font:700 15px/1 var(--disp)}
.brand .w{display:block;min-width:0}
.brand strong{display:block;font:600 14px/1 var(--disp)}
.brand small{display:block;margin-top:4px;color:var(--con-mut);
  font:400 8.5px/1 "IBM Plex Mono",monospace;letter-spacing:.11em;text-transform:uppercase}
.nav{padding:.7rem .6rem;overflow-y:auto;flex:1;display:flex;flex-direction:column}
/* System work sinks to the foot of the menu: it is how the thing runs, not
   what the day's work is. margin-top:auto needs .nav to be a flex column,
   and needs each group wrapped — which is why nav.js emits .grp. */
.grp.tail{margin-top:auto}
.nav h4{margin:1rem .5rem .35rem;font:500 10px/1 var(--disp);letter-spacing:.11em;
  text-transform:uppercase;color:var(--con-mut)}
.nav a{display:flex;align-items:center;gap:.6rem;padding:.5rem .55rem;border-radius:var(--r-sm);
  color:var(--con-mut);font-size:13.5px;text-decoration:none;transition:background .12s,color .12s}
.nav a:hover{background:rgb(255 255 255 / .07);color:var(--con-fg);text-decoration:none}
.nav a.on{background:var(--sig);color:var(--sig-ink);font-weight:500}
.nav svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round}
.sidefoot{border-top:1px solid rgb(255 255 255 / .08);padding:.7rem .9rem;
  font-size:11.5px;color:var(--con-mut);display:flex;align-items:center;gap:.5rem}

.main{min-width:0;display:flex;flex-direction:column;overflow-x:hidden}
/* The page title used to be 17.6px sitting in a 60px toolbar beside its own
   subtitle — three pixels larger than body text, which is no hierarchy at all.
   Two lines, and a size that reads as a heading, so every page opens the same
   way and you can tell at a glance where you are. */
.bar{min-height:72px;display:flex;align-items:center;gap:1rem;padding:.75rem 24px;flex-wrap:wrap;
  background:color-mix(in srgb,var(--paper) 86%,transparent);backdrop-filter:blur(10px);
  position:sticky;top:0;z-index:20;border-bottom:1.5px solid var(--line)}
.bar .field,.bar .btn{min-height:38px;padding-block:.3rem;font-size:13.5px}
.bar .head{display:flex;flex-direction:column;gap:.1rem;min-width:0}
.bar h1{font:600 1.3rem/1.2 var(--disp);margin:0;letter-spacing:-.02em}
.bar .sub{color:var(--mut);font-size:12.5px;line-height:1.45}
.bar .acts{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap;margin-left:auto}
.grow{flex:1}
.body{padding:.9rem 20px 4rem;max-width:78rem;width:100%}

/* ---------- bits ---------- */
.dot{width:8px;height:8px;border-radius:50%;background:var(--ok);flex:none}
.tag{display:inline-block;font:500 11px/1.5 "IBM Plex Sans Thai",sans-serif;
  padding:.05rem .4rem;border:1px solid var(--line);border-radius:4px;color:var(--ink2);background:var(--sheet)}
.tag.ok{color:var(--ok);border-color:color-mix(in srgb,var(--ok) 42%,transparent);background:var(--ok-bg)}
.tag.warn{color:var(--warm);border-color:color-mix(in srgb,var(--warm) 42%,transparent);background:var(--warm-bg)}
.tag.bad{color:var(--hot);border-color:color-mix(in srgb,var(--hot) 42%,transparent);background:var(--hot-bg)}
.tag.acc{color:var(--sig-deep);border-color:var(--sel-line);background:var(--sel)}

input,button,select,textarea{font:inherit;color:inherit}
.field{background:var(--sheet);border:1px solid var(--line);border-radius:var(--r-sm);
  padding:.45rem .7rem;min-height:40px;transition:border-color .15s,box-shadow .15s}
.field:hover{border-color:color-mix(in srgb,var(--mut) 55%,var(--line))}
.field:focus{outline:none;border-color:var(--sig);box-shadow:0 0 0 4px color-mix(in srgb,var(--sig) 18%,transparent)}
.field::placeholder{color:var(--mut)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;border-radius:var(--r-sm);
  background:var(--sheet);border:1px solid var(--line);padding:.45rem .9rem;min-height:40px;
  cursor:pointer;font:500 13px var(--disp);white-space:nowrap;
  transition:transform .15s,box-shadow .15s,background .15s,border-color .15s}
.btn:hover:not(:disabled){background:var(--line2);
  border-color:color-mix(in srgb,var(--mut) 40%,var(--line))}
.btn:active:not(:disabled){transform:none;box-shadow:none}
.btn:focus-visible{outline:3px solid color-mix(in srgb,var(--sig) 55%,transparent);outline-offset:2px}
.btn:disabled{opacity:.42;cursor:not-allowed}
.btn.go{background:var(--sig);color:var(--sig-ink);border-color:transparent;font-size:16px;min-height:52px;
  padding-inline:1.5rem;border-radius:999px;box-shadow:0 8px 20px -8px color-mix(in srgb,var(--sig) 80%,transparent)}
.btn.flat{border-color:transparent;background:transparent}
.btn.flat:hover:not(:disabled){box-shadow:none;transform:none;background:var(--line2);border-color:transparent}
/* The gate markup has always said class="btn primary" and nothing ever
   defined .primary, so the one button on the first screen anyone sees
   rendered as a plain grey button. Smaller than .go, which is reserved for
   the irreversible press on /ship. */
.btn.primary{background:var(--sig);color:var(--sig-ink);border-color:transparent;font-weight:500}
.btn.primary:hover:not(:disabled){background:var(--sig-deep);border-color:transparent}
.btn.sm{min-height:36px;padding:.32rem .75rem;font-size:13px}
.btn.icon{width:40px;min-height:40px;padding:0;border-radius:50%}
.btn.icon svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round}

/* ---------- cards & panels ---------- */
/* Measured against the reference design on a 1400x900 screen: the table
   started at 440px here against 278px there, and rows were 55px against 44px.
   Same screen, 8 rows against 14. The numbers were set at 2.15rem as if this
   were a dashboard somebody reads from across the room; it is a worklist read
   at arm's length, and every pixel above the table is a row not shown.
   This is the same mistake the rail comment on /bills describes, made again
   with cards instead of chips. */
.cards{display:grid;gap:.7rem;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));margin-bottom:.9rem}
.card{background:var(--sheet);border:1px solid var(--line);border-radius:var(--r);
  box-shadow:var(--sh);padding:.5rem .7rem .55rem}
.card .k{font:500 10px/1.2 var(--disp);letter-spacing:.09em;text-transform:uppercase;color:var(--mut)}
.card .v{font:500 1.35rem/1.1 "IBM Plex Mono",monospace;font-variant-numeric:tabular-nums;
  margin-top:.3rem;letter-spacing:-.02em}
.card .n{font-size:11px;color:var(--mut);margin-top:.3rem;
  padding-top:.28rem;border-top:1px solid var(--line2)}
/* A filled cream card was the one warm shape left on a cool page, and it
   shouted louder than the number it was about. The card stays white; the
   figure carries the colour, with a rule down the edge to catch the eye. */
.card.alert{border-color:var(--line);box-shadow:inset 3px 0 0 var(--warm),var(--sh)}
.card.alert .v{color:var(--warm)}
.card.alert .k{color:var(--warm)}
.card.alert .v{color:var(--warm)}

.panel{background:var(--sheet);border:1px solid var(--line);border-radius:var(--r);
  box-shadow:var(--sh);margin-bottom:1.1rem;overflow:auto hidden}
.phead{display:flex;align-items:center;gap:.6rem;padding:.75rem 1.1rem;flex-wrap:wrap;
  border-bottom:1px solid var(--line);font:600 13.5px/1.3 var(--disp);letter-spacing:-.005em}
.phead .note{font-family:"IBM Plex Sans Thai",sans-serif;font-weight:400}
.pbody{padding:1.1rem 1.25rem}
table{width:100%;border-collapse:collapse;font-size:13px}
thead th{padding:.45rem .75rem .4rem;text-align:left;font:500 10px/1.4 var(--disp);letter-spacing:.09em;
  text-transform:uppercase;color:var(--mut);border-bottom:1.5px solid var(--line2);background:var(--sheet);
  white-space:nowrap}
tbody td{padding:.3rem .7rem;line-height:1.35;border-bottom:1px solid var(--line2);vertical-align:middle;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
tbody td.wrap{white-space:normal}
tbody td.soft{max-width:18rem}
tbody td.name{max-width:26rem}
/* The SKU under the title is the second line that sets every row's height,
   so it gets the tightest leading on the page. */
tbody td.name small{line-height:1.25;margin-top:.05rem}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:color-mix(in srgb,var(--sel) 55%,transparent)}
/* One strong column per row: the identifier. Everything else steps back. */
td.id{font-family:"IBM Plex Mono",ui-monospace,Menlo,monospace;font-size:12.5px;
  font-variant-numeric:tabular-nums;letter-spacing:-.01em}
td.soft{color:var(--ink2)}
.empty{text-align:center;color:var(--mut);padding:3.5rem 1rem;font-size:13.5px}
.note{font-size:12px;color:var(--mut)}

/* A marker, not a pill: COD on every second row must not push the id to a new line. */
.mark{display:inline-block;width:1.35rem;text-align:center;font:500 9.5px/1.5 var(--disp);
  letter-spacing:.04em;border-radius:4px;vertical-align:1px;margin-left:.35rem}
.mark.cod{background:var(--warm-bg);color:var(--warm)}
.mark.bad{background:var(--hot-bg);color:var(--hot);width:auto;padding-inline:.3rem}

/* SLA reads as a temperature, not a number to compare by hand. */
.sla{display:inline-flex;align-items:center;gap:.4rem;justify-content:flex-end}
.sla i{width:5px;height:5px;border-radius:50%;background:var(--ok);flex:none}
.sla.warm i{background:var(--warm)} .sla.hot i{background:var(--hot)}
.sla.hot{color:var(--hot);font-weight:500}
.stack{display:flex;flex-direction:column;line-height:1.3}
.stack small{font-size:11px;color:var(--mut)}

/* Was .85rem/1.3rem. A band that reports a condition does not need the
   presence of a card — measured at 95px against the reference's 59px, and
   every one of those pixels is a table row. */
.strip{display:flex;gap:.7rem;padding:.55rem .8rem;border-radius:var(--r-sm);font-size:12.5px;
  border:1.5px solid;margin-bottom:.8rem;line-height:1.5;color:var(--ink2)}
.strip.warn{background:var(--warm-bg);border-color:color-mix(in srgb,var(--warm) 35%,transparent)}
.strip.info{background:var(--sel);border-color:var(--sel-line)}
.strip b{color:var(--ink)}

/* A standing condition is not news. Seven pages that each open with a filled
   warning band teach people to scroll past banners, and then the one that
   actually matters is scrolled past too. Same words, a tenth of the volume;
   .strip stays for things that changed. */
.note-bar{display:flex;gap:.55rem;align-items:flex-start;
  padding:.15rem 0 .15rem .9rem;margin:0 0 1.15rem;
  border-left:2.5px solid var(--line);color:var(--ink2);font-size:12.5px;line-height:1.65}
.note-bar b{color:var(--ink);font-weight:500}
.note-bar .btn{margin-left:.2rem}

/* ---------- gate ---------- */
.gate{max-width:22rem;margin:6rem auto;padding:1.6rem;background:var(--sheet);
  border:1.5px solid var(--line);border-radius:var(--r);box-shadow:var(--sh)}
.gate h2{font:600 1.15rem/1.3 var(--disp);margin:0 0 .25rem}
.gate p{color:var(--mut);font-size:13px;margin:0 0 1.2rem}
.gate .field,.gate .btn{width:100%}
.gate .field{margin-bottom:.6rem}
.gate .err{color:var(--hot);font-size:12.5px;margin-top:.7rem;min-height:1.2em}

.skel{display:inline-block;height:.95em;width:3.5rem;border-radius:6px;
  background:linear-gradient(90deg,var(--line2),var(--line),var(--line2));
  background-size:200% 100%;animation:sk 1.1s linear infinite;vertical-align:-1px}
@keyframes sk{to{background-position:-200% 0}}

@media (max-width:860px){
  .shell{grid-template-columns:1fr}
  .side{position:static;height:auto;flex-direction:row;align-items:center;overflow-x:auto}
  .brand{border-bottom:0;border-right:1px solid rgb(255 255 255 / .08);height:auto;
    min-height:52px;white-space:nowrap}
  .brand small{display:none}
  /* A fixed-width label beside a wrapping row only indents the FIRST line;
     every line that wraps starts at the left edge and the column reads ragged.
     On a narrow screen the label gets its own line instead. */
  .axis-k{width:100%;margin-bottom:.1rem}
  .shell.railed{grid-template-columns:1fr}
  .rail{position:static;height:auto;border-right:0;border-bottom:1px solid var(--line)}
  .railhead{display:none}
  .railbody{display:flex;gap:.75rem;overflow-x:auto;padding:.5rem 14px}
  .railgrp{margin:0;display:flex;align-items:center;gap:.25rem}
  .railgrp h4{margin:0 .15rem 0 0;white-space:nowrap}
  .railitem{width:auto;border:1px solid var(--line);white-space:nowrap}
  .nav{display:flex;flex-direction:row;gap:.25rem;padding:.4rem;flex:1}
  .grp{display:flex;gap:.25rem}
  .grp.tail{margin-top:0;margin-left:auto}
  .nav h4,.sidefoot{display:none}
  .nav a{white-space:nowrap;padding:.4rem .6rem}
  .body{padding-inline:14px}
  .bar{padding-inline:14px}
  .hide-sm{display:none}
  /* Order ID alone cannot tell a picker which parcel is which. Keep what
     identifies the order and what makes it urgent; drop the rest. */
  .keep-sm{display:table-cell!important}
  thead th,tbody td{padding-inline:.55rem}
  tbody td.soft,tbody td.name{max-width:7.5rem}
  td.id{font-size:11px;letter-spacing:-.03em}
  .mark{width:auto;padding-inline:.2rem;margin-left:.25rem}
  .cards{gap:.6rem;grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))}
  .card{padding:.75rem .85rem}
  .card .v{font-size:1.5rem}
}

/* Phones below ~480px cannot hold four columns without a sideways swipe. A
   picker needs which order, what product and how urgent — the baht amount is
   the one of the four they can do without, and COD already shows on the id. */
@media (max-width:480px){
  .drop-xs{display:none!important}
}

/* Checkboxes, identical to /ship — the browser default next to an orange
   custom one made the two halves of the app look unrelated. */
input[type=checkbox]{appearance:none;-webkit-appearance:none;width:22px;height:22px;margin:0;
  display:grid;place-items:center;border:1.5px solid color-mix(in srgb,var(--mut) 70%,transparent);
  border-radius:7px;background:var(--sheet);cursor:pointer;flex:none;
  transition:background .12s,border-color .12s}
input[type=checkbox]:hover{border-color:var(--sig)}
input[type=checkbox]:checked{background:var(--sig);border-color:var(--sig)}
input[type=checkbox]:checked::after{content:"";width:10px;height:5px;border:solid var(--sig-ink);
  border-width:0 0 2.5px 2.5px;border-radius:1px;transform:translateY(-1px) rotate(-45deg)}
input[type=checkbox]:focus-visible{outline:3px solid color-mix(in srgb,var(--sig) 55%,transparent);outline-offset:2px}

/* ---- filter chips, lifted from /ship ----
   A dropdown hides how much is behind each option. A chip row shows the
   choice and the size of it at the same time, which is the thing an operator
   actually wants to know before clicking. */
.chips{display:flex;gap:.35rem;flex-wrap:wrap;align-items:center}
.chip{display:inline-flex;align-items:center;gap:.4rem;border:1px solid var(--line);background:var(--sheet);
  padding:.2rem .7rem .2rem .6rem;min-height:34px;border-radius:var(--r-sm);cursor:pointer;
  font:400 12.5px var(--disp);color:inherit;transition:all .12s;white-space:nowrap}
.chip:hover{border-color:color-mix(in srgb,var(--mut) 50%,var(--line))}
.chip:focus-visible{outline:3px solid color-mix(in srgb,var(--sig) 55%,transparent);outline-offset:2px}
.chip em{font:500 11px "IBM Plex Mono",monospace;font-style:normal;color:var(--ink2);background:var(--line2);
  border-radius:4px;padding:0 .35rem;min-width:1.3rem;text-align:center}
.chip .sw{width:10px;height:10px;border-radius:50%;flex:none}
.chip.on{background:var(--ink);color:var(--sheet);border-color:var(--ink)}
.chip.on em{color:var(--ink);background:var(--sheet)}
.chip.hotc{color:var(--hot);border-color:color-mix(in srgb,var(--hot) 35%,transparent)}
.chip.hotc em{background:var(--hot-bg);color:var(--hot)}
.chip.hotc.on{background:var(--hot);color:#fff;border-color:var(--hot)}
.chip.hotc.on em{background:rgb(255 255 255 / .22);color:#fff}
.chip:disabled{opacity:.4;cursor:not-allowed}
.chipbar{margin-bottom:1.1rem}

/* Two filters stacked need to say which is which, or the second row reads as
   more of the first. */
.axis{margin-bottom:.55rem}
.axis-k{font:500 10px/1 var(--disp);letter-spacing:.11em;text-transform:uppercase;
  color:var(--mut);flex:none;width:3.6rem}
/* A rule between the two questions in one bar: where the bill is, and what we
   pressed. They filter different things and must not read as one list. */
.chipbar .sep{width:1.5px;height:22px;background:var(--line);margin-inline:.3rem;flex:none}
/* Marks a channel whose figures are invented (see functions/_lib/mock.js). */
.chip i.dim{font:500 10px/1.5 var(--disp);font-style:normal;letter-spacing:.04em;
  color:var(--ink2);background:var(--line2);border-radius:4px;padding:0 .3rem}
.chip.on i.dim{color:var(--ink);background:var(--sheet)}
.mark.dim{background:var(--line2);color:var(--ink2);width:auto;padding-inline:.3rem}

/* The master column, and the channel cells that disagree with it. Colour is
   not the only signal: a disagreeing figure also gets a box, so it survives
   a greyscale print and colour-blind readers. */
thead th.ours,tbody td.ours{background:var(--sel)}
tbody td.ours{font-weight:500}
.off{display:inline-block;color:var(--hot);background:var(--hot-bg);
  border:1.5px solid color-mix(in srgb,var(--hot) 42%,transparent);
  border-radius:6px;padding:0 .35rem;font-weight:500}

/* ---------- detail drawer ----------
   A list you cannot open is a dead end: /bills could show 371,000 rows and let
   you read none of them. The drawer keeps the list in place behind it, so
   working down a queue does not mean navigating away and back each time. */
dialog.bill{margin:0 0 0 auto;height:100dvh;max-height:100dvh;width:min(32rem,100vw);
  border:0;border-left:1px solid var(--line);border-radius:0;padding:0;
  background:var(--sheet);color:var(--ink);box-shadow:var(--sh-lg);
  display:flex;flex-direction:column}
dialog.bill:not([open]){display:none}
dialog.bill::backdrop{background:rgb(16 16 20 / .35)}
dialog.bill[open]{animation:bill-in .16s ease-out}
@keyframes bill-in{from{transform:translateX(24px);opacity:0}}
@media (prefers-reduced-motion:reduce){dialog.bill[open]{animation:none}}
.bill-head{display:flex;align-items:center;gap:.6rem;padding:.85rem 1.1rem;
  border-bottom:1px solid var(--line);flex-wrap:wrap}
.bill-head h2{margin:0;font:500 16px "IBM Plex Mono",monospace}
.bill-body{flex:1;overflow:auto;padding:1rem 1.1rem;display:flex;flex-direction:column;gap:1rem}
.bill-sec h3{margin:0 0 .45rem;font:500 9.5px/1.4 var(--disp);letter-spacing:.1em;
  text-transform:uppercase;color:var(--mut)}
.bill-sec dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:.35rem 1rem;
  font-size:12.5px;align-items:baseline}
.bill-sec dt{color:var(--mut)}
.bill-sec dd{margin:0;text-align:right;overflow-wrap:anywhere}
tbody tr.pick{cursor:pointer}
tbody tr.pick:hover{background:var(--line2)}
tbody tr.pick.on{background:var(--sel);box-shadow:inset 3px 0 0 var(--sig)}

/* A cell you can type in. It reads as text until focused, so a table of them
   does not look like a form — the row stays scannable and only the cell being
   worked on announces itself. */
.cell{width:100%;min-width:0;border:1px solid transparent;border-radius:var(--r-sm);
  background:none;padding:.2rem .4rem;font:inherit;color:inherit;transition:border-color .12s,background .12s}
.cell:hover{border-color:var(--line);background:var(--sheet)}
.cell:focus{outline:none;border-color:var(--sig);background:var(--sheet);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--sig) 16%,transparent)}
.cell.num{text-align:right;font-family:"IBM Plex Mono",monospace;font-variant-numeric:tabular-nums}
.cell.empty{background:var(--warm-bg);border-color:color-mix(in srgb,var(--warm) 30%,transparent)}
.cell.saving{border-color:var(--mut)}
.cell.saved{border-color:var(--ok);background:var(--ok-bg)}
.cell.failed{border-color:var(--hot);background:var(--hot-bg)}
td.err{font-size:11.5px;color:var(--hot);white-space:normal}

/* An action that belongs inside a sentence, not beside it. */
.linkbtn{border:0;background:none;padding:0;cursor:pointer;color:var(--sig-deep);
  font:inherit;text-decoration:underline;text-underline-offset:2px}
.linkbtn:hover:not(:disabled){color:var(--ink)}
.linkbtn:disabled{color:var(--mut);cursor:default;text-decoration:none}

/* ---------- filter rail ----------
   Standing the filters up in a column instead of wrapping them above the table
   means the table always starts at the same height, and the counts line up so
   they can be read down the column. */
.rail{background:var(--sheet);border-right:1px solid var(--line);
  position:sticky;top:0;height:100vh;display:flex;flex-direction:column;min-width:0}
.railhead{height:72px;flex:none;display:flex;align-items:center;gap:.5rem;
  padding:0 1rem;border-bottom:1px solid var(--line);
  font:600 13.5px var(--disp)}
.railclear{margin-left:auto;border:0;background:none;cursor:pointer;
  font:400 11.5px "IBM Plex Sans Thai",sans-serif;color:var(--sig-deep);padding:.25rem}
.railclear:hover{text-decoration:underline}
.railbody{flex:1;overflow-y:auto;padding:.6rem .5rem 1.5rem}
.railgrp{margin-bottom:.9rem}
.railgrp h4{margin:0 .5rem .25rem;font:500 9.5px/1.4 var(--disp);letter-spacing:.1em;
  text-transform:uppercase;color:var(--mut)}
.railitem{display:flex;align-items:center;gap:.5rem;width:100%;min-height:32px;
  padding:.35rem .5rem;border:0;border-radius:var(--r-sm);background:none;color:inherit;
  cursor:pointer;font:400 12.5px "IBM Plex Sans Thai",sans-serif;text-align:left}
.railitem:hover{background:var(--line2)}
.railitem:focus-visible{outline:3px solid color-mix(in srgb,var(--sig) 55%,transparent);outline-offset:-2px}
.railitem .l{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.railitem .c{flex:none;font:500 10.5px "IBM Plex Mono",monospace;color:var(--mut)}
.railitem .dim{font:500 9.5px var(--disp);font-style:normal;letter-spacing:.04em;
  color:var(--ink2);background:var(--line2);border-radius:3px;padding:0 .25rem;margin-left:.3rem}
/* One selected row per group means four solid bars down the rail at once,
   which reads as four alarms. A tint plus a weight change says "this one" just
   as clearly and lets the counts stay readable. */
.railitem.on{background:var(--sel);color:var(--ink);font-weight:500;
  box-shadow:inset 2px 0 0 var(--sig)}
.railitem.on .c{color:var(--sig-deep)}
.railitem.on:hover{background:var(--sel)}

/* ---------- worklist ----------
   An overview that lists what happened is a report; you read it and close it.
   What a shop actually opens this page for is what is waiting, so each row is
   a job: how many, why it is stuck, and the way to go and clear it. Rows only
   appear when they have something to say, so an empty list means a clear desk
   rather than four tables of zeroes. */
.jobs .job{display:flex;align-items:center;gap:1.1rem;padding:1rem 1.25rem;flex-wrap:wrap}
.jobs .job+.job{border-top:1px solid var(--line2)}
.jobs .n{font:500 1.6rem/1 "IBM Plex Mono",monospace;font-variant-numeric:tabular-nums;
  min-width:3.4rem;text-align:right;letter-spacing:-.02em;flex:none}
.jobs .what{flex:1 1 13rem;min-width:0}
.jobs .what b{display:block;font:500 14.5px/1.35 var(--disp);color:var(--ink)}
.jobs .what span{display:block;font-size:12.5px;color:var(--mut);margin-top:.1rem}
.jobs .job .btn{flex:none}
.jobs .job.hot .n{color:var(--hot)}
.jobs .job.warn .n{color:var(--warm)}
.jobs .clear{display:flex;align-items:center;gap:.7rem;padding:1.6rem 1.25rem;color:var(--ok);
  font:500 14.5px var(--disp)}
.jobs .clear svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;
  stroke-linecap:round;stroke-linejoin:round;flex:none}

/* Three numbers that are never acted on do not need three tables. */
.facts{display:flex;gap:.35rem 1.6rem;flex-wrap:wrap;padding:.9rem 1.25rem;
  font-size:13px;color:var(--ink2)}
.facts span{white-space:nowrap}
.facts b{color:var(--ink);font-family:"IBM Plex Mono",monospace;font-weight:500}

/* ---------- ⌘K ---------- */
#cmdk{border:0;padding:0;background:transparent;width:min(34rem,calc(100vw - 32px));
  margin-top:12vh;color:var(--ink)}
#cmdk::backdrop{background:rgb(16 16 20 / .45);backdrop-filter:blur(3px)}
#cmdk[open]{animation:cmdk-pop .14s ease-out}
@keyframes cmdk-pop{from{opacity:0;transform:translateY(-6px)}}
@media (prefers-reduced-motion:reduce){#cmdk[open]{animation:none}}
.cmdk-box{background:var(--sheet);border:1px solid var(--line);border-radius:var(--r);
  box-shadow:var(--sh-lg);overflow:hidden}
.cmdk-top{display:flex;align-items:center;gap:.6rem;padding:.7rem .9rem;
  border-bottom:1px solid var(--line)}
.cmdk-top svg{width:16px;height:16px;flex:none;fill:none;stroke:var(--mut);stroke-width:1.8;
  stroke-linecap:round}
.cmdk-top input{flex:1;min-width:0;border:0;background:none;outline:none;
  font:400 14px "IBM Plex Sans Thai",sans-serif;color:var(--ink)}
.cmdk-top input::placeholder{color:var(--mut)}
.cmdk-list{list-style:none;margin:0;padding:.3rem;max-height:17rem;overflow:auto}
.cmdk-list li{display:flex;align-items:center;gap:.6rem;padding:.5rem .6rem;border-radius:var(--r-sm);
  font-size:13px;cursor:pointer}
.cmdk-list li span{flex:1;min-width:0}
.cmdk-list li small{color:var(--mut);font-size:11px}
.cmdk-list li.on{background:var(--ink);color:var(--sheet)}
.cmdk-list li.on small{color:var(--sheet);opacity:.75}
.cmdk-none{color:var(--mut);justify-content:center;cursor:default}
.cmdk-foot{display:flex;gap:1rem;padding:.5rem .9rem;border-top:1px solid var(--line);
  font-size:11.5px;color:var(--mut)}
kbd{font:500 10.5px "IBM Plex Mono",monospace;border:1px solid var(--line);border-bottom-width:2px;
  border-radius:4px;padding:0 .3rem;color:var(--ink2);background:var(--line2)}

/* Visually hidden, still read aloud — for labels the layout has no room for. */
.vh{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip-path:inset(50%);white-space:nowrap;border:0}

/* ---------- a bill of ours, inside the drawer ----------
   Split into items / payment / shipping, because those are three different
   questions asked by three different people: what is in the box, has the
   money come, and where is it going. Stacked in one column they were one
   scroll of thirty rows and the packer read the bank details on the way past. */
.bill-tabs{display:flex;gap:.15rem;padding:0 1.1rem;border-bottom:1px solid var(--line);flex:none}
.bill-tabs button{border:0;background:none;cursor:pointer;color:var(--ink2);
  font:500 12.5px "IBM Plex Sans Thai",sans-serif;padding:.6rem .55rem;
  border-bottom:2px solid transparent;margin-bottom:-1px}
.bill-tabs button:hover{color:var(--ink)}
.bill-tabs button.on{color:var(--sig-deep);border-bottom-color:var(--sig)}
.bill-tabs button:focus-visible{outline:3px solid color-mix(in srgb,var(--sig) 55%,transparent);
  outline-offset:-3px;border-radius:var(--r-sm)}

/* One product line. The quantity and the money line up down the column so a
   bill with eight lines can be checked against a box without reading prose. */
.bl{display:flex;gap:.6rem;align-items:baseline;padding:.45rem 0;font-size:12.5px}
.bl + .bl{border-top:1px solid var(--line2)}
.bl .q{flex:none;min-width:2.2rem;font:500 12px "IBM Plex Mono",monospace;color:var(--ink2)}
.bl .n{flex:1;min-width:0}
.bl .n small{display:block;font:400 10.5px "IBM Plex Mono",monospace;color:var(--mut);margin-top:.1rem}
.bl .a{flex:none;font:500 12.5px "IBM Plex Mono",monospace;font-variant-numeric:tabular-nums}

/* The money block. Mirrors the receipt a customer is shown, down to the order
   of the lines, so the two can be read side by side without translating. */
.tot{display:flex;justify-content:space-between;gap:1rem;font-size:12.5px;
  color:var(--ink2);padding:.2rem 0}
.tot.big{align-items:baseline;margin-top:.4rem;padding-top:.5rem;
  border-top:1px solid var(--line);color:var(--ink)}
.tot.big span:first-child{font:600 13px var(--disp)}
.tot.big b{font:500 1.35rem/1 "IBM Plex Mono",monospace;font-variant-numeric:tabular-nums}
.tot input{width:6.5rem;text-align:right}

/* Who touched the bill. Dense on purpose: it is read when something is wrong,
   and then every row matters. */
.hist{list-style:none;margin:0;padding:0;font-size:12px}
.hist li{padding:.4rem 0;border-top:1px solid var(--line2);display:flex;gap:.5rem;align-items:baseline}
.hist li:first-child{border-top:0}
.hist .k{flex:none;min-width:3.2rem;color:var(--mut);font:400 10.5px var(--disp);
  text-transform:uppercase;letter-spacing:.06em}
.hist .d{flex:1;min-width:0;overflow-wrap:anywhere}
.hist .w{flex:none;font:400 10.5px "IBM Plex Mono",monospace;color:var(--mut)}
.strip.ok{background:var(--ok-bg);border-color:color-mix(in srgb,var(--ok) 35%,transparent)}
.btn.bad{color:var(--hot);border-color:color-mix(in srgb,var(--hot) 40%,transparent)}
.btn.bad:hover:not(:disabled){background:var(--hot-bg)}
.field.sm{min-height:34px;padding:.3rem .55rem;font-size:12.5px}
.fld2{display:flex;flex-direction:column;gap:.2rem;margin-bottom:.5rem}
.fld2 label{font-size:11px;color:var(--mut)}

/* ---------- ported from the Figma Make console pass ----------
   Structure, not just colour. The first attempt at "ยกมาทั้งชุด" only
   retuned tokens, which changed the hue and nothing else — the file was
   read for its variables and never looked at. These are the parts that
   actually made it look different. */

/* The sidebar brand is NOT ported. It already exists at the top of this
   file — a ::before mark plus "MKS commerce" — and the rules written here
   to "add" one overrode span.w and broke it. The design's version is the
   same idea with a letter in the tile instead of a block of colour. */

/* .rail-head, .rail-note and .search were written here from the reference
   design and then never wired into a page — dead rules shipped three
   deployments ago. .search was worse than dead: /ship already has its own
   .search (a position:relative box with an absolutely placed icon and kbd),
   and since app.css loads first, every property ship did NOT redeclare —
   display:flex, border, background, padding, min-height — leaked into it and
   put a second border around the field.

   Removed rather than fixed. If the rail ever gets a head and a footer, the
   CSS comes back with the markup that uses it, not before. */

/* A bar between the filters and the table: which view is open, how it is
   sorted, and the actions that belong to the table rather than the page. */
.tools{display:flex;align-items:flex-end;gap:1rem;margin:1.1rem 0 .55rem;flex-wrap:wrap}
.tools h2{margin:0;font:600 15px var(--disp)}
.tools .sub{display:block;margin-top:.15rem;color:var(--mut);font-size:11.5px}
.tools .acts{margin-left:auto;display:flex;gap:.4rem}

.tfoot{display:flex;align-items:center;gap:.8rem;padding:.65rem .9rem;
  border-top:1px solid var(--line);color:var(--mut);font-size:11.5px}
.tfoot .n{margin-left:auto;font-family:"IBM Plex Mono",monospace}

/* A channel figure that disagrees used to be a colour and nothing else, so
   the reader had to subtract in their head to learn by how much. */
.qty-d{font:400 10px "IBM Plex Mono",monospace;margin-left:.25rem;
  color:var(--hot);vertical-align:.08em}

/* What the adjustment will DO, before it is pressed. The drawer previously
   showed only the current balance, so "ตัดออก 75" from a stock of 70 looked
   fine right up until the server refused it. */
.bal{display:flex;align-items:center;gap:.9rem;margin:.9rem 0;padding:.7rem .85rem;
  border:1px solid var(--line);border-radius:var(--r-sm);background:var(--paper)}
.bal div{flex:1;min-width:0}
.bal span{display:block;font:400 10px var(--disp);letter-spacing:.07em;
  text-transform:uppercase;color:var(--mut)}
.bal strong{display:block;font:500 20px/1.2 "IBM Plex Mono",monospace;
  font-variant-numeric:tabular-nums;margin-top:.1rem}
.bal strong.bad{color:var(--hot)}
.bal > b{flex:none;font:500 15px "IBM Plex Mono",monospace;color:var(--mut)}
.refused{border:1.5px solid color-mix(in srgb,var(--hot) 40%,transparent);
  background:var(--hot-bg);border-radius:var(--r-sm);padding:.65rem .8rem;margin-bottom:.9rem}
.refused strong{display:block;color:var(--hot);font:500 13px var(--disp)}
.refused span{display:block;color:var(--ink2);font-size:12px;margin-top:.15rem}
.req{font-style:normal;font-size:10px;color:var(--sig-deep);margin-left:.25rem}

/* ---------- shell pieces ported from the reference console ----------
   These all ship WITH the markup that uses them. Four rules were added from
   that design before and wired into nothing; see the note further up. */

/* Where you are, above the page title. Built from NAV in nav.js, so it can
   never disagree with the menu about which group a page lives in. */
.crumb{margin:0 0 .15rem;font:400 11px var(--disp);color:var(--mut);letter-spacing:.01em}
.crumb span{opacity:.55;margin:0 .15rem}

/* Search with the icon and the shortcut inside the field. Named .findbox and
   not .search because /ship owns .search and app.css loads first. */
.findbox{display:inline-flex;align-items:center;gap:.4rem;width:var(--fw,16rem);max-width:100%;
  border:1px solid var(--line);border-radius:var(--r-sm);background:var(--sheet);
  padding:0 .5rem;min-height:38px}
.findbox:focus-within{border-color:var(--sig);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--sig) 16%,transparent)}
.findbox svg{width:14px;height:14px;flex:none;fill:none;stroke:var(--mut);stroke-width:1.9;
  stroke-linecap:round;stroke-linejoin:round}
.findbox input{flex:1;min-width:0;border:0;background:none;color:inherit;font:inherit;
  padding:.3rem 0;outline:none}
.findbox kbd{flex:none;opacity:.75}
@media (max-width:860px){
  .findbox{width:100%}

  /* The rail's phone rules live in the FIRST max-width:860 block near the top
     of this file — which comes BEFORE the .rail base rules, so the base won
     and the rail stayed a 100vh sticky column inside a 375px phone. Nobody
     would have found that by reading; it took measuring a mirror. Repeated
     here, after the base rules, where they actually apply. */
  .rail{position:static;height:auto;border-right:0;border-bottom:1px solid var(--line)}
  .railhead{display:none}
  .railbody{display:flex;gap:.75rem;overflow-x:auto;padding:.5rem 14px}
  .railgrp{margin:0;display:flex;align-items:center;gap:.25rem}
  .railgrp h4{margin:0 .15rem 0 0;white-space:nowrap}
  .railnote{margin:0 14px .6rem;position:static}
}

/* The rail says what it filters and how many, and what the list is scoped to.
   On /stock the warehouse question could not be answered from the page: the
   figures were a total and nothing said so. */
.railhead .railn{margin-left:auto;font:400 10.5px "IBM Plex Mono",monospace;
  font-style:normal;color:var(--mut)}
.railhead .railclear{margin-left:.5rem}
.railnote{margin:.7rem .55rem 0;padding:.5rem .6rem;border:1px solid var(--line);
  border-radius:var(--r-sm);background:var(--paper);line-height:1.45}
.railnote span{display:block;font:500 9.5px var(--disp);letter-spacing:.08em;
  text-transform:uppercase;color:var(--mut)}
.railnote strong{display:block;font:500 12.5px var(--disp);margin-top:.1rem}
.railnote small{display:block;color:var(--mut);font-size:11px;margin-top:.05rem}

/* Paging, so a 499-row table stops laying out 499 rows on every keystroke. */
.tfoot .pager{margin-left:auto;display:flex;align-items:center;gap:.5rem}
.tfoot .pager b{font-size:11.5px;color:var(--ink2)}

/* The movement history, inside the adjust drawer. */
.hist2{width:100%;border-collapse:collapse;font-size:11.5px;margin-top:.3rem}
.hist2 th{text-align:left;font:500 9.5px var(--disp);letter-spacing:.07em;text-transform:uppercase;
  color:var(--mut);padding:.25rem .4rem;border-bottom:1px solid var(--line)}
.hist2 td{padding:.3rem .4rem;border-bottom:1px solid var(--line2);vertical-align:top}
.hist2 .p{color:var(--ok);font-weight:500}
.hist2 .m{color:var(--hot);font-weight:500}

/* ═══════════════════════════════════════════════════════════════════════
   REFERENCE DESIGN LAYER

   Every rule below is ~/Downloads/Thai E-commerce Ops Console/src/index.css,
   value for value, mapped from its class names onto ours. Nothing in the
   markup changes, so nothing that works stops working.

   The ONLY deliberate difference is colour: --brand green #23583e becomes
   terracotta, as asked.

   It is a layer at the end rather than surgery through the file above,
   because the two can then be told apart — and because deleting this block
   restores the previous console exactly.

   Their type scale is 8–12px. I argued against it (Thai script needs more
   height than Latin at the same size, and this is read on a laptop at arm's
   length); the call was "เอาเหมือนเด๊ะ" and this is that.
   ═══════════════════════════════════════════════════════════════════════ */

/* their --surface-2 / --surface-3 / --line-strong, which we had no names for */
:root{ --surf2:#f8f9f7; --surf3:#eef0ed; --line3:#cbd0c9; --faint:#8b9189; }
:root[data-theme=dark]{ --surf2:#1d241f; --surf3:#283029; --line3:#424c44; --faint:#7f8981; }

/* Their stylesheet sets body{min-width:1180px} — this design is desktop
   only, and says so. Below 861px the console's own responsive layout
   stands untouched: an earlier pass left these rules unscoped and the
   shell stayed 1146px wide inside a 375px phone, because they come after
   the media query they were silently overriding. */
@media (min-width:861px){
  /* +2px on every size in the reference scale. Thai needs the height. */
  body{font-size:14px}

  /* ---- shell ---- */
  .shell{grid-template-columns:210px minmax(760px,1fr)}
  .shell.railed{grid-template-columns:210px 176px minmax(760px,1fr)}
  .side{padding:18px 12px 14px}
  .brand{height:auto;padding:0 8px 22px;border-bottom:0;gap:10px}
  .brand .mark{width:33px;height:33px;border-radius:8px;font:700 18px/1 var(--disp)}
  .brand strong{font-size:15px;line-height:1}
  .brand small{margin-top:5px;color:#7f8d83;font:400 11px/1 "IBM Plex Mono",monospace;letter-spacing:.1em}
  .nav{gap:2px}
  .grp h4,.nav h4{padding:0 9px 6px;color:#738078;font:600 12px var(--disp);letter-spacing:0;text-transform:none}
  .grp.tail{margin-top:auto}
  .nav a{min-height:40px;padding:0 9px;gap:10px;border-radius:6px;color:#abb6ae;font-size:13.5px;font-weight:400}
  .nav a:hover{color:#fff;background:rgb(255 255 255 / .05)}
  .nav a.on{color:#fff;background:color-mix(in srgb,var(--sig) 18%,transparent);
    box-shadow:inset 2px 0 var(--sig);font-weight:400}
  .nav a svg{width:17px;height:17px}
  .sidefoot{font-size:11px}

  /* ---- filter rail ---- */
  .rail{padding:19px 10px;border-right:1px solid var(--line);background:var(--surf2);position:relative}
  .railhead{height:auto;padding:0 7px 13px;border-bottom:1px solid var(--line);
    display:block;background:none}
  .railhead span{display:block;font:600 13.5px var(--disp);color:var(--ink)}
  .railhead .railn{display:block;margin:0;color:var(--faint);font:400 11px "IBM Plex Mono",monospace}
  .railbody{padding:10px 0}
  .railgrp h4{padding:0 8px 4px;color:var(--faint);font:600 11px var(--disp);letter-spacing:.04em}
  .railitem{height:36px;min-height:36px;padding:0 8px;border-radius:5px;color:var(--ink2);font-size:13px}
  .railitem:hover{background:var(--surf3)}
  .railitem.on{color:var(--sig);background:var(--sel);font-weight:600;box-shadow:none}
  .railitem .c{color:var(--faint);font:500 11px "IBM Plex Mono",monospace}
  .railitem.on .c{color:var(--sig)}
  .railnote{position:absolute;right:10px;bottom:19px;left:10px;margin:0;padding:11px 8px;
    border:0;border-top:1px solid var(--line);border-radius:0;background:none}
  .railnote span{color:var(--faint);font:400 11px var(--disp);letter-spacing:0;text-transform:none}
  .railnote strong{margin-top:3px;font:400 13px var(--disp)}
  .railnote small{color:var(--faint);font-size:11px}

  /* ---- top bar ---- */
  .bar{position:sticky;top:0;z-index:4;min-height:87px;padding:14px 20px;gap:18px;
    border-bottom:1px solid var(--line);
    background:color-mix(in srgb,var(--sheet) 94%,transparent);backdrop-filter:blur(10px)}
  .crumb{margin:0;color:var(--faint);font:600 11px var(--disp)}
  .bar h1{margin:1px 0;font-size:22px;line-height:1.2;letter-spacing:-.02em}
  .bar .sub{color:var(--ink2);font-size:12px}
  .bar .sub b,.bar .sub .mono{color:var(--ink);font-weight:500}
  .acts{gap:7px}
  .findbox{width:250px;height:36px;min-height:36px;gap:7px;padding:0 7px 0 9px;
    border:1px solid var(--line3);border-radius:6px;background:var(--sheet);box-shadow:none}
  .findbox input{font-size:12px}
  kbd{padding:2px 4px;border-radius:3px;background:var(--surf3);color:var(--faint);font-size:10px}
  .btn.icon{width:36px;min-height:36px;height:36px;border:1px solid var(--line3);
    border-radius:6px;background:var(--sheet);color:var(--ink2)}
  .btn.primary{min-height:36px;padding:0 11px;gap:6px;border-radius:6px;
    background:var(--sig);color:#fff;font:600 13px var(--disp);border-color:transparent}
  :root[data-theme=dark] .btn.primary{color:#241106}
  .btn.sm{min-height:28px;padding:0 8px;border:1px solid var(--line3);border-radius:4px;
    background:var(--sheet);color:var(--ink2);font-size:11px}

  /* ---- content ---- */
  .body{padding:14px 18px 24px;max-width:none}

  .strip{min-height:52px;margin-bottom:11px;padding:7px 9px 7px 11px;align-items:center;
    justify-content:space-between;border-radius:0;border-width:1px;gap:9px}
  .strip.warn{border-color:color-mix(in srgb,var(--warm) 35%,var(--line));
    border-left:3px solid var(--warm);background:var(--warm-bg)}
  .strip b{color:var(--warm);font-size:13px}
  .strip div{color:var(--ink2);font-size:11px;line-height:1.5}

  /* No margin under the cards: in the reference the 48px .table-tools bar IS
     the gap. An 11px margin here put us 11px below them for no reason. */
  .cards{display:grid;grid-template-columns:1fr 1fr 1fr 2.15fr;gap:0;margin-bottom:0;
    border:1px solid var(--line);background:var(--sheet)}
  .card{min-height:72px;padding:10px 13px;border:0;border-right:1px solid var(--line);
    border-radius:0;box-shadow:none;position:relative}
  .card:last-child{border-right:0}
  .card .k{color:var(--ink2);font:400 12px var(--disp);letter-spacing:0;text-transform:none}
  .card .v{margin-top:1px;font:500 22px/1.2 "IBM Plex Mono",monospace;letter-spacing:-.04em}
  .card .v small{font-size:13px;font-weight:500}
  .card .note{position:absolute;right:11px;bottom:10px;margin:0;padding:0 0 0 7px;border:0;
    border-left:2px solid var(--warm);color:var(--warm);font-size:11px}

  .tools{height:52px;align-items:flex-end;justify-content:space-between;padding-bottom:7px;margin:0}
  .tools h2{font-size:13.5px;line-height:1.1}
  .tools .sub{color:var(--faint);font-size:11px}
  .tools .acts{gap:5px}

  /* ---- tables ---- */
  .panel{border:1px solid var(--line3);border-radius:0;box-shadow:none;overflow-x:auto}
  .panel table{min-width:1010px}
  thead th{height:34px;padding:0 8px;border-right:1px solid var(--line);
    border-bottom:1px solid var(--line3);background:var(--surf2);color:var(--ink2);
    font:600 11px var(--disp);letter-spacing:0;text-transform:none}
  thead th:last-child,tbody td:last-child{border-right:0}
  thead th.ours{color:var(--sig);background:var(--sel)}
  tbody td{height:48px;padding:4px 8px;border-right:1px solid var(--line);
    border-bottom:1px solid var(--line);white-space:nowrap;font-size:12px;line-height:1.3}
  tbody tr:last-child td{border-bottom:0}
  tbody tr:hover td{background:color-mix(in srgb,var(--sel) 32%,var(--sheet))}
  tbody td.num{font-size:11px}
  tbody td.name{overflow:hidden;font-size:12px;font-weight:500}
  tbody td.name small{margin-top:1px;color:var(--faint);font-size:10px}
  tbody td.ours{background:color-mix(in srgb,var(--sel) 43%,var(--sheet));
    color:var(--sig);font-weight:600}
  tbody td.soft,tbody td.note{color:var(--ink2);font-size:11px}
  .tag{padding:1px 3px;border-radius:3px;font:500 10px/1.4 var(--disp)}
  .tag.bad{color:var(--hot);background:var(--hot-bg)}
  .off{color:var(--hot);font-weight:600}
  .qty-d{margin-left:2px;padding:0 2px;border-radius:2px;background:var(--hot-bg);font-size:9px}
  .tfoot{height:40px;padding:0 8px;border-top:1px solid var(--line3);
    color:var(--faint);font-size:11px}
  .tfoot .pager b{min-width:22px;text-align:center;font:500 11px "IBM Plex Mono",monospace;color:var(--ink)}
  .tfoot .pager .btn{min-height:23px;padding:0 6px;border:1px solid var(--line);border-radius:3px;font-size:11px}

  /* ---- the adjust drawer ---- */
  dialog.bill{width:445px;border-left:1px solid var(--line3);box-shadow:-14px 0 45px rgb(0 0 0 / .13)}
  dialog.bill::backdrop{background:rgb(10 15 11 / .42)}
  .bill-head{min-height:auto;padding:15px 16px;border-bottom:1px solid var(--line)}
  .bill-head h2{font-size:15px;font-family:var(--disp)}
  .bill-body{padding:13px 16px 15px;gap:0}
  .bill-sec h3{font:600 13px var(--disp);letter-spacing:0;text-transform:none;margin-bottom:7px}
  .fld2{margin-bottom:11px}
  .fld2 label{margin-bottom:4px;font:600 12px var(--disp);color:var(--ink)}
  .fld2 .field,.field.sm{height:36px;min-height:36px;padding:0 8px;border:1px solid var(--line3);
    border-radius:5px;background:var(--surf2);font-size:13px}
  .fld2 textarea.field{height:auto;padding:7px 8px}
  .req{color:var(--hot);font-size:10px}
  .bal{height:60px;margin:2px 0 10px;padding:6px 11px;display:grid;
    grid-template-columns:1fr 22px 1fr;align-items:center;border:1px solid var(--line);
    border-radius:0;background:var(--surf2);text-align:center;gap:0}
  .bal span{color:var(--faint);font:400 10px var(--disp);letter-spacing:0;text-transform:none}
  .bal strong{margin-top:0;font:600 17px "IBM Plex Mono",monospace}
  .bal > b{color:var(--faint);font-weight:400}
  .refused{margin:-2px 0 10px;padding:7px 9px;border:0;border-left:3px solid var(--hot);
    border-radius:0;background:var(--hot-bg)}
  .refused strong{color:var(--hot);font:400 12px var(--disp)}
  .refused span{color:var(--ink2);font-size:10px}
  .hist2 th{height:29px;padding:0 5px;font-size:10px}
  .hist2 td{height:34px;padding:0 5px;font-size:10px}
  .hist2 .p{color:var(--ok)} .hist2 .m{color:var(--hot)}

  /* their 1300px collapse: the sidebar becomes icons only */
  @media (max-width:1300px) and (min-width:861px){
    .shell{grid-template-columns:64px minmax(760px,1fr)}
    .shell.railed{grid-template-columns:64px 166px minmax(760px,1fr)}
    .side{padding-right:8px;padding-left:8px}
    .brand{padding-left:7px}
    .brand .w,.grp h4,.nav h4,.nav a span{display:none}
    .nav a{justify-content:center;padding:0}
    .findbox{width:205px}
  }
}
