:root {
  --bg: #08090c;
  --panel: #0f1115;
  --panel-2: #16191f;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --ink: #eef0f4;
  --mute: #8a919e;
  --dim: #5c6370;
  --acc: #7c5cff;
  --acc-2: #b18cff;
  --good: #36d399;
  --bad: #ff6b81;
  --gold: #ffc861;
  --radius: 16px;
  --ui: "Geist", -apple-system, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  color: var(--ink); font: 400 14px/1.45 var(--ui); min-height: 100vh;
  -webkit-font-smoothing: antialiased; letter-spacing: -.006em;
  background:
    radial-gradient(900px 420px at 72% -140px, rgba(124, 92, 255, .16), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Shell */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 20px 12px 14px; border-right: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; padding: 2px 10px 22px; }
.glyph {
  width: 24px; height: 24px; border-radius: 7px; position: relative;
  background: linear-gradient(135deg, var(--acc-2), var(--acc) 60%, #4a2fe0);
  box-shadow: 0 0 22px rgba(124, 92, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.glyph::after { content: ""; position: absolute; inset: 7px; border-radius: 3px; background: var(--bg); transform: rotate(45deg); }
#nav { display: grid; gap: 2px; }
#nav a, .dock a {
  display: flex; align-items: center; gap: 11px; color: var(--mute);
  padding: 8px 10px; border-radius: 9px; font-weight: 500; transition: color .15s, background .15s;
}
#nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
#nav a.on { color: var(--ink); background: rgba(255, 255, 255, .075); box-shadow: inset 0 0 0 1px var(--line); }
#nav a.on svg { color: var(--acc-2); }
svg.ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.rail-foot { margin-top: auto; display: grid; gap: 12px; padding: 0 6px; }
.usage > div:first-child { display: flex; justify-content: space-between; color: var(--mute); font-size: 12px; margin-bottom: 7px; }
.usage b { color: var(--ink); font-weight: 500; }
.track { height: 4px; border-radius: 9px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--acc), var(--acc-2)); transition: width .5s; }
.track i.hot { background: var(--bad); }
.sync {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; color: var(--mute); font-size: 12.5px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; transition: .15s;
}
.sync:hover { color: var(--ink); border-color: var(--line-2); }
.sync i { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.sync.busy i { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

.page { min-width: 0; padding: 22px 32px 64px; max-width: 1320px; width: 100%; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; margin-bottom: 20px; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.top-right { display: flex; align-items: center; gap: 10px; }
.mobile-only { display: none; }
.pill-demo {
  font-size: 12px; font-weight: 500; color: var(--gold); padding: 3px 10px; border-radius: 99px;
  background: rgba(255, 200, 97, .1); box-shadow: inset 0 0 0 1px rgba(255, 200, 97, .22);
}

/* Controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.controls .grow { flex: 1; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { padding: 5px 12px; border-radius: 8px; color: var(--mute); font-weight: 500; font-size: 13px; white-space: nowrap; transition: .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { color: var(--ink); background: var(--panel-2); box-shadow: 0 1px 2px rgba(0, 0, 0, .4), inset 0 0 0 1px var(--line-2); }
select.pick {
  appearance: none; -webkit-appearance: none; max-width: 170px; height: 36px; padding: 0 30px 0 12px; font-size: 13px; font-weight: 500;
  color: var(--ink); border: 0; border-radius: 11px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a919e' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
}

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 90px), var(--panel);
  border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line), 0 12px 32px -20px rgba(0, 0, 0, .8);
}
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { position: relative; padding: 15px 16px 14px; text-align: left; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.kpi:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--line-2), 0 12px 32px -20px rgba(0, 0, 0, .8); }
.kpi.on { box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .55), 0 0 32px -12px rgba(124, 92, 255, .6); }
.kpi .k { display: flex; justify-content: space-between; align-items: center; color: var(--mute); font-size: 13px; font-weight: 500; }
.kpi .v { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.035em; margin: 8px 0 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spark { display: block; width: 100%; height: 34px; }
.delta { display: inline-flex; font-size: 12px; font-weight: 500; padding: 1px 7px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.delta.good { color: var(--good); background: rgba(54, 211, 153, .11); }
.delta.bad { color: var(--bad); background: rgba(255, 107, 129, .11); }

.chart-card { padding: 16px 18px 12px; margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { font-size: 14px; font-weight: 600; }
.card-head .sub, .card-head a { color: var(--mute); font-size: 13px; }
.card-head a:hover { color: var(--acc-2); }
.plot { position: relative; height: 290px; }
.plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.plot text { fill: var(--dim); font: 11px var(--mono); }
.plot .grid { stroke: rgba(255, 255, 255, .06); stroke-dasharray: 3 5; }
.tip {
  position: absolute; top: 8px; pointer-events: none; opacity: 0; transition: opacity .12s; min-width: 120px;
  padding: 8px 11px; border-radius: 10px; background: rgba(24, 27, 34, .92); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 24px rgba(0, 0, 0, .5); font-size: 12px; color: var(--mute);
}
.tip b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; }
.list { padding: 16px 18px 8px; min-width: 0; }

.item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.item > .grow { flex: 1; min-width: 0; }
.nm { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm { display: block; color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.right b { display: block; font-weight: 500; }
.bar { height: 3px; margin-top: 7px; border-radius: 9px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--acc), var(--acc-2)); }

.thumb {
  flex: none; width: 40px; height: 40px; border-radius: 9px; object-fit: cover; display: grid; place-items: center;
  font-weight: 600; color: #fff; background: linear-gradient(135deg, hsl(var(--h, 260) 70% 45%), hsl(calc(var(--h, 260) + 50) 70% 28%));
}

/* Creative gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { overflow: hidden; transition: transform .2s, box-shadow .2s; }
.tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 36px -20px #000; }
.tile.top1 { box-shadow: inset 0 0 0 1px rgba(255, 200, 97, .5), 0 0 34px -14px rgba(255, 200, 97, .6); }
.poster {
  position: relative; display: block; aspect-ratio: 4 / 3; width: 100%; object-fit: cover;
  background: linear-gradient(135deg, hsl(var(--h, 260) 65% 40%), hsl(calc(var(--h, 260) + 60) 70% 16%));
}
.poster-wrap { position: relative; }
.badge {
  position: absolute; top: 9px; left: 9px; min-width: 26px; height: 26px; padding: 0 7px; display: grid; place-items: center;
  border-radius: 8px; font-size: 12px; font-weight: 600; background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px);
}
.top1 .badge { background: var(--gold); color: #241800; }
.live {
  position: absolute; top: 9px; right: 9px; display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px;
  border-radius: 8px; font-size: 11.5px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px);
}
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.live.off i { background: var(--dim); }
.tile-body { padding: 11px 13px 13px; }
.tile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 10px; }
.tile-stats span { color: var(--mute); font-size: 11px; display: block; }
.tile-stats b { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-stats div:first-child b { color: var(--acc-2); }

.input {
  width: 100%; height: 40px; padding: 0 13px; border: 0; border-radius: 11px; outline: 0; background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s;
}
.input:focus { box-shadow: inset 0 0 0 1px var(--acc), 0 0 0 3px rgba(124, 92, 255, .22); }
.input::placeholder { color: var(--dim); }
.controls .input { width: 220px; height: 36px; }

/* Accounts */
table { width: 100%; border-collapse: collapse; }
th { color: var(--mute); font-size: 12px; font-weight: 500; text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
th.n, td.n { text-align: right; }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.state i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.state.off { color: var(--bad); }
.state.off i { background: var(--bad); }

/* Create ads */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; margin-bottom: 12px; }
.steps-col { display: grid; gap: 12px; min-width: 0; }
.block { padding: 16px 18px; min-width: 0; }
.block h2 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.block .card-head h2 { margin: 0; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.block .field:last-child { margin-bottom: 0; }
select.input { appearance: auto; }
.tpl-note { display: grid; gap: 1px; justify-items: start; padding-top: 22px; font-size: 13px; }
.tpl-note b { font-weight: 600; }
.acc-list { display: grid; max-height: 280px; overflow-y: auto; }
.acc { display: flex; align-items: center; gap: 11px; padding: 8px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.acc:first-child { border-top: 0; }
.acc .grow { flex: 1; min-width: 0; }
.acc.off { opacity: .45; cursor: default; }
.acc input { width: 16px; height: 16px; accent-color: var(--acc); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; }
.pick-tile { position: relative; display: block; border-radius: 10px; overflow: hidden; background: var(--panel-2); text-align: left; }
.pick-tile img, .pick-tile > span { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: linear-gradient(135deg, hsl(var(--h, 260) 55% 34%), hsl(calc(var(--h, 260) + 60) 60% 14%)); }
.pick-tile em { display: block; font-style: normal; font-size: 11.5px; padding: 5px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-tile.picked { box-shadow: 0 0 0 2px var(--acc); }
.sum { position: sticky; top: 20px; display: grid; gap: 10px; }
.sum h2 { margin: 0; }
.primary.small { height: 32px; padding: 0 13px; border-radius: 9px; font-size: 13px; }
.history { margin-bottom: 12px; }
.launch-row { align-items: flex-start; flex-wrap: wrap; }
.launch-row .sm.err { color: var(--bad); white-space: normal; margin-top: 4px; }
.launch-actions { display: flex; align-items: center; gap: 9px; }
.muted { font-style: normal; color: var(--dim); font-weight: 400; font-size: 12px; }
.tpl-box { width: min(92vw, 560px); }
.tpl { padding: 4px 16px 16px; }
.tpl .preview-head { padding: 12px 0; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.tpl-grid .full { grid-column: 1 / -1; }
.tpl .field { margin-bottom: 11px; }

/* Manage */
.m-acc { padding: 14px 18px 8px; margin-bottom: 12px; }
.m-camp { border-top: 1px solid var(--line); }
.m-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 96px 90px 72px 72px; gap: 12px; align-items: center; padding: 9px 0; }
.m-row.sub { grid-template-columns: 40px minmax(0, 1fr) 96px 90px 90px 72px 72px; }
.m-name { display: block; min-width: 0; text-align: left; }
.m-sets { padding: 0 0 8px 16px; border-left: 2px solid var(--line-2); margin: 0 0 10px 18px; max-height: 480px; overflow-y: auto; }
.m-all { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 8px 0; color: var(--mute); font-size: 13px; }
.m-cell { display: block; text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; white-space: nowrap; }
.m-cell em { display: block; font-style: normal; color: var(--dim); font-size: 11px; }
.m-cell.edit { width: 100%; padding: 3px 7px; margin-right: -7px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); transition: .15s; }
.m-cell.edit:hover { box-shadow: inset 0 0 0 1px var(--acc); color: var(--acc-2); }
.switch { position: relative; width: 36px; height: 21px; border-radius: 99px; background: rgba(255, 255, 255, .14); transition: background .15s; }
.switch i { position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on { background: var(--good); }
.switch.on i { transform: translateX(15px); }
.switch:disabled { opacity: .5; }
.tag.warn { color: var(--gold); background: rgba(255, 200, 97, .12); margin-top: 0; }
.sm.err { color: var(--bad); }

/* Activity */
.events { padding: 6px 18px 12px; }
.day { font-size: 12px; font-weight: 600; color: var(--mute); padding: 14px 0 6px; }
.event { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.day + .event { border-top: 0; }
.event .grow { flex: 1; min-width: 0; }
.event .nm { white-space: normal; }
.event time { flex: none; color: var(--dim); font: 11.5px var(--mono); padding-top: 2px; }
.who { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.who.app { color: var(--acc-2); background: rgba(124, 92, 255, .16); }
.who.meta { color: #7db4ff; background: rgba(90, 150, 255, .14); }
.who.person { color: var(--gold); background: rgba(255, 200, 97, .13); }
.change { display: block; margin: 3px 0; font: 12px var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.more { display: flex; margin: 12px auto 0; }
.more[hidden] { display: none; }
.logbox { padding: 8px 16px; font-size: 12.5px; max-height: 72vh; overflow-y: auto; }
.logline { display: grid; grid-template-columns: 170px 54px minmax(0, 1fr); gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); color: var(--mute); overflow-wrap: anywhere; }
.logline:first-child { border-top: 0; }
.logline time { color: var(--dim); font: 11.5px var(--mono); }
.logline .lvl { font: 11.5px var(--mono); }
.logline.error { color: var(--bad); }
.logline.warn { color: var(--gold); }

/* Creative filters */
.filters { padding: 14px 16px; margin-bottom: 12px; display: grid; gap: 12px; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.preset { text-align: left; padding: 9px 12px; border-radius: 11px; box-shadow: inset 0 0 0 1px var(--line); transition: .15s; min-width: 0; }
.preset b { display: block; font-weight: 600; }
.preset span { display: block; color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.preset.on { background: rgba(124, 92, 255, .14); box-shadow: inset 0 0 0 1px var(--acc); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.chip-group { display: flex; align-items: center; gap: 5px; }
.chip-group > span { color: var(--mute); font-size: 12.5px; margin-right: 3px; }
.chip { padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 500; color: var(--mute); box-shadow: inset 0 0 0 1px var(--line); transition: .15s; }
.chip:hover { color: var(--ink); }
.chip.on { color: #fff; background: var(--acc); box-shadow: none; }
.adv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.adv[hidden] { display: none; }
.range-box > span { display: block; color: var(--mute); font-size: 12.5px; margin-bottom: 4px; }
.range-box > div { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.range-box .input { height: 34px; padding: 0 10px; font-size: 13px; }
.filter-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.filter-foot .grow { flex: 1; }
.filter-foot [hidden] { display: none; }

/* Date picker */
.date-box { width: min(92vw, 340px); }
.cal { padding: 2px 16px 16px; display: grid; gap: 10px; }
.cal .preview-head { padding: 12px 0 0; }
.seg.wide { display: grid; grid-template-columns: 1fr 1fr; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head button { width: 30px; height: 30px; border-radius: 8px; font-size: 18px; color: var(--mute); }
.cal-head button:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; text-align: center; }
.cal-grid.names span { color: var(--dim); font-size: 11.5px; padding-bottom: 2px; }
.cal-grid button { height: 38px; border-radius: 9px; font-variant-numeric: tabular-nums; }
.cal-grid button:hover:not(:disabled):not(.pick) { background: rgba(255, 255, 255, .07); }
.cal-grid button:disabled { color: var(--dim); opacity: .45; cursor: default; }
.cal-grid button.now { box-shadow: inset 0 0 0 1px var(--line-2); }
.cal-grid button.inside { background: rgba(124, 92, 255, .2); border-radius: 0; }
.cal-grid button.pick { background: var(--acc); color: #fff; font-weight: 600; }
.cal-sum { text-align: center; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login[hidden], .app[hidden], .dock[hidden] { display: none; }
.login-card { width: min(380px, 100%); display: grid; gap: 12px; padding: 28px 24px 22px; }
.login-card .glyph { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 8px; }
.login-card .glyph::after { inset: 11px; border-radius: 4px; }
.login-card h1 { font-size: 22px; }
.login-card p { color: var(--mute); margin-top: -6px; }
.login-card .login-error { color: var(--bad); font-size: 13px; min-height: 18px; margin: 0; }
.logout { padding: 2px 0 4px; }

/* Dashboard tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat { display: flex; align-items: baseline; gap: 9px; padding: 12px 15px; transition: box-shadow .2s; min-width: 0; }
.stat:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.stat b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.stat span { color: var(--mute); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat.hot { box-shadow: inset 0 0 0 1px rgba(255, 107, 129, .4); }
.stat.hot b { color: var(--bad); }

/* Deep performance */
.funnel-card { padding: 16px 18px; margin-bottom: 12px; }
.funnel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.step b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.03em; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.step .bar { margin: 0 0 6px; height: 5px; }
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.group { padding: 15px 18px; min-width: 0; }
.group h2 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.cells div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.cells div:first-child { border-top: 0; }
.cells span { color: var(--mute); }
.cells b { font-weight: 500; font-variant-numeric: tabular-nums; }
.deep-head { margin-bottom: 12px; }
.scroller { overflow-x: auto; max-height: 70vh; overflow-y: auto; }
.scroller table { min-width: 1900px; }
.scroller th { position: sticky; top: 0; z-index: 2; background: var(--panel); white-space: nowrap; }
.scroller th button { color: inherit; font-weight: 500; }
.scroller th button:hover, .scroller th button.on { color: var(--acc-2); }
.scroller td { white-space: nowrap; }
.scroller .first { position: sticky; left: 0; z-index: 1; background: var(--panel); min-width: 230px; max-width: 230px; box-shadow: 1px 0 0 var(--line); }
.scroller th.first { z-index: 3; }

/* Rejected */
.reject-list { display: grid; gap: 10px; }
.reject { display: flex; gap: 14px; padding: 14px; min-width: 0; }
.reject .grow { flex: 1; min-width: 0; }
.reject-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.reason { margin: 8px 0; padding: 9px 11px; border-radius: 9px; background: rgba(255, 107, 129, .07); color: #f3c9d0; font-size: 13px; }
.thumb.big { width: 64px; height: 64px; border-radius: 11px; }
.delta.warn { color: var(--gold); background: rgba(255, 200, 97, .11); flex: none; }
.delta.bad { flex: none; }

/* Library */
.lib { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; align-items: start; }
.folders { position: sticky; top: 20px; padding: 14px 10px 12px; }
.folders .card-head { padding: 0 8px; }
.folders .hint { padding: 0 8px; }
.folder-list { display: grid; gap: 2px; max-height: 62vh; overflow-y: auto; }
.folder { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 9px; color: var(--mute); text-align: left; transition: .15s; }
.folder span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.folder em { font-style: normal; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.folder:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.folder.on { color: var(--ink); background: rgba(124, 92, 255, .15); }
.folder.on svg { color: var(--acc-2); }
.link { color: var(--mute); font-size: 13px; font-weight: 500; }
.link:hover { color: var(--acc-2); }
.link.danger:hover { color: var(--bad); }
.sync.auto { width: auto; height: 40px; padding: 0 14px; }
.lib-main { min-width: 0; border-radius: var(--radius); }
.lib-main.over { outline: 2px dashed var(--acc); outline-offset: 6px; }
.lib-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.lib-tile { position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.lib-tile:hover { transform: translateY(-2px); }
.lib-tile.picked { box-shadow: inset 0 0 0 2px var(--acc), 0 0 28px -10px var(--acc); }
.lib-open { display: block; position: relative; width: 100%; }
.lib-img {
  display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  background: linear-gradient(135deg, hsl(var(--h, 260) 55% 34%), hsl(calc(var(--h, 260) + 60) 60% 14%));
}
.play {
  position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px; border-radius: 50%;
  background: rgba(0, 0, 0, .5); backdrop-filter: blur(6px);
}
.play::after { content: ""; position: absolute; left: 15px; top: 11px; border-left: 12px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.check {
  position: absolute; top: 9px; left: 9px; width: 24px; height: 24px; border-radius: 7px;
  background: rgba(0, 0, 0, .5); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .65);
}
.picked .check { background: var(--acc); box-shadow: none; }
.picked .check::after { content: ""; position: absolute; left: 8px; top: 4px; width: 7px; height: 12px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lib-bar {
  position: fixed; z-index: 25; left: calc(50% + 116px); bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 16px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 44px rgba(0, 0, 0, .65); white-space: nowrap;
}
.lib-bar[hidden], .uploads[hidden] { display: none; }
.lib-bar b { font-weight: 600; }
.uploads {
  position: fixed; z-index: 25; right: 20px; bottom: 20px; width: 300px; display: grid; gap: 6px; padding: 13px 15px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 44px rgba(0, 0, 0, .65);
}
.uploads b { font-weight: 600; }
.uploads .err { color: var(--bad); }
.preview { margin: auto; padding: 0; border: 0; border-radius: var(--radius); background: var(--panel); color: var(--ink); max-width: min(92vw, 720px); overflow: hidden; }
.preview::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(6px); }
.preview-head { display: flex; justify-content: space-between; gap: 16px; padding: 12px 15px; }
.preview video, .preview img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; }

/* Pages */
.page-group { margin-bottom: 22px; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.page-card { display: flex; align-items: center; gap: 13px; padding: 14px; min-width: 0; }
.page-card .grow { flex: 1; min-width: 0; }
.thumb.round { width: 48px; height: 48px; border-radius: 50%; }
.tag { display: inline-block; margin-top: 5px; font-size: 11.5px; color: var(--acc-2); padding: 1px 8px; border-radius: 99px; background: rgba(124, 92, 255, .13); }

/* Connect BM */
.connect { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.connect > .card { padding: 20px; }
.connect h2 { font-size: 16px; font-weight: 600; letter-spacing: -.015em; margin-bottom: 14px; }
.steps { list-style: none; padding: 0; counter-reset: s; }
.steps li { position: relative; counter-increment: s; padding: 0 0 15px 36px; color: var(--mute); }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 23px; height: 23px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--acc-2);
  background: rgba(124, 92, 255, .14); box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .4);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 25px; bottom: 3px; width: 1px; background: var(--line-2); }
.steps b { color: var(--ink); font-weight: 500; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; color: var(--mute); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.primary {
  display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 11px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, #8b6eff, var(--acc)); transition: .15s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px -8px rgba(124, 92, 255, .8);
}
.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.primary:disabled { opacity: .55; cursor: default; transform: none; }
.primary.wide { width: 100%; }
.hint { color: var(--mute); font-size: 12.5px; margin-top: 12px; }
.ghost-del { color: var(--mute); font-size: 13px; padding: 5px 10px; border-radius: 8px; }
.ghost-del:hover { color: var(--bad); background: rgba(255, 107, 129, .1); }
.logs { max-height: 280px; overflow-y: auto; font-size: 12.5px; }
.logs div { display: flex; gap: 14px; padding: 5px 0; color: var(--mute); }
.logs time { color: var(--dim); flex: none; font-family: var(--mono); font-size: 11.5px; }
.logs .err { color: var(--bad); }

.hero-empty { display: grid; place-items: center; text-align: center; padding: 88px 24px; }
.hero-empty .glyph { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 20px; }
.hero-empty .glyph::after { inset: 15px; border-radius: 5px; }
.hero-empty h2 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; margin-bottom: 6px; }
.hero-empty p { color: var(--mute); max-width: 34ch; margin-bottom: 20px; }
.none { color: var(--mute); padding: 22px 0; text-align: center; }

.skeleton { height: 120px; border-radius: var(--radius); background: var(--panel); }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 30; transform: translate(-50%, 14px); opacity: 0; pointer-events: none;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 14px 34px rgba(0, 0, 0, .55);
  padding: 10px 16px; border-radius: 12px; font-weight: 500; font-size: 13px; max-width: calc(100vw - 32px); transition: .22s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.dock { display: none; }

@media (max-width: 1080px) {
  .builder { grid-template-columns: minmax(0, 1fr); }
  .sum { position: static; }
  .groups { grid-template-columns: minmax(0, 1fr); }
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lib { grid-template-columns: minmax(0, 1fr); }
  .folders { position: static; padding: 12px 8px 4px; }
  .folder-list { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
  .folder { width: auto; flex: none; max-width: 200px; }
  .folders .hint { display: none; }
  .lib-bar { left: 50%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .app { display: block; }
  .rail { display: none; }
  .page { padding: 14px 16px 104px; }
  .mobile-only { display: flex; width: auto; }
  h1 { font-size: 20px; }
  .kpi .v { font-size: 23px; }
  .kpi { padding: 13px 13px 12px; }
  .connect { grid-template-columns: minmax(0, 1fr); }
  .plot { height: 220px; }
  .chart-card, .list { padding-left: 14px; padding-right: 14px; }
  .controls .grow { display: none; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  select.pick { flex: 1; max-width: none; min-width: 0; }
  .controls .input { width: 100%; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hide-sm { display: none; }
  .presets { grid-template-columns: minmax(0, 1fr); }
  .adv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logline { grid-template-columns: minmax(0, 1fr) auto; }
  .logline span:last-child { grid-column: 1 / -1; }
  .events { padding: 4px 14px 10px; }
  .m-acc { padding-left: 14px; padding-right: 14px; }
  .m-row { grid-template-columns: 40px minmax(0, 1fr) 84px 62px; gap: 8px; }
  .m-row.sub { grid-template-columns: 40px minmax(0, 1fr) 76px 76px; }
  .m-row.sub .m-cell:not(.edit) { display: none; }
  .m-sets { padding-left: 8px; margin-left: 6px; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tpl-note { padding: 0 0 8px; }
  .launch-actions { width: 100%; justify-content: space-between; }
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lib-bar { bottom: 88px; max-width: calc(100vw - 24px); padding-left: 12px; gap: 6px; }
  .lib-bar .pick { max-width: 130px; }
  .uploads { left: 12px; right: 12px; width: auto; bottom: 88px; }
  th, td { padding: 10px 12px; }
  .dock {
    display: flex; overflow-x: auto; scrollbar-width: none; gap: 0; position: fixed; z-index: 20;
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); padding: 5px; border-radius: 18px;
    background: rgba(20, 22, 28, .86); backdrop-filter: blur(18px); box-shadow: inset 0 0 0 1px var(--line-2), 0 16px 40px rgba(0, 0, 0, .6);
  }
  .dock a { flex: 0 0 68px; flex-direction: column; gap: 3px; padding: 7px 0 6px; font-size: 10px; border-radius: 13px; }
  .dock a.on { color: var(--ink); background: rgba(255, 255, 255, .09); }
  .dock a.on svg { color: var(--acc-2); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
