/* ==========================================================================
   Sổ Thí Nghiệm Phú Thành (buiducthinh) — shared mockup stylesheet
   One file for every screen: tokens, base, shell, components, entry grid,
   A4 documents, phone frame. Plain CSS, no remote assets.

   Colour logic (PRODUCT.md: "ít màu, màu chỉ dùng để báo trạng thái"):
   - graphite neutrals tinted toward cobalt (hue 262)
   - "pen" cobalt = what a person typed (raw measurements), primary action,
     current selection. Computed values are graphite on a sunk cell.
   - "stamp" oxblood = the lab's seal: brand mark and document stamps only
     (BẢN NHÁP, ĐÃ HỦY), never a state colour.
   - verdicts: Đạt / Không đạt / Chưa đủ số liệu / Không đánh giá always carry
     a word and a differently shaped icon (circle / square / dotted circle /
     diamond), so they survive black-and-white print and colour blindness.
   ========================================================================== */

:root {
  /* ---- neutrals ---- */
  --bg: oklch(0.972 0.004 262);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.985 0.003 262);
  --sunk: oklch(0.951 0.006 262);
  --sunk-2: oklch(0.925 0.008 262);
  --ink: oklch(0.235 0.022 262);
  --ink-2: oklch(0.375 0.02 262);
  --ink-3: oklch(0.485 0.018 262);
  --ink-inv: oklch(1 0 0);
  --line: oklch(0.905 0.007 262);
  --line-strong: oklch(0.8 0.012 262);
  --line-ink: oklch(0.62 0.015 262);

  /* ---- pen (cobalt ballpoint) ---- */
  --pen: oklch(0.47 0.165 264);
  --pen-strong: oklch(0.4 0.155 264);
  --pen-ink: oklch(0.43 0.16 264);
  --pen-tint: oklch(0.967 0.017 264);
  --pen-tint-2: oklch(0.928 0.038 264);
  --pen-line: oklch(0.8 0.075 264);

  /* ---- stamp (oxblood seal ink) ---- */
  --stamp: oklch(0.42 0.13 8);
  --stamp-tint: oklch(0.955 0.02 8);

  /* ---- verdict & state ---- */
  --pass: oklch(0.46 0.115 152);
  --pass-tint: oklch(0.955 0.035 152);
  --pass-line: oklch(0.82 0.07 152);
  --fail: oklch(0.505 0.185 27);
  --fail-ink: oklch(0.47 0.17 27);
  --fail-tint: oklch(0.958 0.025 27);
  --fail-line: oklch(0.83 0.075 27);
  --warn: oklch(0.5 0.11 68);
  --warn-tint: oklch(0.966 0.045 85);
  --warn-line: oklch(0.84 0.085 80);
  --na: oklch(0.45 0.045 262);
  --na-tint: oklch(0.955 0.012 262);
  --na-line: oklch(0.84 0.025 262);

  /* ---- type ---- */
  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --font-doc: "Times New Roman", Times, "Liberation Serif", serif;
  --fs-xs: 13px;   /* chart ticks, demo bar only */
  --fs-sm: 14px;   /* hints, meta, table headers */
  --fs-base: 15px; /* body, inputs, table cells (PRODUCT.md: >= 15px) */
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 21px;
  --fs-2xl: 25px;
  --lh: 1.5;

  /* ---- space (4px base) ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;
  --gutter: 32px;

  /* ---- radius ---- */
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 10px;
  --r-pill: 999px;

  /* ---- elevation ---- */
  --sh-1: 0 1px 2px oklch(0.235 0.022 262 / 0.06);
  --sh-2: 0 1px 2px oklch(0.235 0.022 262 / 0.05), 0 4px 12px oklch(0.235 0.022 262 / 0.06);
  --sh-pop: 0 2px 6px oklch(0.235 0.022 262 / 0.08), 0 16px 40px oklch(0.235 0.022 262 / 0.18);
  --sh-a4: 0 1px 2px oklch(0.235 0.022 262 / 0.1), 0 10px 30px oklch(0.235 0.022 262 / 0.12);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--pen);

  /* ---- layers ---- */
  --z-sticky: 10;
  --z-dropdown: 20;
  --z-topbar: 30;
  --z-scrim: 40;
  --z-dialog: 50;
  --z-toast: 60;
  --z-demo: 70;

  --topbar-h: 60px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.012em; }
h2 { font-size: var(--fs-xl); letter-spacing: -0.008em; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0; }
a { color: var(--pen-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--pen-strong); }
ul, ol { margin: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-4) 0; }
small { font-size: var(--fs-sm); }
kbd {
  font-family: var(--font-mono); font-size: 12px; padding: 1px 6px; border-radius: var(--r-1);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); color: var(--ink-3);
}
del { color: var(--ink-3); text-decoration-thickness: 1.5px; }
ins { text-decoration: none; color: var(--pen-ink); font-weight: 600; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-1); }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: var(--z-toast); background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-2); }
.skip:focus { top: 10px; color: #fff; }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code { font-family: var(--font-mono); font-size: 0.93em; letter-spacing: 0.01em; }
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.unit { color: var(--ink-3); font-weight: 400; margin-left: 2px; }
.t-sm { font-size: var(--fs-sm); }
.t-fail { color: var(--fail-ink); }
.t-pass { color: var(--pass); }
.t-warn { color: var(--warn); }
.t-pen { color: var(--pen-ink); }

/* ---- icons ---- */
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-sm { width: 15px; height: 15px; vertical-align: -2px; }
.i-lg { width: 22px; height: 22px; }
.i-xl { width: 32px; height: 32px; stroke-width: 1.5; }

/* ---- layout helpers ---- */
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: var(--sp-3); }
.stack-lg > * + * { margin-top: var(--sp-6); }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px;
  font: inherit; font-size: var(--fs-base); font-weight: 600; line-height: 1.2;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-2);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--line-ink); color: var(--ink); }
.btn:active { background: var(--sunk); }
.btn[disabled], .btn.is-disabled, .btn[aria-disabled="true"] { opacity: .48; cursor: not-allowed; }
.btn-primary { background: var(--pen); border-color: var(--pen); color: var(--ink-inv); }
.btn-primary:hover { background: var(--pen-strong); border-color: var(--pen-strong); color: var(--ink-inv); }
.btn-primary:active { background: var(--pen-strong); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--ink-inv); }
.btn-dark:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--ink-inv); }
.btn-danger { color: var(--fail-ink); border-color: var(--fail-line); }
.btn-danger:hover { background: var(--fail-tint); border-color: var(--fail); color: var(--fail-ink); }
.btn-danger-solid { background: var(--fail); border-color: var(--fail); color: #fff; }
.btn-danger-solid:hover { background: var(--fail-ink); border-color: var(--fail-ink); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunk); border-color: transparent; }
.btn-link { min-height: 0; padding: 0; border: 0; background: none; color: var(--pen-ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.btn-link:hover { background: none; color: var(--pen-strong); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: var(--fs-sm); gap: 5px; }
.btn-lg { min-height: 46px; padding: 0 20px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--sunk); color: var(--ink-2); font-size: 12.5px; display: inline-grid; place-items: center; }
.btn-primary .count { background: oklch(1 0 0 / 0.2); color: #fff; }
.btn-group { display: inline-flex; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-group .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-group .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > .label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.req::after { content: " *"; color: var(--fail-ink); }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 7px 11px;
  font: inherit; font-size: var(--fs-base); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-1);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: 1; }
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23464f62' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-ink); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-tint-2); }
.input[readonly], .input:disabled, .select:disabled, .textarea[readonly] { background: var(--sunk); color: var(--ink-2); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--fail); box-shadow: 0 0 0 3px var(--fail-tint); }
.input.is-warn { border-color: var(--warn-line); background: var(--warn-tint); }
.input.num { text-align: right; }
.input.pen { color: var(--pen-ink); font-weight: 500; }
.hint { font-size: var(--fs-sm); color: var(--ink-3); }
.error-text { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); font-weight: 600; color: var(--fail-ink); }
.warn-text { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); font-weight: 600; color: var(--warn); }
.error-text .i, .warn-text .i { margin-top: 2px; }
.ig { display: flex; align-items: stretch; }
.ig .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ig .select { border-radius: var(--r-1) 0 0 var(--r-1); border-right: 0; }
.ig .select + .input { border-radius: 0; }
.ig .addon { display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--r-1) var(--r-1) 0; background: var(--surface-2); color: var(--ink-3); font-size: var(--fs-sm); white-space: nowrap; }
.ig-pre .addon { border-left: 1px solid var(--line-strong); border-right: 0; border-radius: var(--r-1) 0 0 var(--r-1); }
.ig-pre .input { border-radius: 0 var(--r-1) var(--r-1) 0; }
.check, .radio { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: var(--fs-base); line-height: 1.4; }
.check input, .radio input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--pen); flex: none; }
.search { position: relative; }
.search > .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-4); }
.form-grid > .c-3 { grid-column: span 3; }
.form-grid > .c-4 { grid-column: span 4; }
.form-grid > .c-5 { grid-column: span 5; }
.form-grid > .c-6 { grid-column: span 6; }
.form-grid > .c-8 { grid-column: span 8; }
.form-grid > .c-9 { grid-column: span 9; }
.form-grid > .c-12 { grid-column: span 12; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunk); border-radius: var(--r-2); border: 1px solid var(--line); }
.seg a, .seg button, .seg label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-1); background: none; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; cursor: pointer; white-space: nowrap; }
.seg .is-on, .seg [aria-pressed="true"], .seg [aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* combobox (static) */
.combo { position: relative; }
.combo-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: var(--z-dropdown); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-2); box-shadow: var(--sh-pop); padding: 4px; max-height: 320px; overflow: auto; }
.combo-opt { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: var(--r-1); color: var(--ink); text-decoration: none; }
.combo-opt small { color: var(--ink-3); }
.combo-opt.is-active { background: var(--pen-tint); }
.combo-opt mark { background: var(--pen-tint-2); color: inherit; border-radius: 2px; padding: 0 1px; }
.combo-add { display: flex; align-items: center; gap: 8px; padding: 10px 11px; margin-top: 4px; border-top: 1px solid var(--line); color: var(--pen-ink); font-weight: 600; text-decoration: none; }

