:root {
    color-scheme: dark;
    --bg: #0d1016;
    --surface: rgba(19, 24, 34, 0.96);
    --surface-soft: rgba(255, 255, 255, 0.04);
    --ink: #f3f7ff;
    --muted: #97a2b8;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.16);
    --accent: #22c55e;
    --accent-strong: #16a34a;
    --warn: #f59e0b;
    --danger: #ef4444;
    --radius-2xl: 30px;
    --radius-xl: 22px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.32);
    --shadow-sm: 0 12px 24px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 18%),
        linear-gradient(180deg, #131924 0%, var(--bg) 100%);
}

.shell { width: min(1460px, calc(100% - 40px)); margin: 28px auto 44px; }

.brief-head,
.sheet-card,
.result-card,
.sidebar-card {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-2xl);
}

.brief-head {
    padding: 34px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(151, 162, 184, 0.78);
}

h1, h2, strong { margin: 0; letter-spacing: -0.04em; }
h1 { margin-top: 10px; font-size: 30px; line-height: 0.96; }
.lead { margin: 14px 0 0; max-width: 860px; color: var(--muted); line-height: 1.72; }

.inspector-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) 340px;
    gap: 24px;
    align-items: start;
}

.source-sheet,
.result-deck,
.insight-rail { display: grid; gap: 18px; }
.insight-rail { position: sticky; top: 24px; }

.sheet-card,
.result-card,
.sidebar-card { padding: 24px; }

.section-head {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.section-head h2 { font-size: 1.9rem; line-height: 0.98; }
.section-head p,
.result-card p,
.sidebar-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.72;
}

.field-stack,
.signal-grid,
.toggle-grid { display: grid; gap: 16px; }
.signal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field { display: grid; gap: 10px; }
.field > span {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(243, 247, 255, 0.72);
}

input[type="text"],
select {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    font: inherit;
}

select {
    appearance: none;
    padding-right: 52px;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(243, 247, 255, 0.82) 50%),
        linear-gradient(135deg, rgba(243, 247, 255, 0.82) 50%, transparent 50%);
    background-position: calc(100% - 24px) calc(50% - 3px), calc(100% - 16px) calc(50% - 3px);
    background-size: 8px 8px, 8px 8px;
    background-repeat: no-repeat;
}

.toggle-grid { margin-top: 16px; }
.toggle {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 52px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-weight: 600;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

button {
    min-height: 50px;
    padding: 0 20px;
    border-radius: 999px;
    border: 0;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

button:not(.ghost-button) {
    color: #07110b;
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.ghost-button {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.result-card-primary strong,
.sidebar-card strong {
    display: block;
    margin: 10px 0 8px;
    font-size: 1.28rem;
}

.finding-list {
    margin: 12px 0 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.finding-list li.pass { color: #8ef0b0; }
.finding-list li.warn { color: #ffd48a; }
.finding-list li.fail { color: #ff9f9f; }

.code-block {
    margin: 12px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font: inherit;
    line-height: 1.7;
    color: #cad4ea;
}

.ad-slot,
.ad-placeholder {
    border: 1px solid var(--line);
    border-radius: 18px;
    min-height: 320px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.ad-placeholder { padding: 16px; }
.ad-mockup { position: relative; min-height: 286px; height: 100%; border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); }
.ad-mockup::before { content: ""; position: absolute; inset: 14px; border-radius: 14px; border: 1px dashed rgba(255, 255, 255, 0.12); }
.ad-mockup-top, .ad-mockup-media, .ad-mockup-badge, .ad-mockup-lines { position: absolute; }
.ad-mockup-top { top: 24px; left: 24px; width: 110px; height: 18px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.ad-mockup-media { inset: 78px 24px 106px; border-radius: 16px; background: linear-gradient(135deg, rgba(34,197,94,.16), rgba(16,185,129,.08)); }
.ad-mockup-lines { left: 24px; right: 24px; bottom: 28px; display: grid; gap: 10px; }
.ad-mockup-lines span { display: block; height: 12px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.ad-mockup-lines span:last-child { width: 58%; }
.ad-mockup-badge { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 142px; height: 142px; border-radius: 50%; display: grid; place-content: center; background: linear-gradient(135deg, #22c55e, #10b981); color: #fff; }
.ad-mockup-badge span { font-size: 1.35rem; font-weight: 800; line-height: 1; text-align: center; letter-spacing: .08em; }

@media (max-width: 1180px) {
    .inspector-layout,
    .signal-grid { grid-template-columns: 1fr; }
    .insight-rail { position: static; }
}

@media (max-width: 720px) {
    .shell { width: min(100% - 24px, 1460px); }
    .brief-head,
    .sheet-card,
    .result-card,
    .sidebar-card { padding: 20px; }
    .action-row { flex-direction: column; }
    button { width: 100%; }
}
