:root {
  color-scheme: light;
  --bg: #f4f3f0;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: #e2e0da;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #7c7a74;
  --accent: #2a78d6;
  --accent-soft: #e3eefb;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-text: #006300; --critical-text: #b42323;
  --grid: #e8e6e1;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 1px rgba(0,0,0,.03);
  --radius: 8px;
  --sidebar: #16161a;
  --sidebar-text: #c9c8d0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110; --surface: #1a1a19; --surface-2: #232321; --border: #2f2f2c;
    --text: #ffffff; --text-2: #c3c2b7; --text-3: #8f8e86;
    --accent: #3987e5; --accent-soft: #1d2d42;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --good-text: #4cc94c; --critical-text: #ff7b7b;
    --grid: #2a2a27; --shadow: none; --sidebar: #0c0c0e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --surface-2: #232321; --border: #2f2f2c;
  --text: #ffffff; --text-2: #c3c2b7; --text-3: #8f8e86;
  --accent: #3987e5; --accent-soft: #1d2d42;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --good-text: #4cc94c; --critical-text: #ff7b7b;
  --grid: #2a2a27; --shadow: none; --sidebar: #0c0c0e;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- layout */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 16px; color: #fff; padding: 4px 10px 14px; letter-spacing: -.01em; }
.brand span { font-size: 20px; }
.site-switch { width: 100%; background: #24242a; border: 1px solid #33333b; color: #fff; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #75747f; padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--sidebar-text); font-size: 13.5px; }
.nav a:hover { background: #22222a; text-decoration: none; color: #fff; }
.nav a.active { background: #2a2a34; color: #fff; }
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar .spacer { flex: 1; }
.sidebar .foot { font-size: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.sidebar .foot button { background: none; border: 0; color: var(--sidebar-text); text-align: left; padding: 0; cursor: pointer; font-size: 12px; }
.sidebar .foot button:hover { color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: -.01em; margin-right: auto; }
.content { padding: 20px 24px 60px; display: flex; flex-direction: column; gap: 16px; max-width: 1480px; width: 100%; }
.menu-btn { display: none; }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--text-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--critical-text); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.seg button.on { background: var(--surface-2); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
select.input, input.input, textarea.input { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font-size: 13px; }
input.input:focus, select.input:focus, textarea.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 550; }
label.field .hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12px; }
.chip b { font-weight: 600; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--text-2); border-radius: 50%; width: 18px; height: 18px; line-height: 1; }
.chip button:hover { background: rgba(0,0,0,.1); }
.toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 12.5px; user-select: none; }
.toggle.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font-size: 14px; font-weight: 650; }
.card-b { padding: 14px 16px 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .l { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--text-3); }
.kpi .d .up { color: var(--good-text); }
.kpi .d .down { color: var(--critical-text); }
.kpi.hero .v { font-size: 34px; }
.empty { padding: 36px 16px; text-align: center; color: var(--text-3); }
.empty .big { font-size: 34px; margin-bottom: 6px; }

/* ---------- tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 550; color: var(--text-2); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: default; user-select: none; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl .cell-name { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .bar-cell { position: relative; }
.tbl .bar-cell .bg { position: absolute; left: 0; top: 4px; bottom: 4px; background: var(--accent-soft); border-radius: 0 4px 4px 0; z-index: 0; }
.tbl .bar-cell span { position: relative; z-index: 1; }

/* ---------- bar list */
.barlist { display: flex; flex-direction: column; gap: 6px; }
.barlist .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; position: relative; padding: 5px 8px; border-radius: 4px; cursor: default; }
.barlist .row.click { cursor: pointer; }
.barlist .row.click:hover { background: var(--surface-2); }
.barlist .row .bar { position: absolute; left: 0; top: 2px; bottom: 2px; background: var(--accent-soft); border-radius: 0 4px 4px 0; }
.barlist .row .n { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist .row .v { position: relative; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12.5px; }

/* ---------- charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--text-3); font-size: 11px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--border); stroke-width: 1; }
.chart .xhair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tooltip { position: fixed; z-index: 1000; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(0,0,0,.18); border-radius: 6px; padding: 8px 10px; font-size: 12px; opacity: 0; transition: opacity .1s; max-width: 320px; }
.tooltip.show { opacity: 1; }
.tooltip .t { font-weight: 650; margin-bottom: 4px; }
.tooltip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.tooltip .r b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- funnel */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.fstep { display: grid; grid-template-columns: 180px 1fr 150px; gap: 12px; align-items: center; }
.fstep .lbl { font-weight: 550; }
.fstep .track { height: 34px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; }
.fstep .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.fstep .fill span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #fff; font-weight: 650; font-size: 13px; white-space: nowrap; }
.fstep .stat { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fstep .drop { color: var(--critical-text); }

/* ---------- status */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-text); }
.badge.ni { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--text); }
.badge.poor { background: color-mix(in srgb, var(--critical) 16%, transparent); color: var(--critical-text); }
.badge.blue { background: var(--accent-soft); color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.live { background: var(--good); box-shadow: 0 0 0 0 rgba(12,163,12,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12,163,12,.5); } 70% { box-shadow: 0 0 0 8px rgba(12,163,12,0); } 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); } }
.distbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--surface); }
.distbar div { height: 100%; }