/* ==========================================================================
   Office shell
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 0 var(--gutter);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15.5px; letter-spacing: -0.01em; }
.brand-text small { font-size: 12.5px; color: var(--ink-3); font-family: var(--font-mono); letter-spacing: 0.01em; }

.mainnav { display: flex; align-items: stretch; height: 100%; gap: 2px; margin-left: var(--sp-3); }
.mainnav > a, .navmenu > summary {
  display: inline-flex; align-items: center; gap: 7px; height: 100%;
  padding: 0 12px; font-size: var(--fs-base); font-weight: 600; color: var(--ink-2);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer; list-style: none; white-space: nowrap;
}
.navmenu > summary::-webkit-details-marker { display: none; }
.mainnav > a:hover, .navmenu > summary:hover { color: var(--ink); background: var(--surface-2); }
.mainnav > a[aria-current="page"], .navmenu.is-current > summary { color: var(--ink); border-bottom-color: var(--pen); }
.mainnav .badge-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--pen); color: #fff; font-size: 12.5px; display: inline-grid; place-items: center; }
.navmenu { position: relative; display: flex; }
.navmenu > summary .i { width: 14px; height: 14px; color: var(--ink-3); transition: transform .15s var(--ease); }
.navmenu[open] > summary .i { transform: rotate(180deg); }
.navmenu-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-dropdown);
  min-width: 260px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-2); box-shadow: var(--sh-pop);
}
.navmenu-pop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-1); color: var(--ink); text-decoration: none; font-weight: 500; }
.navmenu-pop a .i { color: var(--ink-3); }
.navmenu-pop a:hover { background: var(--sunk); }
.navmenu-pop a[aria-current="page"] { background: var(--pen-tint); color: var(--pen-ink); }
.navmenu-pop a[aria-current="page"] .i { color: var(--pen-ink); }
.navmenu-pop .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.navmenu-pop .pop-note { padding: 6px 10px 4px; font-size: var(--fs-sm); color: var(--ink-3); }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }
.gsearch { position: relative; width: 236px; }
.gsearch .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.gsearch input { width: 100%; height: 38px; padding: 0 40px 0 36px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); font: inherit; font-size: var(--fs-sm); color: var(--ink); }
.gsearch input::placeholder { color: var(--ink-3); }
.gsearch input:focus { outline: none; background: var(--surface); border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-tint-2); }
.gsearch kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
.usermenu { position: relative; }
.usermenu > summary { display: flex; align-items: center; gap: 9px; list-style: none; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: var(--r-pill); }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: var(--sunk); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--sunk-2); flex: none; letter-spacing: 0.02em; }
.usermenu .who { display: flex; flex-direction: column; line-height: 1.15; }
.usermenu .who strong { font-size: var(--fs-sm); }
.usermenu .who small { font-size: 12.5px; color: var(--ink-3); }
.usermenu .navmenu-pop { left: auto; right: 0; }
.topbar.is-dense .usermenu .who { display: none; }
.topbar.is-dense .usermenu > summary { padding: 4px; }

.page { padding: var(--sp-6) var(--gutter) var(--sp-9); }
.page-narrow { max-width: 1120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-6); margin-bottom: var(--sp-5); }
.page-head .sub { margin-top: 6px; color: var(--ink-2); max-width: 78ch; }
.page-actions { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--pen-ink); text-decoration: underline; }
.crumbs .i { width: 13px; height: 13px; color: var(--line-ink); }
.today { font-size: var(--fs-sm); color: var(--ink-3); }

/* ==========================================================================
   Panels & sections
   ========================================================================== */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--sh-1); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 54px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { font-size: var(--fs-md); font-weight: 700; }
.panel-head .meta { font-size: var(--fs-sm); color: var(--ink-3); }
.panel-body { padding: 18px; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 11px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 8px 8px; font-size: var(--fs-sm); color: var(--ink-3); }
.panel-flush > .panel-body { padding: 0; }
.panel + .panel { margin-top: var(--sp-4); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin: var(--sp-6) 0 var(--sp-3); }
.section-title h2 { font-size: var(--fs-lg); }
.section-title .meta { font-size: var(--fs-sm); color: var(--ink-3); }
.subhead { font-size: var(--fs-md); font-weight: 700; margin-bottom: var(--sp-3); }
.count-pill { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--sunk); color: var(--ink-2); font-size: 13px; font-weight: 700; margin-left: 6px; vertical-align: 1px; }

.dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 9px 18px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: var(--fs-sm); padding-top: 1px; }
.dl dd { margin: 0; font-weight: 500; }
.dl-tight { gap: 6px 14px; grid-template-columns: 140px minmax(0, 1fr); }
.rail .dl, .preview-side .dl, .side-summary .dl, .review-side .dl { grid-template-columns: 100px minmax(0, 1fr); }

/* ==========================================================================
   Tables
   ========================================================================== */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.tbl caption { text-align: left; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); border-bottom-color: var(--line-strong); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--pen-tint); }
