/* Helix RFID v2.2 — web client styles (soft "office" interface). Logical properties so the same CSS works RTL (Arabic) and LTR (English). */
:root {
  --bg: #f3f6fb; --bg2: #e9eef6; --panel: #ffffff; --panel2: #f7f9fc; --line: #dde4f0; --line2: #c9d3e3;
  --text: #0f1b33; --text2: #22314d; --muted: #5a6a86; --faint: #8b98b0;
  --acc: #0e7490; --acc2: #2563eb; --good: #16a34a; --warn: #d97706; --crit: #dc2626; --info: #7c3aed;
  --chill: #0284c7; --frozen: #4f46e5; --dry: #d97706; --ambient: #ea580c; --ctrl: #0d9488;
  --pri-bg: #0e7490; --pri-fg: #ffffff; --sel: #e3f4f8; --hover: #eef3fa;
  --radius: 14px; --shadow: 0 12px 32px rgba(15,27,51,.12); --soft: 0 1px 2px rgba(15,27,51,.06), 0 1px 3px rgba(15,27,51,.05);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --tbar: #0b1220; --tbar-line: #1c2740;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg2: #0f172a; --panel: #111a2e; --panel2: #16213a; --line: #24324f; --line2: #2e3e60;
  --text: #e6edf7; --text2: #c9d5e8; --muted: #8fa0bd; --faint: #5d6e8c;
  --acc: #22d3ee; --acc2: #3b82f6; --good: #22c55e; --warn: #f59e0b; --crit: #ef4444; --info: #a78bfa;
  --chill: #38bdf8; --frozen: #818cf8; --dry: #f59e0b; --ambient: #fb923c; --ctrl: #2dd4bf;
  --pri-bg: linear-gradient(135deg, #22d3ee, #3b82f6); --pri-fg: #04111f; --sel: rgba(34,211,238,.12); --hover: #16213a;
  --shadow: 0 12px 32px rgba(0,0,0,.4); --soft: none; --tbar: #070d18; --tbar-line: #1c2740;
  color-scheme: dark;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.55; }
a { color: var(--acc); text-decoration: none; cursor: pointer; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .01em; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.good { color: var(--good); } .warn { color: var(--warn); } .crit { color: var(--crit); } .acc { color: var(--acc); }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 8px; } .grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; } .grid > * { min-width: 0; } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } .gwide { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ---------- shell: title bar + module rail + module panel ---------- */
.app { display: flex; flex-direction: column; height: 100vh; }
.tbar { flex: none; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 14px; background: var(--tbar); color: #e6edf7; border-bottom: 1px solid var(--tbar-line); position: relative; z-index: 20; }
.tb-brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; margin-inline-end: 6px; }
.tb-brand img { height: 30px; width: auto; max-width: 150px; object-fit: contain; }
.tb-brand img.own { background: #fff; border-radius: 7px; padding: 2px 6px; height: 34px; max-width: 170px; }
.tb-brand b { display: block; font-size: 14.5px; line-height: 1.2; } .tb-brand small { display: block; color: #8fa0bd; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.tbar .search { flex: 1 1 320px; max-width: 620px; margin-inline: auto; position: relative; }
.tbar .search input { width: 100%; min-height: 40px; padding: 0 14px; padding-inline-start: 38px; border-radius: 10px; background: #f3f6fb; border: 1px solid transparent; color: #0f1b33; }
.tbar .search input::placeholder { color: #5a6a86; }
.tbar .search input:focus { border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34,211,238,.25); }
.tbar .search svg { position: absolute; inset-inline-start: 12px; top: 12px; width: 16px; color: #5a6a86; }
.ib { position: relative; width: 40px; height: 40px; flex: none; border: 0; border-radius: 10px; background: transparent; color: #e6edf7; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ib:hover { background: #ffffff14; } .ib.txt { font-weight: 600; font-size: 13px; }
.ib .dot { position: absolute; top: 2px; inset-inline-end: 0; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 2px solid #22d3ee; background: #16213a; color: #fff; font-weight: 700; cursor: pointer; margin-inline-start: 4px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #8fa0bd; padding: 0 6px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #5d6e8c; display: inline-block; }
.live.on i { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.app > .body, body > .body, .shell > .body { flex: 1; min-height: 0; display: flex; }
.modal-box > .body, .drawer > .body { display: block; }
.rail { flex: 0 0 92px; background: var(--bg2); border-inline-end: 1px solid var(--line); overflow-y: auto; padding: 10px 6px; display: flex; flex-direction: column; gap: 2px; }
.rail .mod { min-height: 66px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 2px; color: var(--text2); text-align: center; }
.rail .mod:hover { background: var(--hover); }
.rail .mod.on { background: var(--panel); box-shadow: var(--soft), 0 0 0 1px var(--line); color: var(--text); font-weight: 600; }
.mi { width: 34px; height: 34px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.mi .ic { opacity: 1; }
.rail .ml { font-size: 11.5px; line-height: 1.3; }
.side { flex: 0 0 256px; background: var(--panel); border-inline-end: 1px solid var(--line); overflow-y: auto; padding: 14px 12px 20px; display: flex; flex-direction: column; }
.side .ph { display: flex; align-items: center; gap: 10px; padding: 2px 6px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.side .ph .mi { width: 30px; height: 30px; border-radius: 9px; }
.side-foot { margin-top: auto; padding: 16px 8px 0; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--text2); min-height: 42px; padding: 0 12px; border-radius: 10px; margin: 1px 0; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--sel); color: var(--acc); font-weight: 600; }
.nav a .ic { width: 18px; height: 18px; flex: none; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.content { padding: 22px 26px 40px; overflow-y: auto; flex: 1; }
.page-h { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.page-h > div:first-child { min-width: 0; }
.page-h h1 { font-size: 24px; margin: 0; font-weight: 700; line-height: 1.3; } .page-h .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.scrim { display: none; } .burger { display: inline-flex; }
/* legacy top bar (platform console) */
.top { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--tbar); color: #e6edf7; }
.top .tb { background: #ffffff14; border: 0; border-radius: 10px; padding: 7px 12px; cursor: pointer; color: #e6edf7; }
@media (max-width: 1000px) {
  .burger { display: inline-flex; }
  .rail, .side { position: fixed; top: 56px; bottom: 0; z-index: 30; transition: transform .2s; }
  .rail { inset-inline-start: 0; width: 92px; } .side { inset-inline-start: 92px; width: 256px; }
  [dir="ltr"] .rail, [dir="ltr"] .side { transform: translateX(-120%); } [dir="rtl"] .rail, [dir="rtl"] .side { transform: translateX(120%); }
  [dir="ltr"] .side { transform: translateX(-160%); } [dir="rtl"] .side { transform: translateX(160%); }
  body.nav-open .rail, body.nav-open .side { transform: none !important; box-shadow: var(--shadow); }
  body.nav-open .scrim { display: block; position: fixed; inset: 56px 0 0; background: rgba(2,6,23,.4); z-index: 25; }
  .live span, .tb-brand span { display: none; }
}

/* ---------- cards / tiles ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.card h3 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card h3 .muted { font-weight: 400; font-size: 12px; }
.card.flat { padding: 0; overflow: hidden; } .card.flat h3 { padding: 12px 14px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: default; position: relative; overflow: hidden; }
.tile.link { cursor: pointer; } .tile.link:hover { border-color: var(--acc); }
.tile .k { color: var(--muted); font-size: 12px; } .tile .v { font-size: 22px; font-weight: 700; margin-top: 4px; direction: ltr; text-align: start; }
.tile .s { font-size: 11px; color: var(--faint); margin-top: 2px; }
.tile::after { content: ""; position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 3px; height: 100%; background: var(--line2); }
.tile.good::after { background: var(--good); } .tile.warn::after { background: var(--warn); } .tile.crit::after { background: var(--crit); } .tile.acc::after { background: var(--acc); } .tile.info::after { background: var(--info); }

/* ---------- pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.good { color: var(--good); border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.08); }
.pill.warn { color: var(--warn); border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.08); }
.pill.crit { color: var(--crit); border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.09); }
.pill.acc { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 35%, transparent); background: color-mix(in srgb, var(--acc) 8%, transparent); }
.pill.info { color: var(--info); border-color: rgba(167,139,250,.35); background: rgba(167,139,250,.08); }
.badge { min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; font-size: 11px; background: var(--crit); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.badge.acc { background: var(--acc2); }
.zone-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); }
.zone-chip::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--zc, var(--faint)); }

/* ---------- buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--acc); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.pri { background: linear-gradient(135deg, var(--acc), var(--acc2)); border: 0; color: #04111f; font-weight: 600; }
.btn.danger { border-color: rgba(239,68,68,.5); color: var(--crit); } .btn.ok { border-color: rgba(34,197,94,.5); color: var(--good); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; } .btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { border-color: var(--line2); }
.btn svg { width: 15px; height: 15px; }
input[type=text], input[type=number], input[type=date], input[type=datetime-local], input[type=email], input[type=password], input[type=search], input:not([type]), select, textarea {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { accent-color: var(--acc); width: 16px; height: 16px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.f.req > span::after { content: " *"; color: var(--crit); }
label.f .hint { color: var(--faint); font-size: 11px; }
label.chk { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 12px; } .form .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form { grid-template-columns: 1fr; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: flex-end; }
.filters > * { width: auto; } .filters input, .filters select { width: 170px; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--panel2); color: var(--text); box-shadow: 0 1px 0 var(--line2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--acc); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: start; font-weight: 600; font-size: 12px; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--panel2); position: sticky; top: 0; white-space: nowrap; }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; } table.t tbody tr.click:hover td { background: var(--panel2); }
table.t td.num, table.t th.num { text-align: end; direction: ltr; white-space: nowrap; }
table.t tr.sel td { background: color-mix(in srgb, var(--acc) 7%, transparent); }
table.t.compact td, table.t.compact th { padding: 6px 8px; font-size: 12.5px; }
.empty { padding: 30px; text-align: center; color: var(--faint); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 2px; color: var(--muted); font-size: 12px; }

/* ---------- drawer / modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(2,6,23,.55); z-index: 40; display: flex; }
.drawer { margin-inline-start: auto; width: min(860px, 96vw); height: 100%; background: var(--bg); border-inline-start: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer > header h2 { margin: 0; font-size: 17px; flex: 1; } .drawer > .body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.drawer > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.modal-box { margin: auto; width: min(640px, 94vw); max-height: 92vh; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.modal-box.wide { width: min(980px, 96vw); }
.modal-box > header { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.modal-box > .body { padding: 16px 18px; overflow-y: auto; } .modal-box > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.toasts { position: fixed; inset-block-end: 16px; inset-inline-end: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); max-width: 420px; animation: slidein .2s; }
.toast.err { border-color: rgba(239,68,68,.6); } .toast.ok { border-color: rgba(34,197,94,.6); } .toast.warn { border-color: rgba(245,158,11,.6); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; } .kv > div:nth-child(odd) { color: var(--muted); }
.sec { margin: 18px 0 8px; font-weight: 700; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.note { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.note.warn { border-color: rgba(245,158,11,.45); } .note.crit { border-color: rgba(239,68,68,.5); } .note.good { border-color: rgba(34,197,94,.45); } .note.acc { border-color: color-mix(in srgb, var(--acc) 45%, transparent); }

/* ---------- domain widgets ---------- */
.uom { display: inline-flex; flex-direction: column; line-height: 1.25; } .uom b { font-weight: 600; } .uom small { color: var(--faint); font-size: 11px; }
.uom-tree { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.uom-tree span.lv { background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; }
.bar { height: 7px; background: var(--bg2); border-radius: 4px; overflow: hidden; min-width: 60px; } .bar > i { display: block; height: 100%; background: var(--acc); border-radius: 4px; }
.bar.good > i { background: var(--good); } .bar.warn > i { background: var(--warn); } .bar.crit > i { background: var(--crit); }
.wh-card { cursor: pointer; } .wh-card:hover { border-color: var(--acc); }
.zone-temp { display: flex; flex-direction: column; gap: 4px; padding: 9px 10px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); min-width: 120px; }
.zone-temp .tv { font-size: 20px; font-weight: 700; direction: ltr; text-align: start; } .zone-temp.breach { border-color: var(--crit); } .zone-temp.warn { border-color: var(--warn); } .zone-temp.ok { border-color: rgba(34,197,94,.45); }
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; }
.pipe-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; }
.pipe-col > header { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; }
.pipe-col > .list { padding: 8px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; max-height: 62vh; }
.pipe-item { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; font-size: 12.5px; }
.pipe-item:hover { border-color: var(--acc); } .pipe-item.late { border-color: rgba(239,68,68,.55); }
.chart { width: 100%; height: 220px; } .chart text { fill: var(--muted); font-size: 10px; } .chart .grid line { stroke: var(--line); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 4px; vertical-align: -1px; }
.map { width: 100%; height: 520px; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--acc2) 7%, transparent), transparent 60%), var(--bg2); border-radius: var(--radius); border: 1px solid var(--line); }
.map text { fill: var(--muted); font-size: 10px; }
.timeline { border-inline-start: 2px solid var(--line); margin-inline-start: 6px; padding-inline-start: 14px; display: flex; flex-direction: column; gap: 10px; }
.timeline > div { position: relative; font-size: 12.5px; } .timeline > div::before { content: ""; position: absolute; inset-inline-start: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--acc); }
.steps { display: flex; gap: 0; margin: 4px 0 14px; flex-wrap: wrap; } .steps > div { flex: 1; min-width: 90px; text-align: center; font-size: 11.5px; color: var(--faint); position: relative; padding-top: 18px; }
.steps > div::before { content: ""; position: absolute; top: 5px; inset-inline: 0; height: 3px; background: var(--line); } .steps > div::after { content: ""; position: absolute; top: 0; inset-inline-start: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--line2); }
.steps > div.done { color: var(--muted); } .steps > div.done::before, .steps > div.done::after { background: var(--good); } .steps > div.cur { color: var(--text); font-weight: 600; } .steps > div.cur::after { background: var(--acc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 20%, transparent); }
.matrix td, .matrix th { text-align: center !important; } .matrix td:first-child, .matrix th:first-child { text-align: start !important; }
.cell-err { background: rgba(239,68,68,.13) !important; outline: 1px solid rgba(239,68,68,.5); } .row-err td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.drop { border: 2px dashed var(--line2); border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; } .drop.over { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 5%, transparent); }
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--acc) 12%, transparent), transparent 40%), radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--acc2) 12%, transparent), transparent 40%), var(--bg); }
.login .box { width: min(420px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.login .box h1 { font-size: 20px; margin: 10px 0 4px; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 4px; }
.chat .m { padding: 8px 12px; border-radius: 12px; max-width: 80%; background: var(--panel2); border: 1px solid var(--line); } .chat .m.me { align-self: flex-end; background: color-mix(in srgb, var(--acc) 10%, transparent); }
.sig { width: 100%; height: 140px; background: #fff; border-radius: 8px; touch-action: none; }
.barcode svg { background: #fff; padding: 6px; border-radius: 6px; }
@media print { .side, .rail, .tbar, .top, .no-print, .drawer > footer, .drawer > header .btn { display: none !important; } .overlay { position: static; background: none; } .drawer { width: 100%; box-shadow: none; border: 0; } body { background: #fff; color: #000; } }
[hidden] { display: none !important; }
/* small screens: never wider than the viewport */
@media (max-width: 900px) {
  .content { padding: 14px 12px 30px; overflow-x: hidden; }
  .tbar { gap: 4px; padding: 6px 8px; }
  .tbar .search { min-width: 0; flex-basis: 120px; }
  .page-h > div { min-width: 0; max-width: 100%; }
  .page-h .seg { max-width: 100%; overflow-x: auto; }
  .page-h .row { flex-wrap: wrap; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .v { font-size: 18px; overflow-wrap: anywhere; }
  .drawer { width: 100vw !important; }
  .filters input, .filters select { width: 100%; }
  .filters > * { flex: 1 1 140px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .pipeline { grid-template-columns: repeat(6, minmax(78vw, 1fr)); }
}
/* internal chat — WhatsApp-style */
:root { --wa-bg: #efeae2; --wa-me: #d9fdd3; --wa-them: #ffffff; --wa-green: #00a884; --wa-tick: #53bdeb; --wa-side: var(--panel); --wa-head: #f0f2f5; --wa-sys: #ffffffd9; --wa-dots: rgba(0,0,0,.05); }
:root[data-theme="dark"] { --wa-bg: #0b141a; --wa-me: #005c4b; --wa-them: #202c33; --wa-green: #00a884; --wa-tick: #53bdeb; --wa-side: #111b21; --wa-head: #202c33; --wa-sys: #182229; --wa-dots: rgba(255,255,255,.025); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block; }
.wa { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - 120px); min-height: 480px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--wa-side); }
.wa-side { display: flex; flex-direction: column; border-inline-end: 1px solid var(--line); min-width: 0; background: var(--wa-side); }
.wa-sh { display: flex; align-items: center; gap: 4px; padding: 14px 16px 8px; } .wa-sh b { font-size: 1.25em; }
.wa-search { padding: 4px 12px 8px; } .wa-search input { width: 100%; border-radius: 10px; background: var(--wa-head); border: 0; padding: 9px 14px; }
.wa-chips { display: flex; gap: 6px; padding: 0 12px 8px; }
.wa-chips button { border: 0; border-radius: 99px; padding: 5px 12px; background: var(--wa-head); color: var(--muted); cursor: pointer; font: inherit; font-size: .88em; }
.wa-chips button.on { background: color-mix(in srgb, var(--wa-green) 22%, transparent); color: var(--wa-green); font-weight: 600; }
.wa-list { overflow-y: auto; flex: 1; }
.wa-it { display: flex; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.wa-it:hover { background: var(--wa-head); } .wa-it.on { background: color-mix(in srgb, var(--wa-head) 100%, var(--line) 30%); }
.wa-it-b { flex: 1; min-width: 0; } .wa-it-b .row { gap: 8px; flex-wrap: nowrap; } .wa-it-b b { font-weight: 600; }
.wa-prev { color: var(--muted); font-size: .9em; }
.wa-green { color: var(--wa-green); font-weight: 600; }
.wa-unread { background: var(--wa-green); color: #fff; border-radius: 99px; min-width: 20px; height: 20px; padding: 0 6px; font-size: .75em; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.wa-av { border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; letter-spacing: -.5px; }
.wa-main { display: flex; flex-direction: column; min-width: 0; background: var(--wa-bg); background-image: radial-gradient(var(--wa-dots) 1.2px, transparent 1.2px); background-size: 18px 18px; position: relative; }
.wa-welcome { margin: auto; text-align: center; max-width: 460px; padding: 30px; } .wa-welcome h2 { margin: 12px 0 6px; font-weight: 400; }
.wa-wicon { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--wa-green) 18%, transparent); color: var(--wa-green); }
.wa-h { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--wa-head); border-bottom: 1px solid var(--line); }
.wa-h-t { flex: 1; min-width: 0; cursor: pointer; }
.wa-back { display: none; font-size: 1.4em; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 12px 6%; display: flex; flex-direction: column; gap: 2px; }
.wa-msgs.ro { max-height: 62vh; padding: 10px 4px; background: var(--wa-bg); border-radius: 10px; margin-top: 8px; }
.wa-lock { align-self: center; max-width: 520px; text-align: center; font-size: .8em; background: color-mix(in srgb, #ffd279 30%, var(--wa-sys)); color: var(--text); border-radius: 8px; padding: 6px 12px; margin: 6px auto 10px; line-height: 1.6; }
.wa-day { align-self: center; margin: 10px 0 6px; } .wa-day span, .wa-sys span { background: var(--wa-sys); border-radius: 8px; padding: 4px 12px; font-size: .78em; color: var(--muted); box-shadow: 0 1px .5px rgba(0,0,0,.13); display: inline-block; }
.wa-sys { align-self: center; text-align: center; margin: 4px 0; max-width: 80%; }
.wa-row { display: flex; margin-top: 8px; } .wa-row.cont { margin-top: 2px; } .wa-row.me { justify-content: flex-end; }
.wa-b { position: relative; max-width: min(65%, 560px); background: var(--wa-them); border-radius: 8px; padding: 6px 9px 18px; box-shadow: 0 1px .5px rgba(0,0,0,.13); word-break: break-word; min-width: 90px; }
.wa-row.me .wa-b { background: var(--wa-me); }
.wa-row:not(.cont) .wa-b { border-start-start-radius: 0; }
.wa-row.me:not(.cont) .wa-b { border-start-start-radius: 8px; border-start-end-radius: 0; }
.wa-row:not(.cont) .wa-b::before { content: ''; position: absolute; top: 0; inset-inline-start: -7px; border: 7px solid transparent; border-top-color: var(--wa-them); border-inline-end-color: var(--wa-them); border-width: 0 8px 10px 0; }
.wa-row.me:not(.cont) .wa-b::before { inset-inline-start: auto; inset-inline-end: -7px; border-color: transparent; border-top-color: var(--wa-me); border-inline-start-color: var(--wa-me); border-width: 0 0 10px 8px; }
.wa-b.del { color: var(--muted); }
.wa-name { font-size: .82em; font-weight: 600; margin-bottom: 2px; }
.wa-txt { line-height: 1.55; white-space: normal; padding-inline-end: 54px; } .wa-txt a { color: var(--acc2); text-decoration: underline; }
.wa-meta { position: absolute; bottom: 3px; inset-inline-end: 8px; font-size: .68em; color: var(--muted); display: inline-flex; gap: 3px; align-items: center; direction: ltr; }
.wa-tick { color: var(--muted); letter-spacing: -3px; font-weight: 700; padding-inline-end: 3px; } .wa-tick.read { color: var(--wa-tick); }
.wa-act { position: absolute; top: 2px; inset-inline-end: 4px; display: none; gap: 2px; } .wa-b:hover .wa-act { display: flex; }
.wa-act button { border: 0; background: var(--wa-sys); border-radius: 6px; cursor: pointer; font-size: .8em; padding: 1px 5px; color: var(--muted); }
.wa-card { display: flex; gap: 10px; align-items: center; background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 8px; padding: 8px 10px; margin: 2px 0 6px; cursor: pointer; min-width: 220px; border-inline-start: 3px solid var(--wa-green); }
.wa-card:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.wa-card > div { flex: 1; min-width: 0; } .wa-card .mi { width: 32px; height: 32px; border-radius: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.wa-card.wide { margin-bottom: 6px; } .wa-open { color: var(--wa-green); font-size: .82em; font-weight: 600; }
.wa-file { display: flex; gap: 10px; align-items: center; background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 8px; padding: 8px 10px; margin: 2px 0 6px; cursor: pointer; min-width: 230px; }
.wa-file .grow { min-width: 0; }
.wa-ext { width: 36px; height: 42px; border-radius: 5px; background: #e2584b; color: #fff; font-size: .62em; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.wa-img { margin: 0 -5px 4px; border-radius: 6px; overflow: hidden; cursor: zoom-in; min-height: 60px; max-width: 330px; }
.wa-img img { display: block; width: 100%; max-height: 340px; object-fit: cover; }
.wa-img-ph { display: flex; align-items: center; justify-content: center; height: 120px; background: color-mix(in srgb, var(--text) 8%, transparent); font-size: 1.6em; }
.wa-light { position: relative; max-width: 94vw; max-height: 92vh; } .wa-light img { max-width: 94vw; max-height: 92vh; border-radius: 6px; } .wa-light .btn { position: absolute; top: 8px; inset-inline-end: 8px; }
.wa-in { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px; background: var(--wa-head); }
.wa-in textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; border-radius: 10px; border: 0; padding: 10px 14px; background: var(--panel); line-height: 1.45; }
.wa-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--wa-green); color: #fff; cursor: pointer; font-size: 1.1em; flex: none; }
[dir="rtl"] .wa-send svg { transform: scaleX(-1); } .wa-send { display: inline-flex; align-items: center; justify-content: center; }
.wa-send:disabled { opacity: .6; }
.wa-attach { position: relative; } .wa-attach .ib { font-size: 1.2em; height: 42px; }
.wa-menu { position: absolute; bottom: 52px; inset-inline-start: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.25); padding: 8px; min-width: 300px; z-index: 5; }
.wa-menu button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; font: inherit; color: var(--text); text-align: start; }
.wa-menu button:hover { background: var(--wa-head); } .wa-menu button span { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.wa-blocked { text-align: center; padding: 14px; background: var(--wa-head); color: var(--muted); font-size: .9em; }
.wa-typing-t { color: var(--wa-green); font-weight: 600; }
.wa-dots { display: inline-flex; gap: 2px; margin-inline-start: 3px; } .wa-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: waDot 1.2s infinite; } .wa-dots i:nth-child(2) { animation-delay: .2s; } .wa-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes waDot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.wa-mem { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); cursor: pointer; }
.wa-role { font-size: .72em; border-radius: 6px; padding: 2px 8px; background: color-mix(in srgb, var(--wa-green) 18%, transparent); color: var(--wa-green); font-weight: 600; white-space: nowrap; }
.wa-role.owner { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.wa-msel { width: auto; padding: 2px 6px; font-size: .85em; }
.wa-info-h { text-align: center; padding: 6px 0 10px; } .wa-info-h h2 { margin: 10px 0 2px; } .wa-info-h .wa-av { margin: 0 auto; }
.wa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; } .wa-gi { aspect-ratio: 1; overflow: hidden; border-radius: 4px; cursor: zoom-in; background: var(--panel2); }
.wa-gi img { width: 100%; height: 100%; object-fit: cover; display: block; } .wa-gi .wa-img-ph { height: 100%; }
.wa-b-prev { background: var(--wa-me); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.wa-share-prev .wa-card { cursor: default; }
.chat-user { cursor: pointer; }
@media (max-width: 820px) {
  .wa { grid-template-columns: 1fr; height: calc(100vh - 110px); border-radius: 0; }
  .wa .wa-main { display: none; } .wa.open .wa-main { display: flex; } .wa.open .wa-side { display: none; }
  .wa-back { display: inline-flex; } .wa-msgs { padding: 10px 3%; } .wa-b { max-width: 85%; }
}
.chat .m { white-space: normal; word-break: break-word; } .chat .m a { cursor: pointer; }
/* AI assistant */
.aia { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; }
.aia .aia-msgs { flex: 1; max-height: none; }
.aia .m { max-width: 92%; }
.aia-ex { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.aia-ex .chip { cursor: pointer; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .85em; background: var(--panel); }
.aia-ex .chip:hover { border-color: var(--acc); }
.aia-tbl { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.aia-tbl td, .aia-tbl th { unicode-bidi: plaintext; white-space: nowrap; }
/* ERP connect */
.erp-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 12px; }
.erp-kind { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.erp-kind.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 6%, transparent); }
.erp-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 14px; }
.erp-step { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.erp-step > b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-size: 12px; }
.erp-step.ok { border-color: var(--good); }
.erp-step.ok > b { background: var(--good); color: #fff; }
.vf-h { vertical-align: bottom; min-width: 120px; }
.vf-h .vf-to { font-weight: 700; font-family: var(--mono, monospace); font-size: 12px; }
.vf-h .vf-from { font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 2px; }
.vf-card.bad { border-color: var(--crit); }
.vf-ok { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
#mmGrid select, #mmGrid input { min-width: 0; padding: 4px 6px; }
/* implementation wizard */
.wz { display: grid; grid-template-columns: 240px 1fr; gap: 12px; height: calc(100vh - 200px); min-height: 520px; }
.wz-rail { display: flex; flex-direction: column; gap: 4px; padding: 10px; overflow: auto; }
.wz-ph { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.wz-ph:hover { background: var(--panel2); } .wz-ph.on { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.wz-ph .wz-n { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); font-size: 12px; flex: none; }
.wz-ph.done .wz-n { background: var(--good); color: #04130a; border-color: var(--good); }
.wz-chat { display: flex; flex-direction: column; padding: 12px; overflow: hidden; }
.wz-msgs { flex: 1; max-height: none; }
.wz-msgs .m { max-width: 86%; } .wz-bot { line-height: 1.7; }
.wz-in { border-top: 1px solid var(--line); padding-top: 10px; max-height: 55%; overflow: auto; }
.wz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-chips.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.wz-chip { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.wz-chip:hover { border-color: var(--acc); } .wz-chip.def { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.wz-form { padding: 10px; } .wz-form table input, .wz-form table select { width: 100%; min-width: 0; }
.wz-key { padding: 8px; background: var(--panel2); border-radius: 8px; user-select: all; word-break: break-all; }
.wz-pre { white-space: pre-wrap; background: var(--panel2); padding: 8px; border-radius: 8px; direction: ltr; text-align: left; }
.wz-ck .row { gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 820px) { .wz { grid-template-columns: 1fr; height: auto; } .wz-rail { flex-direction: row; overflow-x: auto; } .wz-ph { white-space: nowrap; } .wz-chat { min-height: 70vh; } }
.wz-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; margin-inline-end: 2px; }

/* ---------- v2.2 soft component layer ---------- */
.card { border-radius: var(--radius); box-shadow: var(--soft); padding: 16px; }
.card h3 { font-size: 15px; font-weight: 700; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { --tc: var(--faint); border-radius: var(--radius); box-shadow: var(--soft); padding: 14px 16px; min-width: 0; }
.tile .k { padding-inline-end: 38px; min-height: 30px; }
.tile::after { display: none; }
.tile::before { content: ""; position: absolute; top: 14px; inset-inline-end: 14px; width: 28px; height: 28px; border-radius: 8px; background: radial-gradient(circle, var(--tc) 0 4px, transparent 5px), color-mix(in srgb, var(--tc) 14%, transparent); }
.tile.good { --tc: var(--good); } .tile.warn { --tc: var(--warn); } .tile.crit { --tc: var(--crit); } .tile.acc { --tc: var(--acc); } .tile.info { --tc: var(--info); }
.tile .k { font-size: 12.5px; } .tile .v { font-size: clamp(18px, 1.55vw, 24px); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v .faint { font-size: 12px; }
.tile.link:hover { border-color: var(--acc); box-shadow: var(--shadow); }
.btn { border-radius: 10px; min-height: 36px; padding: 6px 14px; background: var(--panel); border-color: var(--line2); }
.btn:hover { border-color: var(--acc); background: var(--hover); }
.btn.pri { background: var(--pri-bg); color: var(--pri-fg); }
.btn.pri:hover { filter: brightness(1.06); }
.btn.sm { min-height: 30px; }
input[type=text], input[type=number], input[type=date], input[type=datetime-local], input[type=email], input[type=password], input[type=search], input:not([type]), select, textarea { background: var(--panel); border-color: var(--line2); border-radius: 9px; min-height: 36px; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 18%, transparent); }
.seg { background: var(--bg2); border-color: var(--line); border-radius: 10px; padding: 3px; max-width: 100%; overflow-x: auto; }
.seg button { border-radius: 8px; min-height: 32px; white-space: nowrap; color: var(--text2); }
.seg button.on { background: var(--panel); color: var(--acc); font-weight: 600; box-shadow: var(--soft), 0 0 0 1px var(--line); }
.tabs button { min-height: 40px; color: var(--text2); } .tabs button.on { color: var(--acc); font-weight: 600; border-bottom-width: 3px; }
.tbl-wrap { box-shadow: var(--soft); }
table.t th { background: var(--panel2); color: var(--muted); }
table.t td { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
table.t tbody tr:hover td { background: var(--panel2); }

.pill { border-radius: 999px; font-weight: 500; }
.note { border-radius: 12px; background: var(--panel); }
.note.warn { background: color-mix(in srgb, var(--warn) 8%, var(--panel)); } .note.crit { background: color-mix(in srgb, var(--crit) 7%, var(--panel)); } .note.good { background: color-mix(in srgb, var(--good) 7%, var(--panel)); } .note.acc { background: color-mix(in srgb, var(--acc) 7%, var(--panel)); }
.drawer, .modal-box { background: var(--panel); }
.drawer > header, .modal-box > header { background: var(--panel); }
.modal-box { border-radius: 16px; }
.overlay { background: rgba(15,27,51,.35); }
.toast { border-radius: 12px; }
.login { background: radial-gradient(circle at 15% 10%, rgba(34,211,238,.18), transparent 40%), radial-gradient(circle at 90% 90%, rgba(37,99,235,.14), transparent 40%), var(--bg); }
.login .box { border-radius: 18px; }
.chart .grid line { stroke: var(--line); }
.wh-card:hover { box-shadow: var(--shadow); }
.pipe-col { box-shadow: var(--soft); background: var(--panel2); }
.pipe-item { background: var(--panel); }
.launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.launch-it { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--soft); color: var(--text); min-width: 0; }
.launch-it:hover { border-color: var(--acc); box-shadow: var(--shadow); }
.launch-it b { display: block; font-size: 13.5px; line-height: 1.3; } .launch-it small { color: var(--muted); font-size: 11.5px; }
.launch-it > span:last-child { min-width: 0; }
.dseg { margin-bottom: 16px; }
@media (max-width: 600px) {
  .tb-brand, .live { display: none; }
  .tbar { gap: 2px; padding: 6px; } .ib { width: 36px; height: 36px; } .avatar { width: 32px; height: 32px; }
  .tbar .search { flex: 1 1 60px; margin-inline: 4px; }
  .tbar .search input { padding-inline-end: 6px; }
  .launch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.chartbox { width: 100%; min-width: 0; }
.chart text { font-size: 11px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.hb-t { height: 10px; background: var(--bg2); border-radius: 6px; overflow: hidden; } .hb-t i { display: block; height: 100%; border-radius: 6px; }
.hb-v { min-width: 56px; text-align: end; }
/* reports */
.rp { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.rp-cat { position: sticky; top: 0; display: flex; flex-direction: column; gap: 4px; padding: 10px; max-height: calc(100vh - 140px); overflow-y: auto; }
.rp-g { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 10px 8px 4px; }
.rp-it { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: 10px; cursor: pointer; border: 0; background: transparent; text-align: start; width: 100%; color: var(--text2); }
.rp-it:hover { background: var(--hover); } .rp-it.on { background: var(--sel); color: var(--acc); font-weight: 600; }
.rp-it .mi { width: 30px; height: 30px; border-radius: 9px; } .rp-it small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; line-height: 1.3; }
.rp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 14px; margin-bottom: 14px; }
.rp-bar label.f { width: 170px; } .rp-bar .seg { align-self: flex-end; }
.rp-bar .sp { flex: 1; }
.rp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; } .rp-head .mi { width: 40px; height: 40px; border-radius: 12px; }
.rp-head h2 { margin: 0; font-size: 19px; } .rp-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
table.t tfoot td { font-weight: 700; background: var(--panel2); border-top: 2px solid var(--line2); position: sticky; bottom: 0; }
@media (max-width: 1100px) { .rp { grid-template-columns: 1fr; } .rp-cat { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; } .rp-g { width: 100%; } .rp-it { width: auto; } .rp-it small { display: none; } }
.chart { direction: ltr; }
.side .ph b { flex: 1; }
.ph-x { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; }
.ph-x:hover { background: var(--hover); color: var(--text); }
@media (min-width: 1001px) { body.side-min .side { display: none; } }
/* v2.2.1 sizing pass */
.rail { flex-basis: 78px; padding: 8px 5px; gap: 4px; }
.rail .mod { min-height: 58px; gap: 3px; padding: 5px 2px; border-radius: 11px; }
.rail .mi { width: 32px; height: 32px; border-radius: 9px; }
.rail .ml { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.side { flex-basis: 236px; }
.nav a { min-height: 40px; font-size: 13.5px; } .nav a .ic { width: 17px; height: 17px; }
.mono, .pill, .badge, .zone-chip { white-space: nowrap; }
table.t td:has(> .btn), table.t td:has(> button) { white-space: nowrap; }
table.t td .btn + .btn { margin-inline-start: 4px; }
table.t th { font-size: 12px; }
.filters { align-items: flex-end; } .filters label.chk { min-height: 36px; }
.filters input, .filters select { width: 160px; }
.btn svg, .ib svg { flex: none; }
.tile .k { font-size: 12.5px; line-height: 1.4; }
.tile.has-tip { overflow: visible; z-index: 1; }
.tile.has-tip:hover, .tile.has-tip:focus-within { z-index: 5; }
.tile.has-tip::before { display: none; }
.info-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: help; vertical-align: middle; }
.info-tip span { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid currentColor; border-radius: 50%; font: 700 10px/1 var(--font); }
.info-tip:hover, .info-tip:focus-visible { color: var(--acc); outline: none; }
.info-tip::after, .info-tip::before { content: none !important; } /* one tooltip only: the floating .tile-tooltip shows the explanation */
.tile.has-tip .info-tip { position: absolute; top: 14px; inset-inline-end: 14px; }
.tile-tooltip { position: fixed; z-index: 10000; display: none; width: max-content; max-width: min(320px, calc(100vw - 24px)); padding: 9px 12px; border: 1px solid #344054; border-radius: 7px; background: #111827; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.35); font: 400 13px/1.5 var(--font); text-align: start; white-space: normal; overflow-wrap: anywhere; pointer-events: none; }
.rp-head h2 { display: flex; align-items: center; gap: 4px; }
.rp-head h2 .info-tip { flex: none; }
.up-order { margin-bottom: 14px; }
.up-order > div { margin-top: 4px; }
.up-grid .up-card { display: flex; flex-direction: column; align-items: flex-start; }
.up-card h3 { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.up-card h3 > span:first-child { min-width: 0; }
.up-card .row { margin-top: auto; }
.up-card .up-requires, .up-card .up-missing { margin-top: 8px; }
.up-card .up-missing { color: var(--warn); }
.tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
@media (max-width: 1000px) { .rail { width: 78px; } .side { inset-inline-start: 78px; } }
.fxbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; } .fxbar .sp { flex: 1; } .fxbar .mi { width: 36px; height: 36px; border-radius: 10px; }
.metals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.metal .mv { font-size: 22px; font-weight: 700; margin: 8px 0 4px; white-space: nowrap; } .metal .mv small { font-size: 12px; color: var(--muted); font-weight: 400; margin-inline-start: 6px; }
.metal.old { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.mdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lbl-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: color-mix(in srgb, var(--lc) 12%, var(--panel)); color: color-mix(in srgb, var(--lc) 75%, var(--text)); border: 1px solid color-mix(in srgb, var(--lc) 30%, transparent); }
.lbl-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lc); }
.lbl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(580px, 100%), 1fr)); gap: 14px; }
.lbl-card .mi { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.lbl-usd { width: 90px !important; min-height: 30px !important; padding: 2px 6px !important; text-align: end; }
.demo-pick { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.demo-co { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: start; color: var(--text); min-width: 0; }
.demo-co:hover, .demo-co.on { border-color: var(--acc); background: var(--sel); }
.demo-co .mi { width: 28px; height: 28px; border-radius: 8px; flex: none; } .demo-co b { display: block; font-size: 12.5px; } .demo-co small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-co > span:last-child { min-width: 0; }
.login .box { width: min(480px, 94vw); }
/* drawers: label/value lists never stretch to the height of a neighbouring table */
.kv { align-content: start; align-items: start; }
.drawer .grid { align-items: start; }
.drawer .body .grid.g2 > .kv { position: sticky; top: 0; }
.op-std { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.op-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: start; color: var(--text); min-width: 0; }
.op-card:hover { border-color: var(--acc); } .op-card.on { border-color: var(--acc); background: var(--sel); box-shadow: 0 0 0 1px var(--acc) inset; }
.op-card .mi { width: 32px; height: 32px; border-radius: 9px; flex: none; } .op-card b { display: block; font-size: 13.5px; } .op-card small { display: block; color: var(--muted); font-size: 11.5px; }
.op-sw { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; } .op-sw input { margin-top: 3px; flex: none; } .op-sw b { display: block; font-weight: 600; } .op-sw small { display: block; color: var(--muted); font-size: 12px; }
.dl { font-size: 12px; font-weight: 600; color: var(--muted); } .dl.good { color: var(--good); } .dl.bad { color: var(--crit); } .dl.up { color: var(--acc); }
.kvs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; } .kvs > div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding: 6px 0; } .kvs span { color: var(--muted); }
.heat { display: grid; grid-template-columns: 64px repeat(24, minmax(0, 1fr)); gap: 2px; direction: ltr; font-size: 10.5px; }
.heat .hh { text-align: center; color: var(--faint); } .heat .hd { color: var(--muted); text-align: end; padding-inline-end: 6px; direction: rtl; white-space: nowrap; overflow: hidden; }
.heat .hc { aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--acc) calc(var(--a) * 100%), var(--bg2)); min-height: 10px; }

.store-note { margin-bottom: 14px; }
.store-overview { margin-bottom: 24px; }
.store-overview .card { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 3px 10px; }
.store-overview .card .small { grid-column: 2; }
.store-overview-icon { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--sel); color: var(--acc); }
.store-toolbar { margin-bottom: 8px; }
.store-toolbar h2 { font-size: 18px; margin: 0; }
.store-search { display: flex; align-items: center; gap: 8px; width: min(310px, 100%); padding: 0 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); color: var(--muted); }
.store-search input { width: 100%; min-height: 38px; border: 0; outline: 0; background: transparent; }
.store-filters { display: flex; gap: 7px; margin: 10px 0 14px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(285px, 100%), 1fr)); gap: 12px; }
.store-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--soft); display: flex; flex-direction: column; gap: 8px; }
.store-card:hover { border-color: color-mix(in srgb, var(--acc) 55%, var(--line)); }
.store-card-top, .store-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.store-brand { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--brand) 10%, var(--panel)); color: var(--brand); font-size: 19px; font-weight: 800; }
.store-card h3 { margin: 2px 0 0; font-size: 17px; }
.store-card p { min-height: 40px; margin: 0; }
.store-capabilities { display: flex; flex-wrap: wrap; gap: 7px; margin: 3px 0; }
.store-capabilities span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.store-capabilities .ic { color: var(--acc); }
.store-card-foot { margin-top: auto; padding-top: 9px; border-top: 1px solid var(--line); }
.store-card-foot a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.store-settings { margin: 12px 0; }
.store-flow { margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.store-flow h3 { margin: 0 0 5px; font-size: 15px; }
.store-map-table input:not([type=checkbox]) { width: 100%; min-width: 180px; }
.store-map-table td:last-child, .store-map-table th:last-child { width: 110px; text-align: center; }
@media (max-width: 760px) {
  .store-overview { grid-template-columns: 1fr; }
  .store-toolbar { align-items: stretch; }
  .store-search { width: 100%; }
  .store-card p { min-height: 0; }
  .store-flow { padding: 8px; }
}
/* stock level bar (reorder screen) */
.stock-lvl { position: relative; width: 120px; height: 10px; border-radius: 6px; background: color-mix(in srgb, var(--muted) 18%, transparent); }
.stock-lvl > i { position: absolute; inset-block: 2px; inset-inline-start: 0; border-radius: 4px; background: var(--good); min-width: 2px; }
.stock-lvl.warn > i { background: var(--warn); } .stock-lvl.crit > i { background: var(--crit); }
.stock-lvl > b { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--text, currentColor); opacity: .8; transform: translateX(-1px); }

