/* Motion Tech PRA. Visual identity of the MotionTech website (css/commun/legal.css, product.css, site-chrome.css):
   navy #0A2C54, cyan #1ACDD8, mist and paper backgrounds, Montserrat, pill buttons, 18px cards.
   Layout: navy sticky header, mist-to-paper band behind each page head, white cards and tables on paper. */
:root {
  --navy: #0A2C54;
  --navy-2: #133A6B;
  --cyan: #1ACDD8;
  --cyan-soft: #7DE3EA;
  --cyan-ink: #087983;
  --mist: #DEFBFF;
  --mist-2: #EEFCFE;
  --paper: #F4FBFD;
  --white: #FFFFFF;
  --muted: #51647D;
  --line: rgba(10, 44, 84, .12);
  --line-2: rgba(10, 44, 84, .2);
  --field: #C5CFDB;
  --field-strong: #7A8799;
  --ok: #157A4A;
  --ok-bg: #E2F5EB;
  --bad: #B42318;
  --bad-bg: #FEF2F2;
  --bad-line: #FECACA;
  --warn: #8A5300;
  --warn-bg: #FFF3D6;
  --warn-line: #F5D58C;
  --info: #3E5BC4;
  --info-bg: #E9EEFC;
  --ai: #7A1BC9;
  --ai-bg: #F3E8FD;
  --grey-bg: #EDF1F5;
  --font: 'Montserrat', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 18px;
  --r-lg: 28px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 44, 84, .06), 0 14px 32px -14px rgba(10, 44, 84, .22);
  --shadow-lg: 0 34px 64px -26px rgba(10, 44, 84, .45);
  --ring: 0 0 0 3px rgba(26, 205, 216, .35);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --topbar-h: 66px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--navy); font: 500 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; vertical-align: -3px; }
a { color: var(--navy); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.boot { padding: 40px; font-weight: 700; color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
h1, h2, h3 { margin: 0; color: var(--navy); text-wrap: balance; }
h1 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 700; }
.eyebrow { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan-ink); }
.eyebrow a { color: inherit; }

/* ---------- Buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--white); color: var(--navy); font-size: 13.5px; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s, border-color .18s; }
.btn:hover { border-color: var(--cyan); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--cyan); border-color: var(--cyan); color: var(--navy); box-shadow: 0 10px 24px -12px rgba(26, 205, 216, .9); }
.btn.primary:hover { box-shadow: 0 16px 30px -14px rgba(26, 205, 216, 1); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); }
.btn.danger:hover { border-color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: var(--white); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line-2); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn.big { padding: 12px 24px; font-size: 15px; }
.link { background: none; border: 0; padding: 0; color: var(--cyan-ink); cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--field-strong); background: var(--white); color: var(--navy); border-radius: 12px; padding: 10px 13px; font-size: 14.5px; font-weight: 500; }
.textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.select.sm { width: auto; min-width: 84px; padding: 6px 10px; border-radius: 10px; font-size: 13px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--cyan); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: #8A98AB; }
label.field { display: grid; gap: 6px; align-content: start; }
/* Fields side by side (a grid made only of "label + box" fields): the labels share one line and the boxes start
   level, even when a label wraps. */
