:root { --bg: #f6f6f4; --fg: #1c1c1e; --muted: #6b6b70; --line: #e2e2de; --accent: #E4572E; --card: #fff; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #121214; --fg: #ececee; --muted: #9a9aa0; --line: #2a2a2e; --card: #1b1b1e; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.top { display: flex; align-items: center; gap: 24px; padding: 12px 16px; border-bottom: 1px solid var(--line);
       background: var(--card); }
.top .brand { font-weight: 700; color: var(--fg); text-decoration: none; }
.top nav { flex: 1; display: flex; gap: 16px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top form { margin: 0; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px;
         font: inherit; font-weight: 600; cursor: pointer; }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.login { max-width: 360px; margin: 10vh auto; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0 0 6px; font-size: 20px; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line);
                          border-radius: 8px; padding: 8px 10px; }
.error { color: #d33; margin: 0; }
.empty { color: var(--muted); }
a { color: var(--accent); }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.head h1 { margin: 0; }
.btn { background: var(--accent); color: #fff; border-radius: 8px; padding: 9px 16px; font-weight: 600; text-decoration: none; }
.funnel { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.stage { display: flex; flex-direction: column; min-width: 92px; padding: 10px 12px; border: 1px solid var(--line);
         border-radius: 10px; background: var(--card); color: var(--fg); text-decoration: none; }
.stage b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stage span { font-size: 12px; color: var(--muted); }
.stage.on { border-color: var(--accent); }
.stage.kpi { border-style: dashed; }
table.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.grid th, .grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid th { font-size: 12px; color: var(--muted); font-weight: 600; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; margin: 0 4px 2px 0;
        border: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.chip.marketplace { background: rgba(228,87,46,.10); }
.chip.social { background: rgba(80,120,240,.12); }
.status { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.status.pilot_paid { background: #1f8a4c; color: #fff; border-color: transparent; }
.status.lost { opacity: .6; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
ul.plain, ol.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
@media (max-width: 640px) { .grid th:nth-child(5), .grid td:nth-child(5) { display: none; } }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.inline-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); display: inline-block; }
.status.step-ok { background: rgba(31,138,76,.15); }
.status.step-failed { background: rgba(221,51,51,.15); }
.status.step-needs_browser { background: rgba(80,120,240,.15); }
details summary { cursor: pointer; color: var(--accent); margin-top: 12px; }
