/* Fonty (SIL Open Font License 1.1): Archivo (Omnibus-Type), IBM Plex Mono (IBM). Licencja: fonts/OFL.txt */
@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2"); font-weight: 400 760; font-stretch: 100% 116%; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-latin-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-latin-ext-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-latin-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-latin-ext-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-latin-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-latin-ext-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* Layout: mobile app shell - orange top bar, one working column, bottom tabs with a raised scan button.
   From 1000px a left sidebar replaces the tabs. The scanner is always a dark camera surface. */
:root {
  --bg: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --sunken: #ebe9e5;
  --line: #e4e1dc;
  --line-strong: #cdc8c1;
  --ink: #1c1a18;
  --ink-2: #4a4642;
  --muted: #736d66;
  --brand: #f26b1d;
  --accent: #cf4a00;
  --accent-hover: #b84200;
  --accent-ink: #ffffff;
  --accent-text: #b13e00;
  --accent-soft: #fdeee3;
  --ok: #18794c;
  --ok-soft: #e2f3e9;
  --warn: #855b00;
  --warn-soft: #fff3cf;
  --warn-line: #ecc761;
  --crit: #c21f3a;
  --crit-soft: #fde7ea;
  --crit-line: #f0a3b0;
  --on-crit: #ffffff;
  --info: #2f5fd0;
  --info-soft: #e7edfc;
  --violet: #6a4fc4;
  --violet-soft: #eee9fb;
  --header-bg: #f26b1d;
  --header-ink: #ffffff;
  --header-line: transparent;
  --scrim: rgba(20, 12, 6, .5);
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 6px 20px rgba(40, 30, 20, .07);
  --shadow-lg: 0 10px 40px rgba(30, 20, 10, .2);
  --focus: #cf4a00;
  --font-ui: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-app-theme="light"]) {
    --bg: #121110; --surface: #1c1a19; --surface-2: #22201e; --sunken: #171615; --line: #302c29; --line-strong: #47423d;
    --ink: #f3efea; --ink-2: #d4cec7; --muted: #a39c94;
    --brand: #f47a2e; --accent: #f47a2e; --accent-hover: #ff8b44; --accent-ink: #1a0e05; --accent-text: #ff9d61; --accent-soft: #3b2416;
    --ok: #4fc98f; --ok-soft: #163020; --warn: #f0bf4c; --warn-soft: #352a12; --warn-line: #6e5720;
    --crit: #ff7a8e; --crit-soft: #3d1a20; --crit-line: #7c3140; --on-crit: #1f0a0e; --info: #8aa9ff; --info-soft: #1b2543; --violet: #b6a4ff; --violet-soft: #282142;
    --header-bg: #1c1a19; --header-ink: #ffffff; --header-line: #f47a2e; --scrim: rgba(0, 0, 0, .62);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .6); --focus: #ff9d61;
    color-scheme: dark;
  }
}
:root[data-theme="dark"]:not([data-app-theme="light"]), :root[data-app-theme="dark"] {
  --bg: #121110; --surface: #1c1a19; --surface-2: #22201e; --sunken: #171615; --line: #302c29; --line-strong: #47423d;
  --ink: #f3efea; --ink-2: #d4cec7; --muted: #a39c94;
  --brand: #f47a2e; --accent: #f47a2e; --accent-hover: #ff8b44; --accent-ink: #1a0e05; --accent-text: #ff9d61; --accent-soft: #3b2416;
  --ok: #4fc98f; --ok-soft: #163020; --warn: #f0bf4c; --warn-soft: #352a12; --warn-line: #6e5720;
  --crit: #ff7a8e; --crit-soft: #3d1a20; --crit-line: #7c3140; --on-crit: #1f0a0e; --info: #8aa9ff; --info-soft: #1b2543; --violet: #b6a4ff; --violet-soft: #282142;
  --header-bg: #1c1a19; --header-ink: #ffffff; --header-line: #f47a2e; --scrim: rgba(0, 0, 0, .62);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .6); --focus: #ff9d61;
  color-scheme: dark;
}
:root[data-app-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(23px, 3.4vw, 30px); line-height: 1.14; font-weight: 720; font-stretch: 110%; letter-spacing: -.012em; }
h2 { font-size: 16.5px; line-height: 1.3; font-weight: 680; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
.mono { font-family: var(--font-mono); letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 8px 0; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.ic { flex: none; display: block; }
.hide { display: none !important; }

/* shell */
.app { min-height: 100%; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--header-bg); color: var(--header-ink); border-bottom: 2px solid var(--header-line); }
.topbar-in { height: 56px; display: flex; align-items: center; gap: 4px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 4px 6px 0; color: inherit; }
.pcc-logo { height: 23px; width: auto; display: block; }
.brand-sep { width: 1.5px; height: 22px; background: currentColor; opacity: .5; }
.brand-name { font-weight: 760; font-stretch: 116%; font-size: 19px; letter-spacing: .005em; }
.topbar-sp { flex: 1; }
.live { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; margin-right: 4px; border-radius: 99px; background: rgba(255, 255, 255, .17); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ffffff; animation: pulse 2.4s ease-out infinite; }
.tb-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 0; background: transparent; color: inherit; }
.tb-btn:hover { background: rgba(255, 255, 255, .15); }
.tb-badge { position: absolute; top: 4px; right: 3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #ffffff; color: #b13e00; font-size: 11.5px; font-weight: 760; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.tb-user { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; padding: 0; }
.tb-user .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
@media (max-width: 420px) { .live-t { display: none; } .live { padding: 0 8px; } }

.layout { display: block; }
.sidenav { display: none; }
.main { display: block; width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 18px 168px; }
.main.solo { max-width: 640px; padding-block: 28px 60px; }
.view { display: grid; gap: 16px; min-width: 0; }

@media (min-width: 1000px) {
  .layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start; }
  .sidenav { display: block; position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 58px); overflow-y: auto; padding: 18px 14px 28px max(16px, env(safe-area-inset-left, 0px)); border-right: 1px solid var(--line); background: var(--surface); min-height: calc(100vh - 58px); }
  .main { padding-block: 26px 80px; padding-left: 32px; padding-right: max(32px, env(safe-area-inset-right, 0px)); }
  .bottomnav { display: none !important; }
}
.btn-scan-side { width: 100%; margin-bottom: 14px; min-height: 50px; font-size: 16px; }
.sidenav ul { list-style: none; display: grid; gap: 2px; }
.nav-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 680; padding: 16px 10px 6px; }
.nav-i { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 580; text-align: left; }
.nav-i:hover { background: var(--surface-2); color: var(--ink); }
.nav-i.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 720; display: grid; place-items: center; }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); box-shadow: 0 -6px 24px rgba(30, 20, 10, .07); }
.bn-in { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; height: 64px; max-width: 560px; margin: 0 auto; }
.bn-i { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 64px; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 640; }
.bn-i.on { color: var(--accent-text); }
.bn-scan { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: var(--ink); font-size: 11.5px; font-weight: 720; padding: 0 0 7px; }
.bn-scan-c { width: 62px; height: 62px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #ffffff; box-shadow: 0 6px 18px rgba(242, 107, 29, .42), 0 0 0 5px var(--surface); transition: transform .12s; }
.bn-scan:active .bn-scan-c { transform: scale(.95); }

.draftbar { position: fixed; z-index: 35; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(78px + env(safe-area-inset-bottom, 0px)); max-width: 540px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); text-align: left; animation: up .25s ease-out; }
.draftbar-t { flex: 1; min-width: 0; display: grid; font-size: 13px; color: var(--muted); }
.draftbar-t b { font-size: 15px; color: var(--ink); }
@media (min-width: 1000px) { .draftbar { left: auto; right: 28px; bottom: 24px; width: 380px; margin: 0; } }

