:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f9;
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #94a3b8;
  --border: #e2e8f0;
  --sidebar: #0d1a2a;
  --sidebar-2: #12233a;
  --primary: #1677ff;
  --primary-2: #0b63e5;
  --primary-soft: #e8f2ff;
  --green: #16a34a;
  --green-soft: #e9f9ef;
  --red: #ef4444;
  --red-soft: #fff0f0;
  --orange: #f59e0b;
  --purple: #7c3aed;
  --cyan: #06b6d4;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 55px rgba(15, 23, 42, 0.15);
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-w: 220px;
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --transition: 180ms cubic-bezier(.2,.8,.2,1);
}

[data-theme="dark"] {
  --bg: #09111f;
  --surface: #101a2b;
  --surface-2: #0d1726;
  --surface-3: #172238;
  --text: #f6f8fb;
  --muted: #9aa8ba;
  --muted-2: #708197;
  --border: #223149;
  --sidebar: #07101d;
  --sidebar-2: #0d1a2c;
  --primary-soft: rgba(22, 119, 255, .16);
  --green-soft: rgba(22, 163, 74, .14);
  --red-soft: rgba(239, 68, 68, .13);
  --shadow: 0 8px 28px rgba(0,0,0,.16);
  --shadow-lg: 0 18px 55px rgba(0,0,0,.28);
}

