:root { color-scheme: dark;
  --bg: #09090b; --panel: #131316; --panel2: #1b1b20; --panel3: #24242b; --line: #26262d; --line2: #33333c;
  --text: #ececf1; --muted: #8b8b98; --dim: #5f5f6b;
  --accent: #8b5cf6; --accent-hi: #a78bfa; --accent-bg: rgba(139, 92, 246, .14);
  --ok: #22c55e; --ok-bg: rgba(34, 197, 94, .12);
  --info: #38bdf8; --info-bg: rgba(56, 189, 248, .12);
  --warn: #f5b40b; --warn-bg: rgba(245, 180, 11, .12);
  --bad: #f43f5e; --bad-bg: rgba(244, 63, 94, .12);
  --orange: #fb923c; --orange-bg: rgba(251, 146, 60, .12);
  --mut-bg: rgba(139, 139, 152, .14);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, select, input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
aside { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #6d28d9);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted);
  text-decoration: none; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.nav:hover { color: var(--text); background: var(--panel); }
.nav.on { color: var(--text); background: var(--panel2); font-weight: 600; }
.nav svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .soon { margin-left: auto; font-size: 10px; color: var(--dim); }
.nav .count { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--bad); color: #fff; }
.side-gap { flex: 1; }
.side-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 14px 10px 6px; }

main { padding: 22px 26px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.badge-test { font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border-radius: 5px;
  background: var(--warn-bg); color: var(--warn); text-transform: uppercase; }
.badge-test.ro { background: var(--accent-bg, rgba(139,92,246,.15)); color: var(--accent-hi); text-decoration: none; }
.err { color: var(--bad); }

/* ---------- controls */
.btn { border: 1px solid var(--line2); background: var(--panel2); padding: 7px 13px; border-radius: 9px; cursor: pointer;
  font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: var(--dim); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hi); }
.btn.danger { color: var(--bad); border-color: rgba(244, 63, 94, .35); background: var(--bad-bg); }
.btn.ghost { background: none; border-color: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
input:not([type]), input[type=text], input[type=search], input[type=number], input[type=password], select, textarea {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 9px; padding: 7px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select { padding-right: 26px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel3); color: var(--text); }
.seg button .n { font-size: 10.5px; color: var(--dim); margin-left: 4px; font-weight: 700; }
.seg button.on .n { color: var(--muted); }
.seg button[data-tone=bad] .n { color: var(--bad); }
.seg button[data-tone=warn] .n { color: var(--warn); }
.seg button[data-tone=orange] .n { color: var(--orange); }
.seg-label { color: var(--dim); font-size: 12px; margin-right: 2px; }

/* ---------- stat cards */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; min-width: 0; }
.stat .k { color: var(--muted); font-size: 11.5px; }
.stat .v { font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin-top: 3px; white-space: nowrap; }
.stat .s { color: var(--dim); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delta { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px;
  background: var(--ok-bg); color: var(--ok); margin-left: 6px; vertical-align: 3px; letter-spacing: 0; }
.delta.zero { background: var(--mut-bg); color: var(--dim); }

/* ---------- toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .search { width: 240px; }
.toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.selbar { display: flex; gap: 8px; align-items: center; background: var(--accent-bg); border: 1px solid rgba(139, 92, 246, .35);
  padding: 7px 10px; border-radius: 10px; margin-bottom: 10px; }
.selbar b { margin-right: 6px; }
.selbar .gap { flex: 1; }

/* ---------- table */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-size: 11px; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--panel);
  cursor: pointer; user-select: none; }
