:root {
    --bg: #0b1220;
    --surface: #121a2b;
    --surface-2: #1a2438;
    --border: rgba(241, 245, 249, 0.12);
    --text: #f1f5f9;
    --text-soft: #e2e8f0;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --placeholder: #94a3b8;
    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-soft: rgba(56, 189, 248, 0.14);
    --ok: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;
    --input-bg: #0f172a;
    --radius: 12px;
    --sidebar: 264px;
    --topbar: 72px;
    --font: Inter, "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.cp-shell { display: flex; min-height: 100vh; align-items: stretch; }
.cp-sidebar {
    width: var(--sidebar);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1rem 0.85rem 0.85rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 100vh;
}
.cp-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    text-decoration: none;
    margin: 0 0.15rem 1rem;
    min-height: 44px;
}
.cp-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #0b1220;
    font-weight: 800;
    flex-shrink: 0;
}
.cp-brand-text { min-width: 0; }
.cp-brand strong { display: block; line-height: 1.2; }
.cp-brand small { display: block; color: var(--text-muted); font-size: 0.72rem; }
.cp-sidebar ul { list-style: none; margin: 0; padding: 0; }
.cp-sidebar nav.scroll-region {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.cp-sidebar nav.scroll-region::-webkit-scrollbar { display: none; }
.cp-nav-group { margin: 0 0 0.7rem; }
.cp-nav-group > span {
    display: block;
    padding: 0.3rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.cp-sidebar nav a {
    display: flex;
    align-items: center;
    color: var(--text-soft);
    text-decoration: none;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    min-height: 40px;
}
.cp-sidebar nav a[aria-current="page"], .cp-sidebar nav a:hover {
    background: var(--primary-soft);
    color: var(--text);
}
.cp-side-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding: 0.75rem 0.55rem 0.25rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}
.cp-side-foot a {
    color: var(--text-muted);
    text-decoration: none;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
}
.cp-side-foot a:hover { color: var(--text); }
.cp-workspace {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: flex-end;
    justify-content: center;
    min-width: 0;
}
.cp-workspace label {
    display: grid;
    gap: 0.2rem;
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 600;
}
.cp-workspace select {
    min-height: 40px;
    min-width: 11rem;
    max-width: 16rem;
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
}
.cp-maincol { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cp-top {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.7rem 1.25rem;
    min-height: var(--topbar);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 20;
}
.cp-top-left { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.cp-top-title { min-width: 0; }
.cp-top h1 { margin: 0; font-size: 1.12rem; line-height: 1.25; }
.cp-kicker { margin: 0; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.cp-top-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.2rem 0.2rem 0.2rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
}
.cp-who { color: var(--text-soft); font-size: 0.88rem; }
.cp-content { padding: 1.25rem 1.25rem 2rem; max-width: 1200px; width: 100%; margin: 0 auto; }
.cp-content-wide { max-width: 1360px; }
.cp-stack { display: grid; gap: 1.1rem; }
.cp-crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; color: var(--text-muted); }
.cp-crumbs a { color: var(--text-soft); text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.cp-pagehead {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
}
.cp-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.cp-meta code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
    color: var(--text-soft);
}
.cp-panel-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.cp-panel-head h2 { margin: 0; }
.cp-foot {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 0.75rem 1.1rem;
}
.cp-foot nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}
.cp-foot a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--text-soft);
    text-decoration: none;
}
.cp-foot a:hover { color: var(--text); }
.cp-org-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}
.cp-org-tabs a {
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-soft);
    background: var(--surface-2);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.cp-org-tabs a[aria-current="page"] { background: var(--primary-soft); color: var(--text); }