[data-accent="purple"] { --accent: #7c3aed; --accent-soft: rgba(124,58,237,.12); }
[data-accent="cyan"] { --accent: #0891b2; --accent-soft: rgba(8,145,178,.12); }
[data-accent="orange"] { --accent: #ea580c; --accent-soft: rgba(234,88,12,.12); }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* Login */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(440px, .95fr); background: var(--bg); }
.auth-brand { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 64px; background: linear-gradient(145deg, #09182c, #102d56 65%, #0d4f9f); color: white; }
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); }
.auth-brand::before { width: 420px; height: 420px; background: rgba(34, 134, 255, .22); top: -150px; right: -90px; }
.auth-brand::after { width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.14); bottom: -90px; left: -100px; }
.auth-copy { position: relative; z-index: 1; max-width: 560px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand-bolt { width: 34px; height: 34px; display: grid; place-items: center; color: #42a5ff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; }
.auth-copy h1 { margin: 42px 0 14px; font-size: clamp(38px, 5vw, 66px); line-height: .98; letter-spacing: -.055em; max-width: 600px; }
.auth-copy p { color: #c8d8ee; line-height: 1.7; max-width: 500px; font-size: 16px; }
.auth-feature { margin-top: 34px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.auth-feature div { padding: 14px 16px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.05); border-radius: 12px; color: #e7f0fb; font-size: 13px; }
.auth-pane { display: flex; align-items: center; justify-content: center; padding: 44px; }
.login-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 22px; padding: 34px; animation: cardIn 360ms ease-out both; }
.login-card h2 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.035em; }
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.demo-note { margin-top: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 12px 14px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: linear-gradient(180deg, var(--sidebar), #0a1524); color: #d8e2ef; padding: 18px 12px; display: flex; flex-direction: column; z-index: 40; border-right: 1px solid rgba(255,255,255,.03); }
.sidebar .brand-lockup { padding: 4px 10px 18px; font-size: 18px; color: white; }
.sidebar .brand-bolt { width: 28px; height: 28px; border-radius: 8px; }
.nav { display: grid; gap: 4px; margin-top: 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border-radius: 8px; color: #9eb0c5; font-size: 13px; font-weight: 600; transition: var(--transition); }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); transform: translateX(2px); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(22,119,255,.28), rgba(22,119,255,.14)); box-shadow: inset 0 0 0 1px rgba(74,150,255,.11); }
.nav-item .ico { width: 18px; height: 18px; display: inline-flex; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; color: #dbe7f5; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #f4f7fb; color: #12233a; font-weight: 800; font-size: 12px; }
.sidebar-footer .name { font-size: 12px; font-weight: 700; }
.sidebar-footer .email { font-size: 10px; color: #71859f; margin-top: 2px; }
.sidebar-footer .signout { margin-left: auto; border: 0; background: transparent; color: #8395aa; padding: 6px; border-radius: 7px; }
.sidebar-footer .signout:hover { background: rgba(255,255,255,.06); color: white; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar { display: none; }
.content { max-width: 1440px; margin: 0 auto; padding: 22px 26px 44px; animation: pageIn 220ms ease-out both; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-title h1 { margin: 0; font-size: 27px; letter-spacing: -.04em; line-height: 1.2; }
.page-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* UI basics */
.btn { min-height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 13px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: var(--transition); box-shadow: 0 1px 1px rgba(15,23,42,.02); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(15,23,42,.07); }
.btn:active { transform: translateY(0) scale(.985); }
.btn-primary { background: var(--accent); color: white; border-color: transparent; }
.btn-danger { background: var(--red); color: white; border-color: transparent; }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: var(--transition); }
.icon-btn:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); transform: translateY(-1px); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.card-title { font-size: 13px; font-weight: 800; letter-spacing: -.015em; }
.card-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { min-height: 100px; padding: 16px; position: relative; overflow: hidden; transition: var(--transition); }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15,23,42,.08); }
.kpi-label { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.kpi-value { font-size: 25px; line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.kpi-delta { margin-top: 8px; font-size: 10px; font-weight: 700; color: var(--green); }
.kpi-icon { position: absolute; right: 15px; top: 38px; color: var(--accent); width: 25px; height: 25px; opacity: .95; }

.grid-dashboard { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(280px,.82fr); gap: 12px; margin-bottom: 12px; }
.grid-triple { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.chart-card { min-height: 320px; }
.chart-wrap { position: relative; height: 235px; }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-label { fill: var(--muted-2); font-size: 10px; }
.chart-line-total { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-unique { fill: none; stroke: #22c55e; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.legend { display: flex; align-items: center; gap: 12px; font-size: 10px; color: var(--muted); }
.legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 4px; }

.rank-list { display: grid; gap: 13px; }
.rank-row { display: grid; grid-template-columns: minmax(95px,1fr) minmax(90px,.9fr) 62px; gap: 10px; align-items: center; font-size: 11px; }
.rank-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rank-bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transform-origin: left; animation: growBar 550ms ease-out both; }
.rank-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; border-radius: 999px; padding: 0 8px; font-size: 10px; font-weight: 700; }
.pill-success { color: var(--green); background: var(--green-soft); }
.pill-danger { color: var(--red); background: var(--red-soft); }
.pill-muted { color: var(--muted); background: var(--surface-3); }
.pill-blue { color: var(--accent); background: var(--accent-soft); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Tables */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { flex: 1 1 260px; position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input { padding-left: 34px; }
.input, .select, .textarea { width: 100%; min-height: 38px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 0 11px; outline: none; transition: var(--transition); font-size: 12px; }
.textarea { min-height: 86px; padding: 10px 11px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 0 3px var(--accent-soft); }
.field label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.field .hint { color: var(--muted); font-size: 10px; margin-top: 5px; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-span-2 { grid-column: span 2; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { padding: 10px 12px; background: var(--surface-2); color: var(--muted); font-size: 10px; text-align: left; border-bottom: 1px solid var(--border); font-weight: 700; }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 11px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 38%, transparent); }
.link-primary { color: var(--accent); font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.actions { display: flex; gap: 5px; align-items: center; }
.actions .icon-btn { width: 29px; height: 29px; border: 0; background: var(--surface-2); }
.actions .danger { color: var(--red); }
.empty { padding: 42px 24px; text-align: center; color: var(--muted); }

/* Forms / panels */
.stack { display: grid; gap: 12px; }
.section-card { padding: 17px; }
.section-title { font-size: 13px; font-weight: 800; margin-bottom: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.switch-copy b { display: block; font-size: 12px; }
.switch-copy span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.switch { width: 38px; height: 22px; border-radius: 999px; border: 0; background: #cbd5e1; position: relative; transition: var(--transition); flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%; background: white; left: 2.5px; top: 2.5px; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: var(--transition); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 -17px 16px; padding: 0 17px; overflow-x: auto; }
.tab { position: relative; min-height: 40px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.tab.active { color: var(--accent); }
.tab.active::after { content: ""; position: absolute; height: 2px; left: 9px; right: 9px; bottom: -1px; background: var(--accent); border-radius: 99px; }
.link-hero { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.link-hero-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.link-hero-url { color: var(--accent); font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Rule builder */
.rules-list { display: grid; gap: 8px; }
.rule-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 12px; transition: var(--transition); }
.rule-card:hover { border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); }
.rule-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rule-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 11px; }
.logic-chip { padding: 4px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.dest-chip { padding: 4px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-editor { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); display: grid; gap: 8px; }
.condition-row { display: grid; grid-template-columns: 1fr 1fr 1.3fr auto; gap: 7px; align-items: center; }
.rule-warning { display: flex; gap: 8px; align-items: flex-start; padding: 10px 11px; border: 1px solid #f3cf7a; background: #fff9e9; color: #8b5a00; border-radius: 8px; font-size: 10px; line-height: 1.45; }
[data-theme="dark"] .rule-warning { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.32); color: #fbbf24; }

/* Prelander customizer */
.customizer-grid { display: grid; grid-template-columns: minmax(340px,.78fr) minmax(480px,1.22fr); gap: 12px; }
.preview-stage { min-height: 560px; padding: 22px; display: flex; flex-direction: column; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.preview-devices { flex: 1; display: grid; grid-template-columns: 220px 1fr; align-items: center; justify-content: center; gap: 26px; }
.phone-frame { width: 210px; height: 420px; border: 7px solid #101217; border-radius: 32px; background: #101217; padding: 6px; box-shadow: 0 18px 38px rgba(15,23,42,.16); margin: auto; }
.phone-screen { width: 100%; height: 100%; border-radius: 20px; overflow: hidden; }
.desktop-frame { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.browser-chrome { height: 35px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.browser-dots { display: flex; gap: 4px; }
.browser-dots i { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; }
.browser-url { flex: 1; height: 20px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 8px; display: flex; align-items: center; padding: 0 8px; overflow: hidden; }
.desktop-screen { height: 350px; }
.preland-preview { --pl-bg:#ffffff; --pl-text:#101828; --pl-accent:#1677ff; width: 100%; height: 100%; background: var(--pl-bg); color: var(--pl-text); display: flex; align-items: center; justify-content: center; text-align: center; padding: 26px; transition: 220ms ease; }
.preland-inner { width: min(320px,100%); }
.pl-logo { width: 54px; height: 54px; object-fit: contain; border-radius: 12px; margin: 0 auto 18px; display: block; }
.pl-bolt { width: 48px; height: 48px; margin: 0 auto 18px; display: grid; place-items: center; color: var(--pl-accent); }
.pl-title { font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -.025em; }
.pl-sub { margin-top: 8px; font-size: 11px; opacity: .56; line-height: 1.55; }
.pl-progress { height: 5px; margin: 22px auto 11px; width: 72%; border-radius: 99px; background: color-mix(in srgb, var(--pl-text) 10%, transparent); overflow: hidden; }
.pl-progress span { display: block; height: 100%; width: 62%; border-radius: inherit; background: var(--pl-accent); animation: previewProgress 1.2s ease-in-out infinite alternate; }
.pl-spinner { width: 30px; height: 30px; border: 3px solid color-mix(in srgb, var(--pl-text) 10%, transparent); border-top-color: var(--pl-accent); border-radius: 50%; margin: 20px auto 10px; animation: spin .75s linear infinite; }
.color-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.color-field input[type="color"] { width: 100%; height: 38px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.preset-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.preset { min-height: 52px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); padding: 8px; text-align: left; color: var(--text); transition: var(--transition); }
.preset:hover, .preset.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.preset b { display:block; font-size:10px; }
.preset span { display:block; font-size:9px; color:var(--muted); margin-top:3px; }

/* Analytics */
.analytics-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(280px,.8fr); gap: 12px; }
.bar-chart { height: 280px; display: flex; align-items: flex-end; gap: 6px; padding: 25px 4px 22px; border-bottom: 1px solid var(--border); }
.bar-item { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; }
.bar-item span { width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); transform-origin: bottom; animation: growY 520ms ease-out both; }
.donut-wrap { height: 280px; display: grid; place-items: center; position: relative; }
.donut { width: 180px; height: 180px; border-radius: 50%; background: conic-gradient(var(--accent) 0 68%, #22c55e 68% 97%, #94a3b8 97% 100%); position: relative; }
.donut::after { content:""; position:absolute; inset:33px; border-radius:50%; background:var(--surface); }
.donut-center { position:absolute; z-index:2; text-align:center; }
.donut-center b { display:block; font-size:22px; letter-spacing:-.04em; }
.donut-center span { font-size:10px; color:var(--muted); }

/* Modal + toasts */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; background: rgba(8,15,27,.48); backdrop-filter: blur(4px); animation: fadeIn 150ms ease-out both; }
.modal { width: min(640px,100%); max-height: min(760px,90vh); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); animation: modalIn 180ms ease-out both; }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:17px 18px; border-bottom:1px solid var(--border); }
.modal-head h3 { margin:0; font-size:15px; }
.modal-body { padding:18px; }
.modal-foot { padding:14px 18px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:8px; }
.toast-root { position: fixed; right: 18px; top: 18px; z-index: 120; display: grid; gap: 8px; }
.toast { min-width: 270px; max-width: 360px; padding: 12px 14px; border-radius: 10px; background: #111827; color: white; box-shadow: var(--shadow-lg); display:flex; gap:9px; align-items:flex-start; font-size:11px; animation: toastIn 180ms ease-out both; }
.toast.success { background: #14532d; }
.toast.error { background: #7f1d1d; }

/* Skeleton */
.skeleton { position:relative; overflow:hidden; background:var(--surface-3); border-radius:7px; min-height:14px; }
.skeleton::after { content:""; position:absolute; inset:0; transform:translateX(-100%); background:linear-gradient(90deg,transparent,rgba(255,255,255,.28),transparent); animation:shimmer 1.2s infinite; }

/* Responsive */
@media (max-width: 1120px) {
  :root { --sidebar-w: 190px; }
  .grid-triple { grid-template-columns: 1fr 1fr; }
  .grid-triple > :last-child { grid-column: span 2; }
  .customizer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display:none; }
  .auth-pane { min-height:100vh; padding:22px; }
  .sidebar { transform: translateX(-100%); transition: var(--transition); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left:0; padding-top:58px; }
  .topbar { display:flex; position:fixed; z-index:35; left:0; right:0; top:0; height:58px; align-items:center; justify-content:space-between; padding:0 14px; background:color-mix(in srgb,var(--surface) 88%, transparent); backdrop-filter:blur(12px); border-bottom:1px solid var(--border); }
  .topbar .brand-lockup { font-size:15px; }
  .topbar .brand-bolt { width:27px; height:27px; }
  .content { padding:18px 14px 36px; }
  .kpi-grid { grid-template-columns:1fr 1fr; }
  .grid-dashboard, .analytics-grid { grid-template-columns:1fr; }
  .grid-triple { grid-template-columns:1fr; }
  .grid-triple > :last-child { grid-column:auto; }
  .preview-devices { grid-template-columns:1fr; }
  .desktop-frame { width:100%; }
}
@media (max-width: 560px) {
  .page-head { flex-direction:column; }
  .page-actions { justify-content:flex-start; }
  .kpi-grid { grid-template-columns:1fr; }
  .form-grid { grid-template-columns:1fr; }
  .form-span-2 { grid-column:auto; }
  .condition-row { grid-template-columns:1fr; }
  .color-row, .preset-grid { grid-template-columns:1fr 1fr; }
  .rank-row { grid-template-columns:1fr 80px 55px; }
  .link-hero { align-items:flex-start; flex-direction:column; }
  .preview-stage { padding:14px; }
}

/* Animations */
@keyframes pageIn { from { opacity:0; transform:translateY(5px);} to {opacity:1; transform:none;} }
@keyframes cardIn { from { opacity:0; transform:translateY(12px) scale(.985);} to {opacity:1; transform:none;} }
@keyframes modalIn { from { opacity:0; transform:translateY(8px) scale(.98);} to {opacity:1; transform:none;} }
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes toastIn { from {opacity:0; transform:translateX(12px);} to {opacity:1; transform:none;} }
@keyframes growBar { from {transform:scaleX(0);} to {transform:scaleX(1);} }
@keyframes growY { from {transform:scaleY(0);} to {transform:scaleY(1);} }
@keyframes previewProgress { from {width:24%;} to {width:82%;} }
@keyframes spin { to {transform:rotate(360deg);} }
@keyframes shimmer { 100% {transform:translateX(100%);} }

/* Cloudflare Domain Manager */
.api-banner { display:flex; gap:10px; align-items:flex-start; padding:12px 14px; margin-bottom:12px; border-radius:10px; border:1px solid var(--border); background:var(--surface); font-size:10px; line-height:1.45; animation:cardIn 220ms ease-out both; }
.api-banner > svg { flex:0 0 auto; margin-top:1px; }
.api-banner div { display:grid; gap:2px; }
.api-banner b { font-size:11px; }
.api-banner span { color:var(--muted); }
.api-banner.success { border-color:color-mix(in srgb,#22c55e 35%,var(--border)); background:color-mix(in srgb,#22c55e 6%,var(--surface)); color:#16803a; }
.api-banner.warning { border-color:color-mix(in srgb,#f59e0b 40%,var(--border)); background:color-mix(in srgb,#f59e0b 7%,var(--surface)); color:#a16207; }
.api-banner.info { border-color:color-mix(in srgb,var(--accent) 35%,var(--border)); background:var(--accent-soft); color:var(--accent); }
.api-banner.compact { margin:0; padding:10px 11px; }
.domain-stack { display:grid; gap:5px; min-width:220px; }
.domain-stack > span { display:flex; gap:7px; align-items:center; flex-wrap:wrap; }
.domain-meta { color:var(--muted); font-size:9px; }
.domain-error { display:flex; align-items:center; gap:4px; color:var(--red); max-width:390px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.domain-actions { flex-wrap:nowrap; min-width:max-content; }
.danger-soft { color:#b45309; background:color-mix(in srgb,#f59e0b 8%,var(--surface)); }
.check-row { display:flex; align-items:flex-start; gap:9px; padding:11px; border:1px solid var(--border); border-radius:9px; background:var(--surface-2); cursor:pointer; }
.check-row input { margin-top:2px; accent-color:var(--accent); }
.check-row span { display:grid; gap:3px; }
.check-row b { font-size:10px; }
.check-row small { font-size:9px; color:var(--muted); line-height:1.45; }
