:root {
  --bg: #f8fafc;
  --panel: #fff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --nav: #0f172a;
  --primary: #2563eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); display: grid; grid-template-columns: 252px 1fr; height: 100vh; overflow: hidden; font-size: 13px; transition: grid-template-columns .16s ease; }
body.nav-collapsed { grid-template-columns: 72px 1fr; }
.sidebar { background: var(--nav); color: #e2e8f0; padding: 14px 10px; display: flex; flex-direction: column; gap: 8px; height: 100vh; min-height: 0; overflow: hidden; position: sticky; top: 0; }
.brand { display: grid; grid-template-columns: 32px minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 8px 6px 14px; border-bottom: 1px solid rgba(255,255,255,.1); position: relative; }
.brand span { display: block; color: #94a3b8; font-size: 12px; margin-top: 2px; }
.mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #2563eb, #16a34a); }
.collapse-btn { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; color: #cbd5e1; border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.07); border-radius: 10px; }
.collapse-btn:hover { background: rgba(37,99,235,.34); color: #fff; border-color: rgba(147,197,253,.45); }
.collapse-btn span { width: 11px; height: 11px; display: block; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .16s ease; }
.nav-scroll { min-height: 0; overflow: auto; padding-right: 2px; }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,.35); border-radius: 999px; }
.nav-group { margin-bottom: 6px; }
.nav-section { width: 100%; height: 30px; display: flex; align-items: center; gap: 6px; color: #94a3b8; background: transparent; border: 0; border-radius: 6px; padding: 0 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.nav-section:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.chevron { width: 14px; color: #64748b; transition: transform .16s ease; }
.nav-group:not(.open) .chevron { transform: rotate(-90deg); }
.nav-group:not(.open) .nav-items { display: none; }
.nav-items { display: grid; gap: 4px; }
.nav { width: 100%; min-height: 34px; color: #cbd5e1; background: transparent; border: 0; border-radius: 7px; padding: 0 9px; text-align: left; cursor: pointer; text-decoration: none; font: inherit; display: flex; align-items: center; gap: 10px; }
.nav-icon { width: 22px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 7px; color: #bfdbfe; background: rgba(255,255,255,.055); line-height: 1; }
.nav-icon svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav:hover { background: rgba(37,99,235,.18); color: #fff; }
.nav.active { background: #2563eb; color: #fff; }
.nav:hover .nav-icon { background: rgba(255,255,255,.12); color: #fff; }
.nav.active .nav-icon { background: rgba(255,255,255,.18); color: #fff; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 8px; }
.logout { color: #fecaca; }
.logout .nav-icon { color: #fecaca; }
body.nav-collapsed .brand { grid-template-columns: 32px; justify-content: start; justify-items: center; min-height: 54px; padding: 8px 0 12px 8px; }
body.nav-collapsed .brand-copy, body.nav-collapsed .section-label, body.nav-collapsed .nav-label, body.nav-collapsed .chevron { display: none; }
body.nav-collapsed .collapse-btn { position: absolute; right: 0; top: 8px; width: 20px; height: 32px; border-radius: 7px 0 0 7px; background: rgba(255,255,255,.08); color: #94a3b8; border: 1px solid rgba(255,255,255,.08); border-right: 0; box-shadow: none; }
body.nav-collapsed .collapse-btn:hover { background: rgba(37,99,235,.28); color: #fff; }
body.nav-collapsed .collapse-btn span { transform: rotate(225deg); }
body.nav-collapsed .sidebar { padding-left: 8px; padding-right: 8px; }
body.nav-collapsed .nav-section { display: none; }
body.nav-collapsed .nav-group:not(.open) .nav-items { display: block; }
body.nav-collapsed .nav { justify-content: center; padding: 0; }
body.nav-collapsed .nav-icon { margin: 0; }
main { min-width: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.topbar { height: 74px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
h1 { margin: 0; font-size: 20px; }
p { color: var(--muted); }
#content { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px; }
#content:has(.v2-list-toolbar) { display: flex; flex-direction: column; overflow: hidden; }
#content:has(.v2-list-toolbar) > .tabs,
#content:has(.v2-list-toolbar) > .v2-list-toolbar,
#content:has(.v2-list-toolbar) > #formHost { flex: 0 0 auto; }
#content:has(.v2-list-toolbar) > .table-stack { flex: 1 1 auto; min-height: 0; }
.grid { display: grid; gap: 14px; }
.metrics { grid-template-columns: repeat(5, minmax(130px, 1fr)); }
.two { grid-template-columns: 1fr 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.metric small { color: var(--muted); display: block; }
.metric strong { font-size: 22px; display: block; margin-top: 6px; }
.toolbar { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.list-toolbar { justify-content: flex-start; align-items: flex-start; gap: 8px; }
.v2-list-toolbar { display: grid; grid-template-columns: 1fr; padding: 0 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.toolbar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row { gap: 8px; }
.compact-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 84px; height: 30px; gap: 7px; font-weight: 700; }
.compact-btn span { display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
.compact-btn .action-icon { width: 15px; height: 15px; min-width: 15px; color: currentColor; }
.compact-btn .action-icon svg { width: 15px; height: 15px; display: block; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.v2-list-toolbar .success { background: #b9f77b; color: #064e3b; border-color: #b9f77b; }
.v2-list-toolbar .success:hover { background: #a3ef5f; border-color: #a3ef5f; }
.v2-list-toolbar .primary { background: #1496dc; border-color: #1496dc; color: #fff; }
.v2-list-toolbar .primary:hover { background: #0b82c5; border-color: #0b82c5; }
.v2-list-toolbar .ghost { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.v2-list-toolbar .search-input { width: 160px; }
.v2-list-toolbar select { min-width: 126px; }
.v2-list-toolbar.single-line-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: nowrap; }
.v2-list-toolbar.single-line-toolbar .toolbar-row { flex-wrap: nowrap; min-width: 0; }
.v2-list-toolbar.single-line-toolbar .filter-row { margin-left: auto; justify-content: flex-end; }
.v2-list-toolbar.single-line-toolbar .search-input { width: 160px; min-width: 150px; }
.v2-list-toolbar.single-line-toolbar select { min-width: 124px; }
.v2-list-toolbar.single-line-toolbar .date-range-control { flex: 0 0 auto; }
@media (max-width: 1360px) {
  .v2-list-toolbar.single-line-toolbar { flex-wrap: wrap; }
  .v2-list-toolbar.single-line-toolbar .filter-row { margin-left: 0; }
}
button, input, select, textarea { height: 34px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; padding: 0 10px; font: inherit; }
select.date-filter { min-width: 128px; }
.date-range-control { display: inline-flex; align-items: center; gap: 6px; }
.date-custom-fields { display: none; align-items: center; gap: 6px; }
.date-custom-fields.show { display: inline-flex; }
.date-custom-fields input[type="date"] { width: 136px; padding: 0 8px; }
.date-separator { color: var(--muted); }
input[type="checkbox"] { width: 14px; height: 14px; min-width: 14px; padding: 0; border-radius: 3px; accent-color: var(--primary); vertical-align: middle; }
button { cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; height: 34px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0 10px; text-decoration: none; color: inherit; }
.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.success { background: var(--success); color: #fff; border-color: var(--success); }
.ghost { background: #f1f5f9; }
.danger { color: var(--danger); }
.link-btn { border: 0; background: transparent; color: var(--primary); padding: 0; height: auto; font-weight: 700; }
textarea { width: 100%; height: 92px; padding-top: 8px; }
.table-stack { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.table-wrap { overflow: auto; background: #fff; flex: 1 1 auto; min-height: 0; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
th { background: #f8fafc; color: #334155; position: sticky; top: 0; z-index: 2; }
.table-sort { width: 100%; height: auto; padding: 0; border: 0; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; font: inherit; font-weight: 800; text-align: inherit; }
th:first-child .table-sort, th:nth-child(2) .table-sort { justify-content: flex-start; }
.sort-indicator { color: #94a3b8; font-size: 11px; line-height: 1; }
th.sorted .sort-indicator { color: var(--primary); }
tr:hover { background: #eff6ff; }
.profit-row { background: #dcfce7; }
.loss-row { background: #fee2e2; }
.profit-row:hover { background: #bbf7d0; }
.loss-row:hover { background: #fecaca; }
.empty-cell { text-align: center !important; color: var(--muted); padding: 18px; }
.pager { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-top: 1px solid var(--line); background: #f8fafc; }
.pager-meta { color: var(--muted); font-size: 12px; }
.pager-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager-controls button, .pager-controls select { height: 28px; border-radius: 5px; padding: 0 8px; font-size: 12px; }
.pager-controls button:disabled { opacity: .45; cursor: not-allowed; }
.positive { color: var(--success); font-weight: 800; }
.warning { color: var(--warning); font-weight: 800; }
.tag { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #dbeafe; color: #1e40af; }
.tag-chip { background: color-mix(in srgb, var(--tag-color, #3b82f6) 16%, white); color: #0f172a; border: 1px solid color-mix(in srgb, var(--tag-color, #3b82f6) 42%, white); }
.tag-chip::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--tag-color, #3b82f6); margin-right: 6px; align-self: center; }
.tag-cloud { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag-cloud button { height: 26px; min-height: 26px; padding: 0 8px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.color-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; box-shadow: 0 0 0 1px rgba(15,23,42,.08); }
.shared-tag-picker, .shared-choice-picker { position: relative; margin: 0; }
.shared-tag-picker summary, .shared-choice-picker summary { min-height: 34px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px 34px 8px 10px; font-weight: 400; color: var(--muted); background: #fff; list-style: none; position: relative; }
.shared-tag-picker summary::-webkit-details-marker, .shared-choice-picker summary::-webkit-details-marker { display: none; }
.shared-tag-picker summary::after, .shared-choice-picker summary::after { content: "⌄"; position: absolute; right: 12px; top: 7px; color: var(--muted); }
.shared-tag-picker[open] summary::after, .shared-choice-picker[open] summary::after { content: "⌃"; }
.shared-tag-menu, .shared-choice-menu { position: absolute; z-index: 75; top: calc(100% + 4px); left: 0; right: 0; min-width: 360px; max-height: 360px; overflow: auto; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 20px 60px rgba(15,23,42,.22); padding: 10px; display: grid; gap: 8px; }
.shared-tag-search input { width: 100%; height: 32px; }
.shared-tag-choices { display: grid; gap: 2px; max-height: 190px; overflow: auto; padding-right: 4px; }
.shared-tag-row { min-height: 28px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.shared-tag-row input[type="checkbox"] { width: 14px; height: 14px; min-width: 14px; }
.shared-choice-choices { display: grid; gap: 2px; max-height: 210px; overflow: auto; padding-right: 4px; }
.shared-choice-row { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); background: #fff; border: 0; border-radius: 5px; padding: 4px 6px; text-align: left; }
.shared-choice-row:hover, .shared-choice-row.active { background: #f1f5f9; color: #0087d8; }
.shared-choice-add { display: grid; grid-template-columns: auto minmax(0, 1fr) 44px; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); }
.shared-choice-add input { height: 32px; }
.shared-choice-add button { height: 32px; min-height: 32px; padding: 0 12px; font-size: 18px; }
.shared-tag-create { display: grid; grid-template-columns: 18px minmax(0, 1fr) 60px; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.shared-tag-create input { height: 32px; }
.shared-tag-create button { height: 32px; min-height: 32px; padding: 0 12px; }
.tag-color-preview { width: 16px; height: 16px; border-radius: 2px; display: inline-block; box-shadow: 0 0 0 1px rgba(15,23,42,.12); }
.tag-palette { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-color-swatch { width: 16px; min-width: 16px; height: 16px; min-height: 16px; padding: 0; border: 1px solid rgba(15,23,42,.08); border-radius: 2px; background: var(--swatch); }
.tag-hex-label { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); font-size: 12px; }
.tag-hex-label input { width: 86px; height: 28px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.status-pill { display: inline-flex; align-items: center; min-width: 58px; justify-content: center; padding: 3px 8px; border-radius: 999px; background: #dcfce7; color: #166534; font-weight: 700; }
.status-pill.off { background: #fee2e2; color: #991b1b; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; max-width: 520px; }
.copy-row input { width: 100%; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.form { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; }
.form input, .form select { width: 100%; }
.form input[type="checkbox"] { width: 14px; justify-self: start; }
.actions { display: flex; gap: 8px; margin-top: 14px; }
.actions.compact { margin-top: 0; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.code { background: #f8fafc; border: 1px solid var(--line); border-left: 4px solid var(--primary); padding: 12px; border-radius: 6px; overflow: auto; }
.editor-shell { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-top: 14px; overflow: hidden; }
.editor-head { min-height: 58px; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.editor-head span { color: var(--muted); margin-left: 8px; }
.editor-grid { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr); }
.editor-pane { padding: 18px; border-right: 1px solid var(--line); }
.editor-pane:last-child { border-right: 0; }
h3 { margin: 10px 0 14px; font-size: 13px; text-transform: uppercase; letter-spacing: 0; }
.dense { grid-template-columns: 170px minmax(0, 1fr); }
.inline-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
.checkline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.checkline input[type="checkbox"] { width: 14px; height: 14px; }
details { margin: 16px 0; }
summary { cursor: pointer; font-weight: 700; }
.note-tools { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.note-tools button { width: 36px; padding: 0; }
.notes { min-height: 170px; }
.stack-list { display: grid; gap: 8px; padding: 8px 0; }
.campaign-user-row { min-height: 28px; justify-content: flex-start; }
.split-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.flow-box { border: 1px solid var(--line); background: #f8fafc; }
.flow-row { min-height: 34px; display: grid; grid-template-columns: minmax(0, 1fr) 70px 80px; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.rotation-items .flow-row { grid-template-columns: 110px minmax(0, 1fr) 80px 90px 80px; }
.flow-row input, .flow-row select { height: 28px; }
.flow-head { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.flow-section { padding: 10px 18px; color: var(--success); font-size: 12px; text-transform: uppercase; background: #fff; }
.flow-row.accent { border-left: 4px solid var(--success); background: #fff; }
.toggle { width: 30px; height: 18px; border-radius: 999px; background: #cbd5e1; display: inline-block; position: relative; }
.toggle::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #fff; position: absolute; top: 2px; left: 2px; box-shadow: 0 1px 2px rgba(15,23,42,.2); }
.toggle.on { background: var(--success); }
.toggle.on::after { left: 14px; }
.empty-row { color: var(--muted); padding: 14px; background: #fff; }
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50; display: grid; place-items: start center; padding: 5vh 14px; overflow: auto; }
.dialog { width: min(720px, calc(100vw - 28px)); max-height: 90vh; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 80px rgba(15,23,42,.25); overflow: auto; }
.dialog.narrow-dialog { width: min(620px, calc(100vw - 28px)); }
.dialog.campaign-dialog { width: min(1320px, calc(100vw - 28px)); }
.dialog.campaign-dialog .editor-shell { margin-top: 0; border: 0; border-radius: 0; }
.dialog.campaign-dialog .editor-grid { grid-template-columns: minmax(420px, .92fr) minmax(560px, 1.08fr); gap: 0; }
.dialog.campaign-dialog .editor-pane { padding: 24px 28px; }
.dialog.campaign-dialog .editor-pane:last-child { background: #fbfdff; }
.dialog.campaign-dialog .split-title { margin-bottom: 14px; align-items: center; }
.dialog.campaign-dialog .split-title label { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.dialog.campaign-dialog .split-title select { min-width: 190px; }
.dialog.campaign-dialog .flow-box { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f8fafc; margin-bottom: 14px; padding: 0; }
.dialog.campaign-dialog .path-editor { padding: 0 0 10px; background: #fff; border: 1px solid #dbe4ef; border-radius: 8px; box-shadow: 0 1px 0 rgba(15,23,42,.03); margin: 10px; overflow: hidden; }
.dialog.campaign-dialog .path-editor + .path-editor { margin-top: 18px; }
.dialog.campaign-dialog .path-editor > .flow-row:first-child { background: #f8fafc; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.dialog.campaign-dialog .flow-row.flow-head { border-bottom: 1px solid var(--line); }
.dialog.campaign-dialog .flow-row.flow-head + .path-editor { margin-top: 10px; }
.dialog.campaign-dialog .flow-row { min-height: 42px; grid-template-columns: minmax(0, 1fr) 76px 88px; gap: 12px; padding: 8px 10px; }
.dialog.campaign-dialog .flow-row input,
.dialog.campaign-dialog .flow-row select { height: 32px; }
.dialog.campaign-dialog .flow-row.flow-head { min-height: 34px; margin: 0 10px; background: #f8fafc; grid-template-columns: minmax(0, 1fr) 58px 44px; gap: 0; padding-left: 18px; padding-right: 14px; align-items: center; box-sizing: border-box; }
.dialog.campaign-dialog .flow-row.flow-head span:nth-child(2),
.dialog.campaign-dialog .flow-row.flow-head span:nth-child(3) { font-size: 11px; letter-spacing: 0; }
.dialog.campaign-dialog .flow-row.flow-head span:nth-child(2),
.dialog.campaign-dialog .flow-row.flow-head span:nth-child(3) { justify-self: center; text-align: center; }
.dialog.campaign-dialog .flow-section { padding: 14px 18px 8px; background: transparent; font-weight: 800; }
.dialog.campaign-dialog .path-editor .flow-row.accent { position: relative; min-height: 38px; margin: 0 0 4px; padding: 3px 14px 3px 28px; border-left: 0; border-bottom: 1px solid #edf2f7; border-radius: 0; align-items: center; background: #fff; box-sizing: border-box; grid-template-columns: minmax(0, 1fr) 58px 22px 22px; gap: 0; }
.dialog.campaign-dialog .path-editor .flow-row.accent::before { content: ""; position: absolute; left: 10px; top: 50%; width: 4px; height: 28px; background: var(--success); transform: translateY(-50%); border-radius: 0; }
.dialog.campaign-dialog .path-editor .flow-row.accent:last-of-type { margin-bottom: 6px; }
.dialog.campaign-dialog .path-editor .flow-row.accent > * { align-self: center; }
.dialog.campaign-dialog .path-editor .flow-row.accent input,
.dialog.campaign-dialog .path-editor .flow-row.accent button,
.dialog.campaign-dialog .flow-item-label { height: 32px; min-height: 32px; }
.dialog.campaign-dialog .path-editor .flow-row.accent input,
.dialog.campaign-dialog .path-editor .flow-row.accent button { box-sizing: border-box; line-height: 1; }
.dialog.campaign-dialog .path-editor .flow-row.accent button { display: inline-flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 0; }
.dialog.campaign-dialog .path-editor .flow-row.accent input:not([type="hidden"]) { border-color: transparent; background: transparent; padding-top: 0; padding-bottom: 0; }
.dialog.campaign-dialog .path-editor .flow-row.accent input:not([type="hidden"]):focus { border-color: #93c5fd; background: #fff; }
.dialog.campaign-dialog .path-editor .flow-row.accent button.ghost { border-color: transparent; background: transparent; }
.dialog.campaign-dialog .path-editor .flow-row.accent button.ghost:hover { border-color: #cbd5e1; background: #f8fafc; }
.dialog.campaign-dialog .path-editor .path-main-row { min-height: 34px; grid-template-columns: minmax(0, 1fr) 58px 22px 22px; gap: 0; align-items: center; padding: 4px 14px 4px 18px; }
.dialog.campaign-dialog .path-editor .path-main-row > * { align-self: center; }
.dialog.campaign-dialog .path-editor .path-main-row .path-name,
.dialog.campaign-dialog .path-editor .path-main-row .path-weight { height: 28px; min-height: 28px; border-color: transparent; background: transparent; box-shadow: none; padding: 0 6px; line-height: 28px; }
.dialog.campaign-dialog .path-editor .path-main-row .path-name { font-weight: 700; color: var(--text); }
.dialog.campaign-dialog .path-editor .path-main-row .path-weight,
.dialog.campaign-dialog .path-editor .flow-row.accent .lander-weight,
.dialog.campaign-dialog .path-editor .flow-row.accent .offer-weight { text-align: center; }
.dialog.campaign-dialog .path-editor .path-main-row .path-name:hover,
.dialog.campaign-dialog .path-editor .path-main-row .path-weight:hover { background: #fff; border-color: #d8e2ef; }
.dialog.campaign-dialog .path-editor .path-main-row .path-name:focus,
.dialog.campaign-dialog .path-editor .path-main-row .path-weight:focus { background: #fff; border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(59,130,246,.12); outline: 0; }
.dialog.campaign-dialog .path-editor .flow-row.accent .route-icon-btn,
.dialog.campaign-dialog .path-editor .path-main-row .route-icon-btn { width: 22px; min-width: 22px; height: 26px; min-height: 26px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #94a3b8; cursor: pointer; }
.dialog.campaign-dialog .path-editor .flow-row.accent .route-icon-btn:hover,
.dialog.campaign-dialog .path-editor .path-main-row .route-icon-btn:hover { background: #eef2f7; color: var(--text); }
.dialog.campaign-dialog .path-editor .flow-row.accent .route-icon-btn.danger:hover,
.dialog.campaign-dialog .path-editor .path-main-row .route-icon-btn.danger:hover { background: #fee2e2; color: var(--danger); }
.dialog.campaign-dialog .path-editor .flow-row.accent .route-icon-btn .action-icon,
.dialog.campaign-dialog .path-editor .flow-row.accent .route-icon-btn svg,
.dialog.campaign-dialog .path-editor .path-main-row .route-icon-btn .action-icon,
.dialog.campaign-dialog .path-editor .path-main-row .route-icon-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dialog.campaign-dialog .flow-item-label { display: flex; align-items: center; min-width: 0; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); line-height: 1.2; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog.campaign-dialog .path-editor .flow-row.accent .path-offer-direct,
.dialog.campaign-dialog .path-editor .flow-row.accent .path-lander-direct { min-width: 0; }
.dialog.campaign-dialog .path-editor .actions.compact { gap: 10px; padding: 0 8px 12px; margin: 2px 0 0; border-bottom: 1px solid #dbe4ef; }
.dialog.campaign-dialog .path-editor .actions.compact:last-child { padding-bottom: 0; border-bottom: 0; }
.dialog.campaign-dialog .path-clipboard-actions { align-items: center; gap: 10px; }
.dialog.campaign-dialog .path-clipboard-actions .compact-btn .action-icon { margin-left: 6px; }
.dialog.campaign-dialog .route-preview { gap: 12px 14px; margin-top: 4px; }
.dialog.campaign-dialog .code { margin-top: 12px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dialog-tools { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 0; }
.dialog-actions { display: flex; justify-content: center; gap: 18px; padding: 14px 18px; border-top: 1px solid var(--line); background: #f8fafc; }
.asset-chooser-overlay { z-index: 90; }
.asset-chooser-dialog { width: min(900px, calc(100vw - 28px)); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.asset-chooser-body { min-height: 0; padding: 14px 22px 8px; display: flex; flex-direction: column; gap: 12px; }
.asset-chooser-filters { display: grid; grid-template-columns: minmax(130px, .9fr) minmax(130px, .9fr) minmax(130px, .9fr) minmax(260px, 2fr); gap: 10px; }
.asset-chooser-filters select,
.asset-chooser-filters input { width: 100%; }
.asset-chooser-table { min-height: 360px; max-height: 48vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.asset-chooser-table table { min-width: 760px; }
.asset-chooser-table th:first-child { width: 42px; }
.asset-chooser-table th .table-sort { justify-content: flex-start; }
.asset-chooser-table tr:has(input:checked) { background: #fde68a; }
.asset-chooser-table tr:has(input:checked):hover { background: #fcd34d; }
.icon-btn { width: 34px; min-width: 34px; padding: 0; font-size: 22px; line-height: 1; color: var(--muted); background: transparent; border: 0; border-radius: 6px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: #e2e8f0; color: var(--text); }
.offer-form { padding: 16px 18px 4px; grid-template-columns: 140px minmax(0, 1fr); }
.source-token-buttons button { min-width: 96px; justify-content: center; }
.source-token-buttons button.ghost { background: #fff; }
.source-tag-picker { position: relative; margin: 0; }
.source-tag-picker summary { min-height: 34px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px 34px 8px 10px; font-weight: 400; color: var(--muted); background: #fff; list-style: none; position: relative; }
.source-tag-picker summary::-webkit-details-marker { display: none; }
.source-tag-picker summary::after { content: "⌄"; position: absolute; right: 12px; top: 7px; color: var(--muted); }
.source-tag-picker[open] summary::after { content: "⌃"; }
.source-tag-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 210px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; box-shadow: 0 18px 50px rgba(15,23,42,.18); display: grid; gap: 4px; }
.source-tag-menu label { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 3px 6px; border-radius: 5px; }
.source-tag-menu label:hover { background: #f8fafc; }
.source-tag-menu input { width: 14px !important; height: 14px; }
.source-advanced-options { margin: 0; }
.source-advanced-options summary { color: var(--text); font-weight: 700; }
.source-advanced { display: grid; gap: 10px; align-items: start; }
.source-setting-row { display: grid; grid-template-columns: 180px minmax(0, 120px); gap: 10px; align-items: center; }
.source-setting-row > span { color: var(--text); }
.source-setting-row input[type="checkbox"] { width: 14px; height: 14px; justify-self: start; }
.source-setting-wide { grid-template-columns: 180px minmax(190px, 250px) minmax(0, 1fr); }
.source-setting-wide small { color: var(--muted); line-height: 1.35; }
.source-token-table { margin-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; padding-top: 10px; }
.source-token-head, .source-token-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.source-token-head { color: var(--muted); font-weight: 700; font-size: 12px; }
.source-token-row > span { color: var(--text); }
.source-token-row input:disabled { background: #f8fafc; color: var(--muted); }
.check-list { border: 1px solid var(--line); border-radius: 6px; overflow: auto; background: #fff; }
.check-list.tall { max-height: 420px; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 32px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.check-row:last-child { border-bottom: 0; }
.check-row:hover { background: #f8fafc; }
.check-row input { width: 14px; height: 14px; }
.tutorial-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.tutorial-step { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fafc; min-height: 112px; display: flex; flex-direction: column; gap: 8px; }
.tutorial-step strong { color: var(--ink); font-size: 13px; }
.tutorial-step span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.callout { margin-top: 12px; border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.45; border: 1px solid var(--line); }
.callout.safe { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.callout.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.source-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #1e40af; background: #dbeafe; }
.source-badge.enhanced { color: #065f46; background: #d1fae5; }
.option-note { margin: 10px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.option-note p { margin: 8px 0 4px; color: var(--text); line-height: 1.45; }
.option-note small { color: var(--muted); line-height: 1.45; display: block; }
.ledger-rules { display: grid; gap: 8px; margin-top: 12px; }
.ledger-rules span { border-left: 4px solid var(--primary); background: #f8fafc; padding: 10px 12px; border-radius: 6px; color: var(--muted); }
.restore-checklist { display: grid; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; font-size: 12px; color: var(--muted); }
.restore-checklist label { display: flex; gap: 8px; align-items: center; }
.restore-checklist input { width: 14px; height: 14px; }
.import-dialog-body textarea { min-height: 260px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.token-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.token-row button { height: 28px; font-size: 12px; }
.link-button { border: 0; background: transparent; color: #0087d8; min-height: 24px; padding: 0; justify-content: flex-start; font-size: 12px; }
.link-button:hover { text-decoration: underline; background: transparent; }
.offer-url-tools { margin-top: 10px; border-radius: 10px; background: #f8fafc; padding: 12px 16px; }
.offer-url-primary, .offer-token-list { display: flex; flex-wrap: wrap; gap: 8px; }
.offer-url-primary button, .offer-token-list button { min-height: 30px; height: 30px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: var(--text); padding: 0 10px; font-size: 12px; }
.offer-url-primary button.active, .offer-token-list button.active { border-color: #0087d8; background: #0087d8; color: #fff; }
.offer-token-panel { margin-top: 8px; display: grid; gap: 10px; max-height: 390px; overflow: auto; }
.offer-token-panel-head { display: grid; grid-template-columns: 1fr 160px; gap: 12px; align-items: center; color: var(--muted); font-size: 12px; }
.offer-token-panel .search-wrap { position: relative; margin: 0; }
.offer-token-panel .search-wrap input { width: 100%; padding-right: 34px; }
.offer-token-panel .search-wrap span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #64748b; font-size: 17px; font-weight: 700; line-height: 1; pointer-events: none; }
.offer-token-list { align-content: start; max-height: 310px; overflow: auto; padding-right: 6px; }
.hidden { display: none !important; }
.bars { height: 210px; display: flex; align-items: end; gap: 8px; padding: 18px 10px 34px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(#fff, #f8fafc); overflow: auto; }
.bar { min-width: 32px; background: linear-gradient(180deg, #60a5fa, #2563eb); border-radius: 4px 4px 0 0; position: relative; }
.bar span { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; white-space: nowrap; }
.monitor-card { width: min(820px, 100%); margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 10px 24px rgba(15,23,42,.06); }
.domain-panel { width: min(1060px, 100%); margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 10px 24px rgba(15,23,42,.06); }
.domain-panel > h2 { text-align: center; margin-top: 0; }
.loadbar { display: inline-block; width: 180px; height: 18px; background: #e2e8f0; vertical-align: middle; margin-right: 8px; }
.loadbar i { display: block; height: 100%; background: var(--success); }
.monitor-bars { margin-top: 20px; }
.settings-card { width: min(980px, 100%); margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.settings-card.wide-settings { width: min(1320px, 100%); }
.settings-card > h2 { text-align: center; margin-top: 0; }
.settings-body { padding: 16px 4px 4px; }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
.settings-side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; border-right: 1px solid var(--line); padding-right: 12px; }
.settings-side button { justify-content: flex-start; border: 0; background: transparent; color: var(--text); text-align: left; min-height: 34px; }
.settings-side button.active { color: var(--primary); background: #eff6ff; }
.code-textarea { min-height: 420px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; background: #f8fafc; color: #0f172a; }
.condition-row { display: grid; grid-template-columns: 1.1fr .9fr .9fr minmax(160px, 2fr) 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.tag-manager-row { grid-template-columns: 1.2fr 120px 1fr 90px; }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); padding: 0; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-side { position: static; border-right: 0; border-bottom: 1px solid var(--line); padding-right: 0; padding-bottom: 10px; }
  .condition-row { grid-template-columns: 1fr; }
}
.settings-wide { max-width: 760px; margin: 0 auto; }
.qr { width: 260px; aspect-ratio: 1; display: grid; place-items: center; margin: 28px auto; color: #0f172a; font-weight: 900; text-align: center; background:
  linear-gradient(90deg, #000 10px, transparent 10px) 0 0/24px 24px,
  linear-gradient(#000 10px, transparent 10px) 0 0/24px 24px,
  #fff; border: 14px solid #fff; box-shadow: inset 0 0 0 10px #000; }
.warning-box { margin-top: 18px; border-left: 4px solid var(--warning); background: #fff7ed; padding: 14px; color: #92400e; }
#toast { position: fixed; right: 16px; bottom: 16px; background: #0f172a; color: #fff; border-radius: 8px; padding: 12px 14px; opacity: 0; transform: translateY(80px); transition: .18s; }
#toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1000px) { body { grid-template-columns: 1fr; height: auto; overflow: auto; } .sidebar { position: static; height: auto; } main { height: auto; overflow: visible; } .metrics, .two, .editor-grid, .tutorial-grid { grid-template-columns: 1fr; } .editor-pane { border-right: 0; border-bottom: 1px solid var(--line); } .pager { align-items: flex-start; flex-direction: column; } }