.cp-card-current { border-color: var(--primary); }
.cp-actions-start { justify-content: flex-start; }
.cp-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.cp-metric, .cp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem;
}
.cp-metric span { display: block; color: var(--text-muted); font-size: 0.78rem; }
.cp-metric strong { font-size: 1.25rem; }
.cp-table-wrap { overflow-x: auto; }
table.cp-table { width: 100%; border-collapse: collapse; min-width: 540px; }
.cp-table th, .cp-table td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--border); }
.cp-table th { color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
.cp-overlook-child td:first-child { padding-left: 1.75rem; }
.cp-overlook-under {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}
@media (min-width: 900px) {
    .cp-overlook-child td:first-child { padding-left: 2.25rem; }
}
.cp-badge { display: inline-block; padding: 0.15rem 0.45rem; border-radius: 999px; font-size: 0.75rem; background: var(--surface-2); }
.cp-badge.ok { color: var(--ok); }
.cp-badge.warn { color: var(--warn); }
.cp-badge.danger { color: var(--danger); }
.cp-form { display: grid; gap: 0.7rem; max-width: 32rem; }
.cp-form-wide { max-width: 40rem; }
.cp-form input, .cp-form textarea, .cp-form select, .cp-snippet {
    width: 100%;
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.7rem;
    min-height: 44px;
}
.cp-snippet {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.82rem;
    min-height: 5rem;
    resize: vertical;
}
.cp-form input::placeholder, .cp-form textarea::placeholder { color: var(--placeholder); }
.cp-btn, .cp-burger {
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #0b1220;
    font-weight: 700;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
}
.cp-link { min-height: 44px; display: inline-flex; align-items: center; margin-left: 0.5rem; }
.cp-btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.cp-btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.cp-btn-ai {
    background: var(--primary-soft);
    color: var(--text);
    border-color: var(--primary);
    font-weight: 800;
}
.cp-btn-ai:hover { background: var(--primary); color: #0b1220; }
.cp-pixel-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cp-pixel-card .cp-snippet { margin-bottom: 0.35rem; }
.cp-venture-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.cp-venture-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}
.cp-venture-row:last-child { border-bottom: 0; }
.cp-venture-meta { min-width: 0; flex: 1 1 12rem; }
.cp-inline-form { display: inline; margin: 0; }
.cp-error { color: var(--danger); }
.cp-ok { color: var(--ok); }
.cp-grid { display: grid; gap: 1rem; }
.cp-grid > * { min-width: 0; }
@media (min-width: 900px) {
    .cp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cp-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cp-tabs a { padding: 0.55rem 0.7rem; border-radius: 8px; text-decoration: none; color: var(--text-soft); background: var(--surface-2); min-height: 44px; display: inline-flex; align-items: center; }
.cp-tabs a[aria-current="page"] { background: var(--primary-soft); color: var(--text); }
.cp-burger { display: none; width: 44px; flex-direction: column; justify-content: center; gap: 5px; background: transparent; border-color: var(--border); color: var(--text); }
.cp-burger span { display: block; height: 2px; background: var(--text); }
.cp-overlay { display: none; }
.cp-lead { color: var(--text-muted); max-width: 62ch; }
.cp-muted { color: var(--text-muted); font-size: 0.9rem; }
.cp-optional { color: var(--text-faint); font-weight: 400; font-size: 0.85em; }
.cp-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem 1rem;
    margin: 0;
    display: grid;
    gap: 0.7rem;
}
.cp-fieldset legend {
    padding: 0 0.35rem;
    color: var(--text-soft);
    font-weight: 600;
}
.cp-onboard .cp-form-wide { max-width: 36rem; }
.cp-auth-alt { display: grid; gap: 0.75rem; max-width: 32rem; margin-bottom: 1rem; }
.cp-btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
    text-decoration: none;
}
.cp-btn-google:hover { background: var(--surface); color: var(--text); }
.cp-divider {
    margin: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 1100px) {
    .cp-top { grid-template-columns: minmax(0, 1fr) auto; }
    .cp-workspace { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 767px) {
    .cp-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        height: 100vh;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }
    .cp-shell.nav-open .cp-sidebar { transform: none; }
    .cp-burger { display: flex; }
    .cp-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 30; display: none; }
    .cp-shell.nav-open .cp-overlay { display: block; }
    .cp-top { grid-template-columns: minmax(0, 1fr); padding: 0.7rem 0.9rem; }
    .cp-top-user { justify-self: start; }
    .cp-content { padding: 0.9rem 0.9rem 1.5rem; }
    .cp-workspace select { max-width: none; width: 100%; }
}

.cp-form-inline { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-bottom: 0.75rem; }
.cp-form-inline label { margin: 0; }
.cp-traffic-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.cp-traffic-bars li {
    display: grid;
    grid-template-columns: minmax(5rem, 34%) 1fr auto;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.92rem;
}
.cp-traffic-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.cp-traffic-bar {
    display: block;
    height: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--primary-soft));
    min-width: 4%;
}
.cp-traffic-hits { font-variant-numeric: tabular-nums; color: var(--text-muted); min-width: 2.5rem; text-align: right; }
.cp-card h3 { margin: 0 0 0.65rem; font-size: 1rem; }
.cp-empty { text-align: center; max-width: 36rem; margin: 0 auto 1.25rem; }
.cp-empty h2 { margin-top: 0; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; }
.cp-checkrow {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}
.cp-checkrow input[type="checkbox"] {
    width: auto;
    min-width: 20px;
    min-height: 20px;
    margin-top: 0.35rem;
}
.cp-steps { margin: 0 0 1rem; padding-left: 1.2rem; }
.cp-steps li { margin: 0.35rem 0; }
.cp-form button[disabled] { opacity: 0.45; cursor: not-allowed; }
.cp-cost-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 0 0 1.15rem;
}
.cp-cost-card h2 { margin: 0 0 0.35rem; font-size: 0.95rem; color: var(--text-soft); }
.cp-cost-total {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.cp-cost-total span { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.cp-cost-card .cp-muted { margin: 0; }
.cp-optional { color: var(--text-muted); font-weight: 400; }
@media (min-width: 768px) {
    .cp-cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
    .cp-cost-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.cp-ee-import {
    max-width: 40rem;
    margin: 0 0 1.5rem;
    padding: 1rem 1rem 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.cp-ee-import h2 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: var(--text-soft);
}
.cp-ee-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: flex-end;
    margin: 0.65rem 0;
}
.cp-ee-search label {
    flex: 1 1 12rem;
    min-width: 0;
    margin: 0;
}
.cp-ee-search input[type="search"] {
    width: 100%;
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.7rem;
    min-height: 44px;
}
.cp-ee-search input[type="search"]::placeholder { color: var(--placeholder); }
.cp-ee-search .cp-btn { flex: 0 0 auto; }
.cp-ee-status { min-height: 1.25rem; margin: 0 0 0.5rem; }
.cp-ee-hits {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 18rem;
    overflow-y: auto;
}
.cp-ee-hit {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}
.cp-ee-hit:last-child { border-bottom: 0; }
.cp-ee-hit-meta {
    min-width: 0;
    flex: 1 1 12rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    align-items: center;
}
.cp-ee-hit-meta strong { color: var(--text); }
.cp-ee-hit .cp-btn { flex: 0 0 auto; }
