/* Platform shell. Brand palette lifted from gfgb-streamlit's theme so the two
   apps read as one company: green #1E9E48, sage canvas #E9EFE7, dark ink.
   Phone-first: the warehouse crew lives on phones; desktop just gets wider. */

@font-face {
    font-family: "Hanken Grotesk";
    /* Relative so ManifestStaticFilesStorage can rewrite it to the hashed name. */
    src: url("../HankenGrotesk.c501f578bf3f.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --green: #1E9E48;
    --green-dark: #157A36;
    --canvas: #E9EFE7;
    --ink: #16281D;
    --card: #FFFFFF;
    --muted: #5C6F62;
    --red: #C0392B;
    --amber: #B7791F;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* --- header ------------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--card);
    border-bottom: 1px solid #D7E0D4;
    position: sticky;
    top: 0;
}
.topbar img { height: 30px; display: block; }
.topbar .title { font-weight: 700; font-size: 1.05rem; flex: 1; }
.topbar .who { color: var(--muted); font-size: .85rem; }
.topbar a.signout {
    color: var(--green-dark);
    font-size: .85rem;
    text-decoration: none;
    font-weight: 600;
}

main { padding: 1rem; max-width: 1100px; margin: 0 auto; }
/* Data-table pages opt out of the reading-width cap: a wide table should use
   the monitor it is on rather than sit in a 1100px column with a scrollbar. */
main.wide { max-width: none; }

/* --- home tiles --------------------------------------------------------- */
/* Grouped into cards so the crew scans three short lists instead of one
   long one. The heading costs about 40px of scroll per group on a phone,
   which is the whole price of the change -- the tile grid inside is
   unchanged, so a group of five still fills the same rows it always did. */
.tilegroup {
    /* Recessed, not raised: the card is the shelf and the tiles are the
       things on it, so the group reads as a container rather than competing
       with the buttons inside it. */
    background: #F2F6F0;
    border: 1px solid #DCE5D9;
    border-radius: var(--radius);
    padding: .85rem .85rem 1rem;
    margin-bottom: 1rem;
}
.tilegroup:last-child { margin-bottom: 0; }

.tilegroup-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 .7rem;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--green-dark);
}
.tilegroup-hint {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}

.tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .8rem;
}
@media (min-width: 700px)  { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid #D7E0D4;
    padding: 1.4rem .5rem;
    min-height: 108px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(22, 40, 29, .06);
}
.tile .icon { font-size: 1.9rem; line-height: 1; }
.tile:active { transform: scale(.98); }
.tile.soon { opacity: .45; pointer-events: none; }
.tile.soon::after { content: "coming soon"; font-size: .68rem; font-weight: 600; color: var(--muted); }

/* --- login -------------------------------------------------------------- */
.login-wrap {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid #D7E0D4;
    padding: 2.2rem 2rem;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 18px rgba(22, 40, 29, .08);
}
.login-card img { height: 44px; margin-bottom: 1.1rem; }
.login-card h1 { font-size: 1.15rem; margin: 0 0 1.4rem; }
.btn-google {
    display: block;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    padding: .8rem 1rem;
}
.btn-google:active { background: var(--green-dark); }
.login-card .err { color: var(--red); font-size: .9rem; margin-top: 1rem; }

/* --- tables (Stock browser & friends) ----------------------------------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .9rem;
}
.filters select, .filters input[type=search] {
    font: inherit;
    padding: .45rem .6rem;
    border-radius: 9px;
    border: 1px solid #C4D1C1;
    background: var(--card);
    color: var(--ink);
}
.filters button {
    font: inherit;
    font-weight: 700;
    padding: .45rem .9rem;
    border-radius: 9px;
    border: 0;
    background: var(--green);
    color: #fff;
}

.tablewrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); border: 1px solid #D7E0D4; }
table.data { border-collapse: collapse; width: 100%; font-size: .9rem; }
/* ALIGNMENT RULE (Chad 2026-08-13), and it is a DEFAULT, not an opt-in: columns
   here are wide, so a left header sitting over right-aligned values reads as two
   different columns. Everything is CENTRED -- header and value together, so the
   value always sits under its own title. The ONLY things left-aligned are the
   genuinely readable long text columns, which mark themselves .col-name (an
   existing convention: wrapping, min-width) or .col-text (free text that is read,
   not scanned: notes, details, addresses). Short labels centre with everything
   else. Do not re-introduce a per-page opt-in; this lives here once. */
