:root {
    --bg: #d9dee5;
    --panel: #f8fafc;
    --ink: #111827;
    --muted: #64748b;
    --line: #cbd5e1;
    --accent: #8b0008;
    --dark: #111827;
    --ok: #15803d;
    --warn: #b45309;
    --radius: 10px;
    --shadow: 0 14px 32px rgba(15, 23, 42, .12);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        linear-gradient(135deg, rgba(17,24,39,.92), rgba(139,0,8,.66)),
        radial-gradient(circle at 30% 10%, rgba(255,255,255,.22), transparent 28%),
        var(--bg);
}
iframe[src*="doubleclick"],
iframe[src*="googlesyndication"],
iframe[src*="googleads"],
iframe[src*="adservice"],
iframe[src*="adsterra"],
iframe[src*="propeller"],
iframe[src*="popads"],
iframe[src*="popcash"],
iframe[src*="onclick"],
iframe[src*="mgid"],
iframe[src*="taboola"],
iframe[src*="outbrain"],
iframe[src*="histats"],
iframe[src*="revenuehits"],
iframe[src*="yllix"],
iframe[src*="adnxs"],
body > iframe,
body > frame,
body > object,
body > embed,
.adsbygoogle,
ins.adsbygoogle,
[id^="aswift_"],
[id^="google_ads"],
[id^="ad_iframe"],
[id^="ad-container"],
[id*="adsterra"],
[id*="popads"],
[id*="propeller"],
[class^="ad-"],
[class*=" ad-"],
[class*="-ad "],
[class*="-ads "],
body > div[style*="z-index: 214748"],
body > div[style*="position: fixed"][style*="top: 0"],
body > div[style*="position:fixed"][style*="top:0"],
body > div[style*="position: fixed"][style*="bottom: 0"],
body > div[style*="position:fixed"][style*="bottom:0"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
}
html, body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.content { width: min(1240px, 100%); margin: 0 auto; padding: 14px 14px 96px; }
.topbar {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; color: #fff;
    background: rgba(17,24,39,.94); backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 950; }
