/* Temas: claro (padrão) e escuro, com a mesma estrutura. O escuro vale quando a pessoa escolhe
   (data-theme="dark") ou quando o aparelho está no modo escuro e ela não escolheu o claro. */
:root {
  --bg: #f7f6f3;
  --panel: #ffffff;
  --bar: #ffffff;
  --ink: #1c1917;
  --muted: #6b645e;
  --line: #e7e3df;
  --brand: #0f6e56;
  --brand-ink: #ffffff;
  --ok: #27500a;
  --ok-bg: #eaf3de;
  --bad: #a32d2d;
  --bad-bg: #fcebeb;
  --warn: #854f0b;
  --warn-bg: #faeeda;
  --info: #0c447c;
  --info-bg: #e6f1fb;
  /* Moldura e etiqueta de cada marketplace */
  --p-shopee: #ee4d2d;      --p-shopee-tag: #ee4d2d;   --p-shopee-tag-ink: #ffffff;
  --p-tiktok: #7c3aed;      --p-tiktok-tag: #7c3aed;   --p-tiktok-tag-ink: #ffffff;
  --p-mercado_livre: #e6c800; --p-mercado_livre-tag: #ffe600; --p-mercado_livre-tag-ink: #2d3277;
  --p-shein: #1c1917;       --p-shein-tag: #1c1917;    --p-shein-tag-ink: #ffffff;
  --radius: 12px;
  --tap: 48px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --panel: #111111;
  --bar: #000000;
  --ink: #f2efec;
  --muted: #a8a19a;
  --line: #2a2a2a;
  --brand: #5dcaa5;
  --brand-ink: #04342c;
  --ok: #c0dd97;
  --ok-bg: #27500a;
  --bad: #f7c1c1;
  --bad-bg: #501313;
  --warn: #fac775;
  --warn-bg: #633806;
  --info: #b5d4f4;
  --info-bg: #0c447c;
  --p-shopee: #f26b4a;
  --p-tiktok: #a78bfa;      --p-tiktok-tag: #a78bfa;   --p-tiktok-tag-ink: #1e1240;
  --p-mercado_livre: #ffe600;
  --p-shein: #e7e3df;       --p-shein-tag: #f2efec;    --p-shein-tag-ink: #000000;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --panel: #111111;
    --bar: #000000;
    --ink: #f2efec;
    --muted: #a8a19a;
    --line: #2a2a2a;
    --brand: #5dcaa5;
    --brand-ink: #04342c;
    --ok: #c0dd97;
    --ok-bg: #27500a;
    --bad: #f7c1c1;
    --bad-bg: #501313;
    --warn: #fac775;
    --warn-bg: #633806;
    --info: #b5d4f4;
    --info-bg: #0c447c;
    --p-shopee: #f26b4a;
    --p-tiktok: #a78bfa;      --p-tiktok-tag: #a78bfa;   --p-tiktok-tag-ink: #1e1240;
    --p-mercado_livre: #ffe600;
    --p-shein: #e7e3df;       --p-shein-tag: #f2efec;    --p-shein-tag-ink: #000000;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
h1 { font-size: 1.35rem; margin: .25rem 0 .75rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.inline { display: inline; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.late { color: var(--bad); font-weight: 600; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top));
  background: var(--bar); color: var(--ink); border-bottom: 1px solid var(--line);
}
.brand { color: var(--brand); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.topnav { display: flex; gap: 1rem; align-items: center; font-size: .9rem; }
.topnav a, .topnav .linkish { color: var(--muted); text-decoration: none; }
.topnav a:hover, .topnav .linkish:hover { color: var(--ink); }
.theme-toggle { background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  width: 34px; height: 34px; display: inline-grid; place-items: center; cursor: pointer; font-size: 1rem; }
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
/* Mostra a lua no claro (vai para o escuro) e o sol no escuro (vai para o claro) */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.page { max-width: 760px; margin: 0 auto; padding: 1rem; padding-bottom: 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 1rem 2rem; }

.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-bad { background: var(--bad-bg); color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tap); padding: 0 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-bad { background: var(--panel); border-color: var(--bad); color: var(--bad); }
.btn-block { width: 100%; }
.btn-small { min-height: 40px; padding: 0 .9rem; font-size: .9rem; }
.btn-icon { padding: 0 .8rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }
.danger { color: var(--bad); }

input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .6rem .8rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); font: inherit;
}
textarea { min-height: 0; }
input[type="file"] { padding: .5rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px;
}
label { display: block; font-weight: 600; font-size: .95rem; }
label > input, label > select, label > textarea { margin-top: .35rem; font-weight: 400; }
.stack { display: grid; gap: 1rem; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row input[type="file"] { flex: 1; }
form.inline { display: inline; }
.check { display: flex; gap: .6rem; align-items: center; font-weight: 400; }
.check input { width: 22px; min-height: 22px; }

.login { max-width: 380px; margin: 12vh auto 0; }

.search { display: flex; gap: .5rem; margin-bottom: .75rem; }
.search input { flex: 1; }

.tabs { display: flex; gap: .35rem; overflow-x: auto; margin: 0 -1rem .5rem; padding: 0 1rem .25rem; scrollbar-width: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: .35rem;
  min-height: 40px; padding: 0 .9rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem;
  background: var(--panel); border: 1px solid var(--line);
}
.tab.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab-alert:not(.active) { border-color: var(--bad); color: var(--bad); }
.count { font-size: .78rem; font-weight: 700; padding: 0 .45rem; border-radius: 999px; background: var(--line); color: var(--ink); }
.tab.active .count { background: var(--bg); color: var(--ink); }

.chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { font-size: .85rem; padding: .3rem .7rem; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); }
.chip.active { color: var(--ink); border-color: var(--ink); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.card {
  display: block; padding: .85rem; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.card:active { border-color: var(--brand); }
.card-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.card-body { display: flex; gap: .75rem; align-items: flex-start; }
.card-title { display: block; line-height: 1.25; }
.card-foot { display: flex; justify-content: space-between; gap: .5rem; margin-top: .5rem; color: var(--muted); }
.card-err { margin-top: .5rem; color: var(--bad); }
.card-track { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; background: var(--line); }
.empty { text-align: center; color: var(--muted); padding: 2rem 0; }

.platform { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }

/* Moldura do cartão e etiqueta na cor do marketplace */
.frame { border-width: 2px; }
.frame-shopee { border-color: var(--p-shopee); }
.frame-tiktok { border-color: var(--p-tiktok); }
.frame-mercado_livre { border-color: var(--p-mercado_livre); }
.frame-shein { border-color: var(--p-shein); }
.ptag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .45rem; border-radius: 4px; letter-spacing: .01em; }
.ptag-shopee { background: var(--p-shopee-tag); color: var(--p-shopee-tag-ink); }
.ptag-tiktok { background: var(--p-tiktok-tag); color: var(--p-tiktok-tag-ink); }
.ptag-mercado_livre { background: var(--p-mercado_livre-tag); color: var(--p-mercado_livre-tag-ink); }
.ptag-shein { background: var(--p-shein-tag); color: var(--p-shein-tag-ink); }
.store-name { font-size: .78rem; color: var(--muted); }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-muted { background: var(--line); color: var(--muted); }

.back { display: inline-block; margin-bottom: .75rem; text-decoration: none; font-weight: 600; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.panel.accent { border: 2px solid var(--brand); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem 1rem; margin: 0 0 1rem; }
.facts dt { font-size: .78rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }
.facts .wide dd { font-weight: 400; font-style: italic; }

/* Botão grande para câmera/galeria no lugar do "Escolher arquivo" do navegador */
.picker { display: flex; flex-direction: column; gap: .35rem; }
.picker input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.picker .btn { border-style: dashed; border-width: 2px; min-height: 64px; }
.picker:focus-within .btn { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.items li { display: flex; gap: .75rem; align-items: flex-start; }

.choice { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.choice legend { font-weight: 600; margin-bottom: .5rem; }
.option { display: flex; gap: .75rem; align-items: center; padding: .8rem; border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 400; }
.option input { width: 22px; min-height: 22px; margin: 0; accent-color: var(--brand); }
.option span { display: grid; }
.option small { color: var(--muted); }
.option:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.option-bad:has(input:checked) { border-color: var(--bad); background: var(--bad-bg); }
.option-plain:has(input:checked) { border-color: var(--brand); background: transparent; }
.option-warn:has(input:checked) { border-color: var(--warn); background: var(--warn-bg); }
.flash-warn { background: var(--warn-bg); color: var(--ink); border: 1px solid var(--warn); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.tile-wrap { margin: 0; }
.tile { display: grid; place-items: center; aspect-ratio: 1; width: 100%; border-radius: 8px; overflow: hidden; background: var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.tile img, video.tile { width: 100%; height: 100%; object-fit: cover; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .4rem; }
.previews:empty { display: none; }
.previews img, .previews .vid { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--line); display: grid; place-items: center; font-size: .75rem; }

.decide { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.notes { white-space: pre-wrap; font: inherit; background: var(--bg); padding: .6rem; border-radius: 8px; margin: 0 0 .75rem; }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.timeline { list-style: none; margin: .75rem 0 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); display: grid; gap: .75rem; }

.users { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.users li { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.users li.inactive { opacity: .55; }

/* ---------- ajuda ---------- */
.guide { margin: 0; display: grid; gap: .6rem; }
.guide dt { font-weight: 700; }
.guide dd { margin: 0 0 0 .2rem; color: var(--ink); }
.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .6rem; }
.steps ul { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
/* Menu do topo: botão "Menu" que abre a lista (igual no celular e no computador) */
.menu { position: relative; }
.menu > summary { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); list-style: none;
  cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 0 .75rem; height: 34px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { color: var(--ink); border-color: var(--muted); }
.menu-links { position: absolute; right: 0; top: calc(100% + 6px); display: flex; flex-direction: column;
  min-width: 180px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .3rem; z-index: 20; }
.menu-links a, .menu-links .linkish { display: block; padding: .65rem .8rem; border-radius: 8px; color: var(--ink);
  text-decoration: none; text-align: left; width: 100%; font: inherit; }
.menu-links a:hover, .menu-links .linkish:hover { background: var(--bg); }

/* ---------- relatórios ---------- */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .35rem; }
.filters select { width: auto; flex: 1 1 160px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin: .75rem 0; }
.tile-stat { display: flex; flex-direction: column; gap: .15rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; }
.tile-alert { border-color: var(--bad); }
.tile-link { color: inherit; text-decoration: none; }
.stat-label { font-size: .8rem; color: var(--muted); }
.stat-value { font-size: 1.45rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .75rem; color: var(--muted); }
.tile-alert .stat-sub { color: var(--bad); font-weight: 600; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

.table-wrap { overflow-x: auto; margin: 0 -1rem; padding: 0 1rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: .5rem .4rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead th { font-size: .75rem; color: var(--muted); font-weight: 600; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.bar-head { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.bar-name { min-width: 0; overflow-wrap: anywhere; }
.bar-track { height: 8px; background: var(--line); border-radius: 4px; margin: .3rem 0; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 4px; min-width: 4px; }
.warn-text { color: var(--warn); font-weight: 600; }

.columns { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 1.2rem; margin: .5rem 0 .75rem; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .2rem; min-width: 0; }
.col-bar { width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.col:hover .col-bar { opacity: .75; }
.col-value { font-size: .7rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.col-label { font-size: .65rem; color: var(--muted); white-space: nowrap; }

/* ---------- painel interativo ---------- */
.page-wide { max-width: 1120px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.dash-head h1 { margin: 0; }
.dash-filters { display: grid; gap: .6rem; margin: .75rem 0 .35rem; }
.dash-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.field { display: grid; gap: .2rem; font-size: .78rem; color: var(--muted); flex: 1 1 140px; margin: 0; }
.field input, .field select { min-height: 40px; font-size: .9rem; color: var(--ink); }
.seg { display: flex; flex-wrap: wrap; gap: .3rem; }
.seg-btn { font: inherit; font-size: .85rem; padding: .4rem .8rem; border-radius: 999px; cursor: pointer;
  background: var(--panel); color: var(--muted); border: 1px solid var(--line); min-height: 36px; }
.seg-btn:hover { color: var(--ink); border-color: var(--muted); }
.seg-btn.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg-small .seg-btn { padding: .35rem .7rem; }
.dash-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.dash-chips:empty { display: none; }
.chip-filter { font: inherit; font-size: .85rem; padding: .35rem .75rem; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--brand) 14%, var(--panel)); color: var(--ink); border: 1px solid var(--brand); }
.dash.loading [data-kpis], .dash.loading .panel { opacity: .55; transition: opacity .15s; }
.tiles-5 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .tiles-5 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .tiles-5 { grid-template-columns: repeat(6, 1fr); } }
.delta { font-size: .75rem; color: var(--muted); }
.delta.good { color: var(--ok); font-weight: 600; }
.delta.bad { color: var(--bad); font-weight: 600; }
.tile-link:hover { border-color: var(--brand); }
.dash-row-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem .75rem; }
.dash-row-title h2, .dash-grid h2 { margin: 0 0 .6rem; font-size: 1rem; }
.dash-grid { display: grid; gap: .75rem; margin-bottom: .75rem; align-items: start; }
.dash-grid .panel { margin: 0; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: repeat(3, 1fr); } }
.hint { margin: .5rem 0 0; }

.chart { position: relative; }
.line-chart { width: 100%; height: auto; display: block; overflow: visible; }
.line-chart .grid { stroke: var(--line); stroke-width: 1; }
.line-chart .axis { fill: var(--muted); font-size: 11px; }
.line-chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .dot { fill: var(--brand); stroke: var(--panel); stroke-width: 1.5; }
.line-chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.line-chart .hover-dot { fill: var(--brand); stroke: var(--panel); stroke-width: 2; }
.line-chart .hit { cursor: crosshair; }
.tooltip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: var(--ink); color: var(--bg); font-size: .8rem; padding: .4rem .6rem; border-radius: 8px; }

.hbar { display: grid; gap: .25rem; width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: 8px; padding: .35rem .45rem; margin-bottom: .2rem; }
.hbar:hover { background: var(--bg); }
.hbar.on { border-color: var(--brand); }
.hbar.dim { opacity: .45; }
.hbar-head { display: flex; justify-content: space-between; gap: .75rem; font-size: .9rem; }
.hbar-name { min-width: 0; overflow-wrap: anywhere; }
.hbar-head strong { font-variant-numeric: tabular-nums; }
.hbar-track { height: 8px; background: var(--line); border-radius: 4px; }
.hbar-fill { display: block; height: 100%; background: var(--brand); border-radius: 4px; min-width: 4px; }
.pbar-shopee { background: var(--p-shopee); }
.pbar-tiktok { background: var(--p-tiktok); }
.pbar-mercado_livre { background: var(--p-mercado_livre); }
.pbar-shein { background: var(--p-shein); }

.stack-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; margin: .25rem 0 .75rem; }
.stack-bar span { min-width: 4px; }
.cond-ok { background: #639922; }
.cond-bad { background: #a32d2d; }
.cond-mis { background: #534ab7; }
.cond-none { background: var(--line); }
:root[data-theme="dark"] .cond-ok { background: #97c459; }
:root[data-theme="dark"] .cond-bad { background: #e24b4a; }
:root[data-theme="dark"] .cond-mis { background: #8b84e0; }
:root[data-theme="dark"] .cond-none { background: #444; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cond-ok { background: #97c459; }
  :root:not([data-theme="light"]) .cond-bad { background: #e24b4a; }
  :root:not([data-theme="light"]) .cond-mis { background: #8b84e0; }
  :root:not([data-theme="light"]) .cond-none { background: #444; }
}
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: .5rem; }
.legend strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend .muted { width: 3rem; text-align: right; font-size: .8rem; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }

table.sortable th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th[aria-sort="descending"]::after { content: " ▼"; }
table.sortable th[aria-sort="ascending"]::after { content: " ▲"; }
table.data tbody tr[data-sku] { cursor: pointer; }
table.data tbody tr[data-sku]:hover, table.data tbody tr.on { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.bad-text { color: var(--bad); font-weight: 600; }
td.prod { max-width: 0; width: 60%; }
td.prod .mono { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-name { display: block; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 1rem; }

.scanner { border: 0; border-radius: var(--radius); padding: 1rem; width: min(92vw, 480px); background: var(--panel); color: var(--ink); }
.scanner::backdrop { background: rgb(0 0 0 / .7); }
.scanner video { width: 100%; border-radius: 8px; background: #000; }

@media (max-width: 420px) {
  .decide { grid-template-columns: 1fr; }
}
