:root {
    --bg: #f0f2f5;
    --bg-2: #e9edef;
    --panel: #ffffff;
    --line: #d1d7db;
    --text: #111b21;
    --muted: #667781;
    --accent: #008069;
    --accent-2: #00a884;
    --danger: #e54d4d;
    --radius: 18px;
    --font: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.lab-body {
    min-height: 100dvh;
    font-family: var(--font);
    background:
        radial-gradient(1200px 420px at 8% -8%, rgba(0, 168, 132, 0.12), transparent 50%),
        var(--bg);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
img, svg { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }

.lab-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }

.lab-nav { display: flex; gap: 18px; }
.lab-nav a { color: var(--muted); }
.lab-nav a:hover { color: var(--text); }

.lab-main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 64px;
}
.lab-main.narrow { width: min(720px, calc(100% - 32px)); }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    color: var(--accent-2);
    margin: 0 0 8px;
}
.hero h1, .toolbar h1, .panel-head h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.04em; margin: 0 0 10px; }
.lead, .muted, .panel-head p { color: var(--muted); line-height: 1.5; }
.hero.compact { text-align: center; }

.agent-grid, .choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.agent-card, .choice-card, .panel, .install-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}

.agent-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px 16px;
    color: var(--text);
    min-height: 170px;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.agent-card:hover { transform: translateY(-3px); border-color: var(--agent, var(--accent)); }
.agent-card h2 { margin: 0 0 6px; font-size: 22px; }
.agent-card p { margin: 0; color: var(--muted); }
.agent-card .meta { color: var(--accent-2); font-size: 12px; }
.agent-card .go, .choice-card .go { grid-column: 1 / -1; color: var(--accent); font-weight: 600; }

.agent-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--agent, var(--accent)) 22%, transparent);
    color: var(--agent, var(--accent));
}
.agent-icon svg { width: 26px; height: 26px; }
.agent-icon.lg { width: 72px; height: 72px; margin: 0 auto 12px; }

.choice-card h2 { margin-top: 0; }
.choice-card.alt { border-color: color-mix(in srgb, var(--accent-2) 35%, var(--line)); }

.pipeline-preview { margin-top: 28px; }
.pipeline-preview ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.pipeline-preview li {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-2);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
}
.pipeline-preview span { width: 8px; height: 8px; border-radius: 50%; }

.stack { display: grid; gap: 14px; }
.stack label, form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, textarea, select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.check { display: flex !important; align-items: center; gap: 8px; grid-template-columns: none; }
.check input { width: auto; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.back-link { color: var(--muted); display: inline-block; margin-bottom: 16px; }

.alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.alert-error { background: #fef3f2; color: #b42318; }
.alert-ok { background: #ecfdf3; color: #027a48; }

.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 22px; flex-wrap: wrap; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-size: 12px; font-weight: 500; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5a6b63; margin: 0 4px 0 10px; }
.dot.on { background: var(--accent); }

.copy-box, .code-sample, pre {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    overflow: auto;
    font-size: 13px;
    white-space: pre-wrap;
}

.log-list { display: grid; gap: 12px; }
.log-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel); }
.log-item.ok { border-left: 3px solid var(--accent); }
.log-item.fail { border-left: 3px solid var(--danger); }
.log-item header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.log-item details { margin-top: 8px; }

.install-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.install-card { width: min(520px, 100%); }
.install-card h1 { margin: 0 0 8px; }

@media (max-width: 720px) {
    .split { grid-template-columns: 1fr; }
    .lab-top { padding: 14px; }
    .brand small { display: none; }
}