.tbl tbody tr.is-selected td { background: var(--pen-tint); }
.tbl tbody tr.is-fail td { background: var(--fail-tint); }
.tbl tbody tr.is-muted td { color: var(--ink-3); }
.tbl tbody tr.is-flip td { background: var(--warn-tint); }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.center, .tbl td.center { text-align: center; }
.tbl td.c-check, .tbl th.c-check { width: 44px; padding-right: 0; }
.tbl .c-act { width: 1%; white-space: nowrap; text-align: right; }
.tbl a.rowlink { color: var(--ink); text-decoration: none; font-weight: 600; }
.tbl a.rowlink:hover { color: var(--pen-ink); text-decoration: underline; }
.tbl .sub { display: block; font-size: var(--fs-sm); color: var(--ink-3); font-weight: 400; }
.tbl-compact th, .tbl-compact td { padding: 8px 12px; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-strong); border-bottom: 0; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 12px 18px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }
.pager { display: flex; align-items: center; gap: 4px; }
.pager a, .pager span { min-width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: var(--r-1); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.pager a:hover { background: var(--sunk); }
.pager [aria-current="page"] { background: var(--ink); color: #fff; }

/* ==========================================================================
   Chips: material, lifecycle state, verdict, source
   ========================================================================== */
.mat {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 44px; height: 26px; padding: 0 7px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-ink); border-radius: 3px;
}
.mat-lg { min-width: 56px; height: 40px; font-size: 15px; border-width: 1.5px; border-color: var(--ink-2); color: var(--ink); }

.st {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; line-height: 1;
}
.st .i { width: 14px; height: 14px; stroke-width: 2; }
.st-nhap { color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-ink); }
.st-cho { color: var(--pen-ink); background: var(--pen-tint); border-color: var(--pen-line); }
.st-ph { color: #fff; background: var(--ink); border-color: var(--ink); }
.st-tra { color: var(--warn); background: var(--warn-tint); border-color: var(--warn-line); }
.st-huy { color: var(--ink-3); background: var(--sunk); border-color: var(--line); }
.st-thay { color: var(--ink-2); background: var(--sunk); border-color: var(--line-strong); }
.st-sd { color: var(--pen-ink); background: var(--surface); border: 1px dashed var(--pen-line); }
.st-khoa { color: var(--ink-2); background: var(--sunk); border-color: var(--line-strong); }

.kq { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; line-height: 1.2; }
.kq .i { width: 17px; height: 17px; stroke-width: 2; }
.kq-dat { color: var(--pass); }
.kq-khong { color: var(--fail-ink); }
.kq-thieu { color: var(--ink-3); }
.kq-kdg { color: var(--na); }
.kq-box { height: 28px; padding: 0 10px 0 8px; border-radius: var(--r-1); border: 1px solid; font-size: var(--fs-sm); }
.kq-box.kq-dat { background: var(--pass-tint); border-color: var(--pass-line); }
.kq-box.kq-khong { background: var(--fail-tint); border-color: var(--fail-line); }
.kq-box.kq-thieu { background: var(--surface); border-style: dashed; border-color: var(--line-ink); }
.kq-box.kq-kdg { background: var(--na-tint); border-color: var(--na-line); }
.kq-sm { font-size: var(--fs-sm); }
.kq-sm .i { width: 15px; height: 15px; }
.kq-only .label-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.src { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.src-du-an { color: var(--pen-ink); }
.src .i { width: 13px; height: 13px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-1); font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface); }
.tag .i { width: 13px; height: 13px; stroke-width: 2; }
.tag-tay { color: var(--warn); border-color: var(--warn-line); background: var(--warn-tint); }
.tag-flip { color: var(--warn); border-color: var(--warn-line); background: var(--warn-tint); }
.tag-lock { color: var(--ink-2); background: var(--sunk); }
.tag-pen { color: var(--pen-ink); border-color: var(--pen-line); background: var(--pen-tint); }
.tag-fail { color: var(--fail-ink); border-color: var(--fail-line); background: var(--fail-tint); }
.tag-ok { color: var(--pass); border-color: var(--pass-line); background: var(--pass-tint); }
.tag-solid { color: #fff; background: var(--ink); border-color: var(--ink); }

/* ==========================================================================
   Notices (full border + tint; never a side stripe)
   ========================================================================== */
.note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid; border-radius: var(--r-2); font-size: var(--fs-base); line-height: 1.5; }
.note > .i { margin-top: 2px; width: 19px; height: 19px; }
.note .note-body { flex: 1 1 auto; min-width: 0; }
.note strong { font-weight: 700; }
.note .note-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.note-info { background: var(--pen-tint); border-color: var(--pen-line); color: var(--ink); }
.note-info > .i { color: var(--pen-ink); }
.note-warn { background: var(--warn-tint); border-color: var(--warn-line); color: var(--ink); }
.note-warn > .i { color: var(--warn); }
.note-fail { background: var(--fail-tint); border-color: var(--fail-line); color: var(--ink); }
.note-fail > .i { color: var(--fail-ink); }
.note-ok { background: var(--pass-tint); border-color: var(--pass-line); color: var(--ink); }
.note-ok > .i { color: var(--pass); }
.note-lock { background: var(--sunk); border-color: var(--line-strong); color: var(--ink); }
.note-lock > .i { color: var(--ink-2); }
.note-plain { background: var(--surface); border-color: var(--line); }
.note-compact { padding: 9px 12px; font-size: var(--fs-sm); }
.note a { font-weight: 600; }

/* ==========================================================================
   Tabs (route tabs)
   ========================================================================== */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line-strong); overflow-x: auto; overflow-y: hidden; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 11px 14px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-weight: 600; color: var(--ink-3); text-decoration: none; white-space: nowrap; cursor: pointer; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--pen); }
.tabs .count-pill { margin-left: 0; height: 20px; min-width: 22px; font-size: 12.5px; }

/* ==========================================================================
   Filters, bulk bar, empty states
   ========================================================================== */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.filters .field { min-width: 160px; }
.filters .field.wide { flex: 1 1 280px; }
.filters .field.date { min-width: 280px; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: var(--fs-sm); color: var(--ink-3); }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; }
.fchip .x { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.fchip:hover .x { background: var(--sunk); color: var(--ink); }
.result-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 10px; }
.result-line .count { font-weight: 700; }
.bulkbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 18px; background: var(--ink); color: #fff; border-radius: 8px; margin-bottom: 10px; }
.bulkbar .btn { background: transparent; color: #fff; border-color: oklch(1 0 0 / 0.32); }
.bulkbar .btn:hover { background: oklch(1 0 0 / 0.1); border-color: oklch(1 0 0 / 0.5); color: #fff; }
.bulkbar .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.bulkbar .btn-primary:hover { background: var(--sunk); color: var(--ink); }
.bulkbar strong { font-weight: 700; }
.bulkbar .sep { width: 1px; height: 22px; background: oklch(1 0 0 / 0.25); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 44px 24px; color: var(--ink-2); }
.empty-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed var(--line-ink); color: var(--ink-3); margin-bottom: 6px; }
.empty-ico .i { width: 26px; height: 26px; }
.empty strong { font-size: var(--fs-lg); color: var(--ink); }
.empty p { max-width: 52ch; }
.empty .row { margin-top: 8px; }
.empty-sm { padding: 22px 18px; align-items: flex-start; text-align: left; }
.empty-sm strong { font-size: var(--fs-base); }

/* ==========================================================================
   Tổng quan — work queues (S1)
   ========================================================================== */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: var(--sp-5); }