/* ---------- sign-in: brand panel + form (large Helix wordmark) ---------- */
.login.lg2 { display: grid; grid-template-columns: minmax(380px, 1.05fr) 1fr; place-items: stretch; padding: 0; }
.lg-brand { position: relative; overflow: hidden; color: #e6edf7; display: flex; align-items: center; justify-content: center; padding: 56px 48px;
  background: radial-gradient(circle at 18% 12%, rgba(34,211,238,.28), transparent 42%), radial-gradient(circle at 85% 88%, rgba(37,99,235,.32), transparent 45%), linear-gradient(160deg, #071423 0%, #0b1c33 55%, #0a2540 100%); }
.lg-brand::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 40% 40%, #000 30%, transparent 75%); pointer-events: none; }
.lg-brand-in { position: relative; z-index: 1; width: min(520px, 100%); }
.lg-logo { display: block; width: min(340px, 80%); height: auto; margin-bottom: 22px; filter: drop-shadow(0 6px 24px rgba(34,211,238,.25)); }
.lg-tag { font-size: 21px; line-height: 1.5; font-weight: 600; color: #fff; margin-bottom: 30px; max-width: 30ch; }
.lg-pts { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.lg-pts li { display: grid; gap: 2px; padding-inline-start: 18px; border-inline-start: 2px solid rgba(34,211,238,.55); }
.lg-pts b { font-size: 15px; color: #fff; } .lg-pts span { font-size: 13.5px; color: #9fb3cf; }
.lg-foot { margin-top: 40px; font-size: 12px; color: #6f86a6; }
.lg-main { display: grid; place-items: center; padding: 32px 20px; }
.login.lg2 .box { width: min(460px, 94vw); box-shadow: 0 24px 60px -24px rgba(15,27,51,.35); }
.lg-mini { display: none; background: #0b1c33; border-radius: 10px; padding: 8px 12px; } .lg-mini img { height: 22px; display: block; }
@media (max-width: 900px) {
  .login.lg2 { grid-template-columns: 1fr; }
  .lg-brand { padding: 28px 20px; } .lg-pts, .lg-foot, .lg-tag { display: none; } .lg-logo { width: 200px; margin: 0 auto; }
}

/* ---------- upload steps (Upload Center + wizard) ---------- */
.up-head { margin-bottom: 14px; display: grid; gap: 10px; }
.up-bar { height: 8px; border-radius: 6px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; }
.up-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--good), var(--acc)); border-radius: 6px; transition: width .4s; }
.up-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.up-l b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; margin-inline-end: 5px; font-size: 11px; }
.up-steps { display: grid; gap: 8px; }
.up-step { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; border-inline-start-width: 4px; }
.up-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.up-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.up-n { font: 600 11px/1 var(--mono, monospace); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.up-badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; }
.up-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.up-step.done { border-inline-start-color: var(--good); } .up-step.done .up-ic, .up-l.done b { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); } .up-badge.done { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.up-step.run { border-inline-start-color: var(--acc2); } .up-step.run .up-ic, .up-l.run b { background: color-mix(in srgb, var(--acc2) 18%, transparent); color: var(--acc2); } .up-badge.run { background: color-mix(in srgb, var(--acc2) 15%, transparent); color: var(--acc2); }
.up-step.err { border-inline-start-color: var(--crit); } .up-step.err .up-ic, .up-l.err b { background: color-mix(in srgb, var(--crit) 18%, transparent); color: var(--crit); } .up-badge.err { background: color-mix(in srgb, var(--crit) 15%, transparent); color: var(--crit); }
.up-step.ready { border-inline-start-color: var(--warn); } .up-step.ready .up-ic, .up-l.ready b { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); } .up-badge.ready { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.up-step.lock { border-inline-start-color: var(--line2); opacity: .72; } .up-step.lock .up-ic, .up-l.lock b { background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--muted); } .up-badge.lock { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
@media (max-width: 760px) { .up-step { grid-template-columns: 34px 1fr; } .up-acts { grid-column: 1 / -1; justify-content: flex-start; } }
/* wizard phase list: progress + status under each phase */
.wz-prog { display: grid; gap: 6px; padding: 6px 6px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.wz-pt { display: grid; line-height: 1.25; } .wz-pt small { font-size: 11px; color: var(--faint); }
.wz-ph.done .wz-pt small { color: var(--good); } .wz-ph.on .wz-pt small { color: var(--acc); }
.wz-ph.on .wz-n { border-color: var(--acc); color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 18%, transparent); }
.wz-up .up-head { box-shadow: none; }
/* error log */
.el-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 14px; }
.el-ic.error { background: color-mix(in srgb, var(--crit) 15%, transparent); } .el-ic.warning { background: color-mix(in srgb, var(--warn) 15%, transparent); }
.el-top { display: grid; gap: 6px; } .el-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.el-row:hover { background: var(--panel2); } .el-cnt { text-align: center; }

/* AI engine settings: list of engines + one engine's settings */
.ai-set { display: grid; grid-template-columns: 290px 1fr; gap: 14px; align-items: start; }
.ai-list { padding: 8px; display: grid; gap: 2px; position: sticky; top: 8px; }
.ai-g { font-size: 11.5px; font-weight: 700; color: var(--faint); padding: 10px 8px 4px; }
.ai-it { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--text2); }
.ai-it:hover { background: var(--panel2); }
.ai-it.on { background: color-mix(in srgb, var(--acc) 10%, transparent); color: var(--text); box-shadow: inset 3px 0 0 var(--acc); }
.ai-nm { flex: 1; display: grid; line-height: 1.25; }
.ai-nm small { font-size: 11px; color: var(--faint); }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ai-dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.ai-dot.off { background: var(--line2); }
.ai-pane { padding: 18px 20px; }
.ai-meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.ai-params { display: grid; gap: 4px; }
.ai-p { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.ai-pv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-pv input { width: 110px; }
.ai-pv .tiny { width: 100%; }
.ai-foot { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ai-sw { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.ai-sw input { display: none; }
.ai-sw span { width: 40px; height: 22px; border-radius: 12px; background: var(--line2); position: relative; transition: .2s; }
.ai-sw span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.ai-sw input:checked + span { background: var(--good); }
.ai-sw input:checked + span::after { inset-inline-start: 21px; }
@media (max-width: 900px) { .ai-set { grid-template-columns: 1fr; } .ai-list { position: static; } .ai-p { grid-template-columns: 1fr; } }
.sim-msg { color: var(--acc); margin-top: 3px; max-width: 520px; white-space: normal; }
/* report list: items never shrink (the column has a max height), descriptions stay within two lines */
.rp-it { flex-shrink: 0; align-items: flex-start; }
.rp-it .mi { flex: none; margin-top: 2px; }
.rp-it small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- settings hub (pages-settings.js) ---------- */
.set-nav .set-nav-h { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; padding: 12px 12px 4px; }
.set-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; border-radius: 18px; margin-bottom: 18px; border: 1px solid var(--line);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 60%), var(--panel); box-shadow: var(--shadow); }
.set-hero h1 { margin: 0 0 4px; font-size: 24px; }
.set-hero .sub { color: var(--muted); font-size: 13.5px; max-width: 640px; }
.set-hero > div:nth-child(2) { flex: 1; min-width: 220px; }
.set-hero-ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--acc), var(--acc2)); box-shadow: 0 8px 22px color-mix(in srgb, var(--acc) 35%, transparent); }
.set-q { max-width: 320px; flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.set-q svg { color: var(--faint); flex: none; } .set-q input { flex: 1; min-width: 0; border: 0; background: none; height: 40px; outline: 0; color: var(--text); padding: 0; box-shadow: none; }
.set-sec { margin: 0 0 20px; }
.set-sec h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text2); margin: 0 0 10px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.set-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); transition: border-color .15s, transform .15s, box-shadow .15s; }
.set-card:hover, .set-card:focus-visible { border-color: var(--acc); transform: translateY(-1px); box-shadow: var(--shadow); }
.set-ic { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--acc); background: var(--sel); }
.set-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.set-tx b { font-size: 14px; color: var(--text); }
.set-tx span { font-size: 12.5px; color: var(--muted); }
.set-tx i { font-style: normal; font-size: 11.5px; color: var(--faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.set-go { color: var(--faint); font-size: 20px; line-height: 1; align-self: center; }
.set-crumb { font-size: 12px; margin: -4px 0 8px; } .set-crumb a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.set-help { border: 1px solid color-mix(in srgb, var(--info) 35%, var(--line)); background: color-mix(in srgb, var(--info) 7%, var(--panel)); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }
.set-help summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; }
.set-help summary::-webkit-details-marker { display: none; }
.set-help-i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--info); color: #fff; font: 700 12px/1 var(--font); }
.set-help ol { margin: 8px 0 6px; padding-inline-start: 22px; font-size: 13px; line-height: 1.8; }
.undo-bar { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 900; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.undo-it { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-inline-start: 4px solid var(--acc); box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 13px; }
.undo-t { color: var(--acc); } .undo-x { width: 26px; height: 26px; font-size: 12px; }
@media print { .undo-bar { display: none !important; } }

/* ---------- home-page shortcuts (pages-shortcuts.js) ---------- */
.sc-box { margin: 14px 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.content + .sc-box { margin: 0 16px 16px; }
.sc-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } .sc-h b { display: inline-flex; align-items: center; gap: 6px; }
.sc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.sc-it { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 13px; min-width: 0; transition: border-color .15s, transform .15s; }
.sc-it:hover { border-color: var(--acc); transform: translateY(-1px); }
.sc-it span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-it .mi { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.sc-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 6px 2px; }
.sc-pin.on { color: var(--warn); }
.sc-mine, .sc-all { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.sc-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-bottom: 1px solid var(--line2); font-size: 13px; } .sc-row:last-child { border: 0; }
.sc-row .ib { width: 26px; height: 26px; font-size: 11px; }
.sc-all label.chk { display: flex; align-items: center; gap: 6px; padding: 4px 6px; font-size: 13px; }
@media print { .sc-box { display: none !important; } }
.sc-box .sc-list { max-height: 28vh; overflow: auto; }

/* ---------- Integration Store set-up: readiness steps ---------- */
.st-ready { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.st-step { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); font-size: 12.5px; color: var(--muted); }
.st-step b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--line); color: var(--text); }
.st-step.ok { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); color: var(--text); } .st-step.ok b { background: var(--good); color: #fff; }
.st-step.no { border-color: color-mix(in srgb, var(--crit) 45%, var(--line)); color: var(--text); } .st-step.no b { background: var(--crit); color: #fff; }
.store-brand.logo { padding: 0; overflow: hidden; border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.store-brand.logo img { height: auto; max-height: 70%; display: block; object-fit: contain; }
.st-guide { border: 1px solid color-mix(in srgb, var(--info) 35%, var(--line)); background: color-mix(in srgb, var(--info) 7%, var(--panel)); border-radius: 12px; padding: 10px 14px; margin: 14px 0 0; }
.st-guide summary { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; }
.st-guide summary::-webkit-details-marker { display: none; }
.st-guide ol { margin: 8px 0; padding-inline-start: 22px; font-size: 13px; line-height: 1.9; }
.wa-intro-h { text-align: center; } .wa-intro-h .wa-wicon { width: 76px; height: 76px; }
.wa-intro-f { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; }
.wa-intro-f .mi { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.wa-intro-p { margin: 4px 0 0; padding-inline-start: 20px; line-height: 1.8; } .wa-intro-p li { margin-bottom: 4px; }
/* support tickets: the conversation */
.tk-thread { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; padding: 4px; }
.tk-msg { max-width: 86%; align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13.5px; line-height: 1.6; }
.tk-msg.me { align-self: flex-end; background: var(--sel); border-color: var(--line2); }
.tk-msg.int { background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-style: dashed; border-color: var(--warn); }
.tk-h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; } .tk-h .faint { margin-inline-start: auto; }
.tk-sys { align-self: center; font-size: 11.5px; color: var(--faint); background: var(--bg2); border-radius: 999px; padding: 2px 10px; }

/* ---------- label studio ---------- */
.ls-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 14px; }
.ls-card { display: flex; flex-direction: column; gap: 8px; }
.ls-prev { display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 14px; border-radius: 10px; background: repeating-conic-gradient(var(--panel2) 0 25%, var(--bg2) 0 50%) 0 0 / 14px 14px; }
.ls-prev .ls-svg { max-width: 100%; height: auto; filter: drop-shadow(0 1px 3px rgba(15, 23, 42, .25)); }
.ls-prev.big { min-height: 220px; }
.ls-prev.big .ls-svg { max-height: 420px; }
.ls-fields { display: flex; flex-wrap: wrap; gap: 4px; }
.ls-designer { position: fixed; inset: 2vh 2vw; background: var(--panel); border-radius: 14px; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); overflow: hidden; }
.ls-designer > header, .ls-designer > footer { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ls-designer > footer { border-bottom: 0; border-top: 1px solid var(--line); }
.ls-designer .sp, .ls-print .sp, .ls-zoom .sp { flex: 1; }
.ls-body { flex: 1; display: grid; grid-template-columns: 220px 1fr 290px; min-height: 0; }
.ls-pal, .ls-props { overflow: auto; padding: 10px 12px; border-inline-end: 1px solid var(--line); }
.ls-props { border-inline-end: 0; border-inline-start: 1px solid var(--line); }
.ls-pal .sec, .ls-props .sec { font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 6px; }
.ls-pal-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.ls-flist { display: flex; flex-direction: column; gap: 2px; }
.ls-f { display: flex; flex-direction: column; align-items: flex-start; text-align: start; background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; cursor: pointer; color: var(--text2); font: inherit; font-size: 12.5px; }
.ls-f:hover { background: var(--panel2); border-color: var(--line); }
.ls-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg2); }
.ls-zoom { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.ls-canvas { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 20px; touch-action: none; direction: ltr; }
.ls-sheet { flex: none; box-shadow: 0 2px 12px rgba(15, 23, 42, .25); border-radius: 4px; }
.ls-sheet .ls-svg { display: block; user-select: none; }
.ls-el { cursor: move; }
.ls-hit { fill: transparent; stroke: transparent; stroke-width: 0.25; }
.ls-el:hover .ls-hit { stroke: rgba(14, 116, 144, .5); stroke-dasharray: 0.6 0.4; }
.ls-el.on .ls-hit { stroke: #0e7490; stroke-dasharray: none; fill: rgba(14, 116, 144, .06); }
.ls-handle { fill: #0e7490; cursor: nwse-resize; }
.ls-pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ls-pgrid .full { grid-column: 1 / -1; }
.ls-pgrid input, .ls-pgrid select { width: 100%; }
.ls-zpl { width: 100%; min-height: 50vh; font-size: 11px; white-space: pre; }
.ls-cam { width: 100%; max-height: 60vh; border-radius: 10px; background: #000; }
.ls-print { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ls-print .seg { display: inline-flex; flex-wrap: wrap; }
.ls-over summary { cursor: pointer; color: var(--muted); }
.ls-designer > header { gap: 12px; }
.ls-dtitle { display: flex; flex-direction: column; line-height: 1.25; }
.ls-src { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.ls-ptabs { display: flex; width: 100%; margin-bottom: 4px; }
.ls-ptabs button { flex: 1; }
.ls-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ls-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text2); cursor: pointer; font-size: 11.5px; text-align: center; line-height: 1.2; }
.ls-tile:hover { border-color: #0e7490; color: #0e7490; background: rgba(14, 116, 144, .06); }
.ls-tools .btn.on { background: rgba(14, 116, 144, .12); color: #0e7490; }
.ls-tools .btn:disabled { opacity: .35; }
.ls-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.ls-al { display: inline-flex; gap: 2px; }
.ls-sheet { position: relative; }
.ls-grid { position: absolute; inset: 0; pointer-events: none; border-radius: 4px;
  background-image: linear-gradient(to right, rgba(14, 116, 144, .22) 1px, transparent 1px), linear-gradient(to bottom, rgba(14, 116, 144, .22) 1px, transparent 1px),
    linear-gradient(to right, rgba(14, 116, 144, .08) 1px, transparent 1px), linear-gradient(to bottom, rgba(14, 116, 144, .08) 1px, transparent 1px); }
.ls-layers { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.ls-layer { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.ls-layer:hover { background: var(--panel2); }
.ls-layer.on { border-color: #0e7490; background: rgba(14, 116, 144, .08); }
.ls-ly-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-layer .btn { padding: 0 5px; font-size: 10px; }
.ls-vals { grid-template-columns: auto 1fr; }
.ls-gbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ls-rules { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ls-rules > #lrT { grid-column: 1 / -1; }
.ls-how { display: flex; flex-direction: column; gap: 12px; }
.ls-how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ls-how-steps > div { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: 10px; background: var(--bg2); }
.ls-how-steps b { width: 22px; height: 22px; border-radius: 50%; background: #0e7490; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.ls-how-steps span { font-weight: 600; }
.ls-how-steps small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.ls-try { margin-top: 10px; }
.ls-try .ls-svg, .ls-rprev .ls-svg { max-height: 240px; }
.ls-thumb { width: 74px; height: 46px; display: flex; align-items: center; justify-content: center; background: var(--bg2); border-radius: 6px; padding: 3px; flex: none; }
.ls-thumb .ls-svg { max-width: 100%; max-height: 100%; }
.ls-rform { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ls-rform .seg { display: flex; flex-wrap: wrap; }
.ls-rprev { position: sticky; top: 0; }
@media (max-width: 900px) { .ls-rules, .ls-rform, .ls-how-steps { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .ls-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; overflow: auto; } .ls-pal, .ls-props { border: 0; max-height: 30vh; } .ls-print { grid-template-columns: 1fr; } }
