:root {
  --bg: #0c0e11;
  --panel: #14171c;
  --panel-2: #1a1e25;
  --line: #262b34;
  --text: #e7e9ec;
  --muted: #8b94a1;
  --accent: #b9f24a;
  --accent-ink: #10140a;
  --pos: #55d88a;
  --neg: #ff6f6f;
  --warn: #f2b84a;
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1 { font-size: 30px; line-height: 1.15; margin: 4px 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.eyebrow { color: var(--accent); font-size: 11px; letter-spacing: 0.16em; font-weight: 600; text-transform: uppercase; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 54px;
  background: rgba(12, 14, 17, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -0.01em; font-size: 17px; text-decoration: none; white-space: nowrap; }
.brand b { color: var(--text); font-weight: 700; }
.brand .logo { display: inline-flex; color: var(--accent); }
.login .brand .logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 12px; border-radius: 8px; text-decoration: none;
  color: var(--muted); white-space: nowrap; font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.on { color: var(--text); background: var(--panel-2); }
.who { color: var(--muted); font-size: 13px; white-space: nowrap; }
.page { padding: 26px 20px 60px; max-width: 1680px; margin: 0 auto; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head p { margin: 0; color: var(--muted); }

/* ---------- controls ---------- */
button, .btn {
  font: inherit; color: var(--text); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 8px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover, .btn:hover { border-color: #3a4250; }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { filter: brightness(1.06); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 4px 8px; }
button.ghost:hover { color: var(--text); background: var(--panel-2); }
button.danger:hover { color: var(--neg); border-color: var(--neg); }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
  padding: 7px 10px; border-radius: 8px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
input[type=checkbox] { width: auto; accent-color: var(--accent); }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
label.c { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar select, .toolbar input { width: auto; }
.toolbar .sp { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px;
}
.chip button { padding: 0 6px; border: 0; background: none; color: var(--muted); }

/* ---------- table ---------- */
.tablewrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 1; }
td.l, th.l { text-align: left; }
thead th {
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--panel-2); position: sticky; top: 0; z-index: 2; user-select: none;
}
thead th:first-child { background: var(--panel-2); z-index: 3; }
thead th.s { cursor: pointer; }
thead th.s:hover { color: var(--text); }
tbody tr:hover td { background: #181c22; }
tfoot td { font-weight: 600; background: var(--panel-2); border-bottom: 0; }
tfoot td:first-child { background: var(--panel-2); }
td.pos { color: var(--pos); }
td.neg { color: var(--neg); }
.name { font-weight: 600; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.name a { text-decoration: none; }
.name a:hover { text-decoration: underline; }
.sub { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; margin-top: 2px; white-space: nowrap; }
.sub button { font-size: 12px; padding: 1px 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); display: inline-block; }
.dot.paused { background: var(--warn); }
.dot.archived { background: var(--muted); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.foot { color: var(--muted); font-size: 12px; margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.install { color: #7cc4ff; border-color: #29506f; }
.tag.reg { color: var(--warn); border-color: #6b5220; }
.tag.dep { color: var(--pos); border-color: #24603e; }
.tag.qdep { color: var(--accent); border-color: #55701f; }

/* ---------- cards & forms ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.row > .fix { flex: 0 0 auto; }
.row > .w { flex: 0 0 90px; }
.copy { display: flex; gap: 8px; }
.copy input { font-family: var(--mono); font-size: 12.5px; }
.flow { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: var(--panel-2); }
.flow h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 14px 0 8px; font-weight: 600; }
.flow .items > .row { margin-bottom: 6px; }
/* ---------- campaign editor (two columns) ---------- */
:root { --blue: #3d8bfd; }
.etop { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.etitle { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.etitle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.etitle small { font-size: 15px; font-weight: 400; color: var(--muted); }
.ebtns { display: flex; gap: 8px; flex-wrap: wrap; }
.editor { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; }
.cap { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.q { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 10.5px; align-items: center; justify-content: center; cursor: help; margin-left: 7px; text-transform: none; font-weight: 600; flex: 0 0 auto; }
.opt { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 13px; }
.opt .ol { font-weight: 500; display: flex; align-items: center; }
.opt .oc { min-width: 0; }
.opt .oc .hint { margin-top: 5px; }
.cost { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.money { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; width: 150px; }
.money input { border: 0; background: none; width: 90px; }
.money span { color: var(--muted); padding-right: 10px; font-size: 13px; }
.seg { display: inline-flex; gap: 4px; }
.seg button { padding: 6px 10px; }
.seg button.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
input.link { color: #7fb4ff; }
.urlact { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.urlact a { color: #7fb4ff; text-decoration: none; }
.urlact a:hover { text-decoration: underline; }
details.adv { margin-top: 18px; }
details.adv summary { cursor: pointer; font-weight: 600; margin-bottom: 14px; list-style: none; }
details.adv summary::after { content: ' ▾'; color: var(--muted); }
details.adv:not([open]) summary::after { content: ' ▸'; }
details.adv summary::-webkit-details-marker { display: none; }

button.add, .btn.add { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.new { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
button.add:hover, button.new:hover { filter: brightness(1.07); }
button.ic, a.ic { background: none; border: 0; color: var(--muted); padding: 4px 6px; font-size: 15px; line-height: 1; text-decoration: none; cursor: pointer; }
button.ic:hover, a.ic:hover { color: var(--text); }
button.ic:disabled { opacity: 0.3; }

.sw { position: relative; display: inline-flex; width: 44px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sw span { width: 100%; height: 100%; border-radius: 999px; background: #3a4150; transition: background .15s; position: relative; }
.sw span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #c9ced6; transition: transform .15s; }
.sw input:checked + span { background: var(--accent); }
.sw input:checked + span::after { transform: translateX(20px); background: #2b3513; }
.sw input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.rhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 34px; }
.rhead .cap { margin: 0; }
.rot { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.rot select { width: 220px; }
.panel { background: var(--panel); border-radius: 12px; padding: 6px 0 8px; }
.phead { display: grid; grid-template-columns: 1fr 150px 70px; padding: 12px 18px; font-weight: 600; font-size: 13px; }
.phead .ttl { color: #7fb4ff; text-transform: uppercase; letter-spacing: 0.04em; }
.phead.rules .ttl { color: #ff7b7b; }
.phead span:last-child { text-align: right; }
.path { margin: 0 12px 8px; }
.path.off > .prow, .rule.off > .prow, .irow.off { opacity: 0.55; }
.prow, .irow { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border-radius: 6px; padding: 5px 10px; }
.path > .prow { border-left: 3px solid var(--accent); }
.prow .pname, .irow select { flex: 1; min-width: 0; background: none; border-color: transparent; }
.prow .pname:hover, .irow select:hover { border-color: var(--line); }
.prow .w, .irow .w { width: 70px; flex: 0 0 auto; text-align: right; }
.pct { width: 40px; text-align: right; color: var(--muted); font-size: 12.5px; flex: 0 0 auto; }
.pbody { padding: 4px 0 6px 18px; }
.pbody h4, .rbody h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 14px 0 8px; font-weight: 600; }
.irow { margin-bottom: 5px; border-left: 3px solid #4d8a5a; }
.irow .n { color: var(--muted); width: 14px; font-size: 12.5px; }
.irow .direct { flex: 1; font-weight: 600; letter-spacing: 0.03em; padding: 7px 10px; }
.irow .direct small { color: var(--muted); font-weight: 400; letter-spacing: 0; }
.adds { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.routing > .adds { margin: 12px 0 0; }
.rule { margin: 0 12px 10px; }
.rule > .prow { border-left: 3px solid #ff7b7b; }
.rule .num { width: 22px; height: 22px; border-radius: 50%; background: #ff7b7b; color: #2a0d0d; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 auto; }
.rbody { padding: 2px 0 6px 18px; }
.rbody .path { margin-left: 0; margin-right: 0; }
.crit { display: grid; grid-template-columns: 180px 110px minmax(0, 1fr) 28px; gap: 6px; align-items: center; margin-bottom: 6px; }

@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; gap: 30px; } }
@media (max-width: 720px) {
  .opt { grid-template-columns: 1fr; gap: 5px; }
  .crit { grid-template-columns: 1fr 1fr; }
  .crit input, .crit .muted { grid-column: 1 / -1; }
  .phead { grid-template-columns: 1fr 70px; } .phead span:nth-child(2) { display: none; }
  .prow, .irow { flex-wrap: wrap; }
  .etitle span { max-width: 80vw; }
}
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }

dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog h2 { margin-bottom: 14px; }
dialog .grid { grid-template-columns: 1fr; }
.pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; min-width: 300px; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.rel { position: relative; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: min(360px, 100%); display: grid; gap: 12px; }
.login .brand { font-size: 22px; }
.err { color: var(--neg); font-size: 13px; min-height: 18px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .18s; z-index: 100; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--neg); color: #1a0606; }

@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .who span { display: none; }
  .page { padding: 18px 16px 50px; }
  h1 { font-size: 24px; }
  .name { max-width: 220px; }
  th:first-child, td:first-child { position: static; }
  .sub { flex-wrap: wrap; max-width: 220px; }
  .pop { grid-template-columns: 1fr; min-width: 200px; }
}
.ecol, .routing { min-width: 0; }
@media (max-width: 720px) {
  .rhead { flex-wrap: wrap; }
  .rot select { width: 160px; }
  .path, .rule { margin-left: 6px; margin-right: 6px; }
  .pbody, .rbody { padding-left: 6px; }
  .prow .pname { flex: 1 1 120px; }
  .irow select, .irow .direct { flex: 1 1 100%; order: -1; }
  .irow .n { display: none; }
  .urlact { gap: 10px; }
}

/* ---------- campaigns list, report, context menu ---------- */
.search { width: 230px !important; }
table.stat tbody tr { cursor: default; }
table.stat tbody tr.gain td { background: rgba(120, 190, 90, 0.10); }
table.stat tbody tr.loss td { background: rgba(255, 110, 110, 0.07); }
table.stat tbody tr.gain td:first-child { box-shadow: inset 3px 0 0 #7ccf6a; background: #1b2620; }
table.stat tbody tr.loss td:first-child { box-shadow: inset 3px 0 0 #ff7b7b; background: #241b1d; }
table.stat tbody tr.sel td, table.stat tbody tr.sel td:first-child { background: #2b3a55; }
table.stat tbody tr:hover td { filter: brightness(1.18); }
table.stat th, table.stat td { padding: 7px 12px; }
table.stat th.s { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.cname { display: flex; gap: 10px; align-items: center; }
.cname input { pointer-events: none; }
.noteflag { color: var(--warn); margin-left: 8px; font-weight: 400; cursor: help; }
.tname { display: flex; align-items: center; gap: 4px; }
.tname .name { font-weight: 500; max-width: 460px; }
tr.lv0 .tname .name { font-weight: 600; }
.ic-sp { display: inline-block; width: 27px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; align-items: center; }
.chip-b { padding: 5px 11px; background: var(--panel-2); border-color: transparent; font-weight: 500; }
.chip-b.on { background: var(--blue); color: #fff; }
.pop.one { grid-template-columns: 1fr; min-width: 140px; left: 0; right: auto; padding: 6px; }
.pop.one button { justify-content: flex-start; }
.ctx { position: fixed; z-index: 200; min-width: 210px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); display: grid; }
.ctx button { background: none; border: 0; text-align: left; justify-content: flex-start; padding: 9px 12px; border-radius: 6px; font-weight: 500; }
.ctx button:hover { background: #2b3a55; }
.ctx button.danger { color: var(--neg); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
dialog.wide { width: min(640px, calc(100vw - 32px)); }
@media (max-width: 720px) { .search { width: 100% !important; } }

input.ro { color: var(--muted); background: var(--panel); cursor: default; }

.tokrow { display: grid; grid-template-columns: 78px minmax(0, 1fr) minmax(0, 1fr) 28px; gap: 8px; align-items: center; margin-bottom: 6px; }
.tokrow.head { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
h3.sec { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 16px 0 6px; }
textarea.mono { font-family: var(--mono); font-size: 12.5px; }
dialog.wide { width: min(720px, calc(100vw - 32px)); overflow-y: auto; }
.pop.one { max-height: 60vh; overflow-y: auto; }

/* ---------- table settings and own metrics ---------- */
button.gear { font-size: 17px; padding: 5px 11px; line-height: 1; }
th.dragover { box-shadow: inset 3px 0 0 var(--accent); }
th[draggable=true] { cursor: grab; }
dialog.ts { display: none; }
dialog.ts[open] { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.tslist { overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; min-height: 120px; flex: 1 1 auto; }
.tsrow { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.tsrow:last-child { border-bottom: 0; }
.tsrow.on { background: var(--panel-2); color: var(--text); }
.tsrow .grip { cursor: grab; color: var(--muted); padding: 0 4px; user-select: none; }
.tsrow label.c { margin: 0; gap: 10px; }
.tsrow .sp { flex: 1; }
.fstatus { font-size: 13px; color: var(--muted); min-height: 18px; }
.fstatus.ok { color: var(--pos); }
.fstatus.bad { color: var(--neg); }
.fpad { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.fpad .keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.fpad .keys button { justify-content: center; padding: 7px 0; }
.fpad .keys button:nth-child(1) { grid-column: span 3; }
.fpad .keys button:nth-child(2) { grid-column: span 2; }
.fpad .vars { display: flex; flex-wrap: wrap; gap: 5px; }
.fpad .vars button { padding: 6px 10px; }
.fpad button.op { background: #2a3442; }
@media (max-width: 720px) { .fpad { grid-template-columns: 1fr; } }

/* ---------- side rail ---------- */
.rail { position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; width: 48px; background: #0a0c0f; border-right: 1px solid var(--line); padding: 8px 6px; display: flex; flex-direction: column; gap: 4px; transition: width .15s; overflow: hidden; }
.rail.open { width: 220px; }
.rbtn { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: 8px; border: 0; background: none; color: var(--muted); text-decoration: none; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; width: 100%; justify-content: flex-start; }
.rbtn:hover { color: var(--text); background: var(--panel); border: 0; }
.rbtn.on { color: var(--text); }
.rbtn.cur { color: var(--accent-ink); background: var(--accent); }
.rbtn .ico { display: inline-flex; flex: 0 0 auto; }
.rail .rbtn:first-child { margin-bottom: 6px; }
.topbar, .page { margin-left: 48px; transition: margin-left .15s; }
.page { max-width: none; }
body.rail-open .topbar, body.rail-open .page { margin-left: 220px; }
.login ~ .rail { display: none; }
ul.plan { margin: 0 0 12px; padding-left: 20px; }
ul.plan li { margin-bottom: 6px; }
.lrow { display: grid; grid-template-columns: 220px minmax(0, 1fr) 160px 28px; gap: 8px; align-items: center; margin-bottom: 6px; }
@media (max-width: 720px) {
  .rail.open { width: min(240px, 80vw); box-shadow: 12px 0 30px rgba(0, 0, 0, .5); }
  body.rail-open .topbar, body.rail-open .page { margin-left: 48px; }
  .lrow { grid-template-columns: 1fr 1fr 28px; } .lrow .muted { display: none; }
}

/* ---------- creatives library ---------- */
.crlib { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; align-items: start; }
.crside { position: sticky; top: 70px; display: grid; gap: 6px; }
.crside .big { justify-content: center; padding: 10px; }
.crside h3.sec { margin: 14px 0 2px; }
.crside .seg { display: flex; }
.crside .seg button { flex: 1; justify-content: center; }
.crside .chips { margin: 0; }
.crgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.crgrid > .empty { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.crcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.crmedia { background: #000; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.crmedia img, .crmedia video { width: 100%; height: 100%; object-fit: contain; display: block; }
.crbody { padding: 12px 14px 12px; display: grid; gap: 5px; font-size: 13.5px; }
.crrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-width: 0; }
.crrow > :last-child { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crrow a { color: #7fb4ff; text-decoration: none; }
.crrow a:hover { text-decoration: underline; }
button.code { background: var(--warn); border-color: var(--warn); color: #201400; font-family: var(--mono); font-weight: 700; padding: 3px 9px; font-size: 13px; }
.crtags { display: flex; flex-wrap: wrap; gap: 4px; }
.crstats { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 4px; color: var(--muted); }
.crstats .crrow > :last-child { color: var(--text); font-variant-numeric: tabular-nums; }
.cract { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cract .btn, .cract > button:not(.ic) { padding: 5px 9px; font-size: 13px; }
@media (max-width: 860px) { .crlib { grid-template-columns: 1fr; } .crside { position: static; } }

/* ---------- naming and link generator ---------- */
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ggrid .gcell:first-child { grid-column: span 2; }
.gcell { display: grid; gap: 4px; align-content: start; }
.gcell > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.gcell small { color: var(--muted); font-size: 11.5px; }
.gout { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.gout .glabel { font-weight: 600; }
.gout .gval { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; min-height: 36px; }
.hint.warn { color: var(--warn); margin: 4px 0 8px; }
@media (max-width: 720px) { .gout { grid-template-columns: 1fr; gap: 6px; } .ggrid .gcell:first-child { grid-column: auto; } }

.gsave { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.gwarn { margin-top: 12px; border: 1px solid #6b5220; background: rgba(242, 184, 74, 0.08); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; }
.gwarn b { color: var(--warn); }
.hint.ok { color: var(--pos); }

.gnote { margin-top: 12px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; }
td.wrap { white-space: normal; overflow-wrap: anywhere; max-width: 720px; }
.okc { color: var(--pos); font-weight: 600; } .badc { color: var(--neg); font-weight: 600; }

/* Clever PWA */
.pwat td { vertical-align: middle; }
.pwaname { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); text-decoration: none; }
.pwaname:hover { color: var(--accent); }
.pwaname img, .pwaicon img { border-radius: 24%; background: var(--panel-2); object-fit: cover; }
.noicon { display: inline-flex; width: 32px; height: 32px; border-radius: 24%; background: var(--panel-2); border: 1px dashed var(--line); align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
.noicon.big { width: 56px; height: 56px; font-size: 22px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.linkbtn:hover { color: var(--text); text-decoration: underline; }
.rowact { white-space: nowrap; text-align: right; } .rowact button { margin-left: 6px; padding: 5px 10px; }
.pwaicon { display: flex; align-items: center; gap: 12px; }
.pwashots { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pwashot { position: relative; }
.pwashot img { height: 120px; width: auto; border-radius: 8px; border: 1px solid var(--line); display: block; }
.pwashot button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; border-radius: 50%; line-height: 1; background: rgba(0, 0, 0, 0.7); color: #fff; border: 0; }
.pwalink { display: flex; gap: 8px; } .pwalink input { flex: 1; min-width: 0; }
.pwastats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 6px; }
.pwastats div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; }
.pwastats b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; } .pwastats span { color: var(--muted); font-size: 12.5px; }
.phone { width: 320px; max-width: 100%; height: 640px; border: 8px solid #23272f; border-radius: 36px; overflow: hidden; background: #000; }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.cap a.plain, .cap .add { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.cap a.plain { color: var(--muted); font-size: 12.5px; }
.pwapushes { display: grid; gap: 8px; }
.pwapushes > div { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; display: grid; gap: 2px; }
.pwapushes span { color: var(--muted); } .pwapushes small { color: var(--muted); font-size: 12px; }
input[type=color] { width: 56px; height: 36px; padding: 3px; }

/* Форма оффера */
.oform { position: relative; }
.oform .opt { grid-template-columns: 170px minmax(0, 1fr); align-items: start; }
.oform .opt .ol { justify-content: flex-end; text-align: right; min-height: 36px; }
.onote { position: absolute; top: -52px; right: 0; }
.onote button span, .chipbtn span { margin-left: 6px; color: var(--muted); }
.olinks { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.linkbtn.blue { color: var(--blue); font-weight: 600; }
.ochips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding: 12px; border-radius: 10px; background: var(--panel-2); }
.chipbtn { padding: 5px 10px; border-radius: 8px; background: transparent; }
.opay { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.opay label:not(.c) { display: grid; gap: 3px; width: 92px; } .opay label span { font-size: 11.5px; color: var(--muted); }
.opay .ocur { color: var(--muted); padding-bottom: 9px; } .opay label.c { padding-bottom: 8px; margin: 0 0 0 6px; }
.ocap { display: grid; grid-template-columns: 90px 130px auto minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 8px; }
@media (max-width: 640px) { .oform .opt { grid-template-columns: 1fr; } .oform .opt .ol { justify-content: flex-start; min-height: 0; } .ocap { grid-template-columns: 1fr 1fr; } }

/* Формы «как в Binom»: источник, сеть */
dialog.wide:has(.sform) { width: min(900px, calc(100vw - 32px)); }
.dlgbar { position: sticky; bottom: -22px; background: var(--panel); padding: 12px 0 4px; margin-bottom: -4px; justify-content: center; z-index: 2; }
.tplsel { max-width: 320px; }
.pbchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chipbtn.used { background: var(--blue); border-color: var(--blue); color: #fff; } .chipbtn.used span { color: #fff; }
.advtoggle { background: none; border: 0; padding: 4px 0; margin: 4px 0 12px; font-weight: 600; color: var(--text); cursor: pointer; }
.tokgrid { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 10px; align-items: center; margin-bottom: 8px; }
.tokgrid.head { margin-top: 10px; font-weight: 600; text-align: center; } .tokgrid.head span { display: inline-flex; justify-content: center; align-items: center; }
.tokgrid .tl { text-align: right; font-weight: 500; display: inline-flex; justify-content: flex-end; align-items: center; }
.eye { background: none; border: 0; padding: 4px; color: var(--text); cursor: pointer; display: inline-flex; } .eye.off { color: var(--muted); opacity: 0.6; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); transition: background 0.15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); } .switch input:checked + span::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
input.ro { color: var(--muted); }
/* Домены */
.domt td, .domt th { vertical-align: middle; } .domt .ck { width: 38px; text-align: center; }
.domt tr.def td:first-child { box-shadow: inset 3px 0 0 var(--pos); }
.ibtn { background: none; border: 0; padding: 5px; margin: 0 2px; color: var(--muted); cursor: pointer; display: inline-flex; border-radius: 6px; }
.ibtn:hover { color: var(--text); background: var(--panel-2); } .ibtn.on { color: var(--warn); }
.ssl { display: inline-flex; color: var(--muted); } .ssl.ok { color: var(--pos); } .ssl.warn { color: var(--warn); } .ssl.bad { color: var(--neg); }
.dombottom { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 20px; margin-top: 18px; align-items: start; } .dombottom .ebtns { justify-content: flex-end; }
/* Настройки с разделами */
.setwrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.setnav { display: grid; gap: 4px; position: sticky; top: 16px; border-right: 1px solid var(--line); padding-right: 20px; min-height: 60vh; align-content: start; }
.setnav a { padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.setnav a:hover { background: var(--panel); } .setnav a.on { color: var(--blue); background: var(--panel); }
.setpane { max-width: 980px; } .setpane h1 { margin: 0 0 22px; font-size: 26px; letter-spacing: -0.02em; }
.setblock { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); } .setblock:last-child { border-bottom: 0; }
.setblock h3 { margin: 0 0 12px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.setblock p { margin: 0 0 10px; max-width: 78ch; } .setblock ol { margin: 0 0 12px; padding-left: 20px; max-width: 78ch; } .setblock li { margin-bottom: 4px; }
.setline { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 12px; } .setline .sl { padding-top: 8px; font-weight: 500; }
.setline .sc { display: grid; gap: 8px; justify-items: start; } .setline .sc > input, .setline .sc > textarea, .setline .sc > .pwalink { width: 100%; }
pre.code { margin: 0 0 12px; padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: auto; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 520px; }
.codewrap { position: relative; } .codewrap > button { position: absolute; top: 10px; right: 10px; z-index: 1; }
.apidoc { width: 100%; border-collapse: collapse; } .apidoc td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); vertical-align: top; text-align: left; } .apidoc td:first-child { white-space: nowrap; color: var(--accent); }
/* Список кампаний: шапка и итоги закреплены, страницы */
.tablewrap.fit { max-height: calc(100vh - 250px); min-height: 220px; }
.tablewrap.fit thead th { position: sticky; top: 0; z-index: 3; background: var(--panel); }
.tablewrap.fit tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--panel-2); box-shadow: 0 -1px 0 var(--line); }
.pager { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.pager select { width: auto; padding: 4px 8px; } .pager .pg { padding: 3px 9px; } .pager .gear { margin-right: 6px; }
@media (max-width: 860px) { .setwrap { grid-template-columns: 1fr; gap: 16px; } .setnav { position: static; border-right: 0; padding-right: 0; min-height: 0; display: flex; flex-wrap: wrap; } .setline { grid-template-columns: 1fr; gap: 4px; } .setline .sl { padding-top: 0; } .dombottom { grid-template-columns: 1fr; } .tokgrid { grid-template-columns: 78px 1fr 1fr 1fr 28px; gap: 6px; } }

/* Тренды, монитор, сверка */
.chead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; } .chead h2 { margin: 0; }
.twrap { position: relative; outline: none; border-radius: 8px; } .twrap:focus-visible { box-shadow: 0 0 0 2px var(--blue); }
svg.trend { display: block; width: 100%; height: auto; touch-action: pan-y; }
.trend .grid { stroke: var(--line); stroke-width: 1; } .trend .axis { stroke: var(--muted); stroke-width: 1; }
.trend .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.trend .tline { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .tdot { fill: var(--blue); stroke: var(--panel); stroke-width: 2; } .trend .tmark { fill: var(--blue); stroke: var(--text); stroke-width: 2; }
.trend .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.ttip { position: absolute; transform: translateX(-50%); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; pointer-events: none; display: grid; gap: 1px; white-space: nowrap; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); z-index: 2; }
.ttip[hidden] { display: none; } .ttip b { font-size: 15px; font-variant-numeric: tabular-nums; } .ttip span { color: var(--muted); font-size: 12px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mtile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 3px; align-content: start; }
.mtile .ml { color: var(--muted); font-size: 12.5px; } .mtile b { font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; } .mtile .mn { color: var(--muted); font-size: 12.5px; }
.mtile.warn { border-color: #6b5220; } .mtile.warn .mn { color: var(--warn); } .mtile.bad { border-color: #6b2a2a; } .mtile.bad .mn { color: var(--neg); }
.filebtn { display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; font-weight: 500; }
.filebtn:hover { filter: brightness(1.15); } .filebtn:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.topbar .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; } .topbar .nav::-webkit-scrollbar { display: none; } .topbar .nav a { white-space: nowrap; }
.topbar .who { flex: 0 0 auto; white-space: nowrap; }

/* Верхнее меню: основной ряд и мелкий ряд справа */
.nav2 { display: flex; align-items: center; gap: 2px; } 
.nav2 a { padding: 5px 9px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.nav2 a:hover { color: var(--text); background: var(--panel); } .nav2 a.on { color: var(--accent-ink); background: var(--text); }
.nav2 button { font-size: 13px; padding: 5px 9px; }
.topbar .nav a.on { background: none; box-shadow: inset 0 -2px 0 var(--text); border-radius: 0; }
@media (max-width: 1100px) { .topbar { flex-wrap: wrap; } .topbar .who { order: -1; width: 100%; display: flex; justify-content: flex-end; } }

/* ---------- Тема: сине-серая тёмная, плотная вёрстка ---------- */
:root {
  --bg: #22252e; --panel: #282b35; --panel-2: #30333f; --line: #3b3f4c; --field: #393c4c;
  --text: #dfe2e8; --muted: #9aa2b1; --accent: #b6d98c; --accent-ink: #1a2410; --blue: #3b8ee6;
  --pos: #8fd47a; --neg: #ff7b7b; --warn: #f0c060; --radius: 6px;
}
body { background: var(--bg); font-size: 14px; }
.page { padding: 16px 14px 40px; }
.topbar { background: #1b1d24; border-bottom-color: #15171c; height: 48px; padding: 0 14px; gap: 14px; backdrop-filter: none; }
.rail { background: #1b1d24; }
.nav a { font-size: 15px; padding: 6px 12px; } .nav2 a, .nav2 button { font-size: 14px; }
.head { margin-bottom: 14px; } h1 { font-size: 26px; }

/* поля и кнопки: компактные, почти прямые углы */
input, select, textarea { background: var(--field); border-color: #474b5b; border-radius: 4px; padding: 5px 10px; }
input::placeholder, textarea::placeholder { color: #8c94a4; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline-color: var(--blue); }
input.ro, input[readonly] { background: #2c2f3a; }
button, .btn { background: var(--panel-2); border-color: #474b5b; border-radius: 4px; padding: 5px 14px; font-weight: 500; }
button:hover, .btn:hover { border-color: #5a6072; }
button.primary, button.add, .btn.add { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
button.new { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 500; }
button.outline, .btn.outline { background: transparent; border-color: #7a8091; color: var(--text); }
button.outline:disabled { border-color: #555a69; color: #7d8494; opacity: 1; }
button.cancel { background: #cdd2dc; border-color: #cdd2dc; color: #1b1e25; }
button.add:disabled, button.primary:disabled { background: #6f8459; border-color: #6f8459; color: #2a3520; opacity: 1; }
button.new:disabled { background: #2f5c8c; border-color: #2f5c8c; color: #b9c6d6; opacity: 1; }
button.ghost { border-color: transparent; background: transparent; padding: 3px 8px; }
.bi { display: inline-flex; } .bi svg { display: block; width: 15px; height: 15px; }
.toolbar { gap: 10px; margin-bottom: 10px; }
.toolbar button, .toolbar .btn, .toolbar select, .toolbar input { min-height: 32px; }
.search { width: 190px !important; }

/* таблицы: без рамки-карточки, тонкие разделители, одна строка на запись */
.tablewrap { border: 0; border-radius: 0; background: transparent; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child, thead th:first-child { background: var(--bg); }
thead th { background: var(--bg); text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 500; color: #c2c7d1; border-bottom-color: #4a4f5e; }
table.stat th, table.stat td { padding: 6px 10px; } table.stat th.s { font-size: 13.5px; }
tbody tr:hover td, table.stat tbody tr:hover td, .tablewrap tbody tr:hover td { background: #2b2e39; filter: none; }
table.stat tbody tr.gain td, table.stat tbody tr.loss td { background: transparent; }
table.stat tbody tr td:first-child { box-shadow: inset 2px 0 0 #4b8fe0; background: var(--bg); }
table.stat tbody tr.gain td:first-child { box-shadow: inset 2px 0 0 #7ccf6a; background: var(--bg); }
table.stat tbody tr.loss td:first-child { box-shadow: inset 2px 0 0 #ff7b7b; background: var(--bg); }
table.stat tbody tr.off td:first-child { box-shadow: inset 2px 0 0 #6b7180; }
table.stat tbody tr.off .name { color: var(--muted); }
table.stat tbody tr:hover td:first-child { background: #2b2e39; }
table.stat tbody tr.sel td, table.stat tbody tr.sel td:first-child { background: #2f3f5c; }
tfoot td, tfoot td:first-child { background: #1e2028; font-weight: 500; }
.tablewrap.fit thead th { background: var(--bg); } .tablewrap.fit tfoot td { background: #1e2028; box-shadow: 0 -1px 0 #4a4f5e; }
.tablewrap.fit { max-height: calc(100vh - 190px); }
.cname { display: flex; align-items: center; gap: 12px; }
.name { font-weight: 400; max-width: 560px; }
.stflag { margin-left: 8px; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
input[type=checkbox] { accent-color: var(--blue); width: 15px; height: 15px; }
.foot { margin-top: 8px; }

dialog { background: var(--panel); border-color: var(--line); }
dialog::backdrop { background: rgba(10, 12, 16, 0.6); }
.actions.dlgbar { background: var(--panel); }
.actions.dlgbar button { min-width: 150px; justify-content: center; padding: 8px 16px; }
.card, .mtile, .pwastats div { background: var(--panel); }
.seg button.on { background: var(--blue); border-color: var(--blue); }
.nav2 a.on { background: #f1f3f6; color: #1b1e25; }
pre.code, .ttip { background: #1b1d24; }
.pager select { min-height: 0; padding: 3px 8px; }

/* Капы и финансы */
.navbadge { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #201400; font-size: 11.5px; font-weight: 700; text-align: center; line-height: 18px; }
.navbadge[hidden] { display: none; }
.boardt td, .payt td { vertical-align: top; } .boardt .name { font-weight: 600; }
.terms { margin-top: 4px; color: var(--muted); font-size: 12.5px; white-space: pre-line; max-width: 420px; overflow-wrap: anywhere; }
.capcell { min-width: 190px; } .capcell b { font-size: 15px; }
.meter { height: 6px; border-radius: 3px; background: var(--field); margin-top: 5px; overflow: hidden; } .meter span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.meter.near span { background: var(--warn); } .meter.full span { background: var(--neg); }
.tag.full { margin-left: 6px; color: var(--neg); border-color: #6b2a2a; } .tag.bad { color: var(--neg); border-color: #6b2a2a; }
.teamlist { display: grid; gap: 8px; } .teamlist .tn { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 1px; }
.teamcaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0; } .teamcaps label { display: grid; gap: 3px; } .teamcaps span { font-size: 12.5px; color: var(--muted); }
.hint.warn { color: var(--warn); }
.paysum .sumgrid { display: grid; grid-template-columns: 220px repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.sumcol .cap { margin-bottom: 6px; } .sumrow { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.payt tr.wait td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
.paytitle { max-width: 380px; white-space: normal; } .wrapsub { white-space: normal; overflow-wrap: anywhere; display: block; max-width: 380px; }
.payt .rowact button { margin-left: 6px; }
.payinfo { display: grid; gap: 8px; background: var(--panel-2); border-radius: 6px; padding: 12px 14px; } .payinfo div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; } .payinfo span { color: var(--muted); } .payinfo b { overflow-wrap: anywhere; font-weight: 600; }
.techline { color: var(--muted); text-decoration: none; margin-left: auto; } .techline b { color: var(--text); } .techline:hover { color: var(--text); }
@media (max-width: 900px) { .paysum .sumgrid { grid-template-columns: 1fr; } }

.rail .rbtn { position: relative; } .rail .rbtn .navbadge { margin-left: auto; }
.rail .rbtn .dotbadge { position: absolute; top: 2px; right: 0; margin: 0; min-width: 16px; line-height: 16px; font-size: 10.5px; padding: 0 4px; }

.negv { color: var(--neg); }

/* уведомления */
.topbar .who { display: flex; align-items: center; gap: 4px; }
.bell { position: relative; padding: 6px 8px; }
.bellbadge { position: absolute; top: 0; right: 0; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--neg); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; }
.bellbadge[hidden] { display: none; }
.nlist { display: flex; flex-direction: column; max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.nrow { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.nrow:last-child { border-bottom: 0; }
.nrow.unread { box-shadow: inset 3px 0 0 var(--warn); }
.nrow .nt { display: flex; justify-content: space-between; gap: 12px; }
.nrow .nb { color: var(--muted); font-size: 13px; margin-top: 3px; }
.tag.near { border-color: var(--warn); color: var(--warn); }

/* симуляция «что если» */
.simbar { margin: 0 0 10px; padding: 8px 12px; border: 1px dashed var(--warn); border-radius: 8px; color: var(--warn); font-size: 13px; }
.simbar b { margin-right: 2px; }
td.simv { color: var(--warn) !important; background: rgba(242, 184, 74, 0.10); box-shadow: inset 0 -2px 0 var(--warn); }
.siminp { width: 72px; padding: 2px 6px; text-align: right; font: inherit; }
td.simable { cursor: context-menu; }

/* таблица кампаний до низа окна, «Итого» прижато к нижнему краю */
.tablewrap.fit.fill { max-height: none; }
.tablewrap.fill tr.filler td { height: 0; padding: 0; line-height: 0; border: 0; background: transparent !important; box-shadow: none !important; }
.tablewrap.fill tr.filler:hover td { background: transparent !important; }
.page:has(.tablewrap.fill) { padding-bottom: 12px; }

/* номер кампании перед названием */
.cname .cid { flex: 0 0 38px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
th .cname .cid { cursor: pointer; }
.cname .cbox { flex: 0 0 13px; }

/* ширина колонок */
table.stat thead th { position: relative; }
table.stat th, table.stat td { overflow: hidden; text-overflow: ellipsis; }
.colgrip { position: absolute; top: 0; right: 0; bottom: 0; width: 7px; cursor: col-resize; }
.colgrip:hover, body.colresizing .colgrip:hover { background: var(--accent); opacity: .6; }
body.colresizing { cursor: col-resize; user-select: none; }