.home-head h1 { font-size: var(--fs-2xl); }
.home-head .sub { margin-top: 4px; color: var(--ink-2); }
.queues { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.queue-col { display: flex; flex-direction: column; gap: var(--sp-5); }
.queue-head { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.queue-head h2 { font-size: var(--fs-md); }
.queue-head .q-ico { width: 30px; height: 30px; border-radius: var(--r-2); display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); flex: none; }
.queue-head .q-ico.is-pen { background: var(--pen-tint); color: var(--pen-ink); }
.queue-head .q-ico.is-warn { background: var(--warn-tint); color: var(--warn); }
.queue-head .q-ico.is-fail { background: var(--fail-tint); color: var(--fail-ink); }
.queue-head .q-more { margin-left: auto; font-size: var(--fs-sm); font-weight: 600; }
.q-list { list-style: none; }
.q-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 66px; }
.q-list li:last-child .q-item { border-bottom: 0; }
.q-item:hover { background: var(--pen-tint); color: var(--ink); }
.q-main { min-width: 0; }
.q-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.q-title .code { font-weight: 700; }
.q-title .name { font-weight: 600; }
.q-sub { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.q-sub .sep { margin: 0 6px; color: var(--line-ink); }
.q-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.q-end small { font-size: 13px; color: var(--ink-3); }
.q-reason { margin-top: 6px; font-size: var(--fs-sm); color: var(--warn); display: flex; gap: 6px; align-items: flex-start; }
.q-reason .i { margin-top: 2px; }
.due { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.due-late { color: var(--fail-ink); }
.due-soon { color: var(--warn); }
.progress { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.progress .bar { width: 72px; height: 6px; border-radius: 3px; background: var(--sunk-2); overflow: hidden; }
.progress .bar > span { display: block; height: 100%; background: var(--pen); border-radius: 3px; }

.setup-list { list-style: none; counter-reset: s; }
.setup-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.setup-list li:last-child { border-bottom: 0; }
.setup-list .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-ink); font-weight: 700; color: var(--ink-2); }
.setup-list li.is-done .n { background: var(--pass); border-color: var(--pass); color: #fff; }
.setup-list strong { display: block; }
.setup-list p { font-size: var(--fs-sm); color: var(--ink-3); }

/* ==========================================================================
   Sample workspace header (S5–S8)
   ========================================================================== */
.ws-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px var(--gutter) 0; }
.ws-title { display: flex; align-items: flex-start; gap: 16px; }
.ws-title h1 { font-size: 23px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ws-title h1 .code { font-size: 22px; font-weight: 700; letter-spacing: 0; }
.ws-title h1 .name { font-weight: 600; color: var(--ink-2); font-size: 18px; }
.ws-meta { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 6px; color: var(--ink-2); font-size: var(--fs-sm); }
.ws-meta > span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--line-ink); margin: 0 10px; vertical-align: 3px; }
.ws-state { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ws-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.ws-tabs { margin-top: 14px; box-shadow: none; }
.ws-banner { padding: 0 var(--gutter); }
.ws-banner .note { margin-top: 16px; }

.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more .navmenu-pop { left: auto; right: 0; min-width: 240px; }
.more .navmenu-pop .danger { color: var(--fail-ink); }
.more .navmenu-pop .danger .i { color: var(--fail-ink); }
.navmenu-pop a.is-disabled { color: var(--ink-3); cursor: not-allowed; }
.navmenu-pop a.is-disabled:hover { background: none; }

/* entry page layout: main + sticky rail */
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: var(--sp-5); align-items: start; }
.entry-main { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.rail { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: var(--sp-4); }
.rail .panel-head { min-height: 48px; padding: 10px 16px; }
.rail .panel-body { padding: 14px 16px; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: var(--fs-sm); color: var(--ink-2); }
.legend .sw { display: inline-block; width: 26px; height: 18px; border: 1px solid var(--line-strong); border-radius: 2px; vertical-align: -4px; margin-right: 6px; }
.legend .sw-in { background: var(--surface); position: relative; }
.legend .sw-in::after { content: "1,2"; position: absolute; inset: 0; font-size: 10.5px; color: var(--pen-ink); display: grid; place-items: center; font-weight: 600; }
.legend .sw-calc { background: var(--sunk); }
.legend .sw-calc::after { content: "ƒ"; display: grid; place-items: center; height: 100%; font-size: 11px; color: var(--ink-2); font-style: italic; font-family: var(--font-doc); }

.entry-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.saved { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--ink-3); }
.saved .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pass); }
.saved.is-pending .dot { background: var(--warn); }

/* conclusion block (rail) */
.verdict-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.verdict-card .vc-label { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 600; }
.verdict-big { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; }
.verdict-big .i { width: 28px; height: 28px; stroke-width: 2; }
.verdict-big.kq-dat { color: var(--pass); }
.verdict-big.kq-khong { color: var(--fail-ink); }
.verdict-big.kq-kdg { color: var(--na); }
.verdict-big.kq-thieu { color: var(--ink-3); }
.tally { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; font-size: var(--fs-sm); }
.tally .kq { font-size: var(--fs-sm); }
.tally .kq .i { width: 15px; height: 15px; }
.tally b { margin-left: auto; font-variant-numeric: tabular-nums; }
.tally > div { display: flex; align-items: center; gap: 6px; }

.fail-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.fail-list a { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-1); background: var(--fail-tint); border: 1px solid var(--fail-line); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); line-height: 1.4; }
.fail-list a:hover { border-color: var(--fail); }
.fail-list .i { color: var(--fail-ink); margin-top: 1px; }

/* indicator index (rail): list of criteria with verdict */
.ix { list-style: none; }
.ix a { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); }
.ix li:last-child a { border-bottom: 0; }
.ix a:hover { background: var(--pen-tint); }
.ix .n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ix a.is-here { font-weight: 700; }

/* steel matrix (rail) */
.matrix { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.matrix th, .matrix td { padding: 5px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.matrix thead th { font-weight: 600; color: var(--ink-3); font-size: 12.5px; line-height: 1.2; vertical-align: bottom; }
.matrix tbody th { text-align: left; font-weight: 700; font-family: var(--font-mono); font-size: 13px; }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0; }
.matrix .i { width: 16px; height: 16px; stroke-width: 2; vertical-align: -3px; }
.matrix .c-dat { color: var(--pass); }
.matrix .c-khong { color: var(--fail-ink); background: var(--fail-tint); }
.matrix .c-thieu { color: var(--ink-3); }
.matrix tr.is-fail th { color: var(--fail-ink); }

/* ==========================================================================
   Measurement blocks (chỉ tiêu) and entry grid
   ========================================================================== */
.ct { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--sh-1); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.ct.is-fail { border-color: var(--fail-line); }
.ct.is-locked { background: var(--surface-2); }
.ct-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.ct.is-fail > .ct-head { background: var(--fail-tint); border-bottom-color: var(--fail-line); border-radius: 8px 8px 0 0; }
.ct-no { font-family: var(--font-doc); font-size: 19px; font-weight: 700; color: var(--ink-2); min-width: 28px; }
.ct-title h3 { font-size: var(--fs-md); line-height: 1.3; }
.ct-title .ct-std { margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ct-req { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.ct-req .lbl { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.ct-req b { font-size: var(--fs-base); }
.ct-verdict { min-width: 150px; display: flex; justify-content: flex-end; }
.ct-body { display: grid; grid-template-columns: minmax(0, 1fr) 248px; }
.ct-body.is-wide { grid-template-columns: minmax(0, 1fr); }
.ct-main { padding: 14px 16px; min-width: 0; }
.ct-side { padding: 14px 16px; border-left: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; border-radius: 0 0 8px 0; }
.ct-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); }
.ct-foot .grow { font-size: var(--fs-sm); color: var(--ink-3); }
.ct-collapsed { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 12px 16px; }
.ct-collapsed .vals { font-size: var(--fs-sm); color: var(--ink-2); }

.formula { font-family: var(--font-doc); font-style: italic; font-size: 17px; color: var(--ink); line-height: 1.5; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-1); }
.formula sub, .formula sup { font-size: 0.72em; }
.formula .w { font-style: normal; font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); display: block; margin-top: 4px; }
.side-lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.result-num { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.result-num .unit { font-size: 15px; font-weight: 500; }
.result-num.t-fail { color: var(--fail-ink); }
.side-check { font-size: var(--fs-sm); color: var(--ink-2); display: flex; gap: 6px; align-items: flex-start; }
.side-check .i { margin-top: 2px; }

table.mt { width: 100%; border-collapse: collapse; font-size: var(--fs-base); table-layout: auto; }
.mt th, .mt td { border: 1px solid var(--line); height: 40px; }
.mt thead th { background: var(--surface-2); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); padding: 6px 9px; text-align: center; vertical-align: bottom; line-height: 1.25; }
.mt thead th .u { display: block; font-weight: 400; color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.mt thead th.calc { background: var(--sunk); }
.mt thead th.calc::after { content: "ƒ tự tính"; display: block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.01em; }
.mt thead th.left { text-align: left; }
.mt td { padding: 0 10px; vertical-align: middle; }
.mt td.lbl { color: var(--ink-2); text-align: left; }
.mt td.sym { width: 46px; text-align: center; font-family: var(--font-doc); font-style: italic; font-size: 16px; color: var(--ink-2); }
.mt td.unitc { width: 70px; text-align: center; color: var(--ink-3); font-size: var(--fs-sm); }
.mt td.mnote { color: var(--ink-3); font-size: var(--fs-sm); text-align: left; white-space: nowrap; }
.mt td.grp { font-weight: 700; text-align: left; background: var(--surface); white-space: nowrap; }
.mt td.grp .sub { display: block; font-weight: 500; font-size: 13px; color: var(--ink-3); }
.mt td.idx { text-align: center; color: var(--ink-3); width: 46px; }
.mt td.in { padding: 0; background: var(--surface); position: relative; }
.mt td.in input, .mt td.in select {
  display: block; width: 100%; height: 39px; min-width: 64px;
  border: 0; background: transparent; padding: 0 10px;
  font: inherit; font-size: var(--fs-base); font-weight: 500; color: var(--pen-ink);
  text-align: right; font-variant-numeric: tabular-nums;
}
.mt td.in select { text-align: left; appearance: none; color: var(--pen-ink); cursor: pointer; }
.mt td.in input::placeholder { color: var(--line-ink); }
.mt td.in input:focus, .mt td.in select:focus { outline: 2px solid var(--pen); outline-offset: -2px; background: var(--surface); box-shadow: none; border-radius: 0; }
.mt td.in.is-err { box-shadow: inset 0 0 0 2px var(--fail); background: var(--fail-tint); }
.mt td.in.is-err input { color: var(--fail-ink); }
.mt td.in.is-warn { box-shadow: inset 0 0 0 2px var(--warn-line); background: var(--warn-tint); }
.mt td.in.is-cause { box-shadow: inset 0 0 0 2px var(--fail-line); }
.mt td.in.is-changed input { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.mt td.in.is-unsaved::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.mt td.in.is-locked, .mt td.ro { background: var(--surface-2); color: var(--ink-2); text-align: right; padding: 0 10px; font-weight: 500; }
.mt td.calc { background: var(--sunk); text-align: right; font-weight: 650; color: var(--ink); white-space: nowrap; }
.mt td.calc.is-fail { background: var(--fail-tint); color: var(--fail-ink); }
.mt td.calc.is-fail::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 6px; border: 1.75px solid currentColor; border-radius: 1.5px; vertical-align: -1px; background: linear-gradient(45deg, transparent 43%, currentColor 43%, currentColor 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, currentColor 43%, currentColor 57%, transparent 57%); }
.mt td.calc.is-near { box-shadow: inset 0 -2px 0 var(--warn-line); }
.mt td.calc.is-empty { color: var(--line-ink); font-weight: 400; }
.mt td.calc.is-excluded { color: var(--ink-3); text-decoration: line-through; font-weight: 500; }
.mt td.calc.is-total { background: var(--sunk-2); font-weight: 750; }
.mt td.center { text-align: center; }
.mt tr.mt-req td { background: var(--surface-2); height: 34px; font-size: var(--fs-sm); color: var(--ink-2); text-align: center; }
.mt tr.mt-req td.lbl { text-align: left; font-weight: 600; }
.mt tr.mt-verdict td { height: 36px; text-align: center; background: var(--surface); }
.mt tr.mt-verdict td.lbl { text-align: left; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); }
.mt tr.mt-verdict .kq { font-size: 13.5px; }
.mt tr.mt-verdict .kq .i { width: 15px; height: 15px; }
.mt tr.mt-result td { background: var(--surface-2); font-weight: 600; }
.mt tr.mt-result td.lbl { color: var(--ink); }
.mt tr.mt-split td { border-top: 2px solid var(--line-strong); }
.mt tr.is-fail-row td.idx { color: var(--fail-ink); font-weight: 700; }
.mt tr.is-old td { color: var(--ink-3); background: var(--surface-2); }
.mt tr.is-old td.calc { background: var(--sunk); color: var(--ink-3); }
.mt .pin { position: sticky; left: 0; z-index: 1; }
.mt .pin-2 { position: sticky; left: 88px; z-index: 1; }
.mt-scroll { overflow-x: auto; border-radius: var(--r-1); }
.mt-msgs { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mt-msgs li { display: flex; gap: 7px; align-items: flex-start; font-size: var(--fs-sm); font-weight: 600; }
.mt-msgs li .i { margin-top: 2px; }
.mt-msgs .m-err { color: var(--fail-ink); }
.mt-msgs .m-warn { color: var(--warn); }
.mt-msgs .m-info { color: var(--ink-2); font-weight: 500; }

/* retest & attempts */
.attempt { margin-top: 14px; border: 1px solid var(--pen-line); border-radius: var(--r-2); overflow: hidden; }
.attempt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; background: var(--pen-tint); border-bottom: 1px solid var(--pen-line); font-size: var(--fs-sm); }
.attempt-head strong { font-size: var(--fs-base); }
.attempt-body { padding: 12px; }
.attempt-old { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); }
.attempt-old > summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; font-size: var(--fs-sm); color: var(--ink-2); }
.attempt-old > summary::-webkit-details-marker { display: none; }
.attempt-old > summary .i { transition: transform .15s var(--ease); }
.attempt-old[open] > summary .i.chev { transform: rotate(90deg); }
.attempt-old .attempt-body { padding: 0 12px 12px; }