.banner { display: flex; align-items: center; gap: 8px; padding-block: 9px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--warn-soft); color: var(--warn); font-size: 13.5px; font-weight: 620; }
.banner-info { background: var(--info-soft); color: var(--info); }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 630; font-size: 15px; line-height: 1.15; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; text-align: center; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-big { min-height: 54px; font-size: 16.5px; border-radius: 14px; padding: 0 22px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; }
.btn-quiet { color: var(--ink-2); }
.btn-danger { color: var(--crit); border-color: var(--crit-line); }
.btn-danger:hover { border-color: var(--crit); }
.btn-danger-solid { background: var(--crit); border-color: var(--crit); color: var(--on-crit); }
.wide { width: 100%; }
label.btn { cursor: pointer; }
.link { border: 0; background: none; color: var(--accent-text); font-weight: 680; padding: 4px 2px; font-size: 14px; }
.link:hover { text-decoration: underline; }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn-accent { color: var(--accent-text); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions.center { justify-content: center; }

:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) { width: 100%; min-height: 46px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 16px; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea):focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
:where(select) { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%238a837b' stroke-width='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 8px center; background-size: 20px; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.searchbar { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 5px 0 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbar input { flex: 1; min-width: 0; min-height: 48px; border: 0; outline: 0; padding: 0; background: transparent; color: var(--ink); font-size: 16px; }
.searchbar input:focus { box-shadow: none; }
.sticky-search { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 6; box-shadow: var(--shadow); }

.field { display: grid; gap: 6px; min-width: 0; }
.field label, .flabel, .field legend { font-size: 13.5px; font-weight: 660; color: var(--ink-2); }
.has-err input, .has-err select { border-color: var(--crit); }
.ferr { color: var(--crit); font-size: 13px; font-weight: 620; }
.fhint { color: var(--muted); font-size: 13px; }
.warn-t { color: var(--warn); }
.form { display: grid; gap: 16px; }
.fgrid { display: grid; gap: 14px; }
@media (min-width: 700px) { .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span2 { grid-column: 1 / -1; } }
.fsec { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.panel > .fsec { margin-bottom: 12px; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.code-edit { display: grid; gap: 14px; }
@media (min-width: 700px) { .code-edit { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
.code-prev { background: #ffffff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-height: 120px; display: grid; place-items: center; }
.nocode { color: #625c55; font-size: 13px; text-align: center; padding: 12px; }
.photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 580; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 46px; height: 28px; border-radius: 14px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2.5px solid var(--focus); outline-offset: 2px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); max-width: 100%; }
.seg-i { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-weight: 640; }
.seg-i.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 0 1px var(--line); }
.seg-sm .seg-i { min-height: 34px; padding: 0 10px; font-size: 14px; }
.seg-fmt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.seg-fmt .seg-i { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; text-align: left; }
.seg-fmt .seg-i span { font-size: 12.5px; color: var(--muted); font-weight: 520; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 620; font-size: 14px; }
.chip > span { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip.on > span { color: inherit; opacity: .72; }
.chip-alert.on { background: var(--crit); border-color: var(--crit); color: var(--surface); }
.chip .tbadge { min-width: 0; height: 22px; padding: 0 5px; font-size: 11px; }
.list-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sortsel select { min-height: 36px; width: auto; padding-left: 10px; font-size: 14px; border-radius: 10px; }

/* building blocks */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.panel-h h2 { display: flex; align-items: center; gap: 8px; }
.vhead { display: grid; gap: 6px; }
.back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent-text); font-weight: 680; padding: 4px 0; justify-self: start; margin-left: -4px; }
.vhead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vhead-t { min-width: 0; flex: 1 1 280px; }
.vhead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 680; margin-bottom: 6px; }
.lead { color: var(--ink-2); margin-top: 6px; max-width: 64ch; }
.sub-h { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 18px 0 4px; font-weight: 700; }

.thumb { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); object-fit: cover; }
.thumb-sm { width: 34px; height: 34px; border-radius: 10px; }
.thumb-lg { width: 64px; height: 64px; border-radius: 16px; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 720; letter-spacing: .01em; white-space: nowrap; }
.pill-crit { background: var(--crit-soft); color: var(--crit); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-off { background: var(--sunken); color: var(--muted); }
.tbadge { flex: none; display: inline-grid; place-items: center; min-width: 42px; height: 26px; padding: 0 6px; border-radius: 7px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.t-RW { background: var(--accent-soft); color: var(--accent-text); }
.t-PZ, .t-BO { background: var(--ok-soft); color: var(--ok); }
.t-MM { background: var(--info-soft); color: var(--info); }
.t-INW { background: var(--violet-soft); color: var(--violet); }
.avatar { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #ffffff; font-weight: 720; font-size: 14px; letter-spacing: .02em; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 54px; height: 54px; font-size: 18px; }
.barcode { width: 100%; max-width: 290px; height: auto; display: block; margin: 0 auto; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.empty-t { font-weight: 700; color: var(--ink); font-size: 16px; }
.empty-x { max-width: 46ch; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 560; }
.callout .ic { margin-top: 1px; }
.callout.lv-crit { background: var(--crit-soft); color: var(--crit); }
.callout.lv-warn { background: var(--warn-soft); color: var(--warn); }
.flash { animation: flash 1.6s ease-out; }

/* start */
.greet { padding-top: 2px; }
.panel-alert { border-color: var(--warn-line); }
.panel-alert h2 .ic { color: var(--crit); }
.panel-okay { display: flex; align-items: center; gap: 10px; color: var(--ok); border-color: transparent; background: var(--ok-soft); font-weight: 640; }
.alist { list-style: none; display: grid; }
.arow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.arow:first-child { border-top: 0; }
.arow-main { flex: 1 1 240px; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 0; color: var(--ink); }
.arow-t { min-width: 0; display: grid; gap: 1px; }
.arow-n { font-weight: 660; }
.arow-x { font-size: 13px; color: var(--muted); }
.lv-crit .arow-x { color: var(--crit); }
.lv-warn .arow-x { color: var(--warn); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.qa { position: relative; display: grid; align-content: start; justify-items: start; gap: 3px; padding: 14px; min-height: 118px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: var(--ink); transition: border-color .15s, transform .1s; }
.qa:hover { border-color: var(--accent); }
.qa:active { transform: scale(.985); }
.qa-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 8px; flex: none; }
.qa-t { font-weight: 720; font-size: 15.5px; }
.qa-x { font-size: 13px; color: var(--muted); }
.qa-badge { position: absolute; top: 12px; right: 12px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 720; display: grid; place-items: center; }
.tip { display: grid; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--accent-soft); color: var(--ink); }
.tip-art { justify-self: center; width: 190px; padding: 10px 12px 6px; background: #ffffff; border-radius: 6px; transform: rotate(-3deg); box-shadow: 0 10px 22px rgba(120, 50, 0, .18); }
.tip-body { display: grid; gap: 6px; justify-items: start; }
.tip-body p { color: var(--ink-2); max-width: 56ch; }
.tip-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
@media (min-width: 640px) { .tip { grid-template-columns: 220px minmax(0, 1fr); padding: 18px 22px; } }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stats > div { background: var(--surface); padding: 12px 14px; min-width: 0; }
.stats dt { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stats dd { margin: 2px 0 0; font-size: 21px; font-weight: 720; font-stretch: 104%; }
.stats dd small { font-size: 13px; color: var(--muted); font-weight: 600; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cols { display: grid; gap: 16px; }
@media (min-width: 900px) { .cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.mlist { list-style: none; }
.mlist > li + li { border-top: 1px solid var(--line); }
.mrow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 0; border: 0; background: none; text-align: left; color: var(--ink); }
.mrow:hover .mrow-t { color: var(--accent-text); }
.mrow-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.mrow-t { font-weight: 620; overflow-wrap: anywhere; }
.mrow-m { font-size: 12.5px; color: var(--muted); }
.mrow-q { font-weight: 720; font-size: 15px; flex: none; }
.q-RW { color: var(--accent-text); }
.q-PZ, .q-BO { color: var(--ok); }
.q-MM { color: var(--info); }
.q-INW { color: var(--violet); }
.hbars { list-style: none; display: grid; gap: 10px; margin-top: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(84px, 120px) minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.hb-n { font-size: 14px; font-weight: 620; overflow-wrap: anywhere; }
.hb-t { height: 12px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.hb-f { display: block; height: 100%; border-radius: 6px; background: var(--brand); }
.hb-v { font-size: 13px; color: var(--ink-2); min-width: 64px; text-align: right; }
.toplist { list-style: none; counter-reset: top; }
.toplist li { counter-increment: top; }
.toplist button { width: 100%; display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border: 0; border-top: 1px dashed var(--line); background: none; text-align: left; color: var(--ink); font-size: 14px; }
.toplist li:first-child button { border-top: 0; }
.toplist button::before { content: counter(top); flex: none; width: 20px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.toplist button span:first-child { flex: 1; min-width: 0; }
.toplist button:hover span:first-child { color: var(--accent-text); }

/* stock list */
.stock { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.srow { width: 100%; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; grid-template-areas: "th nm sz mg" "th st sz mg"; column-gap: 12px; row-gap: 3px; align-items: center; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); }
.srow:first-child { border-top: 0; }
.srow:hover { background: var(--surface-2); }
.srow-head { display: none; }
.c-thumb { grid-area: th; }
.c-name { grid-area: nm; min-width: 0; display: grid; gap: 1px; }
.c-cat { display: none; }
.c-sz { grid-area: sz; }
.c-mg { grid-area: mg; }
.c-st { grid-area: st; justify-self: start; }
.c-st:empty { display: none; }
.s-name { font-weight: 660; overflow-wrap: anywhere; }
.s-meta { font-size: 12.5px; color: var(--muted); }
.s-ean { display: none; }
.c-num { display: grid; justify-items: end; min-width: 50px; }
.c-lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.c-num b { font-size: 18px; font-weight: 720; }
.c-num.low b { color: var(--warn); }
.lv-crit .c-sz b, .lv-crit .c-mg b { color: var(--crit); }
@media (min-width: 760px) {
  .srow, .srow-head { grid-template-columns: 46px minmax(0, 2.4fr) minmax(0, 1fr) 76px 76px 116px; grid-template-areas: none; }
  .c-thumb, .c-name, .c-cat, .c-sz, .c-mg, .c-st { grid-area: auto; }
  .srow-head { display: grid; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding-block: 10px; background: var(--surface-2); }
  .srow-head:hover { background: var(--surface-2); }
  .srow-head .c-num { min-width: 0; }
  .c-cat { display: block; color: var(--ink-2); font-size: 14px; }
  .c-lbl { display: none; }
  .s-ean { display: inline; }
  .c-st { justify-self: end; }
  .c-st:empty { display: block; }
}

/* product */
.pgrid { display: grid; gap: 16px; }
@media (min-width: 860px) { .pgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; } }
.pcard { display: grid; gap: 14px; }
.pcard-top { display: flex; align-items: center; gap: 14px; }
.pc-idx { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.pcard-code { background: #ffffff; border-radius: 12px; padding: 14px 12px 10px; border: 1px solid var(--line); }
.pcard-code .muted { color: #625c55; text-align: center; margin-top: 6px; }
.stockcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: start; }
.sc { display: grid; gap: 2px; align-content: start; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.sc-l { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.sc-v { font-size: 30px; font-weight: 740; font-stretch: 104%; line-height: 1.1; }
.sc-v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.sc-m { font-size: 12px; color: var(--muted); }
.sc-low { border-color: var(--warn-line); background: var(--warn-soft); }
.sc-low .sc-v { color: var(--warn); }
.sc-crit { border-color: var(--crit-line); background: var(--crit-soft); }
.sc-crit .sc-v { color: var(--crit); }
.stockcards .callout { grid-column: 1 / -1; }
@media (max-width: 480px) { .stockcards { gap: 8px; } .sc { padding: 10px; } .sc-v { font-size: 23px; } .sc-l, .sc-m { font-size: 11.5px; } }
.danger-zone { display: flex; gap: 8px; flex-wrap: wrap; }

/* operations */
.op-opts { display: grid; gap: 6px; justify-items: start; }
.op-opts.mm { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; justify-items: stretch; }
.op-opts.mm > div { display: grid; gap: 6px; min-width: 0; }
.op-opts.mm .seg { display: flex; width: 100%; }
.op-opts.mm .seg-i { flex: 1; padding: 0 8px; }
.swap-btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); width: 46px; height: 46px; border-radius: 12px; }
@media (max-width: 560px) { .op-opts.mm { grid-template-columns: 1fr; } .swap-btn { justify-self: center; transform: rotate(90deg); } }
.op-add { display: grid; gap: 10px; }
@media (min-width: 760px) { .op-add { grid-template-columns: auto minmax(0, 1fr); align-items: start; } }
.picker { position: relative; min-width: 0; }
.picker-list { list-style: none; margin: 6px 0 0; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 2px; }
.picker-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: none; text-align: left; color: var(--ink); }
.picker-list button:hover, .picker-list button:focus-visible { background: var(--surface-2); }
.pk-t { flex: 1; min-width: 0; display: grid; }
.picker-none { padding: 10px; color: var(--muted); font-size: 14px; }
.lines { list-style: none; display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "th t" "q q"; gap: 10px 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.line > .thumb { grid-area: th; }
.line-t { grid-area: t; min-width: 0; display: grid; gap: 2px; }
.line-q { grid-area: q; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
@media (min-width: 640px) { .line { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "th t q"; } }
.line-n { font-weight: 660; overflow-wrap: anywhere; }
.line-err { border-color: var(--crit-line); background: var(--crit-soft); }
.lines-empty { display: grid; justify-items: center; gap: 8px; padding: 30px 16px; border: 1.5px dashed var(--line-strong); border-radius: 16px; color: var(--muted); text-align: center; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--surface); flex: none; }
.stepper button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: var(--surface-2); color: var(--ink); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper input { width: 64px; min-height: 44px; border: 0; border-radius: 0; padding: 0; text-align: center; font-weight: 720; font-size: 18px; font-variant-numeric: tabular-nums; background: transparent; color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.stepper input:focus { outline: none; background: var(--accent-soft); }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button, .inw-c input::-webkit-inner-spin-button, .inw-c input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.op-fields { display: grid; gap: 12px; }
@media (min-width: 700px) { .op-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .op-who { grid-column: 1 / -1; } }
.op-submit { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
@media (min-width: 1000px) { .op-submit { bottom: 16px; } }
.op-sum { font-size: 15px; color: var(--ink-2); }
.op-submit .btn { flex: 1 1 220px; }
.inw-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 620; cursor: pointer; }
.check input, .lab-ck input, .pt-ck input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.inw { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.inw-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.inw-row:first-child { border-top: 0; }
.inw-t { min-width: 0; display: grid; overflow-wrap: anywhere; }
.inw-c { display: flex; align-items: center; gap: 8px; }
.inw-c input { width: 74px; text-align: center; font-weight: 720; font-variant-numeric: tabular-nums; padding: 0 6px; -moz-appearance: textfield; appearance: textfield; }
.inw-d { min-width: 52px; text-align: right; font-size: 13px; font-weight: 720; color: var(--muted); }
.inw-d.pos { color: var(--ok); }
.inw-d.neg { color: var(--crit); }
.is-counted { background: var(--surface-2); }
.has-diff .inw-c input { border-color: var(--warn-line); }
.done { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 18px; }
.done-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); justify-self: center; }
.done-lines { list-style: none; margin: 6px 0; width: 100%; max-width: 440px; text-align: left; }
.done-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }

/* history */
.hgroup { display: grid; gap: 8px; }
.hday { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 0 2px; }
.hgroup .mlist { padding: 2px 14px; }
.msheet { display: grid; gap: 4px; }
.ms-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-right: 40px; }
.ms-head h2 { font-size: 18px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0 0 14px; }
.kv dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 620; overflow-wrap: anywhere; }
.ms-lines { list-style: none; border-top: 1px solid var(--line); }
.ms-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ms-n { display: grid; min-width: 0; font-weight: 600; }
.ms-r { display: grid; justify-items: end; text-align: right; flex: none; }
.ms-r b { font-size: 17px; }

/* labels */
.lab-grid { display: grid; gap: 16px; }
@media (min-width: 980px) { .lab-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } .lab-prev { position: sticky; top: 78px; } }
.lab-pick { display: grid; gap: 12px; min-width: 0; }
.lab-list { list-style: none; padding: 2px 12px; }
.lab-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lab-list li:first-child { border-top: 0; }
.lab-ck { flex: 1 1 200px; min-width: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.lab-t { display: grid; min-width: 0; overflow-wrap: anywhere; }
.lab-prev-p { display: grid; gap: 12px; }
.lab-one { padding: 18px; background: var(--sunken); border-radius: 12px; }
.lab-one .label-svg { max-width: 380px; margin: 0 auto; }
.label-svg { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .16), 0 6px 16px rgba(0, 0, 0, .08); }
.a4 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; width: 100%; max-width: 300px; aspect-ratio: 210 / 297; margin: 0 auto; padding-top: .17%; background: #ffffff; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); border-radius: 2px; }
.a4-cell { aspect-ratio: 70 / 37; outline: .5px dashed #d9d4cd; min-width: 0; }
.a4-cell .label-svg { box-shadow: none; border-radius: 0; height: 100%; }
.lab-sum { font-size: 15px; color: var(--ink-2); }

/* export */
.exp-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .exp-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.exp-main { display: grid; gap: 14px; }
.sheets { list-style: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sheets li { display: grid; gap: 2px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 14px; }
.sheets li:first-child { border-top: 0; }
.sh-n { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sh-n::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--ok); flex: none; }
.exp-live { display: grid; gap: 10px; background: var(--surface-2); }
.exp-live h2 { display: flex; gap: 8px; align-items: center; }
.exp-live p { color: var(--ink-2); font-size: 14.5px; }

/* users */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 660; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab > span { color: var(--muted); font-weight: 600; }
.ulist { list-style: none; padding: 2px 14px; }
.ulist li + li { border-top: 1px solid var(--line); }
.umenu .ulist { padding: 0; }
.urow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 0; border: 0; background: none; text-align: left; color: var(--ink); }
.urow:hover .u-t > span:first-child { color: var(--accent-text); }
.urow.off { opacity: .62; }
.u-t { flex: 1; min-width: 0; display: grid; overflow-wrap: anywhere; }
.u-t > span:first-child { font-weight: 640; }
.you { font-size: 11.5px; font-weight: 720; color: var(--accent-text); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; margin-left: 4px; }
.role { font-size: 12.5px; font-weight: 680; padding: 3px 8px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; flex: none; }
.role-admin { background: var(--accent-soft); color: var(--accent-text); }
.role-magazynier { background: var(--info-soft); color: var(--info); }
.role-podglad { background: var(--violet-soft); color: var(--violet); }
@media (max-width: 460px) { .ulist .urow .role { display: none; } }
.table-wrap { overflow-x: auto; padding: 0; }
.ptable { width: 100%; border-collapse: collapse; min-width: 580px; font-size: 14px; }
.ptable th, .ptable td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.ptable tbody tr:last-child th, .ptable tbody tr:last-child td { border-bottom: 0; }
.ptable thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); font-weight: 700; }
.ptable tbody th { text-align: left; font-weight: 620; }
.pt-ck { display: inline-grid; place-items: center; cursor: pointer; }
.roles { list-style: none; display: grid; gap: 8px; }
@media (min-width: 700px) { .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.roles li { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.roles-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.rcard { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); cursor: pointer; }
.rcard.on { border-color: var(--accent); background: var(--accent-soft); }
.rcard input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.rcard > span { display: grid; }
.umenu { display: grid; gap: 14px; }
.um-me { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.um-me h2 { font-size: 19px; }
.more-g { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 8px 2px 0; font-weight: 700; }
.more-i { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 650; text-align: left; width: 100%; }
.more-i > span:nth-child(2) { flex: 1; }
.more-i .qa-ic { margin: 0; }
.set-sec { display: grid; gap: 12px; justify-items: start; }
.set-sec > .fgrid, .set-sec > .callout { width: 100%; }
.about { justify-items: start; }
.logo-ink { height: 30px; color: var(--accent-text); }

/* first run */
.firstrun { max-width: 520px; margin: 0 auto; }
.fr-card { display: grid; gap: 14px; padding: 26px 20px; }
.fr-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.fr-or::before, .fr-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* sheets and toasts */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: var(--scrim); animation: fade .2s; }
.sheet { position: relative; width: 100%; max-width: 620px; max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); padding-bottom: env(safe-area-inset-bottom, 0px); animation: up .26s cubic-bezier(.2, .8, .2, 1); }
.sheet-grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 10px auto 0; flex: none; }
.sheet-x { position: absolute; top: 10px; right: 10px; z-index: 2; }
.sheet-body { overflow-y: auto; padding-top: 14px; padding-bottom: 22px; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); overscroll-behavior: contain; }
.sheet-title { margin-bottom: 14px; padding-right: 40px; font-size: 19px; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.confirm { display: grid; gap: 10px; padding-right: 30px; }
.confirm .sheet-foot { justify-content: flex-end; }
@media (min-width: 720px) { .sheet-wrap { align-items: center; padding: 24px; } .sheet { border-radius: 22px; max-height: 84vh; } .sheet-grab { display: none; } .sheet-body { padding-top: 22px; } }
.toasts { position: fixed; z-index: 95; left: 0; right: 0; top: calc(66px + env(safe-area-inset-top, 0px)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 520px; padding: 11px 14px; border-radius: 14px; background: #24211f; color: #f6f3ef; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font-weight: 580; font-size: 14.5px; animation: drop .25s ease-out; }
.toast .ic { margin-top: 1px; }
.toast-ok .ic { color: #5fd49d; }
.toast-info .ic { color: #8aa9ff; }
.toast-warn .ic { color: #f0bf4c; }
.toast-crit .ic { color: #ff8797; }

/* scanner: a dark camera surface in both themes */
.scanner {
  --ink: #f6f3ef; --ink-2: #d9d3cc; --muted: #a9a29a; --surface: #1d1b19; --surface-2: #262320; --sunken: #151412; --line: #34302c; --line-strong: #4a4540;
  --accent: #f47a2e; --accent-hover: #ff8b44; --accent-ink: #1a0e05; --accent-text: #ff9d61; --accent-soft: #3b2416;
  --ok: #5fd49d; --ok-soft: #163020; --warn: #f0bf4c; --warn-soft: #352a12; --warn-line: #6e5720; --crit: #ff8797; --crit-soft: #3d1a20; --crit-line: #7c3140; --on-crit: #1f0a0e; --focus: #ff9d61;
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: #0f0e0d; color: var(--ink); padding-top: env(safe-area-inset-top, 0px); color-scheme: dark;
}
.sc-head { display: flex; align-items: center; gap: 10px; flex: none; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sc-x { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: var(--ink); flex: none; }
.sc-x.on { background: #f2c94c; color: #1a1406; }
.sc-x-sp { width: 44px; flex: none; }
.sc-title { flex: 1; min-width: 0; display: grid; text-align: center; }
.sc-title b { font-size: 16px; }
.sc-title span { font-size: 12.5px; color: var(--muted); }
.sc-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-top: 2px; padding-bottom: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sc-scroll > * { max-width: 600px; margin-left: auto; margin-right: auto; }
.sc-scroll > * + * { margin-top: 12px; }
.sc-view { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 42vh; border-radius: 20px; overflow: hidden; background: radial-gradient(120% 90% at 50% 40%, #2a2724 0%, #121110 72%); display: grid; place-items: center; }
.sc-video, .sc-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-photo { object-fit: contain; background: #000000; }
.sc-idle { display: grid; justify-items: center; gap: 10px; text-align: center; color: var(--muted); padding: 20px; font-size: 14.5px; }
.sc-c { position: absolute; width: 34px; height: 34px; border: 4px solid #f26b1d; transition: border-color .2s; pointer-events: none; }
.sc-c.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.sc-c.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.sc-c.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.sc-c.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.ph-hit .sc-c { border-color: #3ddc84; }
.ph-miss .sc-c { border-color: #f2c94c; }
.sc-laser { position: absolute; left: 9%; right: 9%; top: 50%; height: 2px; background: #ff3b2f; box-shadow: 0 0 12px 2px rgba(255, 59, 47, .65); animation: laser 1.5s ease-in-out infinite; pointer-events: none; }
.sc-status { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 6px 12px; border-radius: 99px; background: rgba(0, 0, 0, .6); font-size: 13px; font-weight: 640; white-space: nowrap; }
.sc-demo { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, #cfc8be, #a9a196); }
.sc-demo-label { width: 70%; max-width: 360px; transform: rotate(-2.6deg); animation: slidein .7s cubic-bezier(.2, .8, .2, 1); }
.sc-demo-label .label-svg { box-shadow: 0 18px 30px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .25); }
.sc-read { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-size: 14px; color: #8be3b4; }
.sc-via { color: var(--muted); }
.sc-msg { color: #f2c94c; font-size: 14px; }
.sc-ctrl { display: grid; gap: 12px; }
.scanner .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: var(--ink); }
.scanner .btn:hover { border-color: rgba(255, 255, 255, .4); }
.scanner .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scanner .btn-primary:hover { background: var(--accent-hover); }
.sc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scanner .sc-demo-btn { border-color: rgba(244, 122, 46, .65); }
.sc-note { font-size: 12.5px; color: var(--muted); }
.sc-manual { display: grid; gap: 6px; }
.sc-sug { margin-top: 0; }
.sc-result { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: grid; gap: 14px; animation: up .25s ease-out; }
.sc-miss { gap: 10px; }
.scr-top { display: flex; gap: 14px; align-items: center; }
.scr-t { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.scr-t h2 { font-size: 19px; overflow-wrap: anywhere; }
.scr-stock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; }
.scr-stock div { background: var(--surface-2); padding: 10px 12px; display: grid; }
.scr-stock span { font-size: 12.5px; color: var(--muted); }
.scr-stock b { font-size: 26px; font-weight: 740; }
.scr-qty { display: grid; gap: 10px; justify-items: start; }
.quickq { display: flex; gap: 6px; flex-wrap: wrap; }
.qq { min-width: 44px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-weight: 720; }
.qq.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scr-more { justify-content: flex-start; }
.sc-foot { flex: none; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-top: 1px solid var(--line); background: #0f0e0d; }
.sc-foot > * { max-width: 600px; margin: 0 auto; }
.scanner .sc-finish { justify-content: space-between; background: #f5f2ee; color: #171513; border: 0; }
.scanner .sc-finish:hover { background: #ffffff; }
.sc-finish span { display: inline-flex; align-items: center; gap: 6px; }

/* loading */
.loading { gap: 14px; }
.sk { border-radius: 14px; background: linear-gradient(90deg, var(--sunken), var(--surface-2), var(--sunken)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
.sk-h { height: 34px; width: 60%; }
.sk-p { height: 90px; }
.sk-q { height: 110px; }
.sk.tall { height: 220px; }

@keyframes up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes laser { 0%, 100% { transform: translateY(-36px); } 50% { transform: translateY(36px); } }
@keyframes slidein { from { transform: translateY(42%) rotate(-9deg); opacity: 0; } to { transform: rotate(-2.6deg); opacity: 1; } }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .sc-laser { animation: none; }
}

/* own-server mode: login, passwords, connection state */
.pass-row { display: flex; gap: 8px; align-items: center; }
.pass-row input { flex: 1; min-width: 0; }
.set-sec > .field { width: 100%; }
.login-brand { display: flex; align-items: center; gap: 10px; color: var(--accent-text); margin-bottom: 4px; }
.login-brand .brand-sep { height: 24px; }
.login-name { font-weight: 760; font-stretch: 116%; font-size: 22px; color: var(--ink); }
.err-ic { background: var(--crit-soft); color: var(--crit); }
.live-off { background: rgba(0, 0, 0, .28); }
.live-off .live-dot { background: #f0bf4c; animation: none; }