.brand span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); }
.topnav { display: flex; flex-wrap: nowrap; gap: 5px; flex: 1; justify-content: center; }
.topnav a, .userbox a { padding: 7px 9px; border-radius: 8px; font-size: 12px; font-weight: 850; color: #dbe4ee; }
.topnav a.active, .topnav a:hover { background: #fff; color: #111827; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.userbox small { color: #aeb8c7; }
.install-btn, .update-btn {
    border: 1px solid rgba(255,255,255,.22); border-radius: 8px;
    min-height: 31px; padding: 0 10px;
    background: #fff; color: #111827; font-size: 12px; font-weight: 950;
    cursor: pointer;
}
.update-btn { background: #e2e8f0; }
.install-btn[hidden] { display: none; }
.login-card {
    width: min(430px, calc(100% - 28px)); margin: 12vh auto 0; padding: 24px;
    background: rgba(248,250,252,.96); border: 1px solid rgba(255,255,255,.32);
    border-radius: 18px; box-shadow: var(--shadow);
}
.login-card h1 { margin: 4px 0; font-size: 36px; }
.eyebrow { color: var(--accent); font-weight: 950; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.version-pill { display: inline-flex; margin-top: 6px; padding: 3px 7px; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: 11px; font-weight: 950; }
.hero, .page-head, .scan-head {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    margin-bottom: 12px; padding: 16px;
    background: rgba(248,250,252,.95); border: 1px solid rgba(255,255,255,.40);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(25px, 4vw, 42px); line-height: 1.05; }
h2 { font-size: 18px; margin-bottom: 10px; }
p { color: var(--muted); }
.panel, .tile, .stats div, .stats a {
    background: rgba(248,250,252,.96); border: 1px solid rgba(255,255,255,.38);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel { padding: 14px; margin-bottom: 12px; }
.panel.compact { padding: 12px; }
.panel.soft { background: rgba(248,250,252,.86); }
.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 16px; min-height: 112px; display: grid; gap: 8px; align-content: start; }
.tile.hot { background: linear-gradient(135deg, #fff, #fee2e2); border-color: #fecaca; }
.tile b { font-size: 18px; }
.tile span, .muted { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stats div, .stats a { padding: 13px; }
.stats a.active-stat { outline: 3px solid rgba(139,0,8,.22); }
.stats span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.stats strong { font-size: 30px; }
.stats.slim { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats.queue-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.btn {
    border: 0; min-height: 42px; padding: 0 14px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 950; cursor: pointer; background: #e2e8f0; color: #111827;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.camera { background: #111827; color: #fff; }
.btn.ghost { background: rgba(17,24,39,.08); color: #111827; }
.btn.danger { background: #991b1b; color: #fff; }
.btn.small { min-height: 34px; font-size: 12px; }
form.stack, .stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 900; color: #334155; }
label span { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
input, select, textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 9px;
    padding: 10px 11px; background: #fff; color: #111827; font-weight: 800;
}
.check-line { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.check-line input { width: auto; }
.check-line span { text-transform: none; letter-spacing: 0; font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 260px; }
.badge { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; background:#e2e8f0; font-weight:950; font-size:11px; text-transform:uppercase; }
.badge.hot { background:#fee2e2; color:#991b1b; }
.model-strip { display:flex; flex-wrap:wrap; gap:5px; min-height:24px; align-items:center; }
.model-filter-strip { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.filter-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.filter-actions .btn { flex:1 1 130px; }
.model-badge {
    display:inline-flex; align-items:center; gap:5px;
    padding:4px 8px; border-radius:999px;
    font-size:11px; line-height:1; font-weight:950;
    border:1px solid rgba(15,23,42,.10);
    white-space:nowrap; text-transform:uppercase;
}
.model-badge em {
    min-width:18px; height:18px; padding:0 5px; border-radius:999px;
    display:inline-grid; place-items:center;
    background:rgba(255,255,255,.72); color:inherit;
    font-style:normal; font-size:10px;
}
.model-wcf { background:#dcfce7; color:#14532d; border-color:#86efac; }
.model-www { background:#dbeafe; color:#1e3a8a; border-color:#93c5fd; }
.model-nxt-www { background:#cffafe; color:#155e75; border-color:#67e8f9; }
.model-nxt-wcf { background:#ccfbf1; color:#115e59; border-color:#5eead4; }
.model-z7 { background:#ede9fe; color:#5b21b6; border-color:#c4b5fd; }
.model-z6 { background:#fef3c7; color:#92400e; border-color:#fcd34d; }
.model-x { background:#e5e7eb; color:#111827; border-color:#cbd5e1; }
.model-archive { background:#f1f5f9; color:#475569; border-color:#cbd5e1; }
.model-sample { background:#ffe4e6; color:#9f1239; border-color:#fda4af; }
.model-other { background:#f3e8ff; color:#6b21a8; border-color:#d8b4fe; }
.model-empty { background:#f8fafc; color:#64748b; border-color:#e2e8f0; }
.active-model { outline:3px solid rgba(17,24,39,.18); box-shadow:0 5px 14px rgba(15,23,42,.12); }
.notice { margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: #e2e8f0; font-weight: 900; }
.notice.ok { background: #dcfce7; color: #14532d; }
.notice.danger { background: #fee2e2; color: #7f1d1d; }
.stats-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.stats-row span { padding: 8px 10px; border-radius: 9px; background: #e2e8f0; font-weight: 850; }
.mini-list { display: grid; gap: 7px; margin-top: 10px; }
.mini-row {
    display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center;
    padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.candidate-row {
    grid-template-columns: 142px 1fr auto auto auto;
    border-width: 2px;
}
.candidate-row .btn { white-space: nowrap; }
.scan-choice-confirm {
    border: 2px solid #86efac;
    background: #f0fdf4;
}
.mini-row span { font-weight: 850; }
.mini-row em { color: var(--muted); font-style: normal; font-weight: 950; white-space: nowrap; }
.big-input { min-height: 62px; font-size: 26px; letter-spacing: .03em; border: 2px solid #111827; }
.scan-shell { display: grid; gap: 10px; }
.scan-head-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.update-inline { min-height: 34px; padding: 0 10px; }
.scan-place-card {
    display: grid;
    grid-template-columns: minmax(160px, .7fr) minmax(220px, 1fr);
    gap: 10px;
    align-items: end;
}
.scan-place-card h2 { margin-bottom: 2px; font-size: 28px; }
.scan-place-card p { margin: 0; }
.scan-place-card .mini-details { grid-column: 1 / -1; }
.scan-form { display: grid; gap: 10px; }
.scan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.scan-form .scan-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scanner-box { display: none; padding: 10px; border: 1px solid #c7d2fe; border-radius: 12px; background: #eef2ff; }
.scanner-box video { width: 100%; max-height: 360px; border-radius: 9px; background: #0f172a; }
.scanner-state, .scan-result {
    padding: 8px 10px; border-radius: 9px; font-weight: 950;
    background: #e2e8f0; color: #111827; border: 1px solid rgba(15,23,42,.08);
}
.scanner-state[data-type="working"], .scan-result[data-type="working"] { background: #fef3c7; color: #7c2d12; }
.scanner-state[data-type="ok"], .scan-result[data-type="ok"] { background: #dcfce7; color: #14532d; }
.scanner-state[data-type="error"], .scan-result[data-type="error"] { background: #fee2e2; color: #7f1d1d; }
.price-card {
    display: grid; gap: 8px; text-align: center;
    padding: 18px 14px; border-radius: 14px;
    background: #fff; border: 2px solid rgba(17,24,39,.10);
    box-shadow: var(--shadow);
}
.price-card strong { font-size: clamp(52px, 16vw, 104px); line-height: .95; color: #111827; }
.price-card p { margin: 0; font-weight: 900; color: #334155; }
.price-card.urgent { background: linear-gradient(135deg, #fff, #fee2e2); border-color: #ef4444; }
.price-card.urgent strong, .price-card.urgent .eyebrow { color: #991b1b; }
.price-card.down { background: linear-gradient(135deg, #fff, #dcfce7); border-color: #86efac; }
.price-card.down strong, .price-card.down .eyebrow { color: #166534; }
.price-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.price-badges span {
    padding: 5px 9px; border-radius: 999px; background: #e2e8f0;
    font-size: 12px; font-weight: 950;
}
.price-badges .model-badge { padding:5px 9px; font-size:12px; }
.price-badges .model-wcf { background:#dcfce7; color:#14532d; border-color:#86efac; }
.price-badges .model-www { background:#dbeafe; color:#1e3a8a; border-color:#93c5fd; }
.price-badges .model-nxt-www { background:#cffafe; color:#155e75; border-color:#67e8f9; }
.price-badges .model-nxt-wcf { background:#ccfbf1; color:#115e59; border-color:#5eead4; }
.price-badges .model-z7 { background:#ede9fe; color:#5b21b6; border-color:#c4b5fd; }
.price-badges .model-z6 { background:#fef3c7; color:#92400e; border-color:#fcd34d; }
.price-badges .model-x { background:#e5e7eb; color:#111827; border-color:#cbd5e1; }
.price-badges .model-archive { background:#f1f5f9; color:#475569; border-color:#cbd5e1; }
.price-badges .model-sample { background:#ffe4e6; color:#9f1239; border-color:#fda4af; }
.price-badges .model-other { background:#f3e8ff; color:#6b21a8; border-color:#d8b4fe; }
.mobile-scan-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.mobile-scan-tabs a {
    min-height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(248,250,252,.82);
    border: 1px solid rgba(255,255,255,.34);
    color: #111827;
    font-weight: 950;
}
.mobile-scan-tabs a.active {
    background: #111827;
    color: #fff;
}
.promo-banner {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    border: 2px solid #fdba74;
}
.promo-banner b { font-size: 18px; letter-spacing: .08em; }
.promo-banner span { font-weight: 950; }
.location-chips {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}
.location-chips span {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-weight: 900;
}
.location-chips em {
    font-style: normal;
    color: #fde68a;
    font-weight: 950;
}
.mobile-last-scan {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    padding: 9px 10px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #86efac;
}
.mobile-last-scan span {
    grid-row: span 2;
    align-self: center;
    color: #166534;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}
.mobile-last-scan b { color: #14532d; }
.mobile-last-scan em {
    color: #166534;
    font-style: normal;
    font-weight: 850;
    line-height: 1.2;
}
.mobile-buffer-panel,
.mobile-saved-place-panel,
.mobile-scan-list-panel {
    padding: 0;
    overflow: hidden;
}
.mobile-buffer-summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    font-weight: 950;
}
.mobile-buffer-summary span { color: #111827; }
.mobile-buffer-summary b {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}
.mobile-buffer-panel > :not(summary),
.mobile-saved-place-panel > :not(summary),
.mobile-scan-list-panel > :not(summary) {
    margin: 10px 12px;
}
.price-mode .price-card {
    position: sticky;
    top: 56px;
    z-index: 9;
    border-width: 3px;
    border-color: rgba(17,24,39,.28);
}
.price-mode .price-card strong { font-size: clamp(58px, 15vw, 112px); }
.price-mode .price-place-form { margin-bottom: 6px; }
.bottom-action {
    position: sticky; bottom: 76px; z-index: 8;
    width: 100%; min-height: 50px; border: 0; border-radius: 12px;
    background: #111827; color: #fff; font-weight: 950;
    box-shadow: var(--shadow);
}
.quick-dialog {
    width: min(460px, calc(100% - 24px)); border: 0; border-radius: 14px;
    padding: 16px; box-shadow: 0 24px 72px rgba(15,23,42,.28);
}
.quick-dialog::backdrop { background: rgba(15,23,42,.55); }
.install-dialog { color: #111827; }
.install-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.install-status { display: grid; gap: 8px; margin: 10px 0; }
.install-status div { display: flex; justify-content: space-between; gap: 12px; padding: 9px; border-radius: 9px; background: #f1f5f9; }
.install-status span { color: var(--muted); font-weight: 900; text-align: right; }
.mini-details { border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: #fff; }
.mini-details summary { font-weight: 950; cursor: pointer; }
.danger-zone { border-color: #fecaca; background: #fff7f7; }
.danger-zone summary { color: #991b1b; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.place-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.place-card { padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: grid; gap: 0; overflow: hidden; }
.place-card strong { font-size: 24px; }
.place-card-summary {
    cursor: pointer;
    display: grid;
    gap: 8px;
    padding: 11px 12px;
    list-style: none;
}
.place-card-summary::-webkit-details-marker { display: none; }
.place-card-summary::after {
    content: "Rozwin";
    justify-self: start;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}
.place-card[open] .place-card-summary { border-bottom: 1px solid var(--line); }
.place-card[open] .place-card-summary::after {
    content: "Zwin";
    background: #111827;
    color: #fff;
}
.place-card-body {
    display: grid;
    gap: 8px;
    padding: 10px 12px 12px;
}
.place-card-head { display: grid; gap: 2px; min-height: 52px; }
.place-card-head span { color: var(--muted); font-weight: 850; font-size: 12px; line-height: 1.25; }
.place-barcode { padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; gap: 4px; }
.place-barcode svg { width: 100%; height: 74px; display: block; }
.place-barcode small { color: #111827; font-weight: 950; text-align: center; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 9px; overflow: hidden; }
th, td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: #e2e8f0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.list { display: grid; gap: 8px; }
.line, .problem-line, .metric-line {
    display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.line em, .problem-line em, .problem-line small, .metric-line span { color: var(--muted); font-style: normal; }
.danger-line { border-color: #fca5a5; background: #fff1f2; }
.danger-line b, .danger-line em { color: #991b1b; }
.problem-line b { color: var(--accent); text-transform: uppercase; }
.model-line { border-color: #fca5a5; background: #fff1f2; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.report-grid .table-wrap { max-height: 280px; overflow: auto; }
.report-source-panel {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px;
    align-items: center; margin-bottom: 12px;
}
.report-source-panel h2 { margin: 3px 0 5px; }
.report-source-panel p { margin: 0; }
.report-source-switch { display: flex; gap: 8px; align-items: stretch; }
.report-source-switch .btn { min-width: 150px; flex-direction: column; gap: 1px; line-height: 1.15; }
.report-source-switch small { font-size: 11px; opacity: .8; }
.report-details { padding: 0; overflow: hidden; }
.report-details summary {
    cursor: pointer; display: flex; justify-content: space-between; gap: 10px;
    align-items: center; padding: 12px 14px; background: #e2e8f0; font-weight: 950;
}
.report-details summary span { color: var(--muted); font-size: 12px; text-align: right; }
.report-details > .table-wrap, .report-details > .list, .report-details > p, .report-details > h2, .report-details .snapshot-tabs {
    margin: 10px 12px;
}
.compact-table { max-height: 310px; overflow: auto; }
.snapshot-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.flash { margin-bottom: 12px; padding: 10px 12px; border-radius: 9px; background: #dcfce7; color: #14532d; font-weight: 900; }
.side-status {
    position: fixed; right: 12px; top: 72px; z-index: 1000;
    display: flex; align-items: center; gap: 8px;
    padding: 9px 11px; border-radius: 999px;
    background: rgba(17,24,39,.94); color: #fff;
    box-shadow: 0 14px 36px rgba(15,23,42,.22);
    transform: translateX(calc(100% + 18px));
    opacity: 0; pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
}
.side-status.active { transform: translateX(0); opacity: 1; }
.side-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.65);
    animation: pulseSave 1s infinite;
}
@keyframes pulseSave {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,.65); }
    70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.quick-issue-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-issue-row form { display: grid; }
.btn.issue { background: #111827; color: #fff; min-height: 54px; }
.btn.issue.danger { background: #991b1b; color: #fff; }
.sticky-actions { position: sticky; bottom: 76px; z-index: 8; }
.missing-row td { background: #fee2e2 !important; color: #7f1d1d; }
.short-row td { background: #ffedd5 !important; color: #7c2d12; }
.ok-row td { background: #dcfce7 !important; color: #14532d; }
.queue-group { margin-bottom: 14px; }
.queue-group h3 { margin: 0 0 8px; display:flex; align-items:center; gap:8px; font-size:18px; }
.queue-group h3 small { color: var(--muted); font-size:12px; }
.label-list { display:grid; gap:7px; }
.label-item {
    display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center;
    padding:10px; border:1px solid var(--line); border-radius:9px; background:#fff;
}
.label-item.urgent { border-color:#fca5a5; background:#fff1f2; }
.label-item span { display:block; font-weight:850; }
.label-item small { color:var(--muted); }
.queue-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.clean-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.clean-actions form { display: inline-flex; }
.audit-stats strong { color: var(--accent); }
.audit-grid { display: grid; gap: 10px; }
.audit-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(248,250,252,.96);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.audit-card summary {
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
}
.audit-card summary b { display: block; font-size: 15px; }
.audit-card summary small { display: block; color: var(--muted); margin-top: 2px; }
.audit-card summary strong {
    min-width: 42px;
    min-height: 32px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #e2e8f0;
}
.audit-card.critical summary { background: #fff1f2; }
.audit-card.critical summary strong { background: #991b1b; color: #fff; }
.audit-card.warning summary { background: #fffbeb; }
.audit-card.warning summary strong { background: #b45309; color: #fff; }
.audit-card.ok summary strong { background: #dcfce7; color: #14532d; }
.audit-card .table-wrap, .audit-card > p { margin: 0; padding: 10px; }
.audit-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .75fr);
    gap: 16px;
    align-items: end;
}
.audit-toolbar h2 { margin: 3px 0 5px; }
.audit-toolbar p { margin: 0; max-width: 760px; }
.audit-bulk-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: end;
}
.audit-check-col { width: 72px; text-align: center; }
.audit-checkbox { width: 19px; height: 19px; margin: 0; accent-color: var(--accent); }
.audit-category-clean {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) auto;
    gap: 9px;
    align-items: center;
    margin: 0 10px 10px;
    padding: 10px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fff7f7;
}
.audit-category-clean b, .audit-category-clean small { display: block; }
.audit-category-clean small { margin-top: 2px; color: var(--muted); }
.audit-action-col { min-width: 290px; }
.audit-add-product { min-width: 260px; }
.audit-add-product > summary {
    cursor: pointer;
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 10px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 950;
}
.audit-product-form {
    display: grid;
    gap: 8px;
    min-width: 420px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fafc;
}
.audit-product-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.audit-product-form input { padding: 8px 9px; }
.promo-tools { display: grid; gap: 10px; }
.promo-tools form { margin: 0; }
.promo-tools .stack { gap: 8px; }
.verify-active { border-color: #f59e0b; background: #fffbeb; }
.row-scan-start small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-weight: 850;
}
.row-scan-bar {
    display: grid;
    gap: 8px;
    border: 2px solid #f59e0b;
    background: #fffbeb;
}
.verify-stats { margin: 6px 0; }
.scan-diff summary { display: flex; justify-content: space-between; gap: 8px; }
.diff-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.diff-grid span { padding: 8px; border-radius: 9px; background: #f1f5f9; font-weight: 900; }
.compact-list .line { padding: 8px; }
.place-sections { display: grid; gap: 10px; }
.place-section {
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    overflow: hidden;
}
.place-section summary {
    cursor: pointer; display: flex; justify-content: space-between; gap: 10px;
    padding: 10px 12px; background: #e2e8f0; font-weight: 950;
}
.place-section summary span { color: var(--muted); font-size: 12px; }
.place-section .table-wrap, .place-section .list { padding: 8px; }

.desktop-portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    margin-bottom: 12px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    background: rgba(248,250,252,.97);
    box-shadow: var(--shadow);
}
.desktop-portal-hero h1 { margin: 4px 0 6px; font-size: 34px; }
.desktop-portal-hero p { margin: 0; }
.portal-status-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.portal-status-row span {
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.portal-status-row b { color: var(--ink); }
.workspace-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.workspace-card {
    position: relative;
    min-height: 190px;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 7px;
    padding: 17px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-top: 5px solid #334155;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15,23,42,.12);
    transition: transform .16s ease, box-shadow .16s ease;
}
.workspace-card:hover { transform: translateY(-2px); box-shadow: 0 15px 32px rgba(15,23,42,.17); }
.workspace-card.racks { border-top-color: #0f766e; }
.workspace-card.promos { border-top-color: #b45309; }
.workspace-card.labels { border-top-color: #8b0008; }
.workspace-card.imports { border-top-color: #4338ca; }
.workspace-kicker { color: var(--muted); font-size: 11px; font-weight: 950; text-transform: uppercase; }
.workspace-card > b { font-size: 21px; line-height: 1.15; }
.workspace-card p { margin: 0; font-size: 13px; }
.workspace-card > strong { font-size: 31px; line-height: 1; }
.workspace-card > strong small { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.portal-more, .workspace-accordion { padding: 0; overflow: hidden; }
.portal-more > summary, .workspace-accordion > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 11px 14px;
    cursor: pointer;
    list-style: none;
    background: rgba(248,250,252,.98);
}
.portal-more > summary::-webkit-details-marker,
.workspace-accordion > summary::-webkit-details-marker { display: none; }
.portal-more > summary span,
.workspace-accordion > summary span { display: grid; gap: 2px; }
.portal-more > summary b,
.workspace-accordion > summary b { font-size: 15px; }
.portal-more > summary small,
.workspace-accordion > summary small { color: var(--muted); font-size: 12px; }
.portal-more > summary em,
.workspace-accordion > summary em {
    color: #334155;
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
    text-transform: uppercase;
}
.portal-more[open] > summary,
.workspace-accordion[open] > summary { border-bottom: 1px solid var(--line); }
.portal-more[open] > summary em::after,
.workspace-accordion[open] > summary em::after { content: " / zwin"; }
.portal-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
}
.portal-tools-grid a {
    display: grid;
    gap: 3px;
    min-height: 72px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}
.portal-tools-grid a:hover { border-color: #64748b; }
.portal-tools-grid span { color: var(--muted); font-size: 12px; }
.workspace-action-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.workspace-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}
.tool-section {
    display: grid;
    align-content: start;
    gap: 10px;
    margin: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}
.tool-section h2, .tool-section h3 { margin: 0; }
.danger-tool { border-color: #fecaca; background: #fff7f7; }
.model-filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
}
.model-filter-state { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 42px; }
.model-filter-state > span:not(.model-badge) { color: var(--muted); font-weight: 850; }
.model-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
}
.model-overview-grid a {
    display: grid;
    justify-items: start;
    gap: 5px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}
.model-overview-grid small { color: var(--muted); }
.rack-stats strong, .promo-stats strong, .import-stats strong { font-size: 25px; }
.place-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.place-card-summary { min-height: 142px; align-content: start; }
.place-card-metrics { display: flex; flex-wrap: wrap; gap: 5px; }
.place-card-metrics span {
    padding: 4px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}
.place-card-metrics b { color: var(--ink); }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.section-heading h2 { margin: 0; }
.section-heading span { color: var(--muted); font-size: 12px; font-weight: 850; }
.rack-groups { display: grid; gap: 8px; }
.rack-group {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.rack-group > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 9px 12px;
    cursor: pointer;
    list-style: none;
    background: #f8fafc;
}
.rack-group > summary::-webkit-details-marker { display: none; }
.rack-group > summary span { display: flex; align-items: baseline; gap: 8px; }
.rack-group > summary b { font-size: 17px; }
.rack-group > summary small { color: var(--muted); }
.rack-group > summary strong { color: #334155; font-size: 12px; }
.rack-group[open] > summary { border-bottom: 1px solid var(--line); background: #e2e8f0; }
.rack-group > .place-grid { padding: 9px; }
.promo-admin-tools .workspace-tool-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.workspace-form { display: grid; gap: 11px; padding: 14px; }
.import-note {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin: 0 14px 14px;
    padding: 10px 12px;
    border-radius: 7px;
    background: #e2e8f0;
}
.import-note p { margin: 0; }
.advanced-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}
.advanced-tools .tool-section:first-child { grid-column: 1 / -1; }
.data-status {
    padding: 8px 10px;
    border-radius: 7px;
    background: #e2e8f0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}
@media (max-width: 1050px) and (min-width: 761px) {
    .workspace-grid, .model-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .place-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.bottomnav { display: none; }
@media (max-width: 760px) {
    .topnav { display: none; }
    .topbar { padding: 7px 8px; max-width: 100vw; overflow: hidden; }
    .brand { flex: 0 0 auto; }
    .brand strong { display: none; }
    .userbox { margin-left: auto; min-width: 0; gap: 5px; }
    .userbox span, .userbox small, .userbox a { display: none; }
    .install-btn, .update-btn { min-height: 30px; padding: 0 8px; font-size: 11px; border-radius: 8px; }
    .content { padding: 8px 8px 86px; max-width: 100vw; overflow-x: hidden; }
    input, select, textarea, .btn { min-width: 0; }
    .hero, .page-head, .scan-head { padding: 12px; align-items: flex-start; }
    .head-actions { width: 100%; justify-content: stretch; }
    .head-actions .btn, .head-actions form { flex: 1; }
    .mini-row { grid-template-columns: 1fr; gap: 4px; }
    .mini-row em { white-space: normal; }
    .tile-grid, .stats, .stats.queue-stats, .grid2, .place-grid, .report-grid, .report-source-panel, .scan-place-card { grid-template-columns: 1fr; }
    .report-source-switch { display: grid; grid-template-columns: 1fr 1fr; }
    .report-source-switch .btn { min-width: 0; }
    .workspace-grid, .portal-tools-grid, .workspace-tool-grid, .model-overview-grid, .advanced-tools { grid-template-columns: 1fr; }
    .desktop-portal-hero, .model-filter-bar { grid-template-columns: 1fr; }
    .portal-status-row, .model-filter-state { justify-content: flex-start; }
    .advanced-tools .tool-section:first-child { grid-column: auto; }
    .import-note { align-items: flex-start; flex-direction: column; }
    .diff-grid { grid-template-columns: 1fr; }
    .scan-actions, .scan-form .scan-actions { grid-template-columns: 1fr; }
    .quick-issue-row { grid-template-columns: 1fr 1fr; }
    .label-item { grid-template-columns:1fr; }
    .queue-actions { justify-content:stretch; }
    .queue-actions form, .queue-actions .btn { width:100%; }
    .audit-toolbar, .audit-bulk-form, .audit-category-clean { grid-template-columns: 1fr; }
    .audit-category-clean .btn { width: 100%; }
    .audit-action-col { min-width: 250px; }
    .audit-product-form { min-width: 280px; }
    .audit-product-fields { grid-template-columns: 1fr; }
    .big-input { min-height: 68px; font-size: 28px; }
    .bottomnav {
        position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 10;
        display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
        padding: 8px; border-radius: 18px; background: rgba(17,24,39,.96);
        box-shadow: 0 18px 42px rgba(15,23,42,.28);
    }
    .bottomnav a { min-height: 48px; display: grid; place-items: center; color: #cbd5e1; border-radius: 12px; font-size: 11px; font-weight: 950; text-transform: uppercase; }
    .bottomnav a.active { background: #fff; color: #111827; }
    .price-mode { gap: 7px; }
    .price-mode .scan-head {
        margin-bottom: 0;
        padding: 9px 10px;
        align-items: center;
    }
    .price-mode .scan-head h1 { font-size: 20px; }
    .price-mode .scan-head .eyebrow { font-size: 10px; }
    .price-mode .scan-head .btn { min-height: 34px; padding: 0 10px; }
    .price-mode .price-card {
        top: calc(8px + env(safe-area-inset-top));
        gap: 5px;
        padding: 10px 9px;
        min-height: 148px;
        border-radius: 13px;
    }
    .price-mode .price-card strong {
        font-size: clamp(56px, 18vw, 86px);
        line-height: .9;
    }
    .price-mode .price-card p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 13px;
        line-height: 1.2;
    }
    .price-mode .price-badges { gap: 4px; }
    .price-mode .price-badges span { padding: 3px 7px; font-size: 10px; }
    .price-mode .price-place-form {
        padding: 8px;
        margin-bottom: 6px;
    }
    .module-scan .bottomnav,
    .module-verify_price .bottomnav {
        display: none;
    }
    .module-scan .topbar,
    .module-verify_price .topbar {
        display: none;
    }
    .module-scan .content,
    .module-verify_price .content {
        padding-top: 8px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
    .module-scan .scan-head,
    .module-verify_price .scan-head {
        padding: 8px 10px;
        align-items: center;
    }
    .module-scan .scan-head h1,
    .module-verify_price .scan-head h1 {
        font-size: 20px;
    }
    .module-scan .scan-head .eyebrow,
    .module-verify_price .scan-head .eyebrow {
        font-size: 10px;
    }
    .module-scan .scan-head .btn,
    .module-verify_price .scan-head .btn {
        min-height: 34px;
        padding: 0 10px;
    }
    .scan-head-actions {
        gap: 6px;
        flex-wrap: nowrap;
    }
    .update-inline { font-size: 11px; }
    .module-scan .scan-head { order: 1; }
    .module-scan .mobile-scan-tabs { order: 2; }
    .module-scan .mobile-place-picker { order: 3; }
    .module-scan .scan-place-card { order: 4; }
    .module-scan #scanForm { order: 5; }
    .module-scan .verify-active,
    .module-scan .panel.soft { order: 6; }
    .mobile-place-picker,
    .scan-place-card,
    .row-scan-start,
    .row-scan-bar,
    .verify-active,
    .module-scan .scan-form {
        padding: 9px;
    }
    .batch-scan-form {
        position: sticky;
        top: calc(8px + env(safe-area-inset-top));
        z-index: 8;
        border: 2px solid #111827;
    }
    .row-scan-bar .verify-stats {
        margin: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .row-scan-bar .verify-stats strong { font-size: 22px; }
    .mobile-buffer-panel h2 {
        margin: 8px 12px 4px;
        font-size: 14px;
    }
    .mobile-buffer-panel h2 small {
        display: inline-grid;
        min-width: 24px;
        min-height: 24px;
        place-items: center;
        border-radius: 999px;
        background: #fee2e2;
        color: #991b1b;
    }
    .scan-place-card h2 { font-size: 22px; }
    .verify-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
    .verify-stats div { padding: 7px 6px; }
    .verify-stats strong { font-size: 20px; }
    .verify-stats span { font-size: 10px; }
    .promo-banner { padding: 8px 9px; }
    .promo-banner b { font-size: 16px; }
    .location-chips span { grid-template-columns: 1fr auto; }
    .location-chips span b { grid-column: 1 / -1; }
    .price-mode .price-place-form label { gap: 4px; }
    .price-mode .price-place-form select { padding: 8px 9px; min-height: 39px; }
    .price-mode .scan-form { padding: 9px; }
    .candidate-panel h2 { margin-bottom: 4px; }
    .candidate-row {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 10px;
    }
    .candidate-row .btn {
        width: 100%;
        min-height: 38px;
    }
    .scan-choice-confirm .inline-form {
        display: grid;
        grid-template-columns: 1fr;
    }
    .bottom-action { bottom: 78px; }
    .sticky-actions { bottom: 78px; }
    .price-mode .sticky-actions { position: static; bottom: auto; }
    .side-status { top: auto; right: 10px; bottom: 76px; }
}
@media print {
    .topbar, .bottomnav, .btn, form, .no-print { display: none !important; }
    body { background: #fff; }
    .content { width: 100%; padding: 0; }
    .panel, .page-head { box-shadow: none; border: 1px solid #ccc; }
    .label-item { break-inside: avoid; grid-template-columns: 1fr; padding: 6px; }
    .print-panel h2 { margin-bottom: 6px; }
}