/* manual entry & suggestion */
.manual { border: 1px dashed var(--warn-line); background: var(--warn-tint); border-radius: var(--r-2); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.manual-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suggest { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.suggest-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.suggest-vals div { padding: 8px 10px; background: var(--sunk); border-radius: var(--r-1); }
.suggest-vals .k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.suggest-vals .v { font-size: var(--fs-lg); font-weight: 700; }
.accepted { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--pass); font-weight: 600; }

/* charts (inline SVG) */
.chart { width: 100%; height: auto; display: block; font-family: var(--font-ui); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-ink); stroke-width: 1.2; }
.chart .tick { fill: var(--ink-3); font-size: 11.5px; }
.chart .axis-t { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart .band { fill: oklch(0.47 0.165 264 / 0.07); stroke: var(--line-ink); stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart .env { fill: none; stroke: var(--line-ink); stroke-width: 1.3; stroke-dasharray: 5 4; }
.chart .curve { fill: none; stroke: var(--ink); stroke-width: 2; }
.chart .curve-pen { fill: none; stroke: var(--pen); stroke-width: 2; }
.chart .pt { fill: var(--surface); stroke: var(--pen); stroke-width: 2; }
.chart .pt-calc { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }
.chart .pt-fail { stroke: var(--fail); stroke-width: 2.2; fill: none; }
.chart .guide { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 3 3; }
.chart .lbl { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart .lbl-fail { fill: var(--fail-ink); font-size: 12px; font-weight: 700; }
.chart .lbl-mut { fill: var(--ink-3); font-size: 11.5px; }
.chart-box { border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); padding: 8px 8px 4px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); padding: 6px 4px 2px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--ink); }
.chart-legend i.dash { border-top: 1.5px dashed var(--line-ink); }
.chart-legend i.dot { width: 10px; height: 10px; border: 2px solid var(--pen); border-radius: 50%; }

/* ==========================================================================
   Version history (S7) and review (S10)
   ========================================================================== */
.ver-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.ver-type { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.ver-type .i { width: 15px; height: 15px; }
.ver-type.t-sua { color: var(--pen-ink); }
.ver-type.t-nhap { color: var(--ink-3); }
.ver-type.t-event { color: var(--ink); }
.diff { display: flex; flex-direction: column; gap: 3px; }
.diff .cell { font-size: var(--fs-sm); color: var(--ink-3); }
.diff .vals { font-variant-numeric: tabular-nums; }
.diff .vals .arr { color: var(--ink-3); margin: 0 6px; }
.flip { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-sm); }
.flip .arr { color: var(--ink-3); }
.reason { font-size: var(--fs-sm); color: var(--ink); }
.reason.is-empty { color: var(--ink-3); font-style: italic; }
.ver-no { font-family: var(--font-mono); font-weight: 700; font-size: 14px; }
.event-row td { background: var(--surface-2); }

.review { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: var(--sp-5); align-items: start; }
.review-side { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: var(--sp-4); }
.confirm { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--warn-line); background: var(--warn-tint); border-radius: var(--r-2); cursor: pointer; }
.confirm input { width: 22px; height: 22px; margin: 0; accent-color: var(--pen); flex: none; }
.confirm strong { display: block; }
.confirm.is-checked { border-color: var(--pass-line); background: var(--pass-tint); }
.issue-no { display: flex; align-items: stretch; }
.issue-no .input { font-size: var(--fs-lg); font-weight: 700; text-align: right; width: 110px; border-radius: var(--r-1) 0 0 var(--r-1); }
.issue-no .addon { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-left: 0; background: var(--surface-2); border-radius: 0 var(--r-1) var(--r-1) 0; font-weight: 600; color: var(--ink-2); font-family: var(--font-mono); font-size: 14px; }
.flip-card { border: 1.5px solid var(--warn-line); border-radius: var(--r-2); background: var(--surface); }
.flip-card .fc-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--warn-tint); border-bottom: 1px solid var(--warn-line); border-radius: var(--r-2) var(--r-2) 0 0; font-weight: 700; font-size: var(--fs-sm); color: var(--warn); }
.flip-card .fc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.timeline { list-style: none; position: relative; }
.timeline li { position: relative; padding: 0 0 14px 26px; font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 1.5px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-ink); background: var(--surface); }
.timeline .dot.is-pen { border-color: var(--pen); }
.timeline .dot.is-ink { border-color: var(--ink); background: var(--ink); }
.timeline .dot.is-warn { border-color: var(--warn); }
.timeline .when { color: var(--ink-3); display: block; font-size: 13px; }
.timeline strong { font-weight: 600; }