/* ---------- code */
pre.code { background: #16161a; color: #e8e7ef; border-radius: 7px; padding: 14px 16px; overflow-x: auto; margin: 0; position: relative; line-height: 1.5; }
.code-wrap { position: relative; }
.code-wrap .copy { position: absolute; top: 8px; right: 8px; background: #2c2c34; color: #fff; border: 0; border-radius: 4px; padding: 4px 10px; cursor: pointer; font-size: 12px; }
.code-wrap .copy:hover { background: #3a3a44; }

/* ---------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .box { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.auth h1 { margin: 0; font-size: 22px; }
.err { color: var(--critical-text); font-size: 13px; }

/* ---------- sites home */
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.site-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s; }
.site-card:hover { border-color: var(--accent); }
.site-card .dom { color: var(--text-3); font-size: 12.5px; }
.site-card .stats { display: flex; gap: 20px; }
.site-card .stats b { font-size: 18px; display: block; font-variant-numeric: tabular-nums; }

/* ---------- heatmap */
.hm-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.hm-pages { max-height: calc(100vh - 160px); overflow-y: auto; }
.hm-pages .pg { padding: 8px 12px; border-bottom: 1px solid var(--grid); cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.hm-pages .pg:hover { background: var(--surface-2); }
.hm-pages .pg.on { background: var(--accent-soft); }
.hm-pages .pg .p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-stage { position: relative; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin: 0 auto; }
.hm-stage .snap { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.hm-stage .snap iframe { border: 0; background: #fff; }
.hm-stage canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.hm-stage .replayer-mouse, .hm-stage .replayer-mouse-tail { display: none !important; }
.hm-stage .scroll-label { position: absolute; right: 8px; transform: translateY(-50%); background: rgba(22,22,26,.85); color: #fff; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; pointer-events: none; font-variant-numeric: tabular-nums; }
.hm-stage .scroll-line { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(22,22,26,.6); pointer-events: none; }
.hm-scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.hm-scale .ramp { width: 140px; height: 10px; border-radius: 5px; }

/* ---------- replay */
.replay-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.player-box { background: #0c0c0e; border-radius: var(--radius); overflow: hidden; min-height: 300px; display: grid; place-items: center; }
.player-box .rr-player { background: #0c0c0e !important; box-shadow: none !important; }
.player-box .rr-controller { background: #16161a !important; }
.player-box .rr-controller__btns button { color: #fff !important; }
.player-box .rr-timeline__time { color: #ddd !important; }
.timeline { max-height: 70vh; overflow-y: auto; }
.tl-item { display: grid; grid-template-columns: 52px 22px 1fr; gap: 6px; padding: 7px 12px; border-bottom: 1px solid var(--grid); font-size: 12.5px; cursor: pointer; align-items: start; }
.tl-item:hover { background: var(--surface-2); }
.tl-item .t { color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-item .d { overflow: hidden; text-overflow: ellipsis; }
.tl-item.error .d { color: var(--critical-text); }
.meta-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; }
.meta-grid dt { color: var(--text-3); }
.meta-grid dd { margin: 0; overflow: hidden; text-overflow: ellipsis; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background: #16161a; color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 13px; transition: transform .2s; z-index: 2000; }
.toast.show { transform: translateX(-50%) translateY(0); }
details.err-group { border-bottom: 1px solid var(--grid); }
details.err-group summary { padding: 10px 12px; cursor: pointer; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; list-style: none; }
details.err-group summary::-webkit-details-marker { display: none; }
details.err-group .body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.steps-editor .step { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; margin-bottom: 8px; }

@media (max-width: 1100px) {
  .g3 { grid-template-columns: 1fr 1fr; }
  .replay-layout { grid-template-columns: 1fr; }
  .hm-layout { grid-template-columns: 1fr; }
  .hm-pages { max-height: 240px; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-btn { display: inline-flex; }
  .g2, .g3, .g-2-1 { grid-template-columns: 1fr; }
  .content { padding: 16px 16px 60px; }
  .topbar { padding: 10px 16px; }
  .fstep { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- refresh button */
.ico-refresh { display: inline-block; }
.ico-refresh.spin { animation: spin .6s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- live store (2D floor plan) */
:root {
  --store-floor: #efe9df; --store-tile: rgba(0,0,0,.035); --store-wall: #3a3833; --store-gondola: #d8d0c2; --store-goods: #bdb3a1;
  --store-zone: rgba(255,255,255,.55); --store-zone-border: rgba(58,56,51,.18); --store-neutral: #8a877f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --store-floor: #23221f; --store-tile: rgba(255,255,255,.03); --store-wall: #55524b; --store-gondola: #3a3833; --store-goods: #4d4a44;
    --store-zone: rgba(255,255,255,.04); --store-zone-border: rgba(255,255,255,.1); --store-neutral: #9d9a92;
  }
}
:root[data-theme="dark"] {
  --store-floor: #23221f; --store-tile: rgba(255,255,255,.03); --store-wall: #55524b; --store-gondola: #3a3833; --store-goods: #4d4a44;
  --store-zone: rgba(255,255,255,.04); --store-zone-border: rgba(255,255,255,.1); --store-neutral: #9d9a92;
}
.store-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.store-side { position: sticky; top: 76px; }
.store-wrap { position: relative; padding: 26px 0 22px; }
.store-sign { position: absolute; top: 0; left: 50%; transform: translateX(-50%); background: var(--store-wall); color: #fff; font-weight: 750; font-size: 13px; letter-spacing: .04em; padding: 4px 16px; border-radius: 4px 4px 0 0; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.store-door-label { position: absolute; bottom: 0; left: 40%; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--text-3); }
.store { position: relative; width: 100%; aspect-ratio: 16 / 11; background-color: var(--store-floor);
  background-image: linear-gradient(var(--store-tile) 1px, transparent 1px), linear-gradient(90deg, var(--store-tile) 1px, transparent 1px);
  background-size: 28px 28px; border: 6px solid var(--store-wall); border-radius: 7px; overflow: visible; }
.store .door { position: absolute; bottom: -6px; height: 6px; background: var(--store-floor); }
.store .door::before, .store .door::after { content: ''; position: absolute; top: -10px; width: 3px; height: 16px; background: var(--store-wall); border-radius: 2px; }
.store .door::before { left: -1px; } .store .door::after { right: -1px; }
.zone { position: absolute; background: var(--store-zone); border: 1px dashed var(--store-zone-border); border-radius: 6px; }
.zone-label { position: absolute; top: 4px; left: 8px; right: 6px; font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-count { position: absolute; top: -9px; right: -7px; z-index: 2; background: var(--text); color: var(--surface); border-radius: 999px; padding: 1px 7px; font-size: 11px; box-shadow: 0 0 0 2px var(--store-floor); }
.zone-count:empty { display: none; }
.zone .registers { position: absolute; left: 8%; right: 8%; bottom: 10%; display: flex; justify-content: space-between; gap: 6%; }
.zone .registers span { flex: 1; height: 10px; background: var(--store-gondola); border-radius: 3px; border-top: 3px solid var(--store-goods); }
.zone .trolleys { position: absolute; right: 6px; bottom: 4px; font-size: 13px; opacity: .45; letter-spacing: -3px; }
.zone .counter { position: absolute; left: 12%; right: 12%; bottom: 10%; height: 9px; background: var(--store-gondola); border-radius: 5px; }
.zone .displays { position: absolute; left: 8%; right: 8%; bottom: 8%; display: flex; gap: 8%; }
.zone .displays span { flex: 1; height: 16px; border-radius: 50%; background: var(--store-gondola); border: 2px solid var(--store-goods); }
.zone .sofa { position: absolute; left: 15%; right: 15%; bottom: 10%; height: 10px; border-radius: 4px 4px 3px 3px; background: var(--store-gondola); }
.gondola { position: absolute; background: var(--store-gondola); border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); padding: 4px; transition: box-shadow .3s; }
.gondola .goods { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; height: 100%; }
.gondola .goods i { background: var(--store-goods); border-radius: 2px; }
.gondola.busy { box-shadow: inset 0 0 0 2px var(--accent); }
.gondola.empty-shelf { opacity: .45; }
.shelf-label { position: absolute; font-size: 10.5px; line-height: 1.25; padding-top: 3px; color: var(--text-2); overflow: hidden; }
.shelf-label b { display: block; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.shelf-label span { white-space: nowrap; }
.shelf-label .now { color: var(--accent); font-weight: 650; }
.shopper { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 3;
  transition: left 1.4s cubic-bezier(.45,.05,.3,1), top 1.4s cubic-bezier(.45,.05,.3,1), opacity .5s, transform .2s; }
.shopper svg { width: 100%; height: 100%; display: block; fill: var(--c); filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.35)); }
.shopper svg circle { stroke: var(--store-floor); stroke-width: 1.6; }
.shopper:hover, .shopper.selected { transform: scale(1.3); z-index: 5; }
.shopper.selected svg { filter: drop-shadow(0 0 0 var(--text)) drop-shadow(0 0 3px var(--text)); }
.shopper.idle { opacity: .45; }
.shopper.arriving, .shopper.leaving { opacity: 0; }
.shopper .bdg { position: absolute; right: -7px; top: -8px; font-size: 12px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.shopper.ping::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c); animation: ping 1s ease-out forwards; }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.store .overflow { position: absolute; transform: translate(-100%, -100%); background: var(--text); color: var(--surface); font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; z-index: 4; }
.store-legend { margin: 10px 0 0; }
.side-where { background: var(--surface-2); border-radius: 6px; padding: 10px 12px; }
.side-where b { display: block; font-size: 14px; margin: 2px 0; }
.side-cart { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; }
@media (max-width: 1100px) { .store-layout { grid-template-columns: 1fr; } .store-side { position: static; } }
@media (max-width: 700px) {
  .shopper { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
  .zone-label { font-size: 9px; left: 4px; } .shelf-label { font-size: 9px; } .zone .registers, .zone .displays { display: none; }
}

.storage-alert { background: color-mix(in srgb, var(--critical) 14%, var(--surface)); border-bottom: 1px solid var(--critical); color: var(--text); padding: 10px 24px; font-size: 13px; }

/* page / product thumbnail above each shopper */
.shopper .thumb { position: absolute; left: 50%; bottom: calc(100% + 5px); transform: translateX(-50%); width: 30px; height: 30px; border-radius: 4px; background: var(--surface); border: 2px solid var(--surface); box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 1px var(--c); transition: width .2s, height .2s; pointer-events: none; z-index: 1; }
.shopper .thumb::after { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 4px solid transparent; border-top-color: var(--surface); }
.shopper .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; }
.shopper .thumb[hidden] { display: none; }
.shopper:hover .thumb, .shopper.selected .thumb { width: 96px; height: 96px; }
.shopper:hover, .shopper.selected { z-index: 6; }
.shopper.idle .thumb { opacity: .7; }
.gondola .shelf-img { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); height: calc(100% + 10px); aspect-ratio: 1; object-fit: cover; border-radius: 5px; border: 2px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.3); z-index: 1; }
.gondola .shelf-img[hidden] { display: none; }
.side-img { margin: -2px 0 8px; }
.side-img img { width: 100%; max-height: 180px; object-fit: contain; border-radius: 4px; background: var(--surface); display: block; }
.side-img[hidden] { display: none; }
@media (max-width: 700px) { .shopper .thumb { width: 20px; height: 20px; } }

/* ---------- live screen ("Ver transmissão") */
.dot.rec { background: #e34948; width: 8px; height: 8px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.watch-bar { display: flex; align-items: center; gap: 12px; min-width: 0; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; background: #e34948; color: #fff; font-weight: 750; font-size: 11.5px; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; flex: none; }
.live-badge.off { background: var(--text-3); }
.live-badge.off .dot { animation: none; background: #fff; }
.watch-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.watch-box { position: relative; min-height: 360px; padding: 0; }
.watch-stage { position: relative; overflow: hidden; margin: 0 auto; background: #fff; }
.watch-stage .replayer-wrapper { position: absolute; left: 0; top: 0; }
.watch-stage iframe { border: 0; background: #fff; }
.watch-msg { color: #c9c8d0; padding: 40px 24px; text-align: center; max-width: 460px; line-height: 1.5; }
.watch-msg[hidden] { display: none; }
.watch-msg.overlay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(12,12,14,.88); color: #fff; border-radius: 7px; z-index: 5; padding: 18px 22px; }

/* ---------- shelves with product photos */
.gondola .goods { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; height: 100%; }
.gondola .pslot { position: relative; border-radius: 4px; overflow: hidden; background: var(--store-goods); display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--text-2); cursor: default; transition: box-shadow .2s, transform .2s; }
.gondola .pslot.vacant { opacity: .35; }
.gondola .pslot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gondola .pslot.busy { box-shadow: 0 0 0 2px var(--accent); z-index: 1; }
.gondola .pslot:not(.vacant):hover { transform: scale(1.8); z-index: 3; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.zone-other .sofa { position: absolute; left: 15%; right: 15%; bottom: 10%; height: 10px; border-radius: 4px 4px 3px 3px; background: var(--store-gondola); }

/* ---------- cart contents in the visitor panel */
.cart-items { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cart-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12.5px; }
.cart-item img, .cart-item .ci-ph { width: 34px; height: 34px; border-radius: 5px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--text-2); }
.cart-item .ci-n { min-width: 0; }
.cart-item .ci-n > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item .ci-v { color: var(--text-2); white-space: nowrap; }

.shopper.at-shelf:not(:hover):not(.selected) .thumb { display: none !important; }

/* ---------- multi-store dashboard */
.dash-grid { display: grid; gap: 16px; }
.dash-grid.cols-1 { grid-template-columns: minmax(0, 1fr); }
.dash-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-card .card-h h2 a { color: inherit; }
.dash-card .card-h .small { margin-right: auto; }
.dash-online { font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.dash-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.dash-metrics div { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.dash-metrics b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-metrics span { font-size: 11px; color: var(--text-3); }
.store-wrap.mini .store { border-width: 4px; }
.cols-2 .store-wrap.mini .zone-label, .cols-3 .store-wrap.mini .zone-label { font-size: 9px; left: 4px; }
.cols-2 .store-wrap.mini .shelf-label, .cols-3 .store-wrap.mini .shelf-label { font-size: 9px; }
.cols-3 .store-wrap.mini .shopper { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.cols-2 .store-wrap.mini .shopper { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.cols-3 .store-wrap.mini .zone .registers, .cols-3 .store-wrap.mini .zone .displays, .cols-3 .store-wrap.mini .trolleys { display: none; }
.cols-3 .dash-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .dash-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .dash-grid.cols-2, .dash-grid.cols-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- edit dialog */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1500; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal-body { overflow-y: auto; }
.modal-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin: 18px 0 8px; }
.modal-body h3:first-child { margin-top: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.edit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13.5px; }
.edit-list { display: flex; flex-direction: column; gap: 6px; }
.edit-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.edit-item .ei-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 13.5px; }

/* shelf slots never grow beyond the gondola (small floors / initials without photo) */
.gondola .goods { grid-template-rows: minmax(0, 1fr); }
.gondola .pslot { min-width: 0; min-height: 0; white-space: nowrap; line-height: 1; }

/* ---------- Owlpfy brand */
:root { --accent: #0052d9; --accent-soft: #e1ebfc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #4d8dff; --accent-soft: #15284d; } }
:root[data-theme="dark"] { --accent: #4d8dff; --accent-soft: #15284d; }
a.brand { color: #fff; text-decoration: none; }
a.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 5px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.auth-logo { width: 64px; height: 64px; border-radius: 11px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 6px 20px rgba(0,0,0,.4); }

/* ---------- collapsible sidebar (desktop) / drawer (mobile) */
.menu-btn { display: inline-flex; padding: 7px 9px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand-row .brand { padding-right: 0; }
.nav-close { background: none; border: 0; color: var(--sidebar-text); padding: 6px; border-radius: 4px; cursor: pointer; display: inline-flex; margin: -10px 2px 0 0; }
.nav-close:hover { background: #22222a; color: #fff; }
.nav-backdrop { display: none; }
@media (min-width: 821px) {
  .layout { transition: grid-template-columns .2s ease; }
  .layout.nav-collapsed { grid-template-columns: 0 1fr; }
  .layout.nav-collapsed .sidebar { visibility: hidden; padding-left: 0; padding-right: 0; overflow: hidden; }
}
@media (max-width: 820px) {
  .layout.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.45); }
  .layout.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 45; }
}

/* ---------- mobile bottom navigation */
.bottom-nav { display: none; }
@media (max-width: 820px) {
  .bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--sidebar); border-top: 1px solid #2a2a31; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 4px 2px;
    color: var(--sidebar-text); text-decoration: none; background: none; border: 0; font: inherit; font-size: 10.5px; border-radius: 7px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .bottom-nav a span, .bottom-nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav a.on { color: #fff; background: #26262e; }
  .bottom-nav a.on svg { color: var(--accent); }
  .bottom-nav a:active, .bottom-nav button:active { background: #26262e; }
  .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .menu-btn { display: none; } /* the bottom bar has the Menu button */
  .layout.nav-open .bottom-nav { z-index: 46; }
}

/* ---------- navigation cleanup */
@media (min-width: 821px) { .layout:not(.nav-collapsed) .menu-btn { display: none; } } /* the sidebar has its own collapse button */
.sidebar .foot a { color: var(--sidebar-text); font-size: 12px; text-decoration: none; }
.sidebar .foot a:hover { color: #fff; }
.site-card { cursor: default; }
.site-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.dim-groups { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 12px; }
.dim-group { display: flex; flex-direction: column; gap: 5px; }
.dim-group-l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.dim-group .seg { flex-wrap: wrap; }

/* ---------- customizable overview grid */
.ov-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 44px; gap: 12px; }
.ov-w { position: relative; min-width: 0; min-height: 0; }
.ov-content { height: 100%; }
.ov-kpi .kpi { height: 100%; overflow: hidden; }
.ov-card .card, .ov-w .ov-card { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.ov-body { flex: 1; min-height: 0; overflow: auto; }
.ov-chart { height: 100%; }
.ov-trend-seg { flex-wrap: wrap; }
.ov-tools, .ov-resize { display: none; }
.ov-editbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px dashed var(--accent); border-radius: 7px; background: var(--accent-soft); font-size: 13px; }
.ov-editbar[hidden] { display: none; }
.ov-editbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ov-corner-hint { display: inline-block; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; vertical-align: -1px; }
.ov-grid.editing .ov-w { outline: 2px dashed var(--border); outline-offset: 2px; border-radius: var(--radius); }
.ov-grid.editing .ov-w:hover { outline-color: var(--accent); }
.ov-grid.editing .ov-content { pointer-events: none; opacity: .9; }
.ov-grid.editing .ov-tools { display: flex; position: absolute; left: 0; right: 0; top: 0; z-index: 3; justify-content: space-between; align-items: center; gap: 6px; padding: 4px; }
.ov-grip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent); color: #fff; border-radius: 4px; padding: 3px 8px 3px 5px; font-size: 11.5px; font-weight: 600; cursor: grab; touch-action: none; user-select: none; max-width: calc(100% - 34px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ov-grip:active { cursor: grabbing; }
.ov-remove { width: 24px; height: 24px; border-radius: 4px; border: 0; background: var(--critical); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; flex: none; }
.ov-grid.editing .ov-resize { display: block; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; z-index: 3; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--accent) 50%); border-radius: 0 0 var(--radius) 0; }
.ov-w.dragging { opacity: .45; }
.ov-w.resizing { outline-color: var(--accent) !important; outline-style: solid !important; }
.ov-empty { grid-column: 1 / -1; }
.ov-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ov-cat-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.ov-cat-item span { font-size: 11.5px; color: var(--text-3); }
.ov-cat-item:hover:not([disabled]) { border-color: var(--accent); }
.ov-cat-item[disabled] { opacity: .45; cursor: default; }
@media (max-width: 1100px) { .ov-w[data-w="2"] { grid-column: span 3 !important; } }
@media (max-width: 820px) {
  .ov-w { grid-column: span 12 !important; }
  .ov-w.ov-kpi { grid-column: span 6 !important; }
  .ov-grid.editing .ov-resize { display: none; } /* phones: move / remove / add only */
}

/* the hidden attribute always wins over component display rules (.btn, .seg, ...) */
[hidden] { display: none !important; }

/* ---------- fluid drag & resize */
.ov-grid.editing .ov-w { cursor: grab; transition: outline-color .15s; }
.ov-w.floating { position: fixed; z-index: 1200; margin: 0; pointer-events: none; cursor: grabbing;
  box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 0 2px var(--accent); border-radius: var(--radius); outline: none !important; will-change: transform; }
.ov-placeholder { border: 2px dashed var(--accent); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ov-resize-box { position: fixed; z-index: 1200; pointer-events: none; border: 2px solid var(--accent); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.ov-resize-box.settle { transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease, opacity .18s ease; opacity: 0; }
.ov-size-badge { position: absolute; right: 8px; bottom: 8px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
body.ov-dragging, body.ov-dragging * { cursor: grabbing !important; user-select: none; }
body.ov-resizing, body.ov-resizing * { cursor: nwse-resize !important; user-select: none; }
.ov-grid.editing .ov-resize { width: 22px; height: 22px; }

@media (max-width: 820px) { .ov-placeholder { grid-column: span 12 !important; } .ov-placeholder.ov-kpi { grid-column: span 6 !important; } }

/* ---------- flowing conversion funnel block */
.ff-wrap { height: 100%; min-height: 150px; }
.ff-svg { display: block; width: 100%; height: 100%; }
.ff-sep { stroke: color-mix(in srgb, var(--series-7) 55%, transparent); stroke-width: 1; }
.ff-step { fill: var(--text-2); font-size: 12.5px; font-weight: 650; }
.ff-pct { fill: #fff; font-size: 15px; font-weight: 750; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 3px; stroke-linejoin: round; font-variant-numeric: tabular-nums; }
.ff-count { fill: var(--text-2); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ff-channel { padding: 4px 8px; font-size: 12px; }

/* ---------- inline icons (replace emojis) */
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; }
.ico-fill { fill: currentColor; stroke-width: 1.5; }
.empty .big .ico { width: 36px; height: 36px; stroke-width: 1.6; color: var(--text-3); }
.cc { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 4px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); vertical-align: 1px; font-variant-numeric: tabular-nums; }
.shopper .bdg { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.35); font-size: 10px; }
.shopper .bdg .ico { width: 10px; height: 10px; stroke-width: 2.4; }
.zone .trolleys { letter-spacing: 0; display: inline-flex; gap: 2px; }
.tl-item > span:nth-child(2) { color: var(--text-2); }

/* ---------- sidebar footer: settings / theme / logout icons side by side */
.sidebar .foot.foot-icons { flex-direction: row; align-items: center; gap: 6px; padding: 8px 6px; border-top: 1px solid #26262e; }
.foot-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 6px; border: 0; background: none;
  color: var(--sidebar-text) !important; cursor: pointer; text-decoration: none; }
.foot-ic .ico { width: 19px; height: 19px; }
.foot-ic:hover, .foot-ic.active { background: #22222a; color: #fff !important; }
.foot-ic:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- add site form (dropdown modal and first run) */
.add-site-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.add-site-form .field { flex: 1; min-width: 160px; }
.add-site-form .field:nth-child(3) { flex: 0 0 auto; min-width: 0; }

/* ---------- store block on the Dashboard geral */
.ov-w .dash-card .card-h .small { margin-right: auto; }
.dash-body { display: flex; flex-direction: column; overflow: hidden; }
.dash-body .store-wrap { width: 100%; margin: 0 auto; }
.ov-w .dash-metrics { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }

/* mini floor inside a dashboard block: compact labels / shoppers (like the old 2-column view) */
.dash-body .store-wrap.mini .zone-label, .dash-body .store-wrap.mini .shelf-label { font-size: 9px; left: 4px; }
.dash-body .store-wrap.mini .shopper { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.dash-body .store-wrap.mini .zone .registers, .dash-body .store-wrap.mini .zone .displays { display: none; }

/* ---------- collapsible sidebar sections */
.nav-sub { margin-top: 2px; }
.nav-sub-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; padding: 7px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--sidebar-text); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.nav-sub-btn:hover { background: #22222a; color: #fff; }
.nav-sub.has-active > .nav-sub-btn { color: #fff; }
.nav-chev { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; transition: transform .2s ease; flex: none; }
.nav-sub.open .nav-chev { transform: rotate(90deg); }
.nav-sub-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.nav-sub.open .nav-sub-items { grid-template-rows: 1fr; }
.nav-sub-items > div { overflow: hidden; display: flex; flex-direction: column; gap: 1px; }
.nav-sub-items a { padding-left: 22px !important; position: relative; font-size: 13px; }
.nav-sub-items a::before { content: ''; position: absolute; left: 12px; top: 6px; bottom: 6px; width: 1px; background: #33333b; }
.nav-sub-items a.active::before { background: var(--accent); width: 2px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 10px 0 -4px; font-weight: 600; }

/* ---------- blocks without the light outline: separation comes from the surface color (+ soft shadow in light mode) */
.card, .kpi { border: 0; }
:root { --shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: none; } }
:root[data-theme="dark"] { --shadow: none; }

/* ---------- conversion funnel: same font as the app, no outlined digits */
.ff-svg { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.ff-pct { font-size: 15px; font-weight: 650; stroke: none; paint-order: normal; font-variant-numeric: normal; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.ff-step, .ff-count { font-variant-numeric: normal; }

/* ---------- add-site wizard */
.wizard { max-width: 540px; }
.wz-steps { display: flex; gap: 6px; list-style: none; margin: 4px 16px 0; padding: 0; }
.wz-steps li { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); padding: 8px 0; border-top: 3px solid var(--border); }
.wz-steps li span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 700; flex: none; }
.wz-steps li span .ico { width: 14px; height: 14px; stroke-width: 2.6; }
.wz-steps li.on { color: var(--text); font-weight: 600; border-top-color: var(--accent); }
.wz-steps li.on span { background: var(--accent); color: #fff; }
.wz-steps li.done { color: var(--text-2); border-top-color: var(--accent); }
.wz-steps li.done span { background: var(--accent-soft); color: var(--accent); }
.wz-body { display: flex; flex-direction: column; gap: 12px; }
.wz-form { display: flex; flex-direction: column; gap: 12px; }
.wz-lead { margin: 0; font-weight: 600; }
.wz-code { font-size: 11.5px; max-height: 150px; }
.wz-plat { flex-wrap: wrap; align-self: flex-start; }
.wz-how { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.wz-wait { text-align: center; padding: 14px 6px 6px; }
.wz-wait p { margin: 6px 0; }
.wz-spinner { width: 34px; height: 34px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.wz-ok { width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good-text); }
.wz-ok .ico { width: 26px; height: 26px; }

/* ---------- minimal settings page */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.set-row .badge .ico { width: 13px; height: 13px; }
.set-actions { display: flex; gap: 8px; }
#codeBox { margin-top: 12px; }
#codeBox p { margin: 0 0 8px; }
.set-note { margin: 10px 0 0; }
.set-form { display: flex; flex-direction: column; gap: 16px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.set-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-top: 12px; }
.set-adv > summary { padding: 14px 16px; cursor: pointer; font-weight: 650; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; }
.set-adv > summary::-webkit-details-marker, .set-sub > summary::-webkit-details-marker { display: none; }
.set-adv > summary::before, .set-sub > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; opacity: .6; }
.set-adv[open] > summary::before, .set-sub[open] > summary::before { transform: rotate(45deg); }
.set-adv > .card-b { padding-top: 0; display: flex; flex-direction: column; gap: 14px; }
.set-sub > summary { cursor: pointer; font-size: 13px; color: var(--text-2); list-style: none; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.set-danger { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--grid); }
.set-save { display: flex; justify-content: flex-end; }

/* ---------- accounts: login screens, tabs, team */
.auth-sub { margin: -4px 0 0; font-size: 13.5px; line-height: 1.5; }
.auth-submit { justify-content: center; padding: 10px; }
.auth-submit:disabled { opacity: .6; cursor: default; }
.auth-links { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.auth-links a, .auth-dev a { color: var(--accent); }
.auth-dev { margin: 0; }
.err:empty { display: none; }
.verify-alert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 16px; font-size: 13px; background: var(--accent-soft); color: var(--text); }
.verify-alert span { flex: 1; min-width: 180px; }
.account-switch { margin-bottom: 6px; font-weight: 650; }
.set-tabs { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.set-tabs a { padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.set-tabs a:hover { color: var(--text); }
.set-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.set-row .field.grow { flex: 1; min-width: 200px; }
.inv-form { align-items: flex-end; }
.team-list { display: flex; flex-direction: column; }
.team-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.team-row:last-child { border-bottom: 0; }
.team-who { display: flex; flex-direction: column; min-width: 0; }
.team-who > * { overflow: hidden; text-overflow: ellipsis; }
.input.sm { padding: 4px 8px; font-size: 12.5px; width: auto; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.set-h3 { font-size: 13px; margin: 18px 0 4px; color: var(--text-2); }
.inv-link { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.inv-link .input { flex: 1; min-width: 0; font-size: 12px; }
.admin-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

/* ---------- wordmark (owl + name) */
.brand img.brand-wordmark { width: auto; height: 25px; border-radius: 0; box-shadow: none; }
.brand-row .brand { padding-top: 6px; }
.auth-wordmark { height: 36px; width: auto; display: block; margin-bottom: 6px; align-self: flex-start; }
.auth-wordmark.on-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-wordmark.on-dark { display: block; } :root:not([data-theme="light"]) .auth-wordmark.on-light { display: none; } }
:root[data-theme="dark"] .auth-wordmark.on-dark { display: block; }
:root[data-theme="dark"] .auth-wordmark.on-light { display: none; }
.auth-alt { justify-content: center; padding: 10px; text-decoration: none; color: var(--text); }
.auth-alt:hover { text-decoration: none; background: var(--surface-2); }

/* ---------- plans */
.pl-cur-name { font-size: 18px; font-weight: 750; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.pl-uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 20px; margin-top: 16px; }
.pl-use-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.pl-use-h b { color: var(--text); font-weight: 650; }
.pl-use .distbar { background: var(--surface-2); }
.pl-alert { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 6px; font-size: 13px; background: color-mix(in srgb, var(--warning) 16%, transparent); }
.pl-alert.crit { background: color-mix(in srgb, var(--critical) 16%, transparent); }
.pl-alert .ico { flex: none; margin-top: 1px; }
.pl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 14px; margin-top: 30px; align-items: stretch; }
@media (max-width: 1180px) { .pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .pl-grid { grid-template-columns: 1fr; } }
.pl-card { position: relative; background: var(--surface); border-radius: 8px; padding: 22px 20px 20px; display: flex; flex-direction: column; }
.pl-card.popular { box-shadow: 0 0 0 2px var(--accent); }
.pl-tag { position: absolute; left: -2px; right: -2px; bottom: 100%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 20px; border-radius: 8px 8px 0 0; }
.pl-card.popular { border-top-left-radius: 0; border-top-right-radius: 0; }
.pl-card h3 { margin: 0; font-size: 18px; }
.pl-tagline { margin: 6px 0 14px; font-size: 13px; color: var(--text-2); min-height: 2.8em; }
.pl-price { font-size: 26px; font-weight: 800; color: var(--accent); letter-spacing: -.01em; }
.pl-price span { font-size: 13px; font-weight: 600; color: var(--text-2); margin-left: 3px; }
.pl-feat { list-style: none; margin: 16px 0 20px; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 13px; flex: 1; }
.pl-feat li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.35; }
.pl-feat li.off { color: var(--text-3); }
.pl-ic { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.pl-ic .ico { width: 12px; height: 12px; stroke-width: 3; }
.pl-ic.ok { background: var(--accent); color: #fff; }
.pl-ic.no { background: var(--surface-2); color: var(--text-3); }
.pl-btn { justify-content: center; padding: 10px; width: 100%; }
.pl-card.current .pl-btn { border-color: var(--accent); color: var(--accent); opacity: 1; }
.pl-btn:disabled { cursor: default; }
.pl-notes { margin-top: 14px; line-height: 1.5; }
.pl-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--good-text); }
.pl-sub.off { color: var(--text-2); }
.pl-sub span { flex: 1; min-width: 200px; }
.pl-sub .btn { color: var(--text-2); }

/* ---------- backups */
.bk-status { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-bottom: 10px; line-height: 1.45; }
.bk-status .ico { flex: none; margin-top: 2px; }
.bk-status.ok { color: var(--good-text); }
.bk-status.bad { color: var(--text); background: color-mix(in srgb, var(--warning) 14%, transparent); padding: 9px 11px; border-radius: 6px; }
.co-price { font-size: 26px; font-weight: 800; color: var(--accent); }
.co-price span { font-size: 13px; font-weight: 600; color: var(--text-2); margin-left: 3px; }

/* ---------- checkout (Mercado Pago card form embedded, in the dashboard look) */
.co-modal { max-width: 460px; }
.co-body { display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 140px); overflow-y: auto; }
.co-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border-radius: 8px; background: var(--surface-2); }
.co-plan { font-weight: 700; font-size: 15px; }
.co-summary .co-price { font-size: 22px; white-space: nowrap; }
.co-brick { min-height: 180px; }
.co-loading { display: grid; place-items: center; min-height: 180px; color: var(--text-3); font-size: 13px; }
.co-secure { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-3); line-height: 1.45; }
.co-secure .ico { flex: none; width: 14px; height: 14px; margin-top: 1px; }

/* ---------- verification codes */
.code-input { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: 6px; font-size: 20px; text-align: center; }
.verify-alert .code-input { width: 120px; font-size: 14px; letter-spacing: 4px; padding: 4px 8px; flex: none; }
.auth-links { justify-content: space-between; }
.blocked-hosts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.blocked-hosts .bk-status { margin: 0; flex-wrap: wrap; }
.blocked-hosts .bk-status span:not(.set-actions) { flex: 1; min-width: 200px; }
.wz-wait .blocked-hosts { text-align: left; }

/* ---------- activity log */
.activity { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.act-row { display: grid; grid-template-columns: 110px minmax(120px, 190px) 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 13px; align-items: baseline; }
.act-row:last-child { border-bottom: 0; }
.act-row.warn .act-what { color: var(--critical-text); }
.act-when { color: var(--text-3); font-size: 12px; }
.act-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.act-ip { color: var(--text-3); font-size: 11px; }
@media (max-width: 620px) { .act-row { grid-template-columns: 1fr; gap: 2px; } .act-ip { display: none; } }

/* ---------- server errors */
.srv-errors { display: flex; flex-direction: column; margin-bottom: 10px; }
.srv-err { border-bottom: 1px solid var(--grid); }
.srv-err summary { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; cursor: pointer; list-style: none; font-size: 13px; }
.srv-err summary::-webkit-details-marker { display: none; }
.srv-err-msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-err pre { white-space: pre-wrap; word-break: break-word; margin: 0 0 10px; padding: 10px; background: var(--surface-2); border-radius: 6px; }
.srv-err summary > span:last-child { white-space: nowrap; flex: none; }

/* ---------- Meta Ads campaign manager */
.mb-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mb-bar .spacer { flex: 1; }
.mb-search { width: 200px; }
.mb-parent { display: flex; align-items: center; gap: 4px; font-size: 13px; background: var(--surface); border-radius: 6px; padding: 3px 4px 3px 10px; }
.mb-table-wrap { overflow: auto; max-height: calc(100vh - 230px); border-radius: 8px; background: var(--surface); }
.mb-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13px; }
.mb-table th, .mb-table td { white-space: nowrap; padding: 9px 12px; border-bottom: 1px solid var(--grid); }
.mb-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); font-weight: 650; font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none; }
.mb-table thead th.sorted { color: var(--accent); }
.mb-table thead th.dragging { opacity: .4; }
.mb-table thead th.drop-target { box-shadow: inset 3px 0 0 var(--accent); }
.mb-table th.num, .mb-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mb-table .mb-name { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 280px; max-width: 360px; text-align: left; }
.mb-table thead .mb-name { z-index: 3; cursor: default; }
.mb-table td.mb-name { display: flex; align-items: center; gap: 10px; box-shadow: 1px 0 0 var(--grid); }
.mb-name-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mb-name-t a, .mb-name-t span { overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--text); }
.mb-name-t a:hover { color: var(--accent); }
.mb-name-t small { overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.mb-total td { background: var(--surface-2); font-weight: 700; position: sticky; top: 36px; z-index: 1; }
.mb-total td.mb-name { background: var(--surface-2); z-index: 2; }
.mb-more { font-size: 16px; line-height: 1; padding: 2px 8px; }
.mb-edit { cursor: pointer; }
.mb-edit:hover .mb-budget { text-decoration: underline dotted; }
.mb-budget small { color: var(--text-3); font-weight: 400; }
.mb-budget-form { display: inline-flex; gap: 4px; }
.mb-budget-form .input { width: 100px; text-align: right; }
.mb-deliv { color: var(--text-3); }
.mb-deliv.on { color: var(--good-text); }
.mb-switch { position: relative; width: 34px; height: 20px; flex: none; }
.mb-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.mb-switch span { position: absolute; inset: 0; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); transition: background .15s; }
.mb-switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-3); transition: transform .15s, background .15s; }
.mb-switch input:checked + span { background: var(--accent); box-shadow: none; }
.mb-switch input:checked + span::after { transform: translateX(14px); background: #fff; }
.mb-switch input:disabled + span { opacity: .5; }
.mb-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.mb-menu { position: absolute; z-index: 1600; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 4px; width: 170px; }
.mb-menu button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; text-align: left; }
.mb-menu button:hover { background: var(--surface-2); }
.mb-menu button.danger { color: var(--critical-text); }
.mb-menu .ico { width: 15px; height: 15px; }
.mb-foot { margin-top: 10px; }
.mb-empty { text-align: center; padding: 40px 20px; }
.mb-empty h3 { margin: 10px 0 6px; }
.mb-empty p { max-width: 460px; margin: 0 auto 18px; }
.mb-empty-ic { width: 48px; height: 48px; margin: 0 auto; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.mb-cols { max-width: 760px; }
.mb-cols-body { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; max-height: calc(100vh - 200px); overflow-y: auto; }
@media (max-width: 700px) { .mb-cols-body { grid-template-columns: 1fr; } }
.mb-cols-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mb-cols-list li { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; border-radius: 6px; background: var(--surface-2); font-size: 13px; cursor: grab; }
.mb-cols-list li > span:nth-child(2) { flex: 1; }
.mb-cols-list li.dragging { opacity: .4; }
.mb-cols-list li.drop-target { box-shadow: inset 0 3px 0 var(--accent); }
.mb-grip { color: var(--text-3); letter-spacing: -2px; }
.mb-cols-group { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mb-cols-group b { width: 100%; color: var(--text-2); }
.mb-col-add { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 6px; padding: 4px 9px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.mb-col-add:hover { border-color: var(--accent); color: var(--accent); }
.mb-set { max-width: 640px; }
.mb-set .card-b { max-height: calc(100vh - 140px); overflow-y: auto; }
.ms-sec { padding: 14px 0; border-bottom: 1px solid var(--grid); }
.ms-sec:last-child { border-bottom: 0; }
.ms-sec h3 { margin: 0 0 10px; font-size: 14px; }
.ms-sec .bk-status { flex-wrap: wrap; }
.ms-acc { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 13.5px; }
.ms-acc span { display: flex; flex-direction: column; }
.ms-acc input { margin-top: 3px; }
.ms-foot { padding: 12px 0 0; }
.ms-link { margin-top: 16px; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; }
.ms-link p { margin: 4px 0 10px; }
.ms-prof { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.ms-prof-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid var(--grid); margin-bottom: 4px; }
.ms-prof-h > div { display: flex; flex-direction: column; }
.ms-warn { color: var(--critical-text); }
.ms-acc { align-items: center; }
.ms-add { border: 1px dashed var(--border); border-radius: 8px; padding: 12px; margin-top: 6px; }
.ms-add-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ms-add-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .ms-add-opts { grid-template-columns: 1fr; } }
.ms-opt { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; color: var(--text); }
.ms-opt:hover { border-color: var(--accent); }
.ms-opt .ico { color: var(--accent); margin-top: 2px; }
.ms-opt span { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.ms-opt small { color: var(--text-2); font-size: 12px; line-height: 1.4; }

/* ---------- Meta Ads "Em breve" */
.mb-soon { position: relative; border-radius: 8px; overflow: hidden; min-height: 420px; }
.mb-soon-preview { filter: blur(3px); opacity: .55; pointer-events: none; user-select: none; overflow: hidden; background: var(--surface); }
.mb-soon-lock { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(2px); }
.mb-soon-card { max-width: 440px; text-align: center; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); border-radius: 12px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.mb-soon-ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.mb-soon-ic .ico { width: 26px; height: 26px; }
.mb-soon-tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); padding: 3px 10px; border-radius: 999px; }
.mb-soon-card h2 { margin: 12px 0 8px; font-size: 19px; }
.mb-soon-card p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.nav-soon { display: inline-flex; margin-left: 6px; opacity: .6; vertical-align: -2px; }
.nav-soon .ico { width: 13px; height: 13px; }
/* R$ 2 test plan (administrator only) */
.pl-test { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 16px 18px; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface); }
.pl-test > div { flex: 1; min-width: 240px; }
.pl-test b { display: inline-flex; align-items: center; gap: 6px; }
.pl-test p { margin: 6px 0 0; }

/* ---------- plan editor (administrator) */
.mb-soon-preview .mb-switch input:checked + span { background: var(--text-3); }

/* ---------- mobile: the side menu ends right above the bottom bar, so its footer icons are always visible */
@media (max-width: 820px) {
  .sidebar { top: 0; bottom: calc(61px + env(safe-area-inset-bottom)); height: auto; max-height: none; padding-bottom: 8px; }
  .sidebar .foot.foot-icons { flex-shrink: 0; justify-content: space-around; padding: 10px 6px 4px; }
  .sidebar .spacer { min-height: 12px; }
}

/* ---------- current plan and locked features */
.pl-card.current { box-shadow: 0 0 0 2px var(--good); border-top-left-radius: 0; border-top-right-radius: 0; }
.pl-tag.cur { background: var(--good); display: flex; align-items: center; gap: 5px; }
.pl-tag .ico { width: 13px; height: 13px; stroke-width: 3; }
.pl-card.current .pl-btn { border-color: var(--good); color: var(--good-text); }
.pl-alert > span { flex: 1; }
.pl-alert .btn { margin-left: auto; }
.btn.locked { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.btn.locked .ico { width: 14px; height: 14px; }
.lock-tag .ico { width: 13px; height: 13px; color: var(--text-3); vertical-align: -2px; }
.up-modal { max-width: 440px; overflow-y: auto; }
.up-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 18px 0; }
.up-lock { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.up-lock .ico { width: 22px; height: 22px; }
.up-body { padding: 12px 20px 20px; }
.up-body h2 { margin: 0 0 6px; font-size: 19px; }
.up-body > p { margin: 0 0 8px; }
.up-cur { color: var(--text-2); }
.up-plan { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px 2px; margin: 14px 0; }
.up-plan-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.up-plan-h b { font-size: 16px; }
.up-plan .pl-price { font-size: 20px; white-space: nowrap; }
.up-plan .pl-feat { margin: 12px 0; }
.up-go { width: 100%; justify-content: center; padding: 11px; }
.up-all { display: block; text-align: center; margin-top: 12px; color: var(--text-2); }
.up-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.up-inline > .ico { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.up-inline > div { flex: 1; min-width: 200px; }
.up-inline p { margin: 2px 0 0; }

/* ---------- plan editor of the Owlpfy administrator */
.pe-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.pe-stat { background: var(--surface); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.pe-stat span { font-size: 12.5px; color: var(--text-2); }
.pe-stat b { font-size: 22px; letter-spacing: -.01em; }
.pe-top { margin: 24px 0 12px; }
.pe-wrap { background: var(--surface); border-radius: 8px; overflow-x: auto; }
.pe-table { width: 100%; border-collapse: collapse; min-width: 820px; table-layout: fixed; }
.pe-table th, .pe-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.pe-table tbody tr:last-child > * { border-bottom: 0; }
.pe-table thead th { vertical-align: bottom; padding-top: 14px; }
.pe-table th[scope=row] { font-size: 13px; font-weight: 600; width: 170px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.pe-table th[scope=row] span, .pe-sep span { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.pe-table thead th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.pe-col { display: flex; flex-direction: column; gap: 4px; }
.pe-col > b { font-size: 15px; }
.pe-count { font-size: 12px; color: var(--text-2); font-weight: 400; }
.pe-count b { color: var(--text); }
.pe-col .badge { align-self: flex-start; }
.pe-col .badge .ico { width: 12px; height: 12px; }
.pe-table .input { width: 100%; min-width: 0; }
.pe-table textarea.input { resize: vertical; font: inherit; font-size: 12.5px; line-height: 1.4; }
.pe-t { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.pe-sep th { background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); padding: 7px 10px; }
.pe-sep span { display: inline; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.pe-money { display: flex; align-items: center; gap: 6px; }
.pe-money i { font-style: normal; font-size: 12.5px; color: var(--text-3); }
.pe-fixed { font-size: 13px; color: var(--text-2); }
.pe-changed .input { border-color: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.pe-sw, .pe-radio { display: inline-flex; cursor: pointer; }
.pe-sw input, .pe-radio input { position: absolute; opacity: 0; pointer-events: none; }
.pe-sw span { width: 36px; height: 20px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; }
.pe-sw span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pe-sw input:checked + span { background: var(--good); }
.pe-sw input:checked + span::after { transform: translateX(16px); }
.pe-changed .pe-sw span { box-shadow: 0 0 0 2px var(--warning); }
.pe-radio span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); }
.pe-radio input:checked + span { border: 5px solid var(--text); }
.pe-sw input:focus-visible + span, .pe-radio input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.pe-bar { position: sticky; bottom: 12px; z-index: 20; display: none; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px 10px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.pe-bar.show { display: flex; }
.pe-bar-msg { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.pe-bar-msg .ico { color: var(--warning); }
.pe-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 760px) {
  .pe-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .pe-stat { padding: 10px 12px; }
  .pe-stat b { font-size: 16px; }
  .pe-table th[scope=row] { width: 120px; }
  .pe-bar { bottom: calc(70px + env(safe-area-inset-bottom)); }
}
