/* SmartCrating - Direction B COMPACT, Excel-like (approved 2026-10-30, mockups/v2-b-compact.html).
   One shared style file: colours and fonts are tokens here; screens only use these classes. */
:root {
  --paper: #F2EDE4;   /* page background */
  --card: #FFFDF8;
  --ink: #231C15;     /* text */
  --muted: #6A5D4F;
  --line: #D9CFBF;
  --dark: #2A2119;    /* top bar, price ticket */
  --amber: #C8791A;   /* accent */
  --amber-dark: #9A5A0C;
  --amber-soft: #FBEBD0;
  --green: #3F6B3A;
  --on-dark: #F5EBDC;
  --on-dark-muted: #CDBFAA;
  --p1: #E9D2A6; --p2: #D9E3C4; --p3: #F1C98F; --p4: #E8C3B0; /* plywood piece colours */
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: Barlow, system-ui, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 14px/1.4 var(--font-body); }
h1, h2, h3, p { margin: 0; }

/* ---- Top bar ---- */
.top { background: var(--dark); color: var(--on-dark); border-bottom: 3px solid var(--amber); }
.top-in { max-width: 1360px; margin: 0 auto; padding: 0 12px; display: flex; align-items: stretch; gap: 20px; min-height: 44px; }
.logo { display: flex; align-items: center; gap: 8px; font: 700 18px var(--font-head); letter-spacing: .05em; text-transform: uppercase; color: inherit; text-decoration: none; }
.logo i { width: 22px; height: 22px; background: var(--amber); display: grid; place-items: center; color: var(--dark); font-style: normal; font-size: 14px; border-radius: 2px; }
.top nav { display: flex; flex: 1; }
.top nav a { display: flex; align-items: center; padding: 0 14px; color: var(--on-dark-muted); text-decoration: none; font: 500 15px var(--font-body); }
.top nav a:hover { color: #fff; }
.top nav a.active { color: #fff; background: rgba(255, 255, 255, .1); box-shadow: inset 0 -3px 0 #fff; }
.top nav a:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
.user { display: flex; align-items: center; font-size: 13px; color: var(--on-dark-muted); }

/* ---- Page ---- */
.page { max-width: 1360px; margin: 0 auto; padding: 10px 12px 24px; display: grid; gap: 10px; }
.page > * { min-width: 0; }
.kicker { font: 600 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--amber-dark); }
h1 { font: 600 22px/1.1 var(--font-head); letter-spacing: .03em; }
h1:focus { outline: none; } /* Blazor moves focus to the page title on each page change (for screen readers) */
h2 { font: 700 15px var(--font-head); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; }
.muted { color: var(--muted); }
.note { display: flex; gap: 12px; align-items: flex-start; background: var(--amber-soft); border-left: 5px solid var(--amber); padding: 6px 10px; font-size: 13px; border-radius: 2px; }

/* ---- Price ticket (full version comes in M2) ---- */
.ticket { background: var(--dark); color: var(--on-dark); border-radius: 2px; border-left: 4px solid var(--amber); padding: 10px 14px; }
.ticket .k { font: 600 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-muted); }
.ticket .price { font: 700 40px/1 var(--font-head); color: #fff; margin: 4px 0 6px; }
.ticket .ticket-line { margin-top: 10px; }
.tag { display: inline-block; background: var(--amber); color: #1d1308; font: 600 12px var(--font-body); padding: 1px 8px; border-radius: 2px; }


/* ===== Compact quote page (mockups/v2-b-compact.html) ===== */
:root { --head: #EFE8DB; --zebra: #FBF7EE; --input-line: #BFB29E; --err: #A1261B; --err-soft: #FBE3DF; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { font: 500 14px var(--font-body); padding: 0 14px; height: 32px; cursor: pointer; border: 1px solid var(--dark); background: #fff; color: var(--dark); border-radius: 2px; }
.btn:hover:not(:disabled) { background: var(--amber-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.pri { background: var(--amber); border-color: var(--amber-dark); color: #1d1308; font-weight: 600; }
.btn.pri:hover:not(:disabled) { background: #DB8A28; }
.btn:focus-visible, .link:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.seg { display: inline-flex; border: 1px solid var(--dark); border-radius: 2px; overflow: hidden; height: 32px; }
.seg button { border: 0; border-left: 1px solid var(--line); background: #fff; color: var(--ink); font: 500 14px var(--font-body); min-width: 42px; padding: 0 12px; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--dark); color: #fff; }
.seg button:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.card h2 small { font: 400 13px var(--font-body); text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.row1 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.row2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.stack { display: grid; gap: 10px; min-width: 0; }
.stack > *, .row1 > *, .row2 > *, .card { min-width: 0; } /* wide tables scroll inside their card, never the page */
.in { width: 100%; font: 400 14px var(--font-body); height: 30px; padding: 0 8px; border: 1px solid var(--input-line); border-radius: 2px; background: #fff; color: var(--ink); }
.in:focus { outline: 2px solid var(--amber); outline-offset: -1px; border-color: var(--dark); }
.in.n { text-align: right; font-variant-numeric: tabular-nums; }
.in.bad, td.c .in.bad { background: var(--err-soft); outline: 1px solid var(--err); outline-offset: -1px; }
.unit-in { position: relative; }
.unit-in .in { padding-right: 30px; text-align: right; }
.unit-in b { position: absolute; right: 7px; bottom: 0; line-height: 30px; color: var(--muted); font-weight: 400; font-size: 12px; }
label.l { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.opt { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tog { display: flex; align-items: center; gap: 8px; height: 30px; cursor: pointer; user-select: none; }
.tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tog .sw { width: 34px; height: 18px; border-radius: 2px; background: #CFC4B2; position: relative; border: 1px solid #A89B86; flex: none; }
.tog .sw::after { content: ""; position: absolute; left: 1px; top: 1px; width: 14px; height: 14px; background: #fff; border: 1px solid #8c7f6c; transition: left .1s; }
.tog input:checked + .sw { background: var(--amber); border-color: var(--amber-dark); }
.tog input:checked + .sw::after { left: 17px; }
.tog input:focus-visible + .sw { outline: 2px solid var(--amber); outline-offset: 1px; }
.tog em { font-style: normal; font-size: 13px; color: var(--muted); }
.scroll { overflow-x: auto; position: relative; } /* keeps hidden screen-reader text inside the box */
table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); }
th, td { border: 1px solid var(--line); height: 28px; padding: 0 8px; text-align: left; white-space: nowrap; }
th { background: var(--head); font: 600 12px var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
tbody tr:nth-child(even) td { background: var(--zebra); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.pid { font-weight: 600; }
td.wrap { white-space: normal; }
td.c { padding: 0; }
td.c .in { border: 0; border-radius: 0; height: 27px; background: transparent; }
td.c .in:focus { background: #fff; }
td.x { width: 30px; padding: 0; text-align: center; }
.link { border: 0; background: none; color: var(--amber-dark); font: 500 14px var(--font-body); cursor: pointer; padding: 0 6px; height: 27px; }
.link:hover { text-decoration: underline; }
.link.del { color: var(--muted); font-size: 16px; }
.link.del:hover { color: var(--err); }
.dot { display: inline-block; width: 10px; height: 10px; border: 1px solid #5a4630; margin-right: 6px; vertical-align: -1px; }
.errors { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--err); }
.errors li::before { content: "• "; }
.note.warn { background: #FFF4D6; border-left-color: #B88A00; }
.note.err { background: var(--err-soft); border-left-color: var(--err); color: #5a140e; }
.notes { display: grid; gap: 6px; }
/* price panel */
.ticket.panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; }
@media (min-width: 1101px) { .ticket.panel { min-height: 220px; } }
.ticket .size { text-align: right; font-size: 12px; color: var(--on-dark-muted); line-height: 1.3; }
.ticket .size b { display: block; color: #fff; font-weight: 600; font-size: 13px; }
.ticket .price.none { color: var(--on-dark-muted); }
.ticket .msg { font-size: 13px; color: var(--on-dark-muted); }
.bd { grid-column: 1 / -1; border-top: 1px solid #5b4c3d; padding-top: 6px; }
.bd div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; min-height: 24px; align-items: center; border-bottom: 1px dotted #6f5e4d; }
.bd div b { font-weight: 600; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bd .tot { border-bottom: 0; }
.bd .tot b { color: #F0B25C; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 2px; padding: 2px 8px; font-size: 13px; }
.chip b { font-weight: 600; margin-right: 4px; }
.sub { font: 600 13px var(--font-body); margin: 10px 0 4px; }
@media (max-width: 1100px) {
  .row1, .row2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .opt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: 0 6px; }
  /* Phone: crate boxes keep a readable width (the table scrolls sideways inside its card instead),
     so a typed value like 1500 kg or 100 7/16 is never cut off (reviewer M2 must-fix). */
  table.crates { min-width: 560px; }
  table.crates th.out, table.crates td.out { display: none; }
}

/* ---- Phone ---- */
@media (max-width: 700px) {
  .top-in { flex-wrap: wrap; gap: 0 10px; padding: 0 8px; }
  .logo { min-height: 40px; }
  .user { display: none; }
  .top nav { flex-basis: 100%; order: 3; }
  .top nav a { flex: 1; justify-content: center; padding: 0 4px; min-height: 40px; }
  .page { padding: 8px 8px 24px; }
}



/* ---- Loading screen (shown while the app downloads, first visit ~3-5 s) ---- */
.loading { min-height: 100vh; display: grid; place-content: center; gap: 18px; justify-items: center; background: var(--dark); color: var(--on-dark); }
.loading .logo { font-size: 24px; }
.loading .bar { width: 220px; height: 6px; background: #4a3c2f; border-radius: 3px; overflow: hidden; }
.loading .bar span { display: block; height: 100%; width: var(--blazor-load-percentage, 0%); background: var(--amber); transition: width .1s; }
.loading p { font: 500 13px var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--on-dark-muted); }

/* ---- Blazor error bar ---- */
#blazor-error-ui { background: var(--amber-soft); border-top: 3px solid var(--amber); bottom: 0; display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; background: none; border: 0; font-size: 18px; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "Something went wrong on this part of the page."; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
td.addrow { background: #fff !important; padding: 0 2px; }
.results { display: grid; gap: 10px; min-width: 0; }
.results > * { min-width: 0; }
.results.stale { pointer-events: none; }
.results.stale > :not(.stale-msg) { opacity: .35; }
.stale-msg { grid-column: 1 / -1; background: var(--dark); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 2px; justify-self: start; }
.ticket.waiting .price, .ticket.waiting .bd { opacity: .5; transition: opacity .1s; }
table.crates td.out { color: var(--muted); font-size: 13px; }


/* ===== M3: sheet drawings, lumber strips, crate box, enlarge, print ===== */
.sheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.sheet-fig { margin: 0; min-width: 0; }
.sheet-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font: 600 14px var(--font-head); letter-spacing: .05em; text-transform: uppercase; }
.sheet-h span { font: 400 12px var(--font-body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.sheet-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--head); cursor: zoom-in; border-radius: 2px; }
.sheet-btn:hover { border-color: var(--amber); }
.sheet-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
svg.sheet { display: block; width: 100%; height: auto; }
svg.sheet .sh { fill: #F8F3E8; stroke: var(--ink); stroke-width: 6; }
svg.sheet .pc { stroke: #5a4630; stroke-width: 3; }
svg.sheet .p1 { fill: var(--p1); } svg.sheet .p2 { fill: var(--p2); } svg.sheet .p3 { fill: var(--p3); } svg.sheet .p4 { fill: var(--p4); }
svg.sheet .lf { stroke: #8d7f6b; stroke-width: 2.5; stroke-dasharray: 12 8; }
svg.sheet .hatch-bg { fill: #F8F3E8; }
svg.sheet .hatch-line { stroke: #A89B86; stroke-width: 5; }
svg.sheet .hatch-line.light { stroke: #D9CFBF; stroke-width: 4; }
svg.sheet text { font-family: var(--font-body); text-anchor: middle; }
svg.sheet .nm { font-family: var(--font-head); font-weight: 600; letter-spacing: .02em; fill: var(--ink); }
svg.sheet .sz { font-weight: 500; fill: #3a2e22; }
svg.sheet .ed { font-size: 34px; font-weight: 500; fill: #5a4630; }
svg.sheet .lt { font-size: 34px; font-weight: 500; fill: var(--muted); }
svg.sheet .keep-t { font-size: 40px; fill: #4a3c2f; }
svg.sheet .cut { stroke: #8a1f15; stroke-width: 3; stroke-dasharray: 18 10; }
svg.sheet .cc { fill: var(--amber); stroke: #fff; stroke-width: 4; }
svg.sheet .cn { font-size: 40px; font-weight: 700; fill: #1d1308; }
.cutlist { margin-top: 4px; font-size: 13px; }
.cutlist summary { cursor: pointer; color: var(--amber-dark); font-weight: 500; }
.cutlist ol, ol.cutlist { margin: 4px 0 0; padding-left: 22px; }
.legend { font-size: 12px; color: var(--muted); margin-top: 8px; }
.key { display: inline-block; width: 12px; height: 10px; border: 1px dashed #8d7f6b; vertical-align: -1px; margin-right: 3px; }
.key.keep { background: repeating-linear-gradient(45deg, #A89B86 0 2px, #F8F3E8 2px 5px); }
.key.scrap { background: repeating-linear-gradient(45deg, #D9CFBF 0 2px, #F8F3E8 2px 5px); }
/* enlarged sheet */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(42, 33, 25, .75); display: grid; place-items: center; padding: 16px; }
.overlay:focus { outline: none; }
.overlay-box { background: var(--card); border-radius: 2px; padding: 12px; width: min(1300px, 100%); max-height: 100%; overflow: auto; }
.overlay-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font: 600 16px var(--font-head); text-transform: uppercase; letter-spacing: .05em; }
.cutlist-big { font-size: 14px; margin: 8px 0 0; padding-left: 22px; columns: 2; }
.cutlist-big li { break-inside: avoid; }
.overlay-box svg.sheet { max-height: 62vh; width: 100%; }
.bar-left { width: 44px; flex: none; font-size: 11px; color: var(--muted); text-align: right; }
@media (max-width: 700px) {
  .cutlist-big { columns: 1; }
  .overlay { padding: 6px; }
  .zoom { overflow-x: auto; }
  .zoom svg.sheet { min-width: 900px; max-height: none; } /* swipe sideways to read the enlarged sheet */
}
/* lumber strips */
.lumber + .lumber { margin-top: 10px; }
.lumber-h { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.lumber-h span { color: var(--muted); }
.bar-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.bar-no { width: 18px; text-align: right; font-size: 12px; color: var(--muted); flex: none; }
.bar { flex: 1; min-width: 0; display: flex; height: 22px; background: repeating-linear-gradient(45deg, #E3D9C8 0 2px, #F8F3E8 2px 6px); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.seg-piece { background: var(--p1); border-right: 1px solid #5a4630; font-size: 11px; line-height: 20px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-piece:nth-child(even) { background: var(--p3); }
/* crate box picture in the price panel */
.ticket .size { display: grid; justify-items: end; gap: 2px; }
.crate-pick { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 170px; margin-bottom: 4px; }
.crate-pick button { font: 500 12px var(--font-body); min-width: 30px; height: 22px; padding: 0 5px; border: 1px solid #6f5e4d; background: transparent; color: var(--on-dark-muted); border-radius: 2px; cursor: pointer; }
.crate-pick button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #1d1308; font-weight: 600; }
.crate-pick button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
svg.crate-box { width: 96px; height: auto; display: block; }
svg.crate-box .cb-front { fill: #E9D2A6; }
svg.crate-box .cb-top { fill: #F1DDB8; stroke: #5a4630; stroke-width: 1; }
svg.crate-box .cb-side { fill: #C9AE80; stroke: #5a4630; stroke-width: 1; }
svg.crate-box .cb-outline { fill: none; stroke: #5a4630; stroke-width: 1.2; }
svg.crate-box .cb-seam { stroke: #B89A6A; stroke-width: .8; }
svg.crate-box .cb-gap { fill: #2A2119; }
svg.crate-box .cb-skid { fill: #8a6a3c; }

.print-only { display: none; }

/* ===== Print (A4, black on white, no prices) - DESIGN.md section 9 ===== */
@page { size: A4 portrait; margin: 12mm; }
@media print {
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .top, .actions, .no-print, .ticket, .notes, .stale-msg, .overlay, #blazor-error-ui, .head .kicker, .head h1 { display: none !important; }
  .print-only { display: block; }
  .page { max-width: none; padding: 0; gap: 4mm; }
  .print-title { font: 700 20pt var(--font-head); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3mm; display: flex; justify-content: space-between; align-items: baseline; }
  .print-title span { font: 400 10.5pt var(--font-body); text-transform: none; }
  .card { border: 0; padding: 0; background: #fff; }
  h2 { font-size: 13pt; border-bottom: 1px solid #000; padding-bottom: 1mm; }
  h2 small, .legend { color: #000; }
  table, th, td { border-color: #000; }
  th { background: #fff; color: #000; border-bottom: 2px solid #000; font-size: 9pt; }
  td { font-size: 10pt; height: auto; padding: 1mm 2mm; }
  tbody tr:nth-child(even) td { background: #fff; }
  .scroll { overflow: visible; }
  .dot { display: none; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .sheets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5mm; }
  .sheet-fig { break-inside: avoid; page-break-inside: avoid; }
  .sheet-btn { border: 0; background: #fff; outline: none !important; }
  svg.sheet .sh { fill: #fff; stroke: #000; stroke-width: 8; }
  svg.sheet .pc { fill: #fff !important; stroke: #000; stroke-width: 3; }
  svg.sheet .hatch-bg { fill: #fff; }
  svg.sheet .hatch-line { stroke: #555; }
  svg.sheet .hatch-line.light { stroke: #bbb; }
  svg.sheet .nm, svg.sheet .sz, svg.sheet .ed, svg.sheet .lt { fill: #000; }
  svg.sheet .cut { stroke: #000; }
  svg.sheet .cc { fill: #fff; stroke: #000; stroke-width: 4; }
  svg.sheet .cn { fill: #000; }
  ol.cutlist { font-size: 9.5pt; }
  .bar { background: #fff; border-color: #000; }
  .seg-piece, .seg-piece:nth-child(even) { background: #fff; border-right-color: #000; color: #000; }
  .lumber-h span, .bar-no, .hint { color: #000; }
  /* bigger labels on paper (reviewer M3: about 7 pt or more), one sheet per row */
  .sheets { grid-template-columns: minmax(0, 1fr); }
  svg.sheet .ed, svg.sheet .lt { font-size: 40px; }
  svg.sheet .keep-t { font-size: 44px; }
  svg.sheet .cc { r: 46px; }
  svg.sheet .cn { font-size: 50px; }
  .sheet-h span, h2 small, .muted, .legend, .hint, .lumber-h span { color: #000; }
  .print-foot { margin-top: 4mm; border-top: 1px solid #000; padding-top: 1mm; font-size: 9pt; }
  .print-stale { border: 2px solid #000; padding: 3mm; font: 700 14pt var(--font-head); text-transform: uppercase; margin-bottom: 3mm; }
  .results.stale, .results.pending, .print-head:has(~ .print-stale) { display: none !important; }
  .bar-row .print-only { display: inline; font-size: 9.5pt; }
  .bar-no { display: none; }
}
@media print { @page { @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 9pt Barlow, sans-serif; } } }

/* ===== M4: login ===== */
.login-wrap { display: grid; place-items: start center; padding-top: 6vh; }
.card.login { width: min(360px, 100%); display: grid; gap: 6px; padding: 18px; }
.card.login h1 { margin-bottom: 8px; }
.card.login .btn { margin-top: 8px; height: 34px; }
.user { gap: 10px; }
.user .link.out { color: var(--on-dark-muted); font-size: 13px; height: auto; padding: 0; text-decoration: underline; }
.user .link.out:hover { color: #fff; }

.card.login .remember { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 13px; margin-top: 4px; cursor: pointer; }

/* ===== M5: admin pages ===== */
.tabs-seg a { display: flex; align-items: center; padding: 0 14px; border-left: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font: 500 14px var(--font-body); }
.tabs-seg a:first-child { border-left: 0; }
.tabs-seg a.on { background: var(--dark); color: #fff; }
.tabs-seg a:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.peso-in { position: relative; }
.peso-in b { position: absolute; left: 8px; top: 0; line-height: 27px; color: var(--muted); font-weight: 400; font-size: 13px; }
.peso-in .in { padding-left: 22px; }
td.c .peso-in b { line-height: 27px; }
.add-thick { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; margin-top: 10px; }
.add-thick label { flex: 0 0 100%; margin: 0; }
.add-thick .unit-in { width: 140px; }
.tag.ph { background: var(--amber-soft); color: var(--amber-dark); border: 1px solid #E5C48F; }
.tag.ch { background: #FFF4D6; color: #6b4e00; border: 1px solid #E8C96A; }
.preview tr.diff td { background: #FFF4D6 !important; }
.preview tr.detail td { font-size: 12px; color: var(--muted); height: auto; padding: 2px 8px 6px; }
.savebar { display: grid; gap: 8px; position: sticky; bottom: 0; background: var(--paper); padding: 8px 0; border-top: 1px solid var(--line); z-index: 5; }
.note.confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.confirm-btns { display: flex; gap: 8px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px 12px; margin-bottom: 6px; }
.set-row { min-width: 0; }
.set-row.changed .in { background: #FFF4D6; }
.set-row .hint { margin-top: 2px; }
.set-row .unit-in b { bottom: 0; }
table.users .in { min-width: 120px; }
tr.changed td { background: #FFF4D6 !important; }
@media (max-width: 700px) { .add-thick .unit-in, .add-thick .btn { flex: 1; } .tabs-seg { width: 100%; } .tabs-seg a { flex: 1; justify-content: center; padding: 0 4px; } }

.sticky-col { position: sticky; top: 10px; }
.confirm-inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; white-space: normal; }
label.real { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; cursor: pointer; white-space: nowrap; }
@media (max-width: 1100px) { .sticky-col { position: static; } }
@media (max-width: 700px) {
  /* Users as cards on phones (design 6.7) */
  table.users thead { display: none; }
  table.users, table.users tbody, table.users tr, table.users td { display: block; width: 100%; }
  table.users tr { border: 1px solid var(--line); border-left: 4px solid var(--amber); margin-bottom: 8px; background: var(--card); padding: 4px 8px; }
  table.users td { border: 0; height: auto; padding: 3px 0; white-space: normal; }
  table.users td.c .in { border: 1px solid var(--input-line); }
}
.lo-tag { display: inline-block; background: var(--amber); color: #1d1308; font-weight: 600; font-size: 12px; padding: 0 6px; border-radius: 2px; margin-right: 4px; }
/* Leftovers page (M6) */
.lo-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.lo-add > div { width: 130px; }
.lo-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.lo-filter .l { margin: 0; }
.lo-filter select { width: auto; }
.lo-filter .chk { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; }
table.leftovers td.act { white-space: nowrap; }
table.leftovers td.act .btn { height: 26px; padding: 0 10px; font-size: 13px; }
table.leftovers td.c .in { width: 90px; height: 26px; }
table.leftovers tr.gone td { color: var(--muted); text-decoration: line-through; }
table.leftovers tr.gone td:nth-child(6) { text-decoration: none; }
@media (max-width: 700px) { .lo-add > div { flex: 1 1 40%; } .lo-add .btn { flex: 1 1 100%; } }
/* Save job (M6) */
.save-job { margin-bottom: 10px; }
.sj-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.sj-row > div { width: 220px; }
/* Jobs (M6) */
a.btn-link { display: inline-flex; align-items: center; text-decoration: none; }
.kicker a { color: inherit; }
table.crate-sum { margin-bottom: 8px; }
table.kv { width: auto; border: 0; margin: 6px 0; }
table.kv th { text-align: left; font-weight: 600; padding: 2px 12px 2px 0; border: 0; background: none; white-space: nowrap; vertical-align: top; }
table.kv td { padding: 2px 0; border: 0; }
table.jobs td { white-space: nowrap; }
table.jobs td:nth-child(3) { white-space: normal; min-width: 220px; }
.confirm-card { border-left: 5px solid var(--amber); margin-bottom: 10px; }
.confirm-card p { margin: 0 0 6px; }
ul.plain { margin: 0 0 8px 18px; padding: 0; font-size: 13px; }
ul.plain li { margin: 2px 0; }
/* Phone: button text never wraps inside a button (user 2026-10-31: text touched the button edge on the phone).
   The mm/cm/in switch gets its own row; the other buttons share the next row. */
.btn { white-space: nowrap; }
a.btn-link { justify-content: center; }
@media (max-width: 700px) {
  .actions .seg { flex: 1 1 100%; }
  .actions .seg button { flex: 1; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}