table.data th, table.data td { padding: .55rem .7rem; text-align: center; white-space: nowrap; }
table.data th.col-name, table.data td.col-name,
table.data th.col-text, table.data td.col-text { text-align: left; }
table.data th {
    position: sticky; top: 0;
    background: var(--card);
    border-bottom: 2px solid var(--green);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
table.data tbody tr:nth-child(even) { background: #F4F7F3; }
/* .num no longer carries alignment -- it only makes digits line up in a column
   (tabular figures). Centring comes from the default above. */
table.data td.num { font-variant-numeric: tabular-nums; }

/* 1px column rules on EVERY table (Chad: easier to see which column you are in).
   border-collapse handles the seams; the last visible column drops its rule so
   there is no edge line against the card border. */
table.data th, table.data td { border-right: 1px solid #D7E0D4; }
table.data th:last-child, table.data td:last-child { border-right: none; }

/* A real frozen header needs the SCROLL to happen inside the table's box, not
   the whole page -- otherwise th's sticky (above) has nothing to stick to. So
   the stock table gets its own scroll region with a cap; the header then pins
   to the top of it as the rows scroll under. z-index lifts it over swatches. */
.tablewrap.stockscroll { max-height: calc(100vh - 13rem); overflow: auto; }
.tablewrap.stockscroll table.data thead th { z-index: 3; }

/* Inline On-Hand edit: the number reads as tappable, and clicking swaps it for
   a small type-and-confirm editor (stock_edit.js posts the delta as a ledger
   adjustment). */
td.oh.editable { cursor: pointer; }
td.oh.editable .ohval { border-bottom: 1px dashed #B4C2B0; padding-bottom: 1px; }
td.oh.saved { background: #E4F3E1; transition: background .2s; }
td.oh .ohedit { display: inline-flex; gap: .25rem; align-items: center; justify-content: center; }
td.oh .ohedit input { width: 4.2rem; text-align: center; font: inherit; padding: .1rem .2rem; }
td.oh .ohedit input.bad { outline: 2px solid var(--red, #c0392b); }
td.oh .ohok, td.oh .ohcancel {
    border: 0; cursor: pointer; border-radius: 6px; padding: .12rem .4rem;
    font-size: .85rem; line-height: 1;
}
td.oh .ohok { background: var(--green); color: #fff; }
td.oh .ohcancel { background: #E7E6E2; color: #333; }

/* Stock Tracking toggle switch */
.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { width: 2.4rem; height: 1.35rem; border-radius: 1rem; background: #C7C6C0; position: relative; transition: background .15s; flex: none; }
.switch .slider::before { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(1.05rem); }
.switch input:focus-visible + .slider { outline: 2px solid var(--green); outline-offset: 2px; }
.switch .switchlabel { font-size: .85rem; color: var(--muted); }
table.data.trackgrid tr.assumed { background: #FBFAF4; }
table.data.trackgrid tr.rowsaved { background: #E4F3E1; transition: background .2s; }
table.data.trackgrid tr.rowerror { background: #FBEAEA; }
.badge.grey { background: #E7E6E2; color: #55534d; }

/* Match Review cards */
.matchcard { background: var(--card); border: 1px solid #D7E0D4; border-radius: var(--radius); padding: .7rem .85rem; margin-bottom: .6rem; transition: opacity .3s, height .3s, padding .3s, margin .3s; overflow: hidden; }
.matchcard.busy { opacity: .5; }
.matchcard.done { background: #E4F3E1; }
.matchcard.bad { border-color: var(--red, #c0392b); }
.matchcard.collapse { height: 0 !important; padding-top: 0; padding-bottom: 0; margin: 0; opacity: 0; }
.mc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.mc-raw { font-weight: 600; }
.mc-seen { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.mc-ok { color: var(--green); font-weight: 600; font-size: .85rem; }
.mc-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.mc-pick, .mc-result { border: 1px solid #C4D1C1; background: #F4F7F3; border-radius: 8px; padding: .35rem .6rem; cursor: pointer; font: inherit; font-size: .85rem; text-align: left; }
.mc-pick:hover, .mc-result:hover { background: #E4F3E1; }
.mc-pick.confident { background: var(--green); color: #fff; border-color: var(--green); }
.mc-service { border: 1px dashed #C0BFB8; background: transparent; color: var(--muted); border-radius: 8px; padding: .35rem .6rem; cursor: pointer; font: inherit; font-size: .85rem; }
.mc-search { margin-top: .5rem; }
.mc-search input { width: 100%; max-width: 22rem; padding: .35rem .5rem; border: 1px solid #C4D1C1; border-radius: 8px; font: inherit; }
.mc-results { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }

/* Product names are the one column allowed to wrap: they are long, and
   nowrap on them is what forced the whole table sideways. Everything else
   stays on one line, so the numbers keep their shape. */
table.data th.col-name, table.data td.col-name { white-space: normal; min-width: 14rem; }
/* On a phone or a narrow tablet, drop the two columns that are filters
   anyway -- manufacturer and type are both in the bar above the table --
   so the balances fit on screen instead of hiding off the right edge. */
@media (max-width: 780px) {
    table.data th.col-drop, table.data td.col-drop { display: none; }
    table.data th, table.data td { padding: .5rem .45rem; }
    table.data th.col-name, table.data td.col-name { min-width: 0; }
}
/* Phones: the three balances are the whole point, so the unit column goes
   ("Linear feet" was costing 90px of a 356px table) and the headings shorten,
   which hands the width back to the product name. */
table.data th .sm { display: none; }
@media (max-width: 520px) {
    table.data th.col-unit, table.data td.col-unit { display: none; }
    table.data th .lg { display: none; }
    table.data th .sm { display: inline; }
    table.data { font-size: .82rem; }
    table.data th, table.data td { padding: .45rem .35rem; }
}
.neg { color: var(--red); font-weight: 700; }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge.green { background: #DDF2E3; color: var(--green-dark); }
.badge.amber { background: #F6EBD4; color: var(--amber); }
.badge.red   { background: #F6DDD8; color: var(--red); }

.pager { display: flex; gap: .6rem; align-items: center; margin-top: .8rem; color: var(--muted); font-size: .9rem; }
.pager a { color: var(--green-dark); font-weight: 700; text-decoration: none; }

.empty { color: var(--muted); padding: 2rem; text-align: center; }

/* --- write-screen flow (Receive / Pick Up / Counts) ---------------------- */
.msg { padding: .7rem 1rem; border-radius: 10px; margin-bottom: .8rem; font-weight: 600; }
.msg.success { background: #DDF2E3; color: var(--green-dark); }
.msg.error   { background: #F6DDD8; color: var(--red); }

.chiprow { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.chip {
    padding: .55rem 1rem; border-radius: 999px; text-decoration: none;
    font-weight: 700; color: var(--ink);
    background: var(--card); border: 1px solid #C4D1C1;
}
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }

/* Count list mode: one row per product, a quantity box on each. Sized for a
   thumb on a tablet walking a shelf, not a mouse. */
table.countlist td { white-space: normal; }
table.countlist input[type=number] {
    width: 6.5rem; padding: .5rem .6rem; font-size: 1.05rem; font-weight: 700;
    text-align: right; border: 1px solid #C4D1C1; border-radius: 10px;
    background: var(--card); color: var(--ink);
}
table.countlist input[type=number]:focus {
    outline: none; border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(30, 158, 72, .18);
}
table.countlist tr.done td { background: #F3F8F2; }
.tag {
    display: inline-block; margin-left: .4rem; padding: .1rem .45rem;
    border-radius: 999px; background: var(--green); color: #fff;
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    vertical-align: middle;
}

.results { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
/* Direct-child anchor cards (other list pages). Scoped to > a so the action
   buttons nested inside a .jobrow are not styled as cards. */
.results > a {
    display: flex; flex-direction: column; gap: .15rem;
    background: var(--card); border: 1px solid #D7E0D4; border-radius: 12px;
    padding: .8rem 1rem; text-decoration: none; color: var(--ink);
}
.results > a span { color: var(--muted); font-size: .82rem; }
.results > a:active { transform: scale(.99); }

/* Job rows: info on the left, actions on the right. */
.jobrow {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: var(--card); border: 1px solid #D7E0D4; border-radius: 12px;
    padding: .8rem 1rem;
}
.jobinfo { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.jobinfo strong { font-size: 1rem; }
.jobinfo > span { color: var(--muted); font-size: .82rem; }
.jobactions { display: flex; gap: .5rem; flex: none; }
.headactions { display: flex; gap: .5rem; margin-top: .55rem; }

.btn {
    display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
    background: var(--green); color: #fff; border: 1px solid var(--green);
    border-radius: 9px; padding: .5rem .85rem; font-size: .85rem; font-weight: 600;
    text-decoration: none; cursor: pointer; line-height: 1;
}
.btn:active { transform: scale(.98); }
.btn.ghost { background: #F4F7F3; color: var(--ink); border-color: #C4D1C1; }
.btn.ghost:hover { background: #E4F3E1; }
@media (max-width: 640px) {
    .jobrow { flex-direction: column; align-items: stretch; }
    .jobactions { }
    .jobactions .btn { flex: 1; justify-content: center; }
}

.bigform {
    background: var(--card); border: 1px solid #D7E0D4; border-radius: var(--radius);
    padding: 1.1rem; margin-bottom: 1.2rem;
    display: flex; flex-direction: column; gap: .6rem;
}
.bigform label { font-weight: 700; font-size: .9rem; }
.bigform input[type=number], .bigform input[type=text], .bigform select {
    font: inherit; font-size: 1.35rem; padding: .7rem .8rem;
    border-radius: 10px; border: 1px solid #C4D1C1; width: 100%;
}
.bigform .checkline { display: flex; gap: .5rem; align-items: center; font-size: .9rem; }
.bigform .checkline input { width: 1.2rem; height: 1.2rem; }
.bigform .go {
    font: inherit; font-size: 1.15rem; font-weight: 800; color: #fff;
    background: var(--green); border: 0; border-radius: 12px; padding: 1rem;
}
.bigform .go:active { background: var(--green-dark); }
.bigform .go:disabled { opacity: .4; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.picked a { color: var(--green-dark); font-weight: 700; }

button.undo {
    font: inherit; font-weight: 700; color: var(--red);
    background: #F6DDD8; border: 0; border-radius: 9px; padding: .4rem .8rem;
}
.sectionhead { margin: 1.4rem 0 .6rem; font-size: 1rem; }
.actionrow { display: flex; gap: .8rem; margin-top: 1rem; }
.actionrow form { flex: 1; display: flex; }
.actionrow button { width: 100%; padding: 1rem; }
/* A link that acts as a button in an action row (the swatch book opens in a
   new tab, so it is an <a>, not a form submit). */
.actionrow a.go {
    flex: 1; text-align: center; text-decoration: none;
    font-size: 1.05rem; font-weight: 800; color: #fff;
    background: var(--green); border-radius: 12px; padding: 1rem;
}
.actionrow a.go.ghost {
    flex: 0 0 auto; background: transparent; color: var(--green-dark);
    border: 1.5px solid #C6D5C6; font-weight: 700;
}

/* --- style-grouped search results: one card per style, colors as chips --- */
.stylegroup {
    background: var(--card); border: 1px solid #D7E0D4; border-radius: var(--radius);
    padding: .9rem 1rem; margin-bottom: .7rem;
}
.stylehead { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .6rem; }
.stylehead strong { font-size: 1.05rem; }
.stylehead span { color: var(--muted); font-size: .8rem; }
.colorchips {
    display: grid; gap: .45rem;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.colorchip {
    display: flex; flex-direction: column; align-items: center; gap: .1rem;
    padding: .6rem .4rem; border-radius: 10px; text-align: center;
    background: #F4F7F3; border: 1px solid #D7E0D4;
    text-decoration: none; color: var(--ink); font-weight: 700; font-size: .9rem;
}
.colorchip em { font-style: normal; font-weight: 600; color: var(--muted); font-size: .72rem; }
.colorchip:active { background: #DDF2E3; border-color: var(--green); }

/* --- multi-color receive ------------------------------------------------- */
.colorchip.pick { cursor: pointer; }
.colorchip.pick input { position: absolute; opacity: 0; pointer-events: none; }
.colorchip.pick:has(input:checked) {
    background: var(--green); border-color: var(--green); color: #fff;
}
.colorchip.pick:has(input:checked) em { color: #E9EFE7; }
.nextbtn {
    margin-top: .7rem; width: 100%;
    font: inherit; font-weight: 800; font-size: 1rem; color: #fff;
    background: var(--green); border: 0; border-radius: 10px; padding: .8rem;
}
.nextbtn:active { background: var(--green-dark); }
.qtyrows { display: flex; flex-direction: column; gap: .45rem; }
.qtyrow {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    background: #F4F7F3; border-radius: 10px; padding: .5rem .7rem;
}
.qtyrow span { font-weight: 700; }
.qtyrow em { font-style: normal; color: var(--muted); font-size: .78rem; margin-left: .3rem; }
.qtyrow input { max-width: 7.5rem; font-size: 1.2rem !important; text-align: right; }
.hint { color: var(--muted); font-size: .82rem; }

.qtyrow .unit {
    color: var(--muted); font-size: .8rem; font-weight: 700;
    margin-left: auto; white-space: nowrap;
}
.qtyrow .unit + input { max-width: 6.5rem; }

.qtyrow .rowdel {
    font: inherit; font-weight: 800; color: var(--red);
    background: none; border: 0; padding: .1rem .35rem; font-size: 1rem;
}
.addrow { display: flex; gap: .5rem; }
.addrow input[type=search] {
    flex: 1; font: inherit; font-size: 1rem; padding: .6rem .7rem;
    border-radius: 10px; border: 1px solid #C4D1C1;
}
.addrow .addbtn {
    font: inherit; font-weight: 700; padding: .6rem 1rem;
    border-radius: 10px; border: 0; background: #DDF2E3; color: var(--green-dark);
}

.addbtn.wide {
    width: 100%; padding: .8rem; font-size: 1rem;
    font-weight: 800; border: 1px dashed var(--green); background: #F4F7F3;
    color: var(--green-dark); border-radius: 10px;
}

/* --- over-entry warning: more than the ledger says is on the shelf ------- */
.qtyrow .overnote { display: none; }
.qtyrow.over {
    background: #F6DDD8;
    outline: 2px solid var(--red);
}
.qtyrow.over input { border-color: var(--red); color: var(--red); font-weight: 800; }
.qtyrow.over .overnote {
    display: block; font-style: normal; font-weight: 700;
    color: var(--red); font-size: .75rem; white-space: nowrap;
}

.vipchip { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.vipchip input { position: absolute; opacity: 0; pointer-events: none; }

.badge.gray { background: #E4E9E2; color: var(--muted); }

/* Product swatch thumbnails -- fetched by fetch_swatches, shown wherever a
   product is named. A missing file simply renders nothing. */
img.swatch {
    width: 2.1rem; height: 2.1rem; object-fit: cover;
    border-radius: .45rem; border: 1px solid #D3DCD0;
    vertical-align: middle; margin-right: .45rem; flex-shrink: 0;
}
.colorchip img.swatch { width: 2.6rem; height: 2.6rem; margin-right: .15rem; }
.qtyrow span { display: flex; align-items: center; }
table.data img.swatch { width: 1.7rem; height: 1.7rem; }

/* --- camera QR scanner --------------------------------------------------- */
.filters .scanbtn {
    background: var(--card);
    color: var(--ink);
    border: 1px solid #D7E0D4;
    border-radius: var(--radius);
    padding: .55rem .8rem;
    font-size: .95rem;
    cursor: pointer;
    white-space: nowrap;
}
.scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.scan-overlay video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.scan-frame {
    position: relative;
    width: min(62vw, 320px);
    aspect-ratio: 1;
    border: 3px solid var(--green);
    border-radius: 18px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45);
}
.scan-status {
    position: relative;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
    margin: 1.2rem 0 0;
    padding: 0 1rem;
    text-align: center;
}
.scan-cancel {
    position: relative;
    margin-top: 1.2rem;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    border: none;
    border-radius: var(--radius);
    padding: .7rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

/* --- Tools hub ----------------------------------------------------------- */
.lede { color: var(--muted); margin-bottom: 1rem; max-width: 46rem; line-height: 1.5; }

.toolgrid { display: grid; grid-template-columns: 1fr; gap: .8rem; }
@media (min-width: 760px) { .toolgrid { grid-template-columns: 1fr 1fr; } }

.toolcard {
    display: flex; gap: .9rem; align-items: flex-start;
    background: var(--card); border: 1px solid #D7E0D4;
    border-radius: var(--radius); padding: 1rem 1.1rem;
    text-decoration: none; color: var(--ink);
    box-shadow: 0 1px 2px rgba(22, 40, 29, .06);
}
.toolcard .icon { font-size: 1.8rem; line-height: 1; }
.toolcard .body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.toolcard b { font-size: 1.05rem; }
.toolcard .blurb { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.toolcard .foot { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
.toolcard .owner {
    font-size: .72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; color: var(--green-dark);
    background: #E4F2E8; padding: .18rem .5rem; border-radius: 999px;
}
.toolcard .count {
    font-size: .72rem; font-weight: 700; color: var(--amber);
    background: #F8F0DC; padding: .18rem .5rem; border-radius: 999px;
}
.toolcard.soon { opacity: .5; }

/* --- Box conversions editor ---------------------------------------------- */
.progress { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.progress span { font-size: .8rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; }
.progress .done { background: #DDF2E3; color: var(--green-dark); }
.progress .todo { background: #F8F0DC; color: var(--amber); }
.progress .of   { color: var(--muted); font-weight: 600; }

.convgroup { margin-bottom: 1.4rem; }
.convgroup h2 {
    font-size: 1rem; margin: 0 0 .5rem;
    display: flex; align-items: baseline; gap: .6rem;
}
.convgroup h2 .type {
    font-size: .72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted);
}
table.data tr.blank { background: #FFFBF0; }
table.data td.mono { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; color: var(--muted); }
table.data td .warn { color: var(--amber); margin-left: .3rem; }
table.data td.sqyd { color: var(--muted); }
table.data input[type=number] {
    font: inherit; width: 6.5rem; text-align: right;
    padding: .3rem .45rem; border-radius: 8px; border: 1px solid #C4D1C1;
    background: var(--card); color: var(--ink);
}

/* Sticky so nobody fills in forty rows and loses them scrolling for a button. */
.savebar {
    position: sticky; bottom: 0;
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
    background: var(--card); border-top: 1px solid #D7E0D4;
    padding: .8rem 1rem; margin: 0 -1rem;
}
.savebar .go {
    font: inherit; font-size: 1rem; font-weight: 800; color: #fff;
    background: var(--green); border: 0; border-radius: 10px; padding: .7rem 1.6rem;
}
.savebar .hint { color: var(--muted); font-size: .85rem; }
table.data tr.varies { background: #FBFAF4; }
table.data .varies { font-size: .78rem; color: var(--amber); font-weight: 700; }

/* Conversions autosave feedback (conversions.js) */
table.data tr.rowsaving td { opacity: .55; }
table.data tr.rowsaved td { background: #EAF7EC; transition: background .2s; }
table.data tr.rowerror input { border-color: var(--red, #C0392B); outline: 1px solid var(--red, #C0392B); }
table.data td.col-name { position: relative; }
button.expand { border: 1px solid var(--line, #ddd); background: #fff;
    border-radius: 6px; width: 1.6rem; height: 1.6rem; line-height: 1;
    margin-right: .4rem; cursor: pointer; font-size: .9rem; color: var(--muted); }
button.expand[aria-expanded="true"] { background: #F4F1EA; }
table.data tr.colourrow { background: #FCFCFA; }
table.data tr.colourrow td { border-top: none; padding-top: .15rem; padding-bottom: .15rem; }
table.data td.colour { padding-left: 2.4rem; color: var(--muted); font-size: .88rem; }