th:hover { color: var(--text); }
th.sorted { color: var(--accent-hi); }
th.sorted::after { content: " ↓"; }
th.sorted.asc::after { content: " ↑"; }
th.l, td.l { text-align: left; }
th.nosort { cursor: default; }
tbody tr:hover td { background: rgba(255, 255, 255, .018); }
tbody tr.sel td { background: var(--accent-bg); }
td.cb, th.cb { width: 34px; padding-right: 0; text-align: left; }
input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.cname { max-width: 280px; }
.cname b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.cname span { color: var(--dim); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; }
.cname .acc-link { color: var(--muted); text-decoration: none; }
.cname .acc-link:hover { color: var(--accent-hi); text-decoration: underline; }
.acc-card { text-decoration: none; margin-left: 5px; opacity: .75; }
.acc-card:hover { opacity: 1; }
.limit-acts { display: flex; gap: 4px; margin-top: 4px; }
.btn.tiny { padding: 2px 8px; font-size: 11px; border-radius: 6px; }
.modal.limits { width: min(560px, 100%); }
.modal.limits .list { border: 1px solid var(--line); border-radius: 10px; overflow-y: auto; margin-bottom: 14px; }
.cstatus { min-width: 160px; max-width: 230px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 2px 9px 2px 7px;
  border-radius: 99px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.orange { background: var(--orange-bg); color: var(--orange); }
.pill.muted { background: var(--mut-bg); color: var(--muted); }
.pill.pulse::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.sdetail { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.sdetail.bad { color: #fb7185; }
.sdetail.warn { color: var(--warn); }
.mval { display: block; }
.md { display: block; font-size: 10.5px; color: var(--ok); font-weight: 600; }
.md.zero { color: var(--dim); font-weight: 500; }
.dash { color: var(--dim); }
tr.group td { background: var(--panel2); font-weight: 600; border-bottom: 1px solid var(--line2); }
tr.group td .gsub { color: var(--muted); font-weight: 500; margin-left: 8px; font-size: 11.5px; }
tfoot td { font-weight: 700; border-bottom: 0; background: var(--panel2); }
.empty { padding: 50px; text-align: center; color: var(--muted); }

/* toggle */
.tog { position: relative; width: 34px; height: 20px; border-radius: 99px; background: var(--panel3); border: 0;
  cursor: pointer; transition: background .15s; vertical-align: middle; }
.tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #8b8b98; transition: transform .15s, background .15s; }
.tog.on { background: var(--accent); }
.tog.on::after { transform: translateX(14px); background: #fff; }
.tog:disabled { opacity: .5; cursor: wait; }

/* row menu */
.more { border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 7px; padding: 3px 8px; font-size: 15px; line-height: 1; }
.more:hover { background: var(--panel3); color: var(--text); }
.menu { position: fixed; z-index: 50; background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px;
  padding: 5px; min-width: 190px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px;
  border-radius: 7px; cursor: pointer; }
.menu button:hover { background: var(--panel3); }
.menu .sep { height: 1px; background: var(--line2); margin: 4px 2px; }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 20px; width: min(420px, 100%); }
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast { background: var(--panel3); border: 1px solid var(--line2); padding: 10px 14px; border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4); max-width: 360px; }
.toast.bad { border-color: rgba(244, 63, 94, .5); }

/* ---------- other pages */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.card h2 { font-size: 14px; margin: 0 0 4px; }
.card .hint { color: var(--muted); font-size: 12px; margin: 0 0 14px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field select { width: 100%; }
.field .help { font-size: 11.5px; color: var(--dim); margin-top: 4px; }
textarea { width: 100%; min-height: 150px; resize: vertical; line-height: 1.5; }
.savebar { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.soon-page { max-width: 560px; }
.soon-page ul { color: var(--muted); padding-left: 18px; }
.log td { text-align: left; }
.log td.t { color: var(--muted); width: 1%; }
.who { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--mut-bg); color: var(--muted); }
.who.warm-up { background: var(--info-bg); color: var(--info); }
.who.you { background: var(--accent-bg); color: var(--accent-hi); }
.who.rule { background: var(--orange-bg); color: var(--orange); }
.who.TikTok { background: var(--mut-bg); color: var(--text); }

@media (max-width: 1250px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  aside { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding-bottom: 4px; width: 100%; }
  .side-gap, .side-label { display: none; }
  .nav { width: auto; }
  .nav .soon { display: none; }
  main { padding: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar .search { width: 100%; }
}

/* ================= shared bits for launcher / presets / sparks */
.thumb { display: inline-grid; place-items: end start; border-radius: 6px; flex: none; overflow: hidden; vertical-align: middle; }
.thumb span { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.85); padding: 2px 4px; }
.spark-tag { font-style: normal; color: var(--accent-hi); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--dim); }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 5px; text-transform: lowercase; }
.tag.fresh { background: var(--ok-bg); color: var(--ok); }
.tag.used { background: var(--accent-bg); color: var(--accent-hi); }
.tag.live { background: var(--warn-bg); color: var(--warn); }
.tag.blocked { background: var(--bad-bg); color: var(--bad); }
.tag.archived, .tag.muted { background: var(--mut-bg); color: var(--muted); }
.tag.abo { background: var(--accent-bg); color: var(--accent-hi); text-transform: none; }
.tag.cbo { background: var(--orange-bg); color: var(--orange); text-transform: none; }
.subtabs { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; margin-bottom: 14px; }
.subtabs a { padding: 6px 13px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 12.5px; }
.subtabs a.on { background: var(--text); color: var(--bg); }
.link { color: var(--accent-hi); cursor: pointer; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; }
.link:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
tr.click { cursor: pointer; }
.btn.launch { background: var(--accent); border-color: var(--accent); color: #fff; }

/* three-column wizard: steps | content | summary */
.wizard { display: grid; grid-template-columns: 230px minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.steps-nav { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; position: sticky; top: 16px; }
.steps-nav button { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 9px; cursor: pointer; color: var(--text); }
.steps-nav button:hover { background: var(--panel2); }
.steps-nav button.on { background: var(--panel2); }
.steps-nav .n { width: 20px; height: 20px; border-radius: 50%; background: var(--panel3); color: var(--muted); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 1px; }
.steps-nav button.on .n { background: var(--accent); color: #fff; }
.steps-nav button.done .n { background: var(--ok-bg); color: var(--ok); }
.steps-nav b { display: block; font-weight: 600; }
.steps-nav small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.steps-nav .note { border-top: 1px solid var(--line); margin-top: 8px; padding: 12px 10px 6px; color: var(--muted); font-size: 11.5px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel + .panel { margin-top: 14px; }
.panel-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 15px; margin: 0; }
.panel-head .hint { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }
.wiz-foot { display: flex; justify-content: space-between; margin-top: 14px; }
.summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 16px; }
.summary h3 { margin: 0 0 10px; font-size: 13.5px; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 10px; margin: 0 0 14px; font-size: 12.5px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary .btn { width: 100%; justify-content: center; padding: 10px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.facts .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; }
.facts .v { font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }

/* choice cards (goal, budget type, destination) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.choice { text-align: left; border: 1px solid var(--line2); background: var(--panel2); border-radius: 11px; padding: 12px 14px; cursor: pointer; }
.choice:hover { border-color: var(--dim); }
.choice.on { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 1px var(--accent) inset; }
.choice b { display: block; font-size: 13px; }
.choice span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.choice:disabled { opacity: .4; cursor: not-allowed; }
.sec-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.sec-label:first-child { margin-top: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills button { border: 1px solid var(--line2); background: var(--panel2); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--muted); }
.pills button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.switch { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch .tog { flex: none; margin-top: 1px; }
.switch b { display: block; }
.switch span { color: var(--muted); font-size: 12px; }
.field textarea { min-height: 70px; }
.field .row-flex input { flex: 1; }

/* phone preview */
.phone { width: 100%; aspect-ratio: 9 / 16; max-height: 430px; border-radius: 18px; background: #000; border: 1px solid var(--line2);
  position: relative; overflow: hidden; margin: 0 auto 12px; }
.phone .ph-media { position: absolute; inset: 0; background: linear-gradient(160deg, #3b2a63, #10101a 70%); display: grid; place-items: center; color: rgba(255,255,255,.35); font-size: 28px; }
.phone .ph-side { position: absolute; right: 10px; bottom: 120px; display: flex; flex-direction: column; gap: 14px; align-items: center; font-size: 10px; color: #fff; }
.phone .ph-side i { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.18); display: block; }
.phone .ph-text { position: absolute; left: 12px; right: 52px; bottom: 54px; color: #fff; font-size: 12px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.phone .ph-text b { display: block; margin-bottom: 3px; }
.phone .ph-cta { position: absolute; left: 12px; right: 52px; bottom: 14px; background: #fe2c55; color: #fff; text-align: center; border-radius: 6px; padding: 8px; font-weight: 700; font-size: 12px; }
.phone .ph-badge { position: absolute; left: 12px; top: 12px; font-size: 10px; background: rgba(0,0,0,.5); color: #fff; padding: 2px 7px; border-radius: 4px; }

/* creative tiles */
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { width: 112px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 6px; position: relative; }
.tile .thumb { width: 100% !important; height: 140px !important; border-radius: 7px; }
.tile b { display: block; font-size: 12px; margin-top: 6px; }
.tile .x { position: absolute; top: 9px; right: 9px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.tile .ord { position: absolute; bottom: 30px; right: 10px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.6); color: #fff; border-radius: 4px; padding: 0 5px; }
.tile.add { display: grid; place-items: center; text-align: center; border-style: dashed; cursor: pointer; color: var(--muted); min-height: 175px; font-size: 12px; }
.tile.add:hover { border-color: var(--accent); color: var(--text); }
.tile.add big { display: block; font-size: 22px; }

/* lists inside modals / account picker */
.modal.wide { width: min(860px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide .list { overflow-y: auto; flex: 1; min-height: 120px; border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; }
.modal .head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal .head h3 { margin: 0; }
.modal .head .x { margin-left: auto; }
.modal .foot { display: flex; align-items: center; gap: 10px; }
.modal .foot .grow { color: var(--muted); font-size: 12px; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--panel2); }
.pick-row.on { background: var(--accent-bg); }
.pick-row .info { flex: 1; min-width: 0; }
.pick-row .info b { display: block; }
.pick-row .info span { color: var(--muted); font-size: 11.5px; }
.pick-row.disabled { opacity: .45; cursor: not-allowed; }
.acct-list { border: 1px solid var(--line); border-radius: 10px; max-height: 520px; overflow-y: auto; }
.acct-group { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel2); border-bottom: 1px solid var(--line); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.acct-group .grow { color: var(--muted); font-weight: 500; font-size: 11.5px; text-align: right; }
.acct-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 30px; border-bottom: 1px solid var(--line); cursor: pointer; }
.acct-row:hover { background: rgba(255,255,255,.02); }
.acct-row.on { background: var(--accent-bg); }
.acct-row.disabled { opacity: .45; cursor: not-allowed; }
.acct-row .name { flex: 1; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row .warn { color: var(--orange); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.acct-row .mkts, .acct-row .tag, .acct-row .mono { flex: none; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line2); background: var(--panel2); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.chips button.on { color: var(--text); border-color: var(--accent); background: var(--accent-bg); }
.chips button .n { color: var(--dim); font-size: 10.5px; margin-left: 3px; }

/* review */
.tiles4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tiles4 > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tiles4 .k { color: var(--muted); font-size: 11.5px; }
.tiles4 .v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.tiles4 .s { color: var(--dim); font-size: 11px; }
.warnbox { background: var(--warn-bg); color: var(--warn); border-radius: 9px; padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px; }
.problem { color: #fb7185; font-size: 11.5px; display: block; }
.big-launch { width: 100%; justify-content: center; padding: 13px; font-size: 15px; margin-top: 14px; }
.progress { height: 8px; background: var(--panel3); border-radius: 99px; overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; }
.progress .ok { background: var(--ok); }
.progress .bad { background: var(--bad); }

@media (max-width: 1200px) {
  .wizard { grid-template-columns: 200px minmax(0, 1fr); }
  .wizard > .summary, .wizard > .side { grid-column: 2; position: static; }
}
@media (max-width: 820px) {
  .wizard { grid-template-columns: 1fr; }
  .wizard > * { grid-column: 1 !important; }
  .steps-nav { position: static; }
  .facts, .tiles4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

a.btn { color: inherit; text-decoration: none; }
a.btn.primary { color: #fff; }

/* rules */
.rules-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.rules-grid .side { position: sticky; top: 16px; }
.mode-banner { display: flex; gap: 12px; align-items: center; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; border: 1px solid; }
.mode-banner.off { background: var(--mut-bg); border-color: var(--line2); }
.mode-banner.dry { background: var(--info-bg); border-color: rgba(56,189,248,.35); color: var(--info); }
.mode-banner.live { background: var(--ok-bg); border-color: rgba(34,197,94,.35); color: var(--ok); }
.mode-banner b { color: var(--text); }
.rule-line { display: grid; grid-template-columns: 1fr 130px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rule-line:last-child { border-bottom: 0; }
.rule-line .t b { display: block; font-weight: 600; }
.rule-line .t span { color: var(--muted); font-size: 11.5px; }
.rule-line input { width: 100%; text-align: right; }
.rule-line.on .t b { color: var(--accent-hi); }
.money-in { position: relative; }
.money-in::before { content: attr(data-unit); position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 12px; pointer-events: none; }
.hit { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.hit:last-child { border-bottom: 0; }
.hit b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit span { color: var(--muted); font-size: 11.5px; }
.hit .why { color: #fb7185; }
.hit .why.up { color: var(--ok); }
.hit .why.skip { color: var(--warn); }
.hits { border: 1px solid var(--line); border-radius: 10px; max-height: 330px; overflow-y: auto; }
@media (max-width: 1200px) { .rules-grid { grid-template-columns: 1fr; } .rules-grid .side { position: static; } }

/* appeals */
.pill.purple { background: var(--accent-bg); color: var(--accent-hi); }
.seg button[data-f="appealed"] .n { color: var(--accent-hi); }
.ap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ap-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.reason-row td { vertical-align: middle; }
.rate { display: inline-block; width: 70px; height: 6px; border-radius: 99px; background: var(--panel3); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.rate i { display: block; height: 100%; background: var(--ok); }
@media (max-width: 1100px) { .ap-grid { grid-template-columns: 1fr; } .ap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* forms / pages */
.cover { display: inline-block; width: 90px; height: 6px; border-radius: 99px; background: var(--bad-bg); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.cover i { display: block; height: 100%; background: var(--ok); }
.bc-chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--panel3); color: var(--muted); margin: 1px 3px 1px 0; white-space: nowrap; }
tr.detail td { background: var(--panel2); padding: 12px 16px 14px 44px; white-space: normal; }
.acct-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.acct-cols h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.acct-cols ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 18px; font-size: 12.5px; }
.acct-cols li { padding: 2px 0; break-inside: avoid; }
.acct-cols li span { color: var(--dim); font-size: 11px; }
.caret { color: var(--dim); transition: transform .15s; display: inline-block; }
tr.open .caret { transform: rotate(90deg); }

/* settings */
.settings-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 1px; }
.settings-nav .side-label { padding: 12px 10px 6px; }
.settings-nav .side-label:first-child { padding-top: 0; }
.settings-nav a { padding: 7px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 13px; }
.settings-nav a:hover { color: var(--text); background: var(--panel); }
.settings-nav a.on { color: var(--text); background: var(--panel2); font-weight: 600; }
@media (max-width: 820px) { .settings-grid { grid-template-columns: 1fr; } .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; } }

td.wrap { white-space: normal; min-width: 240px; }
tr.detail td { text-align: left; }
.tag { white-space: nowrap; }

/* form / page previews + versions */
.fm-detail { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.phone.lf { max-height: none; aspect-ratio: auto; min-height: 380px; background: linear-gradient(160deg, #2a2340, #0c0c12); padding: 46px 12px 14px; margin-bottom: 8px; }
.lf-sheet { background: #fff; color: #161823; border-radius: 12px; padding: 14px; font-size: 11.5px; }
.lf-sheet h4 { margin: 0 0 4px; font-size: 14px; color: #161823; }
.lf-sheet p { margin: 0 0 10px; color: #555; }
.lf-logo { width: 34px; height: 34px; border-radius: 50%; background: #fe2c55; color: #fff; display: grid; place-items: center; margin-bottom: 8px; font-size: 14px; }
.lf-sheet label { display: block; font-weight: 600; margin-bottom: 7px; }
.lf-sheet label span { display: block; height: 26px; border: 1px solid #ddd; border-radius: 6px; margin-top: 3px; background: #f7f7f8; }
.lf-privacy { color: #777; font-size: 10px; margin: 8px 0; }
.lf-submit { background: #fe2c55; color: #fff; text-align: center; border-radius: 6px; padding: 8px; font-weight: 700; margin-top: 6px; }
.lf-sheet.ip { padding: 10px; }
.ip-block { background: #eee; border-radius: 6px; height: 54px; display: grid; place-items: center; color: #888; font-size: 10.5px; margin-bottom: 6px; }
.after { display: flex; align-items: center; gap: 8px; justify-content: center; }
.lf-cta { background: var(--panel3); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 10px; font-weight: 700; font-size: 12px; }
.version { border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel); }
.version.on { border-color: var(--accent); }
.version.odd { border-left: 3px solid var(--orange); }
.link-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; }
.link-line .lbl { color: var(--muted); min-width: 130px; }
.link-line .url { color: var(--text); font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-line .redir { color: var(--warn); font-size: 11.5px; }
.link-line .redir a { color: var(--warn); }
.v-accts { margin-top: 8px; }
.url-short { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; margin-right: 6px; }
@media (max-width: 900px) { .fm-detail { grid-template-columns: 1fr; } .fm-preview { max-width: 260px; } }
/* long unbreakable text (spark codes) must wrap instead of pushing buttons out of a modal */
.modal .foot { flex-wrap: wrap; }
.modal .foot .grow { min-width: 0; overflow-wrap: anywhere; }
.modal { overflow-wrap: anywhere; }
.tile img.thumb { width: 100% !important; height: 140px !important; border-radius: 7px; }

/* campaign detail panel */
#rows tr[data-id] { cursor: pointer; }
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; justify-content: flex-end; }
.drawer-panel { width: min(500px, 100%); height: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line2);
  padding: 18px 20px 24px; box-shadow: -20px 0 60px rgba(0,0,0,.4); animation: slidein .16s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: .6; } }
.dr-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.dr-head h2 { margin: 0 0 3px; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-head > div { flex: 1; }
.dr-explain { border-radius: 10px; padding: 11px 13px; font-size: 12.5px; margin-bottom: 14px; background: var(--panel2); border: 1px solid var(--line2); }
.dr-explain.orange { background: var(--orange-bg); border-color: rgba(251,146,60,.35); }
.dr-explain.bad { background: var(--bad-bg); border-color: rgba(244,63,94,.35); }
.dr-explain.ok { background: var(--ok-bg); border-color: rgba(34,197,94,.3); }
.dr-explain.info, .dr-explain.purple { background: var(--info-bg); border-color: rgba(56,189,248,.3); }
.dr-explain.warn { background: var(--warn-bg); border-color: rgba(245,180,11,.3); }
.dr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.dr-stats > div, .dr-grid > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.dr-stats span, .dr-grid span { display: block; color: var(--muted); font-size: 11px; }
.dr-stats b { font-size: 17px; }
.dr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dr-grid > div { background: none; border: 0; padding: 4px 0; }
.chart { width: 100%; height: 110px; display: block; }
.dr-edit { display: flex; gap: 8px; align-items: center; }
.dr-edit .money-in { flex: 1; }
.money-in input { padding-left: 22px; width: 100%; }
.dr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dr-links { display: flex; gap: 14px; margin-top: 14px; font-size: 12.5px; }
.dr-ags { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 6px; }
.dr-ag { display: grid; grid-template-columns: auto 1fr auto 52px auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.dr-ag .info b { display: block; }
.dr-ag .info span { display: block; color: var(--muted); font-size: 11.5px; }
.dr-ag .info span b { display: inline; color: var(--text); }
.dup-n { width: 52px; padding: 5px 6px; text-align: center; }
.dr-ag-set { grid-column: 2 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dr-ag-set .money-in { width: 100px; }
.dr-timeline > div { display: grid; grid-template-columns: 80px 1fr; gap: 8px; padding: 5px 0; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.dr-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; position: sticky; bottom: -24px; background: var(--panel); padding: 12px 0; border-top: 1px solid var(--line); }

/* ---------- settings → connection */
.conn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.conn-grid .field { margin: 0; }
@media (max-width: 900px) { .conn-grid { grid-template-columns: 1fr; } }

/* ---------- jobs */
.jobs-pill { font-weight: 500; color: var(--muted); }
.jobs-pill.running { color: var(--accent-hi); border-color: var(--accent); }
.jobs-pill.failed { color: var(--bad); border-color: var(--bad); }
.jobs-pill .dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.spin { width: 11px; height: 11px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.jbar { display: inline-flex; width: 120px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.jbar i { display: block; height: 100%; }
.jbar i.ok { background: var(--ok); } .jbar i.bad { background: var(--bad); }
tr.clickable { cursor: pointer; }
.jerrs { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.jerrs li { margin: 2px 0; }
#jb-chips b.bad { color: var(--bad); }
.modal { min-width: 0; max-width: 100%; }
.modal.limits .list { overflow-x: auto; }
.modal.limits .row-flex { flex-wrap: wrap; }

.phone.lf.real { padding: 0; overflow: hidden; display: flex; align-items: flex-start; justify-content: center; }
.phone.lf.real img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.phone.lf.real + .after { flex-direction: column; gap: 6px; align-items: flex-start; }

.miss-list li { display: flex; align-items: center; gap: 6px; }
.miss-list li .btn { margin-left: auto; }

.lg-name { cursor: pointer; border-bottom: 1px dashed var(--line2); }
.lg-name:hover { color: var(--accent-hi); }

.why-not { margin-left: auto; font-size: 11px; color: var(--dim); border-bottom: 1px dotted var(--dim); cursor: help; }

/* ---------- display card */
.card-pick { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.card-pick img, .card-empty { width: 214px; height: 120px; object-fit: contain; border-radius: 10px; background: var(--panel2); flex: none; }
.card-empty { display: grid; place-items: center; color: var(--dim); font-size: 12px; border: 1px dashed var(--line2); }
.phone .ph-card { position: absolute; left: 10px; bottom: 74px; width: 46%; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.phone .ph-card-at { position: absolute; left: 10px; bottom: 60px; font-size: 9px; color: rgba(255,255,255,.75); }

/* ---------- spark preview */
#sp-rows img.thumb { cursor: zoom-in; }
.modal.spark-modal { width: min(640px, 100%); }
.spark-big { display: flex; gap: 18px; align-items: flex-start; }
.spark-big img { width: 240px; max-width: 45%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; background: var(--panel2); flex: none; }
.spark-big dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 13px; min-width: 0; }
.spark-big dt { color: var(--muted); }
.spark-big dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .spark-big { flex-direction: column; } .spark-big img { max-width: 100%; width: 100%; } }

/* ---------- country badges on launcher accounts */
.mkts { display: inline-flex; gap: 4px; }
.mkt { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.mkt.ok { background: rgba(34,197,94,.12); color: var(--ok); }
.mkt.no { background: rgba(239,68,68,.14); color: var(--bad); }

/* ---------- country picker */
.cpick { position: relative; }
.cpick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line2); font-size: 12.5px; }
.cchip b { color: var(--muted); font-size: 11px; }
.cchip button { border: 0; background: none; color: var(--dim); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.cchip button:hover { color: var(--bad); }
.cpick-list { position: absolute; z-index: 20; left: 0; right: 0; margin-top: 4px; max-height: 260px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.cpick-list button { display: flex; justify-content: space-between; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; color: inherit; cursor: pointer; font-size: 13px; }
.cpick-list button:hover { background: var(--panel2); }

/* ---------- add-to-accounts picker */
.miss-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.miss-box .btn { margin-left: 6px; }
.miss-bcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ap-list { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.ap-bc { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.ap-acct { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 36px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.ap-acct.off { opacity: .6; cursor: default; }
.ap-acct .why-not { margin-left: 0; }

.ag-st.ok { color: var(--ok); } .ag-st.bad { color: var(--bad); } .ag-st.warn { color: var(--warn); }
.ag-st.purple { color: var(--accent-hi); } .ag-st.muted { color: var(--dim); }

.btn.done { opacity: .7; cursor: default; color: var(--ok); border-color: transparent; background: rgba(34,197,94,.1); }
.btn.done.bad { color: var(--bad); background: rgba(239,68,68,.1); }

.period { padding: 2px 6px; font-size: 12px; height: auto; }
#period-custom input { padding: 2px 6px; font-size: 12px; }

/* signed-in person, bottom of the sidebar */
.me { margin-top: 10px; padding: 8px 10px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.me b { color: var(--text); }
.sec-codes { font-family: ui-monospace, Menlo, monospace; display: grid; grid-template-columns: repeat(5, auto); gap: 6px 16px; background: var(--panel2); border-radius: 8px; padding: 10px 14px; margin: 10px 0; user-select: all; justify-content: start; }
.sec-link { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--panel2); border-radius: 8px; padding: 8px 10px; word-break: break-all; user-select: all; margin: 8px 0; }