.grid-2:not(:has(> :not(label.field:has(> :nth-child(2):last-child)))) > label.field { grid-row: span 2; grid-template-rows: subgrid; row-gap: 6px; }
.grid-2:not(:has(> :not(label.field:has(> :nth-child(2):last-child)))) > label.field > span { align-self: end; }
.grid-2:not(:has(> :not(label.field:has(> :nth-child(2):last-child)))) > label.field > :last-child { align-self: start; }
label.field > span, .field-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.error-text { margin: 0; color: var(--bad); font-weight: 700; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); }
/* A choice inside a field keeps its own width (not stretched across the whole box). */
.field > .seg { justify-self: start; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.seg button:hover { color: var(--navy); }
.seg button[aria-pressed="true"] { background: var(--navy); color: var(--white); }

/* ---------- Header ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--navy); color: var(--white); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.topbar :focus-visible { outline-color: var(--cyan); }
.topbar-in { max-width: 1720px; margin: 0 auto; padding: 0 24px; min-height: 66px; display: flex; align-items: center; gap: 12px 26px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); flex-shrink: 0; }
.brand img { height: 32px; width: auto; display: block; }
.brand .app-chip { font-size: 11px; font-weight: 800; letter-spacing: .12em; padding: 5px 9px; border-radius: 999px; background: var(--cyan); color: var(--navy); }
.nav { display: flex; gap: 4px 22px; flex-wrap: wrap; }
.nav a { position: relative; padding: 6px 0; color: rgba(255, 255, 255, .86); text-decoration: none; font-size: 14px; font-weight: 600; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -1px; height: 2px; background: var(--cyan); transition: right .3s var(--ease); }
.nav a:hover { color: var(--white); }
.nav a:hover::after, .nav a.active::after { right: 0; }
.nav a.active { color: var(--white); }
.topbar .spacer { flex: 1; }
.topbar .who { color: rgba(255, 255, 255, .9); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.topbar .who:hover { color: var(--white); text-decoration: underline; }
.topbar .btn { background: rgba(255, 255, 255, .06); color: var(--white); border-color: rgba(255, 255, 255, .3); }
.topbar .btn:hover { border-color: var(--cyan); }
.mode-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); color: var(--white); }
.mode-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #F5C04E; }
.mode-badge.live::before { background: #4ADE80; }
.lang { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; }
.lang button { background: transparent; border: 0; color: rgba(255, 255, 255, .78); padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--cyan); color: var(--navy); }

/* ---------- Page ---------- */
main { background: linear-gradient(180deg, var(--mist) 0, var(--paper) 280px) no-repeat; min-height: calc(100vh - 66px); }
.page { max-width: 1720px; margin: 0 auto; padding: 32px 24px 72px; display: grid; gap: 22px; }
/* Grid children may shrink: a wide table scrolls inside its box instead of widening the whole page. */
.page > * { min-width: 0; }
.page.narrow { max-width: 1060px; }
.page.medium { max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; padding-bottom: 4px; }
.page-head .titles { display: grid; gap: 8px; }
.page-head .titles > p { font-size: 15px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.panel-pad { padding: 22px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.banner { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; padding: 14px 18px; border-radius: 14px; border: 1px solid; }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.banner.info { background: var(--mist-2); border-color: var(--cyan-soft); }
.banner.error { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.banner p { margin: 0; flex: 1 1 300px; }
.banner .field > span { color: var(--warn); }
.banner .select, .banner .input { padding: 8px 12px; font-size: 13.5px; }

/* ---------- Sign-in ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 26px; padding: 32px 16px; background: radial-gradient(1200px 600px at 50% -10%, #17508F 0, transparent 60%), var(--navy); }
.auth-logo { height: 44px; width: auto; }
.auth-card { width: min(460px, calc(100vw - 32px)); background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.auth-card header { padding: 28px 30px 0; display: grid; gap: 8px; }
.auth-card form { padding: 20px 30px 30px; display: grid; gap: 16px; }
.auth-card .btn.big { width: 100%; }
.steps { display: flex; gap: 6px; margin-top: 8px; }
.steps span { height: 4px; flex: 1; border-radius: 2px; background: var(--grey-bg); }
.steps span.on { background: var(--cyan); }
.qr { display: grid; justify-items: center; gap: 8px; padding: 14px; background: var(--mist-2); border-radius: var(--r); }
.qr img { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 12px; }
.secret { font-size: 14px; font-weight: 700; letter-spacing: .08em; word-break: break-all; text-align: center; color: var(--navy); margin: 0; }
.code-input { font-size: 28px; font-weight: 700; letter-spacing: .4em; text-align: center; padding: 14px; }

/* ---------- Tables ---------- */
/* Tables never scroll on their own: only the page scrolls, and the header row sticks under the top bar. */
.table-wrap { overflow: clip; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.grid th, table.grid td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid thead th { position: sticky; top: var(--topbar-h); z-index: 3; background: var(--navy); color: var(--white); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; padding-block: 13px; }
table.grid tbody tr { transition: background-color .12s; }
table.grid tbody tr:hover td { background-color: var(--mist-2); }
table.grid td.sticky, table.grid th.sticky { position: sticky; left: 0; z-index: 2; background: var(--white); box-shadow: 1px 0 0 var(--line); }
table.grid thead th.sticky { z-index: 4; background: var(--navy); }
table.grid tr.not-found td { background: var(--bad-bg); color: var(--bad); }
table.grid.clickable tbody tr { cursor: pointer; }
.num { text-align: right; }
.serial-cell { display: grid; gap: 6px; min-width: 132px; }
.serial { font-size: 14px; font-weight: 800; color: var(--navy); text-decoration: none; white-space: nowrap; letter-spacing: .01em; }
a.serial { text-decoration: underline; text-decoration-color: var(--cyan); text-decoration-thickness: 2px; }
a.serial:hover { color: var(--cyan-ink); }
.serial-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.serial-line { display: inline-flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }

/* DIGITAL PRA: fixed column widths so the 11 columns fit the screen width */
/* Every table must fit the page: long headers and labels wrap instead of widening the page. */
.page.full > *, .pra-content > *, .pack-view > * { min-width: 0; }
table.grid thead th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
table.grid.fixed { table-layout: fixed; }
table.grid.fixed thead th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
table.grid.fixed th, table.grid.fixed td { padding-inline: 8px; }
table.grid.fixed .cell, table.grid.fixed .serial-cell { min-width: 0; }
.digital .c-serial { width: 152px; }
.digital .c-deadline { width: 128px; }
.digital .c-country { width: 140px; }
.digital .c-isWarranty { width: 100px; }
.digital .c-toBeSent { width: 170px; }
.digital .c-shippingGroup { width: 100px; }
.cell.size-field { display: grid; grid-template-columns: auto 120px; align-items: center; gap: 4px 12px; min-width: 0; }
.size-field .size-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.size-field .cell-meta { grid-column: 1 / -1; margin-top: 0; }
.deadline-cell { display: grid; gap: 6px; justify-items: start; padding-top: 7px; min-width: 0; }
.deadline-cell .pill.status { font-size: 11px; padding: 4px 8px; }

/* Editable cells */
.cell { position: relative; min-width: 160px; }
.cell.w-sm { min-width: 100px; }
.cell.w-md { min-width: 140px; }
.cell.w-lg { min-width: 240px; }
/* A list sized to its longest choice (transporter, carrier, ticket status): the column widens instead of cutting it. */
.cell.fit { min-width: 0; }
.cell.fit select { width: auto; min-width: 100%; }
.cell textarea, .cell input, .cell select { width: 100%; border: 1px solid var(--field); background: var(--white); color: var(--navy); border-radius: var(--r-sm); padding: 7px 10px; font-size: 13.5px; font-weight: 500; line-height: 1.4; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.cell textarea { resize: none; min-height: 36px; overflow: hidden; }
.cell textarea:hover, .cell input:hover, .cell select:hover { border-color: var(--field-strong); }
.cell textarea:focus, .cell input:focus, .cell select:focus { outline: none; border-color: var(--cyan); box-shadow: var(--ring); }
.cell.manual textarea, .cell.manual input, .cell.manual select { background: var(--mist-2); border-color: var(--cyan); }
.cell.bad input, .cell.bad select { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.cell-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.cell-meta a { color: var(--cyan-ink); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.conflict { background: var(--info); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--white); color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tag.ai { color: var(--ai); background: var(--ai-bg); border-color: #DDC2F7; }
.tag.manual { color: var(--cyan-ink); background: var(--mist); border-color: var(--cyan-soft); }
.tag.waiting { color: #7A4300; background: var(--warn-bg); border-color: var(--warn-line); }
.chip.packed { background: var(--ok-bg); color: var(--ok); }
.nav-count { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--cyan); color: var(--navy); font-size: 11px; font-weight: 800; }
.tag.conflict { color: var(--info); background: var(--info-bg); border-color: #C4D0F6; }
.pill { display: inline-block; max-width: 100%; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
/* Long texts (HubSpot statuses, warnings) wrap inside a rounded box: a 999px radius on several lines makes an oval. */
.pill.status, table.grid .pill { white-space: normal; overflow-wrap: break-word; overflow: visible; border-radius: 9px; text-align: left; }
.pill.yes { background: var(--ok-bg); color: var(--ok); }
.pill.no { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.grey { background: var(--grey-bg); color: var(--muted); }
.pill.status { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.chip { padding: 3px 9px; border-radius: 999px; background: var(--mist); color: var(--navy); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.suggest { padding: 5px 11px; border: 1.5px dashed var(--cyan); border-radius: 999px; background: transparent; color: var(--cyan-ink); font-size: 12.5px; font-weight: 800; cursor: pointer; margin-top: 6px; }
.suggest:hover { background: var(--mist); }
.warn-icon { color: var(--warn); font-size: 12px; font-weight: 800; }
.transporter { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--navy); background: var(--grey-bg); }
.transporter.error { background: var(--bad-bg); color: var(--bad); }
.amount-missing input, .amount-unneeded input { background: var(--bad-bg) !important; border-color: var(--bad) !important; }
.amount-na input { background: var(--grey-bg) !important; border-color: var(--grey-bg) !important; }
.bin { display: inline-grid; place-items: center; min-width: 50px; height: 38px; padding: 0 10px; border-radius: 12px; background: var(--mist); border: 1px solid var(--cyan-soft); color: var(--navy); font-size: 16px; font-weight: 800; }
.bin.none { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); font-size: 11.5px; }
.dns { display: inline-block; max-width: 100%; padding: 4px 10px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); font-size: 11.5px; font-weight: 800; white-space: nowrap; vertical-align: middle; }

/* ---------- Full-width pages (PRA, PRA list, log): tables and tab bar run edge to edge ---------- */
.page.full { max-width: none; padding: 28px 0 64px; }
.page.full > .page-head, .page.full > .pra-head, .page.full > .pra-banners, .page.full > .panel,
.page.full > div > .panel, .page.full > div > p, .page.full > .page-foot, .pra-content .summary, .pra-content .phys-grid, .pra-content .pack-bar, .pra-content > .panel { margin-inline: 24px; }
.page.full .table-wrap { border-radius: 0; border-inline: 0; box-shadow: none; }
.page.full table.grid th:first-child, .page.full table.grid td:first-child { padding-left: 24px; }
.page.full table.grid th:last-child, .page.full table.grid td:last-child { padding-right: 24px; }
.pra-content { display: grid; gap: 14px; }
.page.full > .tabs { display: flex; justify-self: stretch; gap: 2px; margin: 0; padding: 0 24px; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; box-shadow: none; scrollbar-width: none; }
.page.full > .tabs::-webkit-scrollbar { display: none; }
.page.full > .tabs button { border-radius: 0; padding: 13px 16px 11px; margin-bottom: -1px; border-bottom: 3px solid transparent; background: transparent; }
.page.full > .tabs button:hover { background: transparent; color: var(--navy); }
.page.full > .tabs button[aria-selected="true"] { background: transparent; color: var(--navy); border-bottom-color: var(--cyan); }
.page.full > .tabs button[aria-selected="true"] .count { background: var(--navy); color: var(--white); }

/* Narrow screens: the table keeps readable columns and scrolls sideways (never up and down). */
@media (max-width: 1279px) {
  .table-wrap { overflow-x: auto; }
  table.grid thead th { top: 0; }
  table.grid.fixed { min-width: 1240px; }
}

/* ---------- Partner liners, PACKAGING sheet ---------- */
.cell-meta.waiting { color: var(--bad); font-weight: 700; }
.pack-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin-inline: 24px; }
.pack-view { display: grid; gap: 14px; }
.action-bar { justify-content: flex-end; }
.requested { margin: 0; color: var(--ok); font-size: 12.5px; font-weight: 700; }
.pack-info { max-width: 620px; white-space: pre-wrap; }
.group-letter { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 999px; background: var(--navy); color: var(--white); font-weight: 800; }
.print-head, .print-only { display: none; }
.check-box { display: inline-block; width: 18px; height: 18px; border: 1.5px solid #000; border-radius: 3px; }

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { background: #fff; }
  body { color: #000; font-size: 10.5pt; }
  .topbar, .pra-head, .pra-banners, .tabs, .no-print, #toasts, .overlay { display: none !important; }
  main { background: none; min-height: 0; }
  .page, .page.full { padding: 0; gap: 0; max-width: none; }
  .print-head { display: block; margin: 0 0 5mm; }
  .print-head h1 { font-size: 17pt; color: #000; }
  .print-head p { margin: 2px 0 0; font-size: 10pt; color: #333; }
  .print-head .print-brand { font-size: 9pt; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #000; }
  th.print-only, td.print-only { display: table-cell; text-align: center; width: 22mm; }
  .table-wrap { border: 0; box-shadow: none; overflow: visible; border-radius: 0; }
  table.grid { font-size: 10.5pt; }
  table.grid thead th { position: static; background: #fff; color: #000; border-bottom: 2px solid #000; font-size: 9pt; }
  table.grid th, table.grid td, .page.full table.grid th:first-child, .page.full table.grid td:first-child,
  .page.full table.grid th:last-child, .page.full table.grid td:last-child { padding: 5px 7px; border-bottom: 1px solid #999; }
  table.grid thead th, .page.full table.grid thead th:first-child, .page.full table.grid thead th:last-child { border-bottom: 2px solid #000; }
  table.grid tbody tr:last-child td { border-bottom: 1px solid #999; }
  table.grid tbody tr:hover td { background: none; }
  tr { break-inside: avoid; }
  .serial { color: #000; }
  .bin { background: #fff; border: 1.5px solid #000; color: #000; height: 30px; }
  .dns { background: #fff; color: #000; border: 1.5px solid #000; }
  .pill, .pill.yes, .pill.ok, .pill.no, .pill.warn, .chip { background: #fff; color: #000; border: 1px solid #666; }
  .group-letter { background: #fff; color: #000; border: 1.5px solid #000; }
}

/* Packaging sheet, portrait (D13) */
@media print {
  /* Portrait page for this sheet only: the button adds body.packaging-print right before window.print(). */
  @page pack-portrait { size: A4 portrait; margin: 10mm 12mm; }
  body.packaging-print { page: pack-portrait; }
  body.packaging-print .pack-view { display: block; }

  /* Small two-sided header line above the table (title/date/site left, count + printed by right). */
  body.packaging-print .print-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1mm 4mm; margin: 0 0 2mm; font-size: 9pt; color: #000; }
  body.packaging-print .print-head-title { font-weight: 700; }
  body.packaging-print .print-head-when { white-space: nowrap; }

  /* The printed sheet: one table, 45 lines at most, header repeated on the next page if needed. */
  body.packaging-print table.print-sheet { display: table; width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 11pt; line-height: 1.2; color: #000; border: 1px solid #4A5568; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.packaging-print .print-sheet thead { display: table-header-group; }
  body.packaging-print .print-sheet th, body.packaging-print .print-sheet td { border: 0.5pt solid #9AA3AE; padding: 0 3pt; height: 5.8mm; vertical-align: middle; overflow-wrap: anywhere; }
  body.packaging-print .print-sheet tr { break-inside: avoid; }
  body.packaging-print .print-sheet thead th { background: var(--navy); color: #fff; font-weight: 700; font-size: 10.5pt; text-align: center; }

  /* Column widths: Serial, Send?, Packaging info (widest), Bac, then two narrow print-only columns. */
  body.packaging-print .print-sheet .w-serial { width: 22%; }
  body.packaging-print .print-sheet .w-send { width: 17%; text-align: center; white-space: nowrap; }
  body.packaging-print .print-sheet .w-info { width: 49%; }
  body.packaging-print .print-sheet .w-bin { width: 12%; text-align: center; font-weight: 700; }

  /* "TO BE SENT" plain text; "DO NOT SEND" on a full pink cell with dark text. */
  body.packaging-print .print-sheet td.w-serial { font-weight: 700; }
  body.packaging-print .print-sheet td.w-send.dns-cell { background: #F6C6D0; color: #4A0F18; font-weight: 700; }

  /* Packaging info wraps; chips stay under the text, small. */
  body.packaging-print .print-sheet .ps-chips { display: flex; flex-wrap: wrap; gap: 2pt; margin-top: 1pt; }
  body.packaging-print .print-sheet .ps-chip { font-size: 8.5pt; color: #444; }
  body.packaging-print .print-sheet .check-box { width: 5mm; height: 5mm; border: 1.5pt solid #000; border-radius: 1px; }
}

/* ---------- Production day: CH / HU ---------- */
:root { --site-ch: #0A2C54; --site-hu: #5772D2; --site-hu-bg: #ECEFFB; }
.site-badge.site-HU { background: var(--site-hu); }
.assign { display: grid; gap: 12px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.assign-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 20px; flex-wrap: wrap; }
.assign-head > div:first-child { display: grid; gap: 4px; }
.assign-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.count-pill { padding: 6px 12px; border-radius: 999px; background: var(--grey-bg); color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: .03em; }
.count-pill.site-CH { background: var(--site-ch); color: var(--white); }
.count-pill.site-HU { background: var(--site-hu); color: var(--white); }
.assign-list { display: grid; gap: 6px; max-height: 46vh; overflow: auto; padding-right: 4px; }
.assign-row { display: grid; grid-template-columns: minmax(110px, max-content) minmax(90px, 1fr) minmax(0, auto) auto; gap: 12px; align-items: center; padding: 8px 10px 8px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.assign-row.skipped { opacity: .55; }
@media (max-width: 640px) { .assign-row { grid-template-columns: 1fr auto; } }
.seg.seg-sm { padding: 3px; }
.seg.seg-sm button { padding: 5px 12px; font-size: 12px; }
.seg button.site-HU[aria-pressed="true"] { background: var(--site-hu); }
.seg button.site-skip[aria-pressed="true"] { background: var(--grey-bg); color: var(--muted); }
.day-switch { display: inline-flex; gap: 4px; padding: 4px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; }
.day-switch a, .day-switch span { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-decoration: none; color: var(--muted); white-space: nowrap; }
.day-switch a:hover { background: var(--mist-2); color: var(--navy); }
.day-switch .current.site-CH { background: var(--site-ch); color: var(--white); }
.day-switch .current.site-HU { background: var(--site-hu); color: var(--white); }
.day-switch span.none { color: #9AA6B6; font-weight: 600; }
.btn.move { color: var(--site-hu); border-color: #C9D2F4; }
.btn.move.to-CH { color: var(--site-ch); border-color: var(--line-2); }

/* ---------- PRA ---------- */
.pra-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; }
.pra-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pra-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.site-badge { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--navy); color: var(--white); font-size: 12px; font-weight: 800; letter-spacing: .08em; vertical-align: middle; }
h1 .site-badge { font-size: 13px; }
.presence { display: inline-flex; gap: 7px; align-items: center; color: var(--ok); }
.presence .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(21, 122, 74, .15); }
.tabs { display: inline-flex; gap: 4px; padding: 5px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; justify-self: start; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: .05em; cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s; }
.tabs button:hover { color: var(--navy); background: var(--mist-2); }
.tabs button[aria-selected="true"] { background: var(--navy); color: var(--white); }
.tabs .count { padding: 2px 8px; border-radius: 999px; background: var(--grey-bg); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0; }
.tabs button[aria-selected="true"] .count { background: var(--cyan); color: var(--navy); }
.summary { display: flex; gap: 12px; flex-wrap: wrap; }
.summary .stat { min-width: 132px; padding: 14px 18px; display: grid; gap: 2px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.summary .stat b { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--navy); }
.summary .stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.phys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 16px; }
/* min-width: 0 everywhere: a long badge or label wraps inside the card instead of pushing it wider than its column.
   Passed / Failed sit at the bottom, level across a row of cards. */
.phys-card { display: flex; flex-direction: column; min-width: 0; gap: 14px; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s; }
.phys-card > * { min-width: 0; }
.phys-card.passed { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok), var(--shadow); }
.phys-card.failed { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad), var(--shadow); }
.phys-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.phys-card .serial { font-size: 17px; }
.phys-card .badges { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin-top: -6px; }
.phys-card .ap { margin: 0; padding: 11px 14px; min-height: 44px; background: var(--mist-2); border: 1px solid var(--mist); border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--navy); white-space: pre-wrap; overflow-wrap: anywhere; }
.phys-card .ap.empty { background: var(--paper); border-color: var(--line); color: var(--muted); font-weight: 500; font-style: italic; }
.phys-card .cell.size-field { grid-template-columns: minmax(0, 1fr) 132px; min-width: 0; padding: 2px 2px 0; }
.phys-card .size-field input { text-align: right; font-size: 15px; font-weight: 700; padding-block: 9px; }
.phys-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: auto; }
.phys-btns button { min-width: 0; padding: 13px 10px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--white); color: var(--navy); font-size: 15px; font-weight: 800; cursor: pointer; overflow-wrap: anywhere; transition: background-color .15s, border-color .15s, color .15s, opacity .15s; }
.phys-btns button.pass:not(:disabled):not([aria-pressed="true"]):hover { border-color: var(--ok); color: var(--ok); }
.phys-btns button.fail:not(:disabled):not([aria-pressed="true"]):hover { border-color: var(--bad); color: var(--bad); }
.phys-btns button.pass[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: var(--white); }
.phys-btns button.fail[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: var(--white); }
.phys-btns button[aria-pressed="true"]:not(:disabled):hover { filter: brightness(1.08); }
.phys-btns button:disabled { cursor: not-allowed; opacity: .42; }
.phys-btns button[aria-pressed="true"]:disabled { opacity: 1; }
.qc-unsigned { margin: -4px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 12.5px; font-weight: 700; }
.qc-hint { margin: -6px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.qc-hint.off { visibility: hidden; }
/* Backup replacement procedure, on the card of a backup liner */
.bkp-box { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); }
.bkp-box .btn { justify-self: start; }
.qc-statement { display: flex; align-items: baseline; gap: 8px; margin: 0 24px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

/* Points ticked by the controller, on the card and in the dialog */
.qc-box { display: grid; gap: 6px; padding: 12px 12px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.qc-box.signed { background: var(--white); }
.qc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 0 4px 4px; }
.qc-title { flex: 1 1 auto; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.qc-count { padding: 2px 9px; border-radius: 999px; background: var(--grey-bg); color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.qc-count.done { background: var(--ok-bg); color: var(--ok); }
.qc-count.bad { background: var(--bad-bg); color: var(--bad); }
.qc-head .btn.sm { padding: 4px 11px; }
.qc-ticks { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.qc-tick { position: relative; display: flex; align-items: flex-start; gap: 11px; padding: 8px 6px; border-radius: 10px; font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--navy); cursor: pointer; transition: background-color .12s; }
label.qc-tick:hover { background: var(--mist-2); }
label.qc-tick:has(input:disabled) { cursor: default; background: transparent; }
.qc-tick > span:not(.box) { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.qc-tick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.qc-tick .box { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 0; border: 1.5px solid var(--field-strong); border-radius: 6px; background: var(--white); transition: background-color .12s, border-color .12s, box-shadow .12s; }
.qc-tick .box::after { content: ""; width: 5px; height: 10px; margin-top: -2px; border: solid var(--white); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); opacity: 0; }
.qc-tick input:checked + .box, .qc-tick .box.on { background: var(--ok); border-color: var(--ok); }
.qc-tick input:checked + .box::after, .qc-tick .box.on::after { opacity: 1; }
.qc-tick input:focus-visible + .box { border-color: var(--cyan); box-shadow: var(--ring); }
.qc-tick input:disabled:not(:checked) + .box { background: var(--grey-bg); }
.qc-tick .box.nok { background: var(--bad); border-color: var(--bad); }
.qc-tick .box.nok::after { content: "✕"; width: auto; height: auto; margin: 0; border: 0; transform: none; opacity: 1; color: var(--white); font-size: 11px; font-weight: 800; line-height: 1; }
.qc-tick.nok { color: var(--bad); }
.qc-box.failing .qc-tick input:not(:checked) + .box { border-color: var(--bad); background: var(--bad-bg); }
.qc-box.failing .qc-tick:has(input:not(:checked)) { color: var(--bad); }
.qc-tick .nok-label { flex: none; font-size: 11px; letter-spacing: .06em; }
.qc-ticks.signed .qc-tick { cursor: default; }
.seg button.pass[aria-pressed="true"] { background: var(--ok); }
.seg button.fail[aria-pressed="true"] { background: var(--bad); }

/* ---------- Dialogs ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5, 18, 38, .5); }
.modal { width: min(780px, 100%); max-height: 92vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--white); color: var(--navy); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal.wide { width: min(1020px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 26px; background: linear-gradient(180deg, var(--mist) 0, var(--white) 100%); border-bottom: 1px solid var(--line); }
.modal .body { padding: 20px 26px; overflow: auto; display: grid; gap: 16px; align-content: start; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 26px; border-top: 1px solid var(--line); }
dl.kv { display: grid; grid-template-columns: minmax(150px, max-content) minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); font-weight: 700; }
dl.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Lists to paste in the Zaps (Integrations): the name above its list, the list wraps after each comma. */
.zap-lists { margin-top: 18px; display: grid; gap: 8px; }
.zap-lists dl.kv { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.zap-lists dl.kv dd { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.zap-lists dl.kv dd code { flex: 1 1 240px; min-width: 0; white-space: normal; word-break: break-all; }
.raw { margin: 0; padding: 10px 13px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; font: 500 13.5px/1.5 var(--font); white-space: pre-wrap; }
.list-plain { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.picked { font-weight: 800; }
.temp-pass { padding: 16px; border-radius: var(--r); background: var(--mist); border: 1px dashed var(--cyan); color: var(--navy); font-size: 22px; font-weight: 800; letter-spacing: .06em; text-align: center; user-select: all; }

/* Details: exact HubSpot values */
.exact-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 20px; flex-wrap: wrap; }
.exact-head > div:first-child { display: grid; gap: 4px; max-width: 640px; }
.exact-group { border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.exact-group > summary { cursor: pointer; padding: 10px 14px; font-weight: 800; color: var(--navy); }
.exact-group[open] > summary { border-bottom: 1px solid var(--line); }
.exact-group > :not(summary) { margin: 10px 14px; }
.exact { display: grid; gap: 6px; }
.exact + .exact { border-top: 1px dashed var(--line-2); padding-top: 10px; }
.exact-id { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.exact-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.exact-table th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--line); }
.exact-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.exact-table td:first-child { width: 30%; font-weight: 600; }
.exact-table td:nth-child(2) { width: 26%; color: var(--muted); word-break: break-all; }
.exact-value { margin: 0; font: 500 13px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--navy); }
.empty-value { color: #8A98AB; font-style: italic; }

/* ARCHIVING: one box per deal in the confirmation window */
.tag.archived { color: var(--ok); background: var(--ok-bg); border-color: #BFE6D0; }
.tag.emptied { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.arch-deal { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.arch-deal.blocked { background: var(--grey-bg); }
.arch-deal-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.arch-table td:first-child { width: 28%; }
.arch-table td:nth-child(2), .arch-table td:nth-child(3) { width: 36%; color: var(--navy); word-break: normal; }
.arch-kept summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.arch-kept ul { margin-top: 6px; }
/* Fit narrow windows: the tables wrap instead of scrolling sideways. */
.arch-table, .arch-tickets { table-layout: fixed; }
.arch-table th, .arch-table td, .arch-tickets th, .arch-tickets td { overflow-wrap: anywhere; }
.modal .body > div { min-width: 0; }
.arch-tickets td { vertical-align: middle; }
.arch-tickets td:first-child { width: auto; }
.arch-tickets td:nth-child(2) { color: var(--navy); word-break: break-all; }
/* "On hold / Missing info" window: one line per HubSpot option */
.hold-options { display: grid; gap: 6px; }
.hold-option { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.hold-option:has(input:checked) { border-color: var(--cyan-soft); background: var(--mist-2); }
.mono-input input { font-family: ui-monospace, Menlo, Consolas, monospace; }
/* Room for a whole UPS or FedEx number (up to 18 characters). */
.cell.mono-input { min-width: 184px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
/* Signed quality check */
.qc-nc { display: grid; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bad-bg); }
.qc-nc h3 { margin: 0; color: var(--bad); }
.qc-sign { display: grid; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--mist); }
.qc-sign p { margin: 0; }
.signed-line { margin: 0; font-size: 12px; color: var(--muted); }
.nc-line { color: var(--bad); font-weight: 700; }
.q-check { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.q-check:last-child { border-bottom: 0; }
.q-check p { margin: 0; }
/* Waiting list: two parts, kept apart */
.wait-part { display: grid; gap: 10px; }
.wait-head { display: grid; gap: 2px; margin-inline: 24px; padding-left: 12px; border-left: 4px solid var(--cyan); }
.wait-part.other .wait-head { border-left-color: var(--warn-line); }
.wait-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.wait-head .count { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--mist); color: var(--cyan-ink); }
.wait-head .hint { margin: 0; }
@media (max-width: 760px) { .wait-head { margin-inline: 16px; } }

/* ---------- Settings, reports ---------- */
.rules { display: grid; gap: 8px; }
.rule { display: grid; grid-template-columns: 172px minmax(130px, 1fr) minmax(130px, 1fr) 76px; gap: 8px; align-items: center; }
/* Same last column on every line (the first rule has no "up" button), so the fields line up. */
.rule > .row-actions { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
@media (max-width: 680px) {
  /* Phone: kind of rule and its buttons on one line, then the value and the result each on a full line. */
  .rule { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 10px; border-bottom: 1px dashed var(--line-2); }
  .rule > :nth-child(1) { order: 1; }
  .rule > :nth-child(4) { order: 2; }
  .rule > :nth-child(2) { order: 3; grid-column: 1 / -1; }
  .rule > :nth-child(3) { order: 4; grid-column: 1 / -1; }
}
.color-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px auto; gap: 8px; align-items: center; }
.color-row input[type="color"] { width: 64px; height: 40px; padding: 3px; border: 1px solid var(--field-strong); border-radius: 12px; background: var(--white); }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; background: rgba(244, 251, 253, .92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.report { display: grid; gap: 10px; font-size: 13.5px; }
.ok { color: var(--ok); font-weight: 800; }
.ko { color: var(--bad); font-weight: 800; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 12px 18px; border-radius: 14px; background: var(--navy); color: var(--white); font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow-lg); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--bad); }

@media (max-width: 760px) {
  /* Phone: the bar scrolls away with the page (sticky, it took a third of the screen) and the menu is one line that scrolls sideways. */
  .topbar { position: static; }
  .topbar-in { padding: 10px 16px 0; gap: 8px 10px; min-height: 0; }
  .brand img { height: 26px; }
  .topbar .spacer { flex: 1 1 0; }
  .topbar .who { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .btn { padding: 6px 12px; font-size: 12.5px; }
  .mode-badge { padding: 5px 9px; font-size: 10px; }
  .nav { order: 10; flex: 1 0 100%; flex-wrap: nowrap; gap: 20px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .summary .stat { flex: 1 1 0; min-width: 92px; padding: 12px 14px; }
  .page { padding: 20px 16px 56px; }
  .page.full > div > .panel, .page.full > div > p, .page.full > .page-foot, .pra-content .summary, .pra-content .phys-grid, .pra-content .pack-bar, .pra-content > .panel { margin-inline: 16px; }
  .qc-statement { margin-inline: 16px; }
  .table-wrap { max-height: none; }
  .tabs { border-radius: var(--r); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .btn:hover { transform: none; }
}

.advice-item { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }

/* Advice: follow-up tab (D3) */
.follow-tab { display: grid; gap: 12px; }
.follow-sub { margin: 0 24px; }
table.grid.follow-table th, table.grid.follow-table td { text-align: center; }
table.grid.follow-table th { white-space: normal; line-height: 1.3; }
table.grid.follow-table th:first-child, table.grid.follow-table td:first-child { text-align: left; }
.follow-table th, .follow-table td { min-width: 68px; }
.follow-table th:first-child, .follow-table td:first-child { min-width: 130px; }
.follow-cell.has-advice { cursor: pointer; }
.follow-cell.has-advice:hover { background: var(--mist); }
.follow-cell.has-advice:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 760px) {
  .follow-sub { margin-inline: 16px; }
  .follow-scroll { overflow-x: auto; }
  .follow-table { min-width: 720px; }
}

/* Advice: accuracy tab (D7) */
.adv-stats-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-inline: 24px; }
.adv-stats .panel { margin-inline: 24px; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.table th, table.table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table thead th { background: var(--navy); color: var(--white); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; padding-block: 13px; }
table.table tbody tr:hover td { background-color: var(--mist-2); }
.adv-judge { display: grid; gap: 10px; }
.adv-judge-item { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.adv-judge-head { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.adv-judge-lines { display: grid; gap: 2px; }
.adv-judge-item p { margin: 0; }
.adv-judge-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1279px) { table.table { min-width: 900px; } }
@media (max-width: 760px) { .adv-stats-bar, .adv-stats .panel { margin-inline: 16px; } }

/* Advice: lines used by the to-do panel */
.advice-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--line-2); min-width: 0; }
.advice-line:first-child { border-top: 0; padding-top: 0; }
.advice-line-main { display: grid; gap: 6px; flex: 1 1 340px; min-width: 0; }
.advice-line-top { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; min-width: 0; }
.advice-line-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Advice: to-do panel (D10) */
.pra-content .todo-panel { margin-inline: 24px; }
@media (max-width: 760px) { .pra-content .todo-panel { margin-inline: 16px; } }
.todo-closed { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.todo-head { display: grid; gap: 10px; }
.todo-block { display: grid; gap: 10px; }
.todo-block-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.todo-missing { display: grid; gap: 2px; }
.todo-done { display: grid; gap: 8px; }
.todo-done-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.todo-done-list { display: grid; gap: 4px; }
.todo-done-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