/* ==========================================================================
   Dialogs (static open state) and drawer
   ========================================================================== */
.scrim { position: fixed; inset: 0; background: oklch(0.235 0.022 262 / 0.42); z-index: var(--z-scrim); }
.dialog { position: fixed; z-index: var(--z-dialog); left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border-radius: var(--r-3); box-shadow: var(--sh-pop); animation: dlg-in .2s var(--ease); }
.dialog-wide { width: min(760px, calc(100vw - 32px)); }
.dialog-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 8px; }
.dialog-head h2 { font-size: var(--fs-lg); }
.dialog-head .sub { margin-top: 4px; color: var(--ink-2); font-size: var(--fs-sm); }
.dialog-head .x { margin-left: auto; }
.dialog-body { padding: 10px 22px 18px; display: flex; flex-direction: column; gap: 14px; }
.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-3) var(--r-3); }
.dialog-foot .grow { font-size: var(--fs-sm); color: var(--ink-3); }
@keyframes dlg-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } }
.summary-box { border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.summary-box .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.drawer { position: fixed; z-index: var(--z-dialog); top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); box-shadow: var(--sh-pop); display: flex; flex-direction: column; border-left: 1px solid var(--line-strong); animation: drw-in .22s var(--ease); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: var(--fs-lg); }
.drawer-head .x { margin-left: auto; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
@keyframes drw-in { from { transform: translateX(24px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: var(--z-toast); display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--ink); color: #fff; border-radius: var(--r-2); box-shadow: var(--sh-pop); font-weight: 500; }
.toast .i { color: oklch(0.82 0.1 152); }

/* ==========================================================================
   S3 new sample, S4 paste
   ========================================================================== */
.new-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-5); align-items: start; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--sh-1); }
.step + .step { margin-top: var(--sp-4); }
.step-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.step.is-done .step-n { background: var(--pass); }
.step-head h2 { font-size: var(--fs-md); }
.step-head .meta { margin-left: auto; font-size: var(--fs-sm); color: var(--ink-3); }
.step-body { padding: 18px; }
.mats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mat-opt { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); cursor: pointer; min-height: 112px; }
.mat-opt:hover { border-color: var(--line-ink); background: var(--surface-2); }
.mat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mat-opt .mo-name { font-weight: 700; line-height: 1.3; }
.mat-opt .mo-std { font-size: 13px; color: var(--ink-3); line-height: 1.35; }
.mat-opt.is-on { border: 2px solid var(--pen); padding: 11px 13px; background: var(--pen-tint); }
.mat-opt.is-on .mat { border-color: var(--pen); color: var(--pen-ink); }
.mat-opt .mo-check { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); }
.mat-opt.is-on .mo-check { background: var(--pen); border-color: var(--pen); }
.mat-opt.is-on .mo-check::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.mat-opt:has(input:focus-visible) { box-shadow: var(--focus); }
.prefill { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); padding: 12px 14px; }
.prefill .dl { grid-template-columns: 150px minmax(0, 1fr); }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface); font-family: var(--font-mono); font-weight: 700; font-size: 14px; }
.size-chip small { font-family: var(--font-ui); font-weight: 500; color: var(--ink-3); font-size: 13px; }
.size-chip .x { width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r-1); color: var(--ink-3); }
.size-chip.is-tron { border-style: dashed; }
.side-summary { position: sticky; top: calc(var(--topbar-h) + 16px); }
.carry { font-size: var(--fs-sm); color: var(--ink-2); display: flex; gap: 8px; align-items: flex-start; }

.paste-box { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; min-height: 172px; white-space: pre; overflow: auto; color: var(--ink-2); background: var(--surface-2); tab-size: 14; }
.preview-tbl td.chk { white-space: nowrap; }
.row-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-sm); }
.row-status .i { width: 15px; height: 15px; stroke-width: 2; }
.row-status.ok { color: var(--pass); }
.row-status.err { color: var(--fail-ink); }
.row-status.warn { color: var(--warn); }
.row-status.dup { color: var(--ink-3); }
.preview-tbl tr.is-err td { background: var(--fail-tint); }
.preview-tbl tr.is-warn td { background: var(--warn-tint); }
.preview-tbl tr.is-dup td { color: var(--ink-3); }
.preview-tbl td .bad { color: var(--fail-ink); font-weight: 700; text-decoration: underline wavy var(--fail); text-underline-offset: 3px; }
.preview-tbl .msg { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }

/* ==========================================================================
   S8 A4 preview and documents (Times New Roman, as the customer's forms)
   ========================================================================== */
