/* Layout: steel top bar with section tabs, one working column (max 1240px);
   dashboard = figure strip, then the production queue as the main table. */
:root {
  --bg: #eceff3;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --line: #d3dae2;
  --fg: #17202a;
  --muted: #586676;
  --bar: #1c2631;
  --bar-fg: #e8edf2;
  --bar-muted: #93a2b2;
  --accent: #8f6210;
  --accent-strong: #6f4b08;
  --accent-soft: #f4e8d0;
  --accent-fg: #ffffff;
  --ok: #1d7448; --ok-soft: #dcf0e4;
  --warn: #9a5600; --warn-soft: #fbead1;
  --bad: #b3261e; --bad-soft: #fbe0dc;
  --info: #2b5b8e; --info-soft: #dde8f5;
  --seg-fg: #ffffff;
  --t0: #2f64a8; --t1: #b8741c; --t2: #2f8a5f; --t3: #8f4590; --t4: #b8473d;
  --t5: #23808c; --t6: #7a6a1f; --t7: #5d55b8; --t8: #52677a; --t9: #a3557a;

  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 6px;
  /* Printed labels are paper in both themes */
  --paper: #ffffff;
  --ink: #111111;
  --ink-muted: #aeaaaa;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f151b; --surface: #17202a; --surface-2: #1c2732; --line: #2c3a48;
    --fg: #e5ebf1; --muted: #93a1b0;
    --bar: #0a0f14; --bar-fg: #e5ebf1; --bar-muted: #8494a5;
    --accent: #e2b45c; --accent-strong: #f0c97a; --accent-soft: #3a2f19; --accent-fg: #1a1407;
    --ok: #52c48e; --ok-soft: #153627; --warn: #f0a94b; --warn-soft: #3b2a12;
    --bad: #f2806f; --bad-soft: #401d1a; --info: #82b2e6; --info-soft: #1a2d44;
    --seg-fg: #10161c;
    --t0: #7fa8e0; --t1: #e8ad5c; --t2: #6cc59a; --t3: #c98fd0; --t4: #ec8f84;
    --t5: #6cc6cf; --t6: #cdbb66; --t7: #a49df0; --t8: #9fb1c2; --t9: #e29bbb;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f151b; --surface: #17202a; --surface-2: #1c2732; --line: #2c3a48;
  --fg: #e5ebf1; --muted: #93a1b0;
  --bar: #0a0f14; --bar-fg: #e5ebf1; --bar-muted: #8494a5;
  --accent: #e2b45c; --accent-strong: #f0c97a; --accent-soft: #3a2f19; --accent-fg: #1a1407;
  --ok: #52c48e; --ok-soft: #153627; --warn: #f0a94b; --warn-soft: #3b2a12;
  --bad: #f2806f; --bad-soft: #401d1a; --info: #82b2e6; --info-soft: #1a2d44;
  --seg-fg: #10161c;
  --t0: #7fa8e0; --t1: #e8ad5c; --t2: #6cc59a; --t3: #c98fd0; --t4: #ec8f84;
  --t5: #6cc6cf; --t6: #cdbb66; --t7: #a49df0; --t8: #9fb1c2; --t9: #e29bbb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: 0.01em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0; }
.num, td.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--bar);
  color: var(--bar-fg);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
}
.topbar-inner, .wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: inherit; text-decoration: none; }
.brand b { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
.brand span { font-family: var(--font-display); font-size: 1.05rem; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a {
  color: var(--bar-muted); text-decoration: none; padding: 6px 12px; border-radius: var(--radius);
  font-weight: 500; font-size: 0.93rem;
}
.tabs a:hover { color: var(--bar-fg); }
.tabs a[aria-current="page"] { color: var(--bar-fg); background: rgba(255, 255, 255, 0.09); box-shadow: inset 0 -2px 0 var(--accent); }

main.wrap { padding-block: 28px 56px; display: flex; flex-direction: column; gap: 24px; }
.foot { color: var(--muted); font-size: 0.82rem; padding-block: 0 32px; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sub { color: var(--muted); }
.crumbs { font-size: 0.85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.actions, .page-head > .actions { display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  font: inherit; font-size: 0.9rem; font-weight: 500;
  padding: 7px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn.small { padding: 3px 9px; font-size: 0.8rem; }
.btn.icon { padding: 3px 8px; font-family: var(--font-mono); }
.btn:disabled { opacity: 0.4; cursor: default; }

input, select, textarea {
  font: inherit; font-size: 0.92rem; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 9px; width: 100%; min-width: 0;
}
input[type="number"] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); font-weight: 500; min-width: 0; }
label.check { display: inline-flex; gap: 8px; align-items: center; font-size: 0.9rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; }
.grid-form .wide { grid-column: 1 / -1; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel > header { padding: 16px 18px 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.panel > header > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.panel-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.hint { color: var(--muted); font-size: 0.85rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Figures (KPI strip) ---------- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.figure { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.figure .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.figure .value { font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figure .value small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.figure .note { font-size: 0.8rem; color: var(--muted); }
.figure.alert .value { color: var(--bad); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
th small { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; font-style: italic; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 600; }
th.num, td.num { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.muted td { color: var(--muted); }
td input[type="number"] { width: 84px; text-align: right; padding: 4px 6px; }
td input.w-ref { width: 92px; }
td input.w-name { min-width: 150px; }
td input.w-s { width: 72px; }
td select { width: auto; padding: 4px 6px; }
.cell-main { font-weight: 600; }
td.nowrap { white-space: nowrap; }
.cell-sub { font-size: 0.8rem; color: var(--muted); }
.order-link { color: var(--fg); text-decoration: none; font-weight: 600; }
.order-link:hover { color: var(--accent); }

/* ---------- Status pills & progress ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.bar { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; min-width: 90px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.done > i { background: var(--ok); }
.progress-cell { display: flex; flex-direction: column; gap: 4px; min-width: 110px; }

/* ---------- Pallet visual ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.82rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pallets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.pallet { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.pallet figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pallet figcaption b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: 0.03em; }
.pallet figcaption span { font-size: 0.82rem; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 6px; align-items: end; }
.col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stack {
  height: 210px; display: flex; flex-direction: column-reverse;
  border: 1px solid var(--line); border-radius: 4px 4px 0 0; background: var(--surface);
  overflow: hidden;
}
.stack.empty { border-style: dashed; background: transparent; }
.seg { display: flex; align-items: center; justify-content: center; color: var(--seg-fg); font-family: var(--font-mono); font-size: 0.66rem; line-height: 1; overflow: hidden; border-top: 1px solid var(--surface); text-align: center; }
.col-foot { text-align: center; font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); line-height: 1.3; }
.pallet-base { height: 8px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--muted) 0 18%, transparent 18% 41%); opacity: 0.55; }
details.col-list summary { cursor: pointer; font-size: 0.82rem; color: var(--muted); }
details.col-list table { margin-top: 6px; font-size: 0.8rem; }
details.col-list td, details.col-list th { padding: 4px 6px; }

/* ---------- Misc ---------- */
.empty-state { padding: 36px 18px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.86rem; max-height: 280px; overflow: auto; }
.log time { color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; margin-right: 8px; }
.signoffs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.signoff { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.signoff h3 { font-size: 1rem; }
.signoff h3 small { font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 0.78rem; margin-left: 6px; }
.signoff.done { border-color: var(--ok); }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rate-table td:first-child { font-weight: 600; }
.warnbox { border: 1px solid var(--warn); background: var(--warn-soft); color: var(--fg); border-radius: var(--radius); padding: 10px 12px; font-size: 0.88rem; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: var(--radius);
  font-size: 0.88rem; z-index: 50; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.search { max-width: 280px; }
.seg-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg-tabs button { font: inherit; font-size: 0.85rem; padding: 6px 12px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.seg-tabs button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

@media (max-width: 560px) {
  h1 { font-size: 1.7rem; }
  .figure .value { font-size: 1.6rem; }
  .topbar-inner { gap: 8px 16px; }
  .stack { height: 170px; }
}

@media (prefers-reduced-motion: no-preference) {
  .bar > i { transition: width 0.3s ease; }
}

/* ---------- Account, sign-in ---------- */
.topbar-inner .tabs { flex: 1 1 auto; }
.account { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--bar-muted); }
.account .who { color: var(--bar-fg); font-weight: 500; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--bar-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--bar-fg); }
.badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 0.72rem; font-weight: 600; }
.auth-wrap { display: flex; justify-content: center; padding-block: 6vh; }
.auth-card { width: 100%; max-width: 420px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.form-error { color: var(--bad); font-size: 0.88rem; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); padding: 0; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 15, 20, 0.45); }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Requests, documents, portal ---------- */
.panel.attention { border-color: var(--warn); }
.figure.attention .note { color: var(--warn); font-weight: 600; }
.request-box { padding-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.request-box > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.client-note { white-space: pre-wrap; max-width: 70ch; }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.files li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.files li:last-child { border-bottom: 0; padding-bottom: 0; }
.files a { font-weight: 600; word-break: break-word; }
.files .btn { margin-left: auto; }
[data-drop].dropping { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.stack-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.invite-box { border: 1px solid var(--ok); background: var(--ok-soft); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.invite-box input { font-family: var(--font-mono); font-size: 0.82rem; flex: 1 1 320px; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; counter-reset: step; }
.stepper li { position: relative; padding-top: 14px; font-size: 0.8rem; color: var(--muted); text-align: center; }
.stepper li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.stepper li.done::before { background: var(--ok); border-color: var(--ok); }
.stepper li.current::before { background: var(--accent); border-color: var(--accent); }
.stepper li.current { color: var(--fg); font-weight: 600; }
@media (max-width: 640px) {
  .stepper { grid-template-columns: minmax(0, 1fr); }
  .stepper li { text-align: left; padding: 0 0 0 18px; }
  .stepper li::before { top: 4px; bottom: 4px; right: auto; width: 6px; height: auto; }
}
.lots-cell { font-size: 0.82rem; white-space: nowrap; }

/* ---------- LOT numbers ---------- */
.lot-blocks { gap: 12px; }
.lot-block .table-wrap { max-width: 100%; }
.lot-block { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.lot-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; width: 100%; }
.lot-head span:not(.pill) { color: var(--muted); font-size: 0.88rem; }
.lot-head .pill { margin-left: auto; }
.lot-table { width: auto; }
.lot-table td input:not([type="number"]) { width: 170px; font-family: var(--font-mono); }
.stack { position: relative; }
.seg.lot-break { border-top: 2px dashed var(--seg-fg); }
.seg.run-start { border-bottom: 2px solid var(--fg); }
.run-mark {
  position: absolute; left: 2px; z-index: 1;
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 3px;
  background: var(--fg); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; line-height: 15px; text-align: center;
}
.run-mark.inline { position: static; display: inline-block; vertical-align: middle; }
.placement td { white-space: nowrap; }

/* ---------- LOT labels (Oznaka blaga), one per A4 sheet ---------- */
.label-options { padding-top: 18px; display: flex; flex-direction: row; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; }
.label-options .field { max-width: 320px; }
.label-options .warnbox { flex-basis: 100%; }
.label-sheets { display: flex; flex-wrap: wrap; gap: 16px; }
.label-group { display: flex; flex-direction: column; gap: 12px; }
.label-group h2 small { font-family: var(--font-body); font-size: 0.85rem; font-weight: 400; color: var(--muted); margin-left: 8px; }
.label-sheet {
  /* Real A4 page; every position below is measured from O_Oznaka_blaga_22._9._2023.pdf (in pt). */
  position: relative; flex: none;
  width: 210mm; height: 297mm; overflow: hidden;
  background: var(--paper); color: var(--ink);
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  zoom: 0.5; box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
}
.label-sheet > * { position: absolute; margin: 0; box-sizing: border-box; }
.oz-box { left: 17.3pt; top: 39.6pt; width: 223.3pt; height: 207.6pt; border: 0.95pt solid var(--ink); }
.oz-divider { left: 18.2pt; top: 170.9pt; width: 222.4pt; border-top: 0.95pt solid var(--ink); }
.oz-big, .oz-desc, .oz-row, .oz-foot { left: 17.3pt; width: 223.3pt; white-space: nowrap; }
.oz-big { top: 67.6pt; font-size: 72pt; line-height: 72pt; font-weight: 700; text-align: center; }
.oz-desc { top: 156pt; font-size: 14pt; line-height: 14pt; text-align: center; }
.oz-row { display: flex; font-size: 14pt; line-height: 14pt; }
.oz-k { flex: none; width: 67.5pt; text-align: right; font-weight: 700; }
.oz-v { padding-left: 4.5pt; overflow: hidden; }
.oz-foot { font-size: 11pt; line-height: 11pt; text-align: center; color: var(--ink-muted); }
.oz-rule { left: 4.1pt; width: 530.1pt; border-top: 1pt solid var(--ink); }
@media (max-width: 420px) { .label-sheet { zoom: 0.42; } }

@media print {
  /* Labels need the whole sheet (positions match the Excel form); other printouts get their margin from main.wrap */
  @page { size: A4 portrait; margin: 0; }
  .topbar, .no-print, .foot, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { border-color: #999; break-inside: avoid; }
  main.wrap { padding: 10mm; }
  body.print-labels main.wrap { max-width: none; gap: 0; padding: 0; }
  body.print-labels .label-sheets { display: block; }
  body.print-labels .label-sheet { zoom: 1; box-shadow: none; break-after: page; page-break-after: always; }
  body.print-labels .label-group { display: block; }
  body.print-labels .label-group:last-child .label-sheet:last-child { break-after: auto; page-break-after: auto; }
}