.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-5); align-items: start; }
.sheet-tabs { display: flex; gap: 4px; padding: 4px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-2); width: max-content; max-width: 100%; overflow-x: auto; }
.sheet-tabs a { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: var(--r-1); font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.sheet-tabs a .xl { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); font-weight: 500; }
.sheet-tabs a:hover { background: oklch(1 0 0 / 0.6); color: var(--ink); }
.sheet-tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.a4-stage { margin-top: 14px; padding: 28px; background: var(--sunk-2); border-radius: 8px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 24px; overflow: auto; }
.a4 {
  position: relative; width: 210mm; min-height: 297mm; flex: none;
  padding: 12mm 13mm 14mm 18mm; background: #fff; color: #000;
  font-family: var(--font-doc); font-size: 11pt; line-height: 1.32;
  box-shadow: var(--sh-a4);
  font-variant-numeric: lining-nums tabular-nums;
}
.a4.is-landscape { width: 297mm; min-height: 210mm; }
.a4 * { font-family: inherit; }
.a4 .pg { position: absolute; bottom: 7mm; right: 13mm; font-size: 9.5pt; color: #333; }
.doc-head { display: grid; grid-template-columns: 30mm minmax(0, 1fr); gap: 4mm; align-items: center; }
.doc-logo { display: flex; flex-direction: column; align-items: center; gap: 1mm; }
.doc-logo svg { width: 17mm; height: 17mm; }
.doc-logo span { font-size: 9pt; font-weight: 700; }
.doc-org { text-align: center; line-height: 1.3; }
.doc-org .co { font-weight: 700; font-size: 11pt; text-transform: uppercase; }
.doc-org .lab { font-weight: 700; font-size: 11.5pt; text-transform: uppercase; }
.doc-org .ad { font-size: 10pt; font-style: italic; }
.doc-rule { border: 0; border-top: 1.5px solid #000; border-bottom: 0.5px solid #000; height: 2px; margin: 2mm 0 2.5mm; }
.doc-noline { display: flex; justify-content: space-between; align-items: baseline; font-size: 11pt; }
.doc-noline .no b { display: inline-block; min-width: 26mm; text-align: center; border-bottom: 1px dotted #000; font-weight: 700; }
.doc-noline .no b.is-blank { color: transparent; }
.doc-noline .date { font-style: italic; }
.doc-hd { font-size: 10.5pt; margin-top: 1mm; }
.doc-title { text-align: center; font-size: 15pt; font-weight: 700; text-transform: uppercase; margin: 5mm 0 4mm; letter-spacing: 0.01em; }
.doc-title small { display: block; font-size: 11pt; font-weight: 400; font-style: italic; text-transform: none; margin-top: 1mm; }
.doc-info { width: 100%; border-collapse: collapse; font-size: 11pt; }
.doc-info td { padding: 0.3mm 0; vertical-align: top; line-height: 1.25; }
.doc-info td.k { width: 46mm; white-space: nowrap; }
.doc-info td.c { width: 4mm; }
.doc-sec { font-weight: 700; text-align: center; text-transform: uppercase; font-size: 12pt; margin: 5mm 0 2mm; }
.doc-sec small { display: block; font-weight: 400; font-style: italic; text-transform: none; font-size: 11pt; }
.doc-h { font-weight: 700; font-size: 11pt; margin: 3.5mm 0 1.5mm; }
table.f { width: 100%; border-collapse: collapse; font-size: 10.5pt; page-break-inside: auto; }
table.f th, table.f td { border: 0.75px solid #000; padding: 0.9mm 1.4mm; text-align: center; vertical-align: middle; }
table.f th { font-weight: 700; }
table.f td.l, table.f th.l { text-align: left; }
table.f td.r { text-align: right; }
table.f tr { page-break-inside: avoid; }
table.f .it { font-style: italic; }
table.f.sm { font-size: 9.5pt; }
table.f.sm th, table.f.sm td { padding: 0.6mm 1mm; }
table.f .nw { white-space: nowrap; }
.doc-note { font-size: 10pt; margin-top: 2mm; }
.doc-note i { font-style: italic; }
.doc-sign { display: grid; gap: 4mm; margin-top: 6mm; page-break-inside: avoid; text-align: center; font-size: 11pt; }
.doc-sign.c3 { grid-template-columns: 1fr 1fr 1fr; }
.doc-sign.c4 { grid-template-columns: repeat(4, 1fr); }
.doc-sign .grp { grid-column: span 2; font-weight: 700; text-transform: uppercase; font-size: 10.5pt; }
.doc-sign .grp-1 { font-weight: 700; text-transform: uppercase; font-size: 10.5pt; }
.doc-sign .role { font-weight: 700; }
.doc-sign .name { margin-top: 17mm; font-weight: 700; }
.doc-sign .name.is-blank { color: #777; font-weight: 400; font-style: italic; }
.doc-stamp-draft { position: absolute; top: 5mm; right: 13mm; font-family: var(--font-ui); font-size: 9pt; font-weight: 700; letter-spacing: 0.06em; color: var(--stamp); border: 1.5px solid var(--stamp); padding: 1mm 2.5mm; border-radius: 1mm; }
.doc-watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.doc-watermark span { transform: rotate(-30deg); font-family: var(--font-ui); font-size: 58pt; font-weight: 800; letter-spacing: 0.08em; color: transparent; -webkit-text-stroke: 1.5px oklch(0.42 0.13 8 / 0.16); white-space: nowrap; }
.doc-void { position: absolute; top: 58mm; left: 50%; transform: translateX(-50%) rotate(-8deg); font-family: var(--font-ui); font-size: 30pt; font-weight: 800; letter-spacing: 0.1em; color: var(--stamp); border: 3px double var(--stamp); padding: 2mm 8mm; opacity: .85; }
.doc-replaced { margin-top: 2mm; font-family: var(--font-ui); font-size: 9pt; font-weight: 700; color: var(--stamp); border: 1px solid var(--stamp); display: inline-block; padding: 0.5mm 2mm; }
.doc-chart { border: 0.75px solid #000; padding: 2mm; margin-top: 2mm; }
.doc-chart .chart text { font-family: var(--font-doc); }
.doc-chart .chart .tick, .doc-chart .chart .axis-t, .doc-chart .chart .lbl { fill: #000; }
.doc-chart .chart .band { fill: #f1f1f1; stroke: #000; }
.doc-chart .chart .curve { stroke: #000; }
.doc-chart .chart .pt { stroke: #000; fill: #fff; }
.doc-chart .chart .grid { stroke: #ddd; }
.doc-chart .chart .axis { stroke: #000; }
.doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.dots { border-bottom: 1px dotted #000; display: inline-block; min-width: 40mm; }
.preview-side .panel-body { display: flex; flex-direction: column; gap: 12px; }
.zoom { display: inline-flex; align-items: center; gap: 4px; }
.zoom span { min-width: 52px; text-align: center; font-weight: 600; font-size: var(--fs-sm); }
.file-out { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface-2); font-size: var(--fs-sm); }
.file-out .code { font-size: 13px; word-break: break-all; color: var(--ink); }
.sheet-list { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.sheet-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sheet-list li:last-child { border-bottom: 0; }

/* ==========================================================================
   Danh mục layout (S13–S15), settings (S16)
   ========================================================================== */
.cat-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.cat-rail { position: sticky; top: calc(var(--topbar-h) + 16px); }
.cat-rail h2 { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 600; margin: 4px 10px 8px; }
.cat-rail nav { display: flex; flex-direction: column; gap: 2px; }
.cat-rail a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-2); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.cat-rail a .i { color: var(--ink-3); }
.cat-rail a .n { margin-left: auto; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.cat-rail a:hover { background: var(--sunk); color: var(--ink); }
.cat-rail a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); border: 1px solid var(--line); padding: 8px 9px; }
.cat-rail a[aria-current="page"] .i { color: var(--pen-ink); }
.cat-rail .sep { height: 1px; background: var(--line); margin: 10px 6px; }
.cat-main { min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-5); align-items: start; }
.inactive td { color: var(--ink-3); }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: var(--sp-6); align-items: start; }
.settings-preview { position: sticky; top: calc(var(--topbar-h) + 16px); }
.mini-a4 { background: var(--sunk-2); padding: 18px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; }
.mini-a4 .a4 { width: 210mm; min-height: 0; padding: 10mm 12mm 10mm 14mm; transform: scale(0.51); transform-origin: top left; margin-bottom: calc(-1 * (100% * 0)); }
.mini-a4-wrap { height: 330px; overflow: hidden; }
.form-section { padding: 20px 22px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.form-section:last-child { border-bottom: 0; }
.form-section h2 { font-size: var(--fs-md); }
.form-section .desc { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-3); }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-2); cursor: pointer; }
.radio-card.is-on { border: 2px solid var(--pen); padding: 10px 12px; background: var(--pen-tint); }
.radio-card input { margin-top: 3px; accent-color: var(--pen); width: 18px; height: 18px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 12px; background: var(--sunk-2); border: 1px solid var(--line-strong); position: relative; margin: 0; cursor: pointer; transition: background-color .15s var(--ease); flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .18s var(--ease); }
.switch input:checked { background: var(--pen); border-color: var(--pen); }
.switch input:checked::after { transform: translateX(16px); }
.th-group td { background: var(--surface-2); font-weight: 700; font-size: var(--fs-sm); color: var(--ink-2); }
.conf { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.conf .i { width: 15px; height: 15px; stroke-width: 2; }
.conf-yes { color: var(--pass); }
.conf-no { color: var(--warn); }
.keyset { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.keyset .tag { height: 22px; font-family: var(--font-mono); font-size: 12px; }

/* ==========================================================================
   Login (S0) and status pages (403 / 404 / error)
   ========================================================================== */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.login-art { position: relative; background: var(--ink); color: oklch(0.93 0.01 262); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-art .brand { color: #fff; }
.login-art .brand-text small { color: oklch(0.78 0.02 262); }
.login-art h1 { font-size: 32px; line-height: 1.2; color: #fff; max-width: 18ch; letter-spacing: -0.015em; }
.login-art p { color: oklch(0.82 0.015 262); max-width: 46ch; margin-top: 14px; font-size: var(--fs-md); }
.login-art .art { position: absolute; right: -40px; bottom: 120px; width: 620px; opacity: 1; }
.login-art .art .g { stroke: oklch(1 0 0 / 0.08); }
.login-art .art .b { fill: oklch(1 0 0 / 0.05); stroke: oklch(1 0 0 / 0.28); stroke-dasharray: 6 5; }
.login-art .art .c { stroke: oklch(0.8 0.09 264); stroke-width: 2.5; fill: none; }
.login-art .art .p { fill: var(--ink); stroke: oklch(0.8 0.09 264); stroke-width: 2.5; }
.login-art .art .t { fill: oklch(1 0 0 / 0.45); font-size: 12px; font-family: var(--font-mono); }
.login-facts { position: relative; display: flex; gap: 28px; font-size: var(--fs-sm); color: oklch(0.82 0.015 262); }
.login-facts strong { display: block; color: #fff; font-family: var(--font-mono); font-size: 14px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 48px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: var(--fs-2xl); }
.login-card .sub { margin-top: 6px; color: var(--ink-2); }
.login-card form { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.login-card .input { min-height: 46px; font-size: var(--fs-md); }
.login-card .btn-lg { margin-top: 6px; }
.login-help { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-3); }
.pw { position: relative; }
.pw .btn { position: absolute; right: 4px; top: 4px; min-height: 38px; }

.status-page { min-height: calc(100vh - var(--topbar-h)); display: grid; place-items: center; padding: 40px var(--gutter); }
.status-card { max-width: 560px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.status-code { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.08em; }
.status-ico { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--line-ink); color: var(--ink-2); margin-bottom: 4px; }
.status-ico .i { width: 32px; height: 32px; }
.status-card h1 { font-size: 26px; }
.status-card p { color: var(--ink-2); font-size: var(--fs-md); max-width: 50ch; }
.status-card .row { margin-top: 10px; justify-content: center; flex-wrap: wrap; }
.status-detail { margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-3); font-family: var(--font-mono); }

/* ==========================================================================
   Phone frame (390 x 844) — Chỉ xem
   ========================================================================== */
body.ph { background: var(--bg); }
.ph-app { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.ph-bar { position: sticky; top: 0; z-index: var(--z-topbar); display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 8px 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ph-bar .brand-mark { width: 30px; height: 30px; }
.ph-bar .t { font-weight: 700; font-size: var(--fs-md); line-height: 1.15; min-width: 0; }
.ph-bar .t small { display: block; font-weight: 500; font-size: 12.5px; color: var(--ink-3); font-family: var(--font-mono); }
.ph-bar .ph-btn { margin-left: auto; }
.ph-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-2); color: var(--ink); cursor: pointer; text-decoration: none; flex: none; }
.ph-btn:hover { background: var(--sunk); }
.ph-back { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 8px 0 0; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.ph-main { flex: 1; padding: 16px 16px 28px; display: flex; flex-direction: column; gap: 16px; }
.ph-search { position: relative; }
.ph-search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.ph-search input { width: 100%; height: 48px; padding: 0 14px 0 42px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); font: inherit; font-size: var(--fs-md); color: var(--ink); }
.ph-search input:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-tint-2); }
.ph-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ph-h h1, .ph-h h2 { font-size: var(--fs-lg); }
.ph-h a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--fs-sm); font-weight: 600; }
.ph-login-top .brand { min-height: 44px; }
.ph-list { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ph-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 76px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ph-list li:last-child .ph-card { border-bottom: 0; }
.ph-card:active, .ph-card:hover { background: var(--pen-tint); }
.ph-card .t1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.ph-card .t2 { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.ph-card .t3 { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ph-card .chev { color: var(--line-ink); }
.ph-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.ph-chip { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; text-decoration: none; }
.ph-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ph-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.ph-panel h2 { font-size: var(--fs-md); margin-bottom: 10px; }
.ph-dl { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 8px 12px; font-size: var(--fs-sm); }
.ph-dl dt { color: var(--ink-3); }
.ph-dl dd { margin: 0; font-weight: 500; color: var(--ink); }
.ph-res { list-style: none; }
.ph-res li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ph-res li:last-child { border-bottom: 0; }
.ph-res .n { font-weight: 600; }
.ph-res .v { text-align: right; font-weight: 700; white-space: nowrap; }
.ph-res .r { font-size: 13px; color: var(--ink-3); }
.ph-res .k { justify-self: end; }
.ph-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.ph-actions .btn { min-height: 48px; }
.ph .btn { min-height: 44px; }
.ph-sheet { position: fixed; inset: 0; z-index: var(--z-dialog); display: none; }
.ph-sheet.is-open { display: block; }
.ph-sheet .scrim { position: absolute; }
.ph-sheet-body { position: absolute; top: 0; right: 0; bottom: 0; width: 84%; max-width: 330px; background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--sh-pop); z-index: 2; }
.ph-sheet-body a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: var(--r-2); color: var(--ink); text-decoration: none; font-weight: 600; }
.ph-sheet-body a[aria-current="page"] { background: var(--pen-tint); color: var(--pen-ink); }
.ph-sheet-body .who { display: flex; align-items: center; gap: 12px; padding: 8px 12px 16px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.ph-login { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.ph-login-top { background: var(--ink); color: #fff; padding: 28px 20px 26px; position: relative; overflow: hidden; }
.ph-login-top .brand { color: #fff; }
.ph-login-top .brand-text small { color: oklch(0.78 0.02 262); }
.ph-login-top h1 { margin-top: 26px; font-size: 23px; color: #fff; }
.ph-login-top p { margin-top: 6px; color: oklch(0.84 0.015 262); font-size: var(--fs-sm); max-width: 32ch; }
.ph-login-form { padding: 24px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.ph-login-form .input { min-height: 48px; font-size: var(--fs-md); }
.ph-login-form .btn { min-height: 50px; font-size: var(--fs-md); }

@media (max-width: 639px) {
  body.ph .mk-demo { bottom: 88px; }
}
@media (min-width: 640px) {
  body.ph { background: var(--sunk-2); padding: 28px 0; }
  body.ph .ph-app, body.ph .ph-login { width: 390px; min-height: 844px; margin: 0 auto; border-radius: 28px; overflow: hidden; box-shadow: var(--sh-pop); border: 1px solid var(--line-strong); position: relative; }
  body.ph .ph-actions { position: sticky; }
}

/* ==========================================================================
   Mockup-only annotation: demo bar (not product UI; mask in visual QA)
   ========================================================================== */
.mk-demo { position: fixed; right: 14px; bottom: 14px; z-index: var(--z-demo); font-family: var(--font-ui); font-size: var(--fs-xs); }
.mk-demo > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: oklch(0.3 0.02 262 / 0.92); color: #fff; font-weight: 600; box-shadow: var(--sh-2); float: right; }
.mk-demo > summary::-webkit-details-marker { display: none; }
.mk-demo .mk-body { clear: both; margin-bottom: 8px; width: 330px; background: oklch(0.26 0.02 262); color: oklch(0.9 0.01 262); border-radius: 10px; padding: 12px 14px; box-shadow: var(--sh-pop); display: flex; flex-direction: column; gap: 10px; }
.mk-demo[open] { display: flex; flex-direction: column-reverse; align-items: flex-end; }
.mk-demo .mk-k { font-weight: 700; color: oklch(0.75 0.03 262); margin-bottom: 4px; font-size: 12px; }
.mk-demo .mk-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-demo a, .mk-demo span.mk-off { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 6px; background: oklch(1 0 0 / 0.08); color: #fff; text-decoration: none; font-weight: 600; }
.mk-demo a:hover { background: oklch(1 0 0 / 0.18); }
.mk-demo a.is-on { background: #fff; color: var(--ink); }
.mk-demo span.mk-off { opacity: .45; }
.mk-demo .mk-meta { color: oklch(0.75 0.02 262); line-height: 1.45; }

/* ==========================================================================
   Responsive — tablet landscape 1024 (S6 beside the testing machine)
   ========================================================================== */
@media (max-width: 1280px) {
  :root { --gutter: 20px; }
  .gsearch { width: 44px; }
  .gsearch input { padding: 0; color: transparent; cursor: pointer; }
  .gsearch input::placeholder { color: transparent; }
  .gsearch kbd { display: none; }
  .gsearch .i { left: 13px; }
  .usermenu .who { display: none; }
  .brand-text small { display: none; }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .rail .panel + .panel { margin-top: 0; }
  .ct-body { grid-template-columns: minmax(0, 1fr); }
  .ct-side { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; flex-direction: row; flex-wrap: wrap; }
  .ct-side > * { flex: 1 1 200px; }
  .review, .preview-layout, .new-layout, .settings-layout, .split { grid-template-columns: minmax(0, 1fr); }
  .review-side, .side-summary, .settings-preview { position: static; }
  .mt td.in input { min-height: 44px; height: 44px; }
  .mt th, .mt td { height: 44px; }
  .btn { min-height: 40px; }
}
@media (max-width: 760px) {
  .topbar { gap: 8px; }
  .mainnav { display: none; }
  .page-head, .home-head { flex-direction: column; align-items: stretch; }
  .queues, .grid-2, .grid-3, .grid-4, .cat-layout, .rail { grid-template-columns: minmax(0, 1fr); }
  .mats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   Motion & print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .topbar, .ws-head, .preview-side, .sheet-tabs, .page-head, .mk-demo, .note, .crumbs, .entry-toolbar { display: none !important; }
  .page { padding: 0; }
  .preview-layout { display: block; }
  .a4-stage { padding: 0; margin: 0; background: none; border: 0; display: block; }
  .a4 { box-shadow: none; margin: 0; page-break-after: always; }
  .doc-watermark span { -webkit-text-stroke: 1.5px oklch(0.42 0.13 8 / 0.22); }
}
