:root {
    color-scheme: light;
    --ink: #1c1e21;
    --muted: #8b919a;
    --paper: #e7e9ed;
    --canvas: #f5f6f8;
    --panel: #ffffff;
    --line: #eceef2;
    --line-strong: #e3e6eb;
    --accent: #ff4f1f;
    --accent-hover: #e8461b;
    --accent-soft: #fff1eb;
    --success: #178a45;
    --success-soft: #e8f8ee;
    --danger: #d1263d;
    --danger-soft: #fdecee;
    --warning: #b86e00;
    --warning-soft: #fff6e5;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
    --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.12);
    --radius: 16px;
    --radius-control: 10px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --control-h: 36px;
    --font-page: 24px;
    --font-section: 15px;
    --font-body: 14px;
    --font-secondary: 13px;
    --font-label: 12px;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid #ffb199; outline-offset: 2px; }

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(900px 420px at 50% -10%, rgba(255, 79, 31, 0.16), transparent 60%),
        var(--paper);
}
.login-card {
    width: min(420px, calc(100% - 32px));
    background: var(--panel);
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 22px; }
.login-card h1 { font-size: 28px; letter-spacing: -0.03em; margin-bottom: 6px; }
.login-card .muted { margin-bottom: 18px; }
.login-card label { margin-bottom: 14px; }
.login-card button { width: 100%; margin-top: 6px; }
.eyebrow { letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-size: 11px; font-weight: 700; margin: 0 0 6px; }
.muted { color: var(--muted); font-weight: 500; }
label { display: grid; gap: 6px; margin: 0; font-size: var(--font-secondary); font-weight: 650; color: #3a4048; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: #fff;
    min-height: var(--control-h);
    padding: 8px 12px;
    border-radius: var(--radius-control);
    font-size: var(--font-body);
    font-weight: 500;
}
textarea { resize: vertical; line-height: 1.45; min-height: 88px; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; height: 16px; padding: 0; }
textarea.code, pre { font-family: ui-monospace, Consolas, monospace; font-weight: 450; font-size: 12px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #ffb199; box-shadow: 0 0 0 3px rgba(255, 79, 31, 0.12); }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b919a' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
::placeholder { color: #a3a9b2; }
button, .button {
    border: 0;
    background: var(--accent);
    color: white;
    min-height: var(--control-h);
    padding: 0 14px;
    border-radius: var(--radius-control);
    font-size: var(--font-secondary);
    font-weight: 650;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: none;
}
button:hover, .button:hover { background: var(--accent-hover); }
button.secondary, .button.secondary, a.button.secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}
button.secondary:hover, .button.secondary:hover, a.button.secondary:hover { background: #fafbfc; filter: none; }
button.danger, a.button.danger { background: var(--danger); box-shadow: none; }
button.danger:hover, a.button.danger:hover { background: #b91c32; }
button:disabled, .button:disabled { opacity: 0.45; cursor: not-allowed; }
a.button { display: inline-flex; align-items: center; text-decoration: none; }
.error { color: var(--danger); font-weight: 600; }
.error.is-ok { color: var(--success); }
.toast-stack {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 80;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px 14px 16px;
    background: #fff;
    border: 1px solid #ffd0d6;
    border-left: 4px solid var(--danger);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(28, 30, 33, 0.16);
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast p { margin: 0; flex: 1; font-size: 14px; font-weight: 650; line-height: 1.45; color: #3a1218; }
.toast-ok { border-color: #b7e4c7; border-left-color: var(--success); }
.toast-ok p { color: #0f3d22; }
.toast-x {
    flex: none;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #8b919a;
    box-shadow: none;
    font-size: 18px;
    line-height: 1;
}
.toast-x:hover { background: #f6f7f9; color: var(--ink); }
.banner {
    margin-top: 12px;
    background: var(--danger-soft);
    color: var(--danger);
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 650;
}

.shell {
    height: calc(100vh - 28px);
    margin: 14px;
    background: var(--canvas);
    border-radius: 28px;
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.08);
}
.sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 22px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow: auto;
}
.brand-row { display: flex; align-items: center; gap: 4px; padding: 0 4px 10px; }
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 750;
    font-size: 18px;
    letter-spacing: -0.03em;
    padding: 0 4px;
    min-width: 0;
    flex: 1;
}
button.sidebar-collapse {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    background: #f6f7f9;
    color: #5c6370;
    box-shadow: none;
    display: grid;
    place-items: center;
    flex: none;
}
button.sidebar-collapse svg { width: 16px; height: 16px; }
button.sidebar-collapse:hover { background: #eceef2; }
@media (min-width: 1101px) {
    .shell.nav-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
    .shell.nav-collapsed .sidebar { padding: 16px 10px 12px; align-items: center; }
    .shell.nav-collapsed .brand-row { flex-direction: column; padding: 0 0 8px; gap: 8px; }
    .shell.nav-collapsed .brand { justify-content: center; padding: 0; flex: none; }
    .shell.nav-collapsed .brand-word,
    .shell.nav-collapsed .nav-label,
    .shell.nav-collapsed .nav-count,
    .shell.nav-collapsed .logout-label,
    .shell.nav-collapsed .nav a > span:not(.nav-ico) { display: none; }
    .shell.nav-collapsed .nav { width: 100%; }
    .shell.nav-collapsed .nav a { justify-content: center; padding: 10px; }
    .shell.nav-collapsed .sidebar-foot { width: 100%; }
    .shell.nav-collapsed .logout { justify-content: center; padding: 12px; }
    .shell.nav-collapsed .sidebar-collapse svg { transform: scaleX(-1); }
}
.brand-mark, .login-brand svg { width: 32px; height: 32px; display: block; flex: none; }
.brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
    flex: none;
}
.login-brand .brand-logo { width: 36px; height: 36px; }
.nav-label {
    margin: 12px 10px 6px;
    color: #a0a6ae;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.nav { display: grid; gap: 4px; }
.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 12px;
    color: #3d434b;
    font-weight: 620;
    font-size: 14px;
}
.nav a:hover { background: #f6f7f9; }
.nav a.active { background: #fff1eb; color: #ff4f1f; box-shadow: none; }
.nav-ico, .nav-ico svg { width: 18px; height: 18px; display: block; flex: none; }
.nav-count {
    margin-left: auto;
    background: #f3f4f6;
    color: #6d7380;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
    font-size: 11px;
    font-weight: 750;
    padding: 2px 6px;
}
.nav a.active .nav-count { background: #ffe4d8; color: #ff4f1f; }
.sidebar-foot { margin-top: auto; padding-top: 12px; }
button.logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f6f7f9;
    color: var(--danger);
    border-radius: 12px;
    box-shadow: none;
    text-align: left;
    padding: 12px;
}
button.logout svg, button.profile svg { width: 18px; height: 18px; flex: none; }
button.logout:hover { background: #fdecee; }

.workspace { min-width: 0; min-height: 0; overflow: auto; }
.header {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px 10px;
    background: rgba(245, 246, 248, 0.92);
    backdrop-filter: blur(12px);
}
.search-wrap { position: relative; flex: 1; max-width: 520px; }
.search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px 8px 14px;
    color: #9aa1aa;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}
.search svg { width: 18px; height: 18px; flex: none; }
.search input { border: 0; background: transparent; min-height: 0; height: 24px; padding: 2px 0; box-shadow: none; font-weight: 500; }
.search input:focus { box-shadow: none; }
.search:focus-within { border-color: #ffb199; box-shadow: 0 0 0 3px rgba(255, 79, 31, 0.12); }
.search kbd {
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    padding: 3px 6px;
    font-size: 11px;
    color: #8b919a;
    font-family: inherit;
    background: #fafbfc;
}
.suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 20;
}
.suggest a {
    display: flex;
    text-decoration: none;
    border-radius: 10px;
    padding: 9px 10px;
    font-weight: 650;
}
.suggest a:hover { background: var(--accent-soft); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.env {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
}
.live { width: 8px; height: 8px; border-radius: 50%; background: #1f9d55; box-shadow: 0 0 0 4px #e7f7ee; }
.env.warn .live { background: #e25b1c; box-shadow: 0 0 0 4px #fff1eb; }
button.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    color: #3d434b;
    border: 1px solid var(--line);
    box-shadow: none;
    display: grid;
    place-items: center;
}
button.icon-btn svg { width: 18px; height: 18px; }
button.icon-btn:hover { background: #fafbfc; }
button.icon-btn .dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: none;
}
.popwrap { position: relative; }
.popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 14px;
    z-index: 20;
}
.popover h2 { font-size: 15px; margin-bottom: 8px; }
.popover p, .popover li { font-size: 13px; line-height: 1.45; }
.popover ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.note-list { display: grid; gap: 8px; margin-top: 8px; }
.note-list a {
    display: block;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 12px;
    background: #fafbfc;
}
.note-list a:hover { background: var(--accent-soft); }
.note-list strong { display: block; font-size: 13px; }
.note-list span { color: var(--muted); font-size: 12px; }
button.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
    box-shadow: none;
    text-align: left;
}
button.profile small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
button.profile strong { display: block; font-size: 13px; line-height: 1.2; }
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 750;
}
.profile-menu button {
    width: 100%;
    margin-top: 10px;
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: none;
}

.content { padding: var(--space-1) var(--space-6) var(--space-8); }
.topbar { display: flex; justify-content: space-between; gap: var(--space-4); align-items: center; margin-bottom: var(--space-5); }
.topbar h1 { font-size: var(--font-page); letter-spacing: -0.03em; font-weight: 700; line-height: 1.2; }
.lede { margin-top: var(--space-1); font-size: var(--font-body); line-height: 1.45; max-width: 68ch; }
.date-pill, .range-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}
.date-pill svg { width: 16px; height: 16px; color: #6d7380; }
.range-select { padding: 0 4px 0 0; }
.range-select select { border: 0; background-color: transparent; box-shadow: none; width: auto; font-weight: 700; padding: 8px 32px 8px 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); align-items: stretch; }
.kpi, .card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.kpi { display: flex; flex-direction: column; min-height: 132px; padding: var(--space-4) var(--space-5); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.kpi-label { color: #5c6370; font-size: var(--font-secondary); font-weight: 650; }
.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    flex: none;
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-icon.tone-bad { background: var(--danger-soft); color: var(--danger); }
.kpi-value { display: block; margin-top: var(--space-3); font-size: 30px; line-height: 1; letter-spacing: -0.04em; font-weight: 750; }
.kpi-foot { display: flex; align-items: center; gap: var(--space-2); margin-top: auto; padding-top: var(--space-3); font-size: var(--font-label); color: var(--muted); font-weight: 600; }
.delta { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 7px; font-size: 12px; font-weight: 750; }
.delta.up { color: var(--success); background: var(--success-soft); }
.delta.down { color: var(--danger); background: var(--danger-soft); }
.delta.flat { color: #6d7380; background: #f3f4f6; }

.chart-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); align-items: stretch; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.85fr); gap: var(--space-4); margin-top: var(--space-4); align-items: stretch; }
.side-stack { display: grid; gap: var(--space-4); align-content: stretch; height: 100%; }
.card { padding: var(--space-4) var(--space-5); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-3); }
.card-head h2, .card h2, h2 { font-size: var(--font-section); letter-spacing: -0.02em; font-weight: 700; }
.card-head p { margin-top: 2px; font-size: var(--font-secondary); line-height: 1.4; }
.link { color: var(--accent); font-size: 13px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.legend { display: flex; gap: 14px; color: #6d7380; font-size: 12px; font-weight: 700; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch.ok { background: repeating-linear-gradient(-45deg, #ff4f1f, #ff4f1f 2px, #ff7348 2px, #ff7348 4px); }
.swatch.bad { background: #3a3d42; }

.chart { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; height: 272px; padding: 4px 4px 0; }
.chart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #a0a6ae;
    font-size: 11px;
    font-weight: 650;
    text-align: right;
    padding-bottom: 24px;
}
.chart-main { min-width: 0; display: flex; flex-direction: column; }
.chart-plot {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 8px;
    min-height: 0;
}
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.bar-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background-image: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #eef0f3 calc(25% - 1px), #eef0f3 25%);
}
.bar {
    width: min(34px, 72%);
    background: var(--accent);
    border-radius: 8px 8px 3px 3px;
    position: relative;
    min-height: 0;
}
.bar.peak { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent); }
.callout {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 750;
    padding: 3px 6px;
    border-radius: 8px;
    white-space: nowrap;
}
.callout::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--accent);
}
.bar.stack {
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    width: min(28px, 78%);
}
.seg.ok { background: repeating-linear-gradient(-45deg, #ff4f1f, #ff4f1f 3px, #ff7348 3px, #ff7348 6px); }
.seg.bad { background: #3a3d42; }
.bar.stack .seg:first-child { border-radius: 7px 7px 0 0; }
.bar-label { height: 28px; display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 650; }
.chart-empty { height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }

.table-card { padding: 0; overflow: auto; }
.table-toolbar, .pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    flex-wrap: wrap;
}
.table-toolbar h2 { font-size: var(--font-section); font-weight: 700; }
.toolbar-controls { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.mini-search {
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--control-h);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-control);
    padding: 0 12px;
    color: #9aa1aa;
}
.mini-search svg { width: 15px; height: 15px; flex: none; }
.mini-search input { border: 0; background: transparent; width: 160px; min-height: 0; height: 32px; padding: 0; box-shadow: none; font-size: var(--font-secondary); }
.toolbar-controls select, .toolbar-controls > input { width: auto; min-width: 148px; height: var(--control-h); background-color: #fff; border-radius: var(--radius-control); padding-top: 0; padding-bottom: 0; font-size: var(--font-secondary); font-weight: 600; }
.toolbar-controls > input { width: 200px; }
.pager { border-top: 1px solid var(--line); }
.pager-actions { display: flex; gap: var(--space-2); }
.pager .secondary { min-height: 32px; padding: 0 12px; }
table { width: 100%; border-collapse: collapse; background: transparent; min-width: 640px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: var(--font-body); }
th { color: #8b919a; font-size: var(--font-label); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: #fafbfc; white-space: nowrap; }
td { height: 48px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
td.cell-end, th.cell-end { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.clickable tbody tr { cursor: pointer; }
tr.is-selected td { background: #fff6f2 !important; }
table a { font-weight: 750; text-decoration: none; }
table a:hover { color: var(--accent); }
.id-cell { font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 650; }
.clip { display: block; max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px !important; height: auto; }
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
    white-space: nowrap;
}
.badge.ok, .badge.success, .badge.healthy, .badge.published, .badge.completed { background: var(--success-soft); color: var(--success); }
.badge.warn, .badge.draft, .badge.attention { background: var(--accent-soft); color: #c2410c; }
.badge.pending, .badge.waiting { background: var(--warning-soft); color: var(--warning); }
.badge.bad, .badge.failed { background: var(--danger-soft); color: var(--danger); }
.badge.neutral, .badge.required { background: #f3f4f6; color: #4b5160; }
.badge.required { background: var(--accent-soft); color: #c2410c; }

.fail-list, .status-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.fail-list a, .status-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    padding: 10px 0;
    border-top: 1px solid #f3f4f6;
}
.fail-list a:first-child, .status-list li:first-child { border-top: 0; padding-top: 0; }
.fail-list strong, .status-list strong { display: block; font-size: 13px; }
.fail-list p, .status-list p { font-size: 12px; margin-top: 2px; }
.fail-meta { display: grid; justify-items: end; gap: 4px; font-size: 12px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.status-dot.ok { background: #1f9d55; }
.status-dot.warn { background: #e25b1c; }
.status-dot.bad { background: var(--danger); }
.status-copy { display: flex; gap: 10px; align-items: flex-start; }
.attention { margin-top: 14px; background: #fafbfc; border-radius: 14px; padding: 12px; }
.attention h3 { font-size: 13px; margin-bottom: 8px; }
.attention ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: #3d434b; font-size: 13px; }
.attention.calm { background: var(--success-soft); color: #146c38; }
.attention.calm h3, .attention.calm p { color: #146c38; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; }
.stack h2 { margin-top: 4px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.split { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); gap: 14px; align-items: start; }
.edges { position: absolute; inset: 0; z-index: 1; overflow: visible; pointer-events: none; }
.edge-hit { pointer-events: stroke; cursor: grab; }
.edge:hover .edge-line { filter: brightness(0.92); }
.edge.is-target .edge-line { stroke: #ff4f1f; }
.edge.is-selected .edge-line { filter: none; }
.edge-glow { pointer-events: none; }
.edge-line.is-flow { animation: edge-flow 0.85s linear infinite; }
@keyframes edge-flow { to { stroke-dashoffset: -32; } }
.line-inspector .line-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background:
        linear-gradient(var(--line-color), var(--line-color)) center / 22px 2.5px no-repeat,
        color-mix(in srgb, var(--line-color) 14%, white);
    flex: none;
}
.line-preview {
    display: grid;
    gap: 4px;
    padding: 8px 10px 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}
.line-preview svg { width: 100%; height: 42px; }
.line-preview span { color: #6d7380; font-size: 11px; font-weight: 750; letter-spacing: 0.02em; }
.line-patterns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.line-pattern {
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 8px 4px 6px;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
}
.line-pattern svg { width: 100%; height: 12px; }
.line-pattern line { stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.line-pattern line.is-dashed { stroke-dasharray: 7 4; }
.line-pattern line.is-dotted { stroke-dasharray: 0.2 4; }
.line-pattern line.is-dashdot { stroke-dasharray: 8 3 1.5 3; }
.line-pattern small { font-size: 10px; font-weight: 750; color: #6d7380; }
.line-pattern.is-on { border-color: var(--ink); background: #f4f7fb; }
.line-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.line-swatch {
    width: 22px;
    height: 22px;
    min-height: 0;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--swatch);
    box-shadow: 0 0 0 1px #d7dbe2;
}
.line-swatch.is-on { box-shadow: 0 0 0 2px var(--ink); }
.line-custom input { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; }
.line-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.line-toggle strong { display: block; font-size: 13px; }
.line-toggle small { display: block; margin-top: 2px; color: #6d7380; font-size: 11px; font-weight: 650; }
.line-toggle input { width: 16px; height: 16px; }
.line-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.line-actions .secondary { width: 100%; }
.field b[data-weight] { color: var(--ink); font-weight: 750; }
.edge-insert {
    position: absolute;
    z-index: 4;
    width: 22px;
    height: 22px;
    min-height: 0;
    margin: -11px 0 0 -11px;
    padding: 0;
    border: 1.5px solid #fff;
    border-radius: 50%;
    background: #2f6fed;
    color: #fff;
    box-shadow: 0 6px 16px rgba(47, 111, 237, 0.28);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.84);
    transition: opacity 0.12s ease, transform 0.12s ease;
}
.edge-insert svg { width: 12px; height: 12px; }
.edge-insert.is-hot, .edge-insert:hover, .edge-insert:focus-visible {
    opacity: 1;
    pointer-events: auto;
    background: #2f6fed;
    transform: scale(1);
}
.edge-bend {
    position: absolute;
    z-index: 4;
    width: 12px;
    height: 12px;
    min-height: 0;
    margin: -6px 0 0 -6px;
    padding: 0;
    border: 1.5px solid #2f6fed;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.16);
    cursor: grab;
}
.edge-bend:hover { background: #2f6fed; }
.edge-menu {
    position: absolute;
    z-index: 8;
    width: 204px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}
.edge-menu p {
    margin: 4px 8px 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.edge-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 0;
    text-align: left;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    border-radius: 10px;
    padding: 6px;
    font-size: 13px;
    font-weight: 700;
}
.edge-menu button:hover { background: #f6f7f9; }
.edge-menu .node-icon { width: 26px; height: 26px; border-radius: 8px; }
.edge-menu .node-icon svg { width: 14px; height: 14px; }
.flow-node.is-anchoring { box-shadow: inset 0 0 0 1.5px #2f6fed, 0 10px 24px rgba(16, 24, 40, 0.06); }
.canvas-mark {
    position: absolute;
    box-sizing: border-box;
    border-style: solid;
    overflow: hidden;
    user-select: none;
    cursor: grab;
}
.canvas-mark.selected { box-shadow: 0 0 0 2px #2f6fed, 0 12px 28px rgba(16, 24, 40, 0.08); }
.canvas-mark .mark-head {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.canvas-mark .mark-head strong { font-weight: 750; line-height: 1.2; }
.canvas-mark .mark-head small {
    color: inherit;
    opacity: 0.72;
    font-size: 12px;
    font-weight: 600;
    white-space: pre-wrap;
}
.canvas-mark .mark-title { display: block; margin-bottom: 6px; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.canvas-mark .mark-body { white-space: pre-wrap; word-break: break-word; }
.canvas-mark.kind-stamp {
    display: grid;
    place-items: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.canvas-mark .node-resize { opacity: 0; }
.canvas-mark.selected .node-resize,
.canvas-mark:hover .node-resize { opacity: 1; }
.edge-label {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, -50%);
    max-width: 180px;
    padding: 4px 8px;
    border: 1px solid #d7dbe3;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.edge-label.has-arrow::before {
    content: "";
    position: absolute;
    left: 50%;
    width: 0;
    height: 0;
    border: 5px solid transparent;
}
.edge-label.place-above.has-arrow::before {
    top: 100%;
    transform: translateX(-50%);
    border-top-color: currentColor;
}
.edge-label.place-below.has-arrow::before {
    bottom: 100%;
    transform: translateX(-50%);
    border-bottom-color: currentColor;
}
.edge-label.place-left.has-arrow::before {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: currentColor;
}
.edge-label.place-right.has-arrow::before {
    left: auto;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: currentColor;
}
.line-comments { gap: 10px; }
.line-comment-list { display: grid; gap: 8px; }
.line-comment-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
}
.line-comment-card strong {
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
}
.line-comment-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.line-comment-tools select,
.line-comment-tools button {
    width: auto;
    min-height: 30px;
    padding: 0 10px;
}
.line-comment-tools button.is-on {
    background: #eaf2ff;
    border-color: #2f6fed;
    color: #2f6fed;
}
.mark-modal-scrim {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: rgba(16, 24, 40, 0.28);
    backdrop-filter: blur(2px);
}
.mark-modal {
    width: min(420px, calc(100% - 32px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 16px;
    display: grid;
    gap: 12px;
}
.mark-modal header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.mark-modal header strong { font-size: 16px; }
.mark-modal header button {
    width: 28px;
    height: 28px;
    min-height: 0;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #8b919a;
    box-shadow: none;
}
.mark-modal header button:hover { background: #f6f7f9; color: var(--ink); }
.mark-modal label { display: grid; gap: 6px; }
.mark-modal footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.mark-modal footer button { width: auto; }
.choice-row, .rule-row {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 8px;
    background: #fafbfc;
}
.choice-list { display: grid; gap: 8px; margin-bottom: 8px; }
.extra-list { display: grid; gap: 10px; width: 100%; margin-bottom: 8px; }
.extra-card {
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding: 10px 12px 12px 16px;
    border: 1px solid #efe6da;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 79, 31, 0.08), transparent 28px),
        #fff;
    box-shadow: 0 10px 24px rgba(72, 52, 24, 0.05);
    position: relative;
}
.extra-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #ff8a62, #ff4f1f);
}
.extra-card-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.extra-card-bar span,
.extra-card > span {
    color: #9a9186;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.extra-card > input,
.extra-card .token-field { width: 100%; min-width: 0; }
.extra-card > input {
    padding: 9px 12px;
    border-radius: 12px;
    background: #fbf8f4;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px;
    font-weight: 650;
}
.extra-card .token-field .token-input,
.extra-card .token-field .token-mirror {
    padding-right: 58px;
}
button.extra-remove {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #8b919a;
    box-shadow: none;
    font-size: 16px;
    line-height: 1;
}
button.extra-remove:hover { background: #fdecec; color: var(--danger); }
.choice-card {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    grid-template-areas: "index field remove" "index slug remove";
    gap: 2px 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #fbfbfc);
}
.choice-card:focus-within { border-color: #ffb199; box-shadow: 0 0 0 3px rgba(255, 79, 31, 0.12); }
.choice-index {
    grid-area: index;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 750;
}
.choice-card .token-field { grid-area: field; }
.choice-slug {
    grid-area: slug;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 11px;
    color: var(--muted);
    background: transparent;
}
button.choice-remove {
    grid-area: remove;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #8b919a;
    box-shadow: none;
    font-size: 18px;
    line-height: 1;
}
button.choice-remove:hover { background: #fdecec; color: var(--danger); }
.token-field { position: relative; }
.token-field .token-input,
.token-field .token-mirror {
    margin: 0;
    font: inherit;
    font-weight: 550;
    font-size: 14px;
    line-height: 1.45;
    padding: 10px 42px 10px 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.token-mirror {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #111;
    pointer-events: none;
    background: #fff;
}
.token-field .token-input {
    position: relative;
    z-index: 1;
    background: transparent;
    color: transparent;
    -webkit-text-fill-color: transparent;
    caret-color: #111;
}
.token-field .token-input::selection {
    background: transparent;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.token-field .token-input::spelling-error,
.token-field .token-input::grammar-error {
    text-decoration: none;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.token-field.is-line .token-input,
.token-field.is-line .token-mirror { white-space: nowrap; overflow: hidden; }
.token-ok { color: #c2410c; background: #fff1eb; border-radius: 4px; font-weight: inherit; }
.token-bad { color: #d92d20; background: #fdecee; border-radius: 4px; text-decoration: line-through; text-decoration-thickness: 1.5px; font-weight: inherit; }
.token-mirror .is-selected { background: rgba(47, 111, 237, 0.28); border-radius: 2px; }
button.token-insert {
    position: absolute;
    z-index: 2;
    right: 5px;
    bottom: 6px;
    width: auto;
    height: 22px;
    padding: 0 6px;
    border-radius: 7px;
    background: #fff;
    color: #111;
    border: 1px solid #111;
    box-shadow: none;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: -0.04em;
    line-height: 20px;
}
button.token-insert:hover,
button.token-insert:focus-visible {
    background: #f4f5f7;
    color: #111;
    border-color: #111;
}
.token-field.is-line button.token-insert { top: 50%; bottom: auto; transform: translateY(-50%); }
.action-page button.token-insert { padding: 0 6px; border-radius: 7px; width: auto; height: 22px; }
.token-suggest, .token-picker {
    position: absolute;
    z-index: 6;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    max-height: 240px;
    overflow: auto;
}
.token-suggest button, .token-chips button {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: 650;
    text-align: left;
}
.token-suggest button small { color: var(--muted); font-size: 11px; font-weight: 650; }
.token-suggest button.is-active, .token-suggest button:hover, .token-chips button:hover { background: #fff4ef; color: var(--accent); }
.token-picker-head { display: grid; gap: 8px; padding: 6px 6px 8px; }
.token-picker-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.token-picker-head strong { font-size: 13px; }
.token-picker section { display: grid; gap: 8px; padding: 8px 6px; border-top: 1px solid var(--line); }
.token-picker header { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; }
.token-sides { display: flex; background: #f3f4f6; border-radius: 999px; padding: 2px; }
.token-sides button {
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
}
.token-sides button.active { background: #fff; color: var(--accent); }
.token-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.token-chips button { width: auto; background: #f7f8fa; border-radius: 999px; padding: 6px 10px; font-size: 12px; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 420px; }
.chat form { display: flex; gap: 8px; }
.chat form input { flex: 1; }
.chart-note { margin-top: 8px; font-size: 13px; }
.chat-panel { min-height: 560px; }
.bubble { padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; max-width: 80%; }
.bubble.user { margin-left: auto; background: var(--accent-soft); border-color: #ffd8cc; border-radius: 14px 14px 4px 14px; }
.minimap { position: absolute; left: 14px; bottom: 14px; width: 180px; height: 112px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08); overflow: hidden; z-index: 3; }
pre { margin: 0; background: #f7f8fa; border-radius: 12px; padding: 14px; overflow: auto; border: 1px solid var(--line); line-height: 1.5; max-height: 360px; }
pre.card { box-shadow: none; }
.bot-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; }
.bot-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #5c6370;
    background: transparent;
    border: 0;
    font-size: 14px;
    font-weight: 650;
}
.bot-nav a:hover { background: #f3f4f6; color: var(--ink); }
.bot-nav a.active { background: var(--accent-soft); color: var(--accent); }
.dev-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--muted); font-size: 13px; font-weight: 650; }
.dev-crumb a { color: var(--ink); text-decoration: none; }
.dev-crumb a:hover { color: var(--accent); }
.dev-crumb .here { color: var(--ink); }
.dev-title { margin-bottom: var(--space-5); }
.dev-title h1 { font-size: var(--font-page); letter-spacing: -0.03em; font-weight: 700; }
.dev-title p { margin-top: 4px; }
.dev-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.dev-panel { display: grid; gap: 16px; align-content: start; height: 100%; }
.dev-panel-head, .dev-keys-head { display: flex; gap: 12px; align-items: flex-start; }
.dev-keys-head { justify-content: space-between; align-items: flex-start; }
.dev-keys-head > button, .dev-keys-head form button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dev-keys-head > button svg, .dev-keys-head form button svg, .key-menu svg, .dev-preview svg { width: 16px; height: 16px; flex: none; }
.dev-panel h2, .dev-keys-head h2 { font-size: 16px; }
.dev-ico {
    width: 28px; height: 28px; border-radius: 999px; flex: none;
    display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.dev-ico svg { width: 16px; height: 16px; }
.dev-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.dev-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.dev-num {
    width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 750;
}
.dev-steps strong { display: block; font-size: 14px; }
.dev-steps p { margin-top: 2px; font-size: 13px; }
.dev-sample { position: relative; background: #1c1e21; color: #f5f6f8; border-radius: 14px; padding: 14px 40px 14px 14px; }
.dev-sample p { color: #c5c8ce; font-size: 12px; font-weight: 650; margin-bottom: 8px; }
.dev-sample pre { margin: 0; padding: 0; background: transparent; border: 0; color: inherit; max-height: none; font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; }
.dev-sample .icon-quiet { position: absolute; top: 10px; right: 10px; color: #fff; background: transparent; }
.dev-table-wrap { overflow: visible; }
.dev-table { width: 100%; border-collapse: collapse; }
.dev-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 8px 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dev-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; white-space: nowrap; }
.dev-table tr:last-child td { border-bottom: 0; }
.dev-preview { display: inline-flex; align-items: center; gap: 8px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.dev-preview button, .key-menu button, .dev-sample .icon-quiet {
    background: transparent; color: var(--muted); box-shadow: none; border: 0; padding: 4px; border-radius: 8px;
}
.dev-preview button:hover, .dev-sample .icon-quiet:hover { background: #f4f5f7; color: var(--ink); }
.dev-sample .icon-quiet:hover { background: rgba(255,255,255,0.08); color: #fff; }
.key-actions { position: relative; text-align: right; }
.key-actions form { display: inline-block; margin-left: 6px; }
.key-actions > button {
    background: transparent; color: var(--ink); box-shadow: none; border: 0; padding: 6px 8px; border-radius: 8px; letter-spacing: 1px;
}
.key-actions > button:hover { background: #f4f5f7; }
.key-menu {
    position: absolute; right: 0; top: calc(100% - 8px); z-index: 6; min-width: 180px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.key-menu button { display: flex; width: 100%; align-items: center; gap: 8px; justify-content: flex-start; padding: 8px 10px; border-radius: 8px; font-weight: 650; color: var(--ink); }
.key-menu button:hover { background: #f6f7f9; filter: none; }
.key-menu button.danger { background: transparent; color: var(--danger); box-shadow: none; }
.key-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.dev-empty { padding: 28px 8px; text-align: center; }
.modal-back {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(28, 30, 33, 0.46);
}
.key-modal {
    width: min(460px, 100%);
    background: var(--panel);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 22px;
    display: grid;
    gap: 10px;
}
.key-modal h2 { font-size: 22px; }
.secret-well {
    background: #1c1e21;
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-all;
}
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 6px; }
.modal-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    white-space: nowrap;
}
.modal-actions button svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 980px) {
    .dev-grid { grid-template-columns: 1fr; }
}
.docs-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.docs-hero h1 { font-size: 32px; letter-spacing: -0.03em; }
.docs-hero .lede { max-width: 62ch; margin-top: 8px; }
.docs-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.docs-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.docs-quick { padding: 16px 18px; }
.docs-quick h2 { font-size: 15px; margin: 0 0 8px; }
.docs-index { display: grid; gap: 10px; margin: 0 0 14px; }
.docs-index-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.docs-index-row > span { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); min-width: 92px; }
.docs { display: grid; gap: 14px; max-width: 920px; }
.docs h2 { font-size: 18px; margin: 0; }
.docs h3 { font-size: 15px; margin: 4px 0 0; }
.docs p, .docs li { line-height: 1.55; }
.docs ol, .docs ul { margin: 0; padding-left: 1.2rem; }
.docs li + li { margin-top: 6px; }
.docs a { color: var(--accent); }
.docs code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.92em; background: #f4f5f7; padding: 1px 5px; border-radius: 6px; }
.docs pre { margin-top: 4px; }
.docs table { margin-top: 4px; }
.docs th, .docs td { vertical-align: top; white-space: normal; }
.docs-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.docs-toc a { color: var(--ink); text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 650; }
@media (max-width: 860px) {
    .docs-hero { grid-template-columns: 1fr; }
}
.builder-context { flex-wrap: wrap; }
.builder-identity .bot-nav { margin: 10px 0 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button.active-tab { background: var(--accent); color: white; border-color: transparent; box-shadow: 0 8px 16px rgba(255, 79, 31, 0.18); }
.meta-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -6px 0 14px; color: var(--muted); font-size: 13px; }
.hidden { display: none; }

@media (max-width: 1180px) {
    .kpi-grid, .chart-grid, .lower-grid, .form-grid { grid-template-columns: 1fr 1fr; }
    .lower-grid, .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
    button.sidebar-collapse { display: none; }
    body { overflow: auto; height: auto; }
    .shell { height: auto; overflow: visible; display: block; margin: 0; border-radius: 0; min-height: 100vh; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 12; }
    .nav { display: flex; gap: 6px; overflow: auto; }
    .nav-label { display: none; }
    .sidebar-foot { margin-top: 10px; }
    .split, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .kpi-grid, .chart-grid { grid-template-columns: 1fr; }
    .header { flex-wrap: wrap; }
    .search-wrap { max-width: none; order: 3; flex-basis: 100%; }
    .header-actions { margin-left: 0; }
    .profile-name { display: none; }
    .topbar { align-items: flex-start; flex-direction: column; }
}

.shell.builder-mode {
    height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    background: #f7f8fa;
}
.shell.page-flat {
    height: calc(100vh - 28px);
    margin: 14px;
    border-radius: 28px;
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.08);
    background: var(--canvas);
}
.shell.page-flat .header {
    background: rgba(245, 246, 248, 0.92);
    border-bottom: 0;
    padding: 18px 22px 10px;
}
.shell.builder-mode .workspace {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.shell.builder-mode .header {
    flex: none;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 18px;
}
.studio-mark { display: none; }
body.is-studio { background: #f4f1ea; }
body.is-studio .shell.builder-mode {
    grid-template-columns: minmax(0, 1fr);
    background: #f4f1ea;
}
body.is-studio .sidebar,
body.is-studio .workspace > .header { display: none; }
body.is-studio .content.builder-content { padding: 8px 10px 10px; }
body.is-studio .builder { gap: 0; }
body.is-studio .builder-context {
    align-items: center;
    height: 44px;
    margin: -8px -10px 8px;
    padding: 0 12px;
    background: #fff;
    border-bottom: 1px solid #ebe6dc;
    box-shadow: none;
}
body.is-studio .builder-identity {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
body.is-studio .back-link,
body.is-studio .bot-nav { display: none; }
body.is-studio .studio-mark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #1c1916;
    text-decoration: none;
    flex: none;
}
body.is-studio .studio-glyph {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: linear-gradient(145deg, #ff7a4d, #ff4f1f);
    position: relative;
    flex: none;
    box-shadow: 0 4px 10px rgba(255, 79, 31, 0.28);
}
body.is-studio .studio-glyph::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    width: 8px;
    height: 8px;
    border: 1.4px solid #fff;
    border-radius: 2px;
}
body.is-studio .studio-glyph::after {
    content: "";
    position: absolute;
    right: 3px;
    top: 3px;
    width: 5px;
    height: 5px;
    border-top: 1.4px solid #fff;
    border-right: 1.4px solid #fff;
}
body.is-studio .studio-word {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    line-height: 1;
}
body.is-studio .studio-word small {
    color: #9a9186;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 750;
}
body.is-studio .studio-word strong {
    color: #1c1916;
    font-size: 13px;
    letter-spacing: -0.02em;
}
body.is-studio .builder-title-row { margin: 0; min-width: 0; }
body.is-studio .builder-title-row::before {
    content: "";
    width: 1px;
    height: 16px;
    margin-right: 8px;
    background: #e6dfd4;
}
body.is-studio .builder-title-row h1,
body.is-studio .name-input {
    color: #1c1916;
    font-size: 15px;
    font-weight: 720;
}
body.is-studio .builder-meta { margin: 0; color: #8d857a; font-size: 11px; white-space: nowrap; }
body.is-studio button.icon-quiet { color: #8d857a; width: 24px; height: 24px; }
body.is-studio button.icon-quiet:hover { background: #f4f1ea; color: #1c1916; }
body.is-studio .builder-actions { gap: 6px; }
body.is-studio .builder-actions select {
    height: 30px;
    min-width: 108px;
    padding: 0 30px 0 12px;
    border-radius: 999px;
    background-color: #f7f4ee;
    color: #1c1916;
    border-color: #e6dfd4;
    font-size: 11px;
}
body.is-studio .builder-actions .ghost,
body.is-studio .builder-actions button[data-save] {
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
}
body.is-studio .builder-actions .ghost {
    background: #fff;
    color: #1c1916;
    border-color: #e6dfd4;
}
body.is-studio .builder-actions .ghost:hover { background: #f7f4ee; }
body.is-studio .builder-actions button[data-save] { box-shadow: 0 4px 10px rgba(255, 79, 31, 0.22); }
body.is-studio .builder-actions .icon-btn {
    width: 30px;
    height: 30px;
    background: #fff;
    color: #1c1916;
    border-color: #e6dfd4;
}
body.is-studio .builder-actions .icon-btn:hover { background: #f7f4ee; }
body.is-studio .builder-stage { gap: 10px; }
body.is-studio .canvas-frame,
body.is-studio .palette-panel,
body.is-studio .inspector-panel {
    border: 1px solid #ebe4d8;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(72, 52, 24, 0.06);
    background: #fff;
}
body.is-studio .canvas-frame,
body.is-studio .canvas-wrap {
    background:
        radial-gradient(ellipse at 50% 18%, #fff 0%, rgba(255, 255, 255, 0) 46%),
        #f7f3eb;
}
body.is-studio .canvas-world {
    background-color: transparent;
    background-image: radial-gradient(#ddd4c6 1.15px, transparent 1.15px);
}
body.is-studio .canvas-toolbar {
    background: rgba(255, 252, 247, 0.88);
    border-bottom-color: #efe8dc;
    backdrop-filter: blur(8px);
}
.content.builder-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 14px 14px;
    overflow: hidden;
}
.builder {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.builder-context {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex: none;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #6d7380;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
}
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--ink); }
.builder-title-row { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.builder-title-row h1 { font-size: 22px; letter-spacing: -0.03em; font-weight: 750; }
button.icon-quiet {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #8b919a;
    box-shadow: none;
    display: grid;
    place-items: center;
}
button.icon-quiet:hover { background: #fff; color: var(--ink); }
button.icon-quiet svg, .builder-actions .ghost svg, .more-menu svg { width: 16px; height: 16px; }
.name-input {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.03em;
    width: min(320px, 46vw);
    padding: 2px 8px;
    border-radius: 10px;
}
.builder-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.builder-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.builder-actions select {
    width: auto;
    min-width: 118px;
    border-radius: 12px;
    background-color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 9px 34px 9px 12px;
}
a.button.ghost, button.ghost {
    background: transparent;
    color: #3d434b;
    border: 0;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
a.button.ghost:hover, button.ghost:hover { background: #f3f4f6; color: var(--ink); }
.more-wrap { position: relative; }
.more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 190px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 12;
}
.more-menu button {
    width: 100%;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    text-align: left;
    border-radius: 8px;
    font-weight: 650;
    padding: 8px 10px;
}
.more-menu button:hover { background: #f6f7f9; }
.more-menu button.danger-item { color: var(--danger); }
.more-menu button.danger-item:hover { background: var(--danger-soft); }
.builder-note { flex-basis: 100%; margin: 0; text-align: right; font-size: 13px; }
button.panel-toggle {
    display: none;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: none;
    padding: 8px 12px;
}
.builder-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr) 320px;
    gap: 12px;
}
.stage-split {
    position: absolute;
    grid-column: 1 / -1;
    grid-row: 1;
    top: 10px;
    bottom: 10px;
    z-index: 4;
    width: 14px;
    transform: translateX(-50%);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    min-height: 0;
    cursor: col-resize;
}
.stage-split::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 42px;
    transform: translate(-50%, -50%);
    border-radius: 4px;
    background: #e4e7ec;
    transition: height 0.12s ease, background 0.12s ease;
}
.stage-split:hover::after,
.stage-split:focus-visible::after,
.stage-split.is-dragging::after { height: 64px; background: #ff4f1f; }
body.is-pane-drag, body.is-pane-drag * { cursor: col-resize !important; user-select: none !important; }
.palette-panel, .inspector-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.palette-head { padding: 10px 12px 0; }
.palette-head h2, .inspector-stack h3 { font-size: 12px; font-weight: 750; }
.palette-tabs {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 0 12px;
    flex: none;
}
.palette-tabs button {
    background: transparent;
    color: #8b919a;
    box-shadow: none;
    border-radius: 0;
    padding: 8px 0 6px;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 700;
    min-height: 0;
}
.palette-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.palette-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.palette-pane .palette-list { flex: 1; }
.palette-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 10px;
    padding: 0 8px;
    background: #f6f7f9;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #9aa1aa;
}
.palette-search svg { width: 13px; height: 13px; flex: none; }
.palette-search input { border: 0; background: transparent; box-shadow: none; padding: 6px 0; font-size: 12px; font-weight: 550; min-height: 0; }
.palette-search input:focus { box-shadow: none; }
.palette-list { overflow: auto; padding: 0 6px 6px; display: grid; gap: 2px; align-content: start; }
.palette-hint { margin: 0; padding: 0 12px 10px; color: var(--muted); font-size: 11px; font-weight: 600; }
.palette-card {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: #fff;
    color: var(--ink);
    border: 1px solid transparent;
    box-shadow: none;
    border-radius: 8px;
    padding: 5px 6px;
    font-weight: 650;
    min-height: 0;
}
button.palette-card:hover { background: #fafbfc; border-color: var(--line); }
.palette-card.is-static { cursor: default; }
.var-section { display: grid; }
.var-section-body { display: none; }
.var-section.is-open > .var-section-body { display: grid; gap: 2px; }
.palette-panel .var-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 4px 0 2px;
    padding: 6px 8px;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    border-radius: 8px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 750;
}
.palette-panel .var-section-head:hover { background: #f6f7f9; color: var(--ink); }
.palette-panel .var-section-head em {
    margin-left: auto;
    font-style: normal;
    letter-spacing: 0;
    text-transform: none;
    font-size: 11px;
    background: #f3f4f6;
    color: #5c6370;
    border-radius: 999px;
    padding: 1px 7px;
}
.var-chevron {
    width: 7px;
    height: 7px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(-45deg);
    flex: none;
}
.var-section.is-open > .var-section-head .var-chevron { transform: rotate(45deg); }
.var-action-head { display: flex; align-items: center; min-width: 0; }
.palette-panel .var-twist {
    width: 22px;
    height: 28px;
    padding: 0;
    flex: none;
    background: transparent;
    color: #8b919a;
    box-shadow: none;
    border-radius: 8px;
}
.palette-panel .var-twist:hover { background: #f3f4f6; color: var(--ink); }
.var-twist::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(-45deg);
    display: block;
    margin-left: 2px;
}
.var-action.is-open > .var-action-head .var-twist::before { transform: rotate(45deg); margin-left: 0; margin-top: -2px; }
.var-action-card { flex: 1; min-width: 0; }
.var-method { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; flex: none; }
.var-leaves {
    display: none;
    margin: 0 4px 6px 28px;
    padding-left: 10px;
    border-left: 1px solid var(--line);
}
.var-action.is-open > .var-leaves,
.var-nest.is-open > .var-leaves { display: grid; gap: 1px; }
.palette-panel .var-leaf {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    border-radius: 8px;
    padding: 5px 8px;
    font-weight: 650;
}
.palette-panel .var-leaf:hover { background: #f6f7f9; }
.var-leaf strong { display: block; font-size: 12px; line-height: 1.2; }
.var-leaf small { display: block; color: var(--muted); font-size: 10px; font-weight: 600; margin-top: 1px; }
.var-leaf.is-copied small { color: #14915f; }
.var-dot { width: 7px; height: 7px; border-radius: 99px; background: #3b82f6; flex: none; }
.var-dot.is-branch { background: transparent; box-shadow: inset 0 0 0 1.5px #3b82f6; }
.palette-panel .var-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 4px 8px 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}
.palette-panel .var-pager button {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
    font-size: 16px;
    line-height: 1;
}
.palette-pane.is-filtering .var-pager { display: none; }
.palette-pane.is-filtering .var-action:not([hidden]) > .var-leaves,
.palette-pane.is-filtering .var-nest:not([hidden]) > .var-leaves { display: grid; }
.palette-group { display: grid; gap: 4px; }
.palette-group h3 {
    margin: 8px 8px 2px;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.palette-group .muted { margin: 4px 8px 8px; font-size: 12px; }
.palette-card strong, .flow-fallback button strong, .canvas-search-results button strong, .incoming-list button strong { display: block; font-size: 12px; line-height: 1.2; }
.palette-card small, .flow-fallback button small, .canvas-search-results button small, .incoming-list button small { display: block; color: var(--muted); font-size: 10px; font-weight: 550; margin-top: 1px; }
.node-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: none;
    background: var(--node-tint, #f6f7f9);
    color: var(--node-accent, var(--accent));
}
.node-icon svg { width: 18px; height: 18px; }
.palette-panel .node-icon,
.inspector-panel .node-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
}
.palette-panel .node-icon svg,
.inspector-panel .node-icon svg { width: 12px; height: 12px; }
.flow-fallback { display: none; }
.builder-stage > [data-canvas] { min-width: 0; min-height: 0; height: 100%; }
.canvas-frame {
    position: relative;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.canvas-toolbar {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    flex: none;
}
button.tool-btn,
a.tool-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #5c6370;
    box-shadow: none;
    display: grid;
    place-items: center;
    flex: none;
}
button.tool-btn svg,
a.tool-btn svg { width: 16px; height: 16px; }
button.tool-btn:hover,
a.tool-btn:hover { background: #f4f5f7; }
a.tool-btn { text-decoration: none; color: #5c6370; }
a.tool-btn.tool-studio { color: #111; }
a.tool-btn.tool-studio:hover { background: #111; color: #fff; }
button.tool-btn.is-on { background: var(--accent-soft); color: var(--accent); }
button.tool-btn.danger { background: transparent; color: #d1263d; }
button.tool-btn.danger:hover { background: var(--danger-soft); }
button.tool-btn:disabled { opacity: 0.35; }
.tool-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; flex: none; }
.tool-menu { position: relative; flex: none; }
.tool-menu-btn {
    height: 32px;
    padding: 0 8px 0 10px;
    border-radius: 8px;
    background: #f6f7f9;
    color: #3d434b;
    box-shadow: none;
    font-size: 12px;
    font-weight: 750;
    gap: 6px;
}
.tool-menu-btn svg { width: 14px; height: 14px; flex: none; }
.tool-menu-btn svg:last-child { width: 12px; height: 12px; opacity: 0.55; }
.tool-menu-btn:hover, .tool-menu-btn[aria-expanded="true"] { background: #eceef2; }
.tool-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 8;
    min-width: 168px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 2px;
}
.tool-dropdown.is-rich {
    min-width: 248px;
    padding: 8px;
    border-radius: 16px;
    gap: 2px;
}
.tool-dropdown button {
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 650;
}
.tool-dropdown button:hover { background: #f6f7f9; }
.menu-kicker {
    margin: 4px 8px 2px;
    color: #9aa1aa;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.menu-rule {
    height: 1px;
    margin: 6px 4px;
    background: var(--line);
}
.menu-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 0;
    width: 100%;
    padding: 8px;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    text-align: left;
}
.menu-row:hover:not(:disabled) { background: #f6f7f9; }
.menu-row:disabled { opacity: 0.38; }
.menu-row.is-danger { color: var(--danger); }
.menu-row.is-danger:hover:not(:disabled) { background: var(--danger-soft); }
.menu-ico {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: none;
    background: #f3f4f6;
    color: #3d434b;
}
.menu-ico svg { width: 15px; height: 15px; }
.menu-ico.tone-blue { background: #eaf2ff; color: #2f6fed; }
.menu-ico.tone-green { background: #e8f8ee; color: #14915f; }
.menu-ico.tone-amber { background: #fff6dd; color: #b86e00; }
.menu-ico.tone-violet { background: #f3eefe; color: #7c3aed; }
.menu-ico.tone-ink { background: #f3f4f6; color: #1c1e21; }
.menu-ico.tone-danger { background: #fdecee; color: #d1263d; }
.menu-copy { min-width: 0; display: grid; gap: 1px; }
.menu-copy strong { font-size: 13px; font-weight: 750; line-height: 1.2; }
.menu-copy small { color: #8b919a; font-size: 11px; font-weight: 600; line-height: 1.25; }
.menu-row kbd {
    margin-left: 4px;
    padding: 2px 6px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #fafbfc;
    color: #8b919a;
    font: 600 10px/1 ui-monospace, Consolas, monospace;
}
.canvas-context {
    position: absolute;
    z-index: 30;
    width: 188px;
    padding: 4px;
    background: #fff;
    border: 1px solid #d9dde3;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
    display: grid;
    gap: 1px;
}
.ctx-item {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 28px;
    padding: 0 8px;
    border-radius: 4px;
    background: transparent;
    color: #1c1e21;
    box-shadow: none;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
}
.ctx-item:hover:not(:disabled) { background: #f0f2f5; }
.ctx-item:disabled { opacity: 0.35; }
.ctx-item.is-danger { color: #d1263d; }
.ctx-item.is-danger:hover:not(:disabled) { background: #fdecee; }
.ctx-ico {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    color: #5c6370;
}
.ctx-ico svg { width: 13px; height: 13px; }
.ctx-item.is-danger .ctx-ico { color: #d1263d; }
.ctx-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item kbd {
    color: #9aa1aa;
    font: 600 10px/1 ui-monospace, Consolas, monospace;
}
.ctx-rule {
    height: 1px;
    margin: 3px 4px;
    background: #eceef2;
}
.z-order-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.z-order-row button {
    width: 100%;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
}
.zoom-cluster { display: flex; align-items: center; gap: 0; background: #f6f7f9; border-radius: 10px; padding: 0 2px; }
.zoom-readout { min-width: 44px; text-align: center; font-size: 12px; font-weight: 750; color: #4b5160; }
.tool-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 150px;
    max-width: 210px;
    background: #f6f7f9;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 10px;
    color: #9aa1aa;
}
.tool-search svg { width: 15px; height: 15px; flex: none; }
.tool-search input { border: 0; background: transparent; box-shadow: none; width: 100%; padding: 6px 0; font-size: 13px; font-weight: 550; }
.tool-search input:focus { box-shadow: none; }
.canvas-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #f6f7f9;
    border: 0;
    border-radius: 0;
    touch-action: none;
}
.canvas-wrap.is-dropping { box-shadow: inset 0 0 0 2px #ffb199; }
.canvas-world {
    position: absolute;
    transform-origin: 0 0;
    background-color: #f6f7f9;
    background-image: radial-gradient(#d5d8de 1.15px, transparent 1.15px);
    background-size: 20px 20px;
}
.canvas-world.grid-off { background-image: none; }
.canvas-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    gap: 6px;
    color: var(--muted);
    pointer-events: none;
    padding: 24px;
}
.canvas-empty strong { color: var(--ink); font-size: 16px; }
.canvas-empty p { font-size: 13px; font-weight: 550; }
.canvas-search-results {
    position: absolute;
    top: 54px;
    right: 12px;
    z-index: 5;
    width: 260px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: grid;
    gap: 4px;
}
.canvas-search-results.hidden { display: none; }
.canvas-search-results button, .flow-fallback button, .incoming-list button {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    border-radius: 8px;
    padding: 4px 6px;
    font-weight: 650;
    min-height: 0;
    font-size: 12px;
}
.canvas-search-results button:hover, .flow-fallback button:hover, .incoming-list button:hover { background: #f6f7f9; }
.canvas-search-results .node-icon, .flow-fallback .node-icon, .incoming-list .node-icon { width: 22px; height: 22px; border-radius: 6px; }
.canvas-search-results .node-icon svg, .flow-fallback .node-icon svg, .incoming-list .node-icon svg { width: 12px; height: 12px; }
.flow-node {
    position: absolute;
    min-width: 220px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--node-accent, #d7dbe3) 28%, #e6e8ee);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
    user-select: none;
    z-index: 1;
}
.flow-node.selected { box-shadow: 0 0 0 2px var(--node-accent, #2f6fed), 0 16px 30px rgba(16, 24, 40, 0.08); }
.start-node.selected { box-shadow: 0 0 0 2px #178a45, 0 16px 30px rgba(23, 138, 69, 0.12); }
.node-head { height: 46px; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 0 10px; cursor: grab; }
.node-head:active { cursor: grabbing; }
.flow-node .node-icon { width: 28px; height: 28px; border-radius: 8px; }
.flow-node .node-icon svg { width: 15px; height: 15px; }
.node-title { color: var(--node-accent); font-size: 13px; font-weight: 750; }
.start-pill {
    margin-left: auto;
    background: #e8f8ee;
    color: #178a45;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    padding: 2px 7px;
}
.node-preview {
    height: 40px;
    box-sizing: border-box;
    padding: 0 12px 8px 46px;
    color: #6d7380;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
}
.options-block { padding-bottom: 8px; }
.node-choice, .port-line {
    height: 30px;
    box-sizing: border-box;
    margin: 0 12px 4px;
    padding: 0 18px 0 10px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    background: #fafbfc;
    border: 1px solid #eef0f3;
    font-size: 12px;
    font-weight: 700;
    color: #3a4048;
}
.node-choice.is-empty { color: var(--muted); font-weight: 600; }
.node-choice span, .port-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-block { padding-top: 4px; padding-bottom: 8px; }
button.port,
.port {
    width: 8px;
    height: 8px;
    min-width: 8px;
    min-height: 8px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-sizing: border-box;
    position: absolute;
    z-index: 2;
    box-shadow: none;
    line-height: 0;
}
.port.out {
    right: -4px;
    background: #fff;
    border-color: #2f6fed;
    box-shadow: 0 0 0 1px rgba(47, 111, 237, 0.22);
    cursor: grab;
}
.port.out.side-top, .port.out.side-bottom, .port.out.side-left { right: auto; }
.port.out.side-left { left: -4px; }
.port.in {
    left: -4px;
    border-radius: 2px;
    background: #fff;
    border-color: #14915f;
    box-shadow: 0 0 0 1px rgba(20, 145, 95, 0.2);
    pointer-events: none;
}
button.port.out::after,
button.port.in::after { content: ""; position: absolute; inset: -8px; }
button.port.in { pointer-events: auto; cursor: grab; }
.port.out.is-pinned { background: #2f6fed; }
.port.in.is-pinned { background: #14915f; }
button.port.in:hover { background: #14915f; box-shadow: 0 0 0 3px rgba(20, 145, 95, 0.16); }
.port.in.side-top, .port.in.side-bottom, .port.in.side-right { left: auto; }
.port.in.side-right { right: -4px; }
.palette-card .start-play, .flow-fallback .start-play { width: 22px; height: 22px; }
.palette-card .start-play svg, .flow-fallback .start-play svg { width: 11px; height: 11px; }
button.port.out:hover,
.port.out:hover {
    background: #2f6fed;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
    transform: none;
}
.port-tag.side-top, .port-tag.side-bottom { right: auto; }
.port-tag {
    position: absolute;
    right: 16px;
    max-width: 92px;
    color: #2f6fed;
    font-size: 10px;
    font-weight: 750;
    line-height: 16px;
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.node-resize {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 14px;
    height: 14px;
    padding: 0;
    border-radius: 4px;
    background:
        linear-gradient(135deg, transparent 50%, #c5cad3 50%, #c5cad3 62%, transparent 62%),
        linear-gradient(135deg, transparent 68%, #c5cad3 68%, #c5cad3 80%, transparent 80%);
    box-shadow: none;
    cursor: nwse-resize;
    opacity: 0;
}
.flow-node.selected .node-resize, .flow-node:hover .node-resize { opacity: 1; }
.start-node {
    --node-accent: #178a45;
    min-width: 0;
    background: linear-gradient(180deg, #f7fdf9 0%, #eef8f2 100%);
    border-color: #b7ebc9;
    box-shadow: 0 10px 22px rgba(23, 138, 69, 0.08);
}
.start-node .node-head { height: 100%; }
.start-node .node-head span:last-child { display: grid; min-width: 0; }
.start-node small { color: #3d8b5f; font-size: 11px; font-weight: 650; }
.start-node .node-title { color: #146c38; }
.start-marker {
    position: absolute;
    width: 168px;
    height: 62px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    background: #f3fbf6;
    border: 1px solid #b7ebc9;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(23, 138, 69, 0.08);
    z-index: 1;
    cursor: pointer;
}
.start-play {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #178a45;
    color: #fff;
    flex: none;
}
.start-play svg { width: 14px; height: 14px; }
.start-marker strong { display: block; color: #146c38; font-size: 13px; }
.start-marker small { display: block; color: #3d8b5f; font-size: 11px; font-weight: 650; }
.map-node { position: absolute; border-radius: 3px; opacity: 0.92; }
.map-node.is-selected { outline: 1px solid #1c1e21; z-index: 1; }
.map-view {
    position: absolute;
    border: 1.5px solid rgba(255, 79, 31, 0.75);
    background: rgba(255, 79, 31, 0.06);
    border-radius: 4px;
    pointer-events: none;
}
.inspector-tabs {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 0 12px;
    flex: none;
}
.inspector-tabs button {
    background: transparent;
    color: #8b919a;
    box-shadow: none;
    border-radius: 0;
    padding: 8px 0 6px;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 700;
    min-height: 0;
}
.inspector-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.inspector-scroll { overflow: auto; padding: 10px 12px; flex: 1; min-height: 0; }
.inspector-stack { display: grid; gap: 8px; align-content: start; }
.inspector-identity { display: flex; gap: 8px; align-items: center; }
.inspector-identity strong { display: block; font-size: 13px; font-weight: 750; }
.inspector-identity p { color: var(--muted); font-size: 11px; font-weight: 600; margin-top: 1px; line-height: 1.35; }
.inspector-stack .field span, label.field > span { color: #6d7380; font-size: 11px; font-weight: 700; }
.inspector-stack label.field,
.inspector-stack .field { gap: 4px; font-size: 12px; }
.inspector-stack .secondary, .inspector-foot button { width: 100%; }
.inspector-panel input,
.inspector-panel textarea,
.inspector-panel select,
.inspector-panel button:not(.inspector-tabs button):not(.token-insert):not(.choice-remove):not(.extra-remove) {
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}
.inspector-panel textarea { min-height: 64px; padding: 6px 8px; line-height: 1.4; }
.inspector-panel select { padding-right: 28px; background-position: right 8px center; }
.inspector-panel .token-field .token-input,
.inspector-panel .token-field .token-mirror {
    font-size: 12px;
    line-height: 1.4;
    padding: 6px 36px 6px 8px;
}
.inspector-panel button.token-insert {
    height: 20px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 18px;
    border-radius: 5px;
}
.inspector-panel .choice-card {
    grid-template-columns: 22px minmax(0, 1fr) 22px;
    gap: 2px 6px;
    padding: 6px;
    border-radius: 10px;
}
.inspector-panel .choice-index {
    width: 22px;
    height: 22px;
    font-size: 10px;
}
.inspector-panel button.choice-remove {
    width: 22px;
    height: 22px;
    font-size: 14px;
}
.inspector-panel .extra-card {
    gap: 4px;
    padding: 8px 10px 8px 12px;
    border-radius: 10px;
}
.inspector-panel .extra-card > input {
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 12px;
}
.inspector-panel .line-mark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background:
        linear-gradient(var(--line-color), var(--line-color)) center / 14px 2px no-repeat,
        color-mix(in srgb, var(--line-color) 14%, white);
}
.inspector-panel .line-preview {
    padding: 6px 8px 4px;
    border-radius: 10px;
}
.inspector-panel .line-preview svg { height: 32px; }
.inspector-panel .line-preview span { font-size: 10px; }
.inspector-panel .line-pattern {
    padding: 6px 2px 4px;
    border-radius: 8px;
}
.inspector-panel .line-pattern small { font-size: 9px; }
.inspector-panel .line-swatch { width: 18px; height: 18px; }
.inspector-panel .line-toggle {
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
}
.inspector-panel .line-toggle strong { font-size: 12px; }
.inspector-panel .line-toggle small { font-size: 10px; }
.inspector-panel .z-order-row button { min-height: 26px; font-size: 11px; padding: 0 6px; }
.inspector-panel .start-play { width: 22px; height: 22px; }
.inspector-panel .start-play svg { width: 11px; height: 11px; }
input.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #4b5160; background: #f6f7f9; }
.inspector-foot { padding: 8px 12px 10px; border-top: 1px solid var(--line); flex: none; }
button.danger-quiet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    color: var(--danger);
    border: 1px solid #f3c5cb;
    box-shadow: none;
    font-size: 12px;
}
button.danger-quiet svg { width: 13px; height: 13px; }
button.danger-quiet:hover { background: var(--danger-soft); }
.inspector-empty {
    margin: auto;
    text-align: center;
    padding: 24px 16px;
    display: grid;
    justify-items: center;
    gap: 6px;
}
.inspector-empty h2 { font-size: 13px; }
.inspector-empty p { color: var(--muted); font-size: 11px; font-weight: 550; max-width: 200px; line-height: 1.4; }
.inspector-checks {
    background: #fff6f2;
    color: #9a3412;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
}
.inspector-checks ul { margin: 4px 0 0; padding-left: 14px; display: grid; gap: 3px; }
.start-note {
    margin: 0;
    background: var(--success-soft);
    color: #146c38;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
}
.incoming-list { display: grid; gap: 4px; }
.flow-fallback { padding: 0 10px 14px; }
.flow-fallback h3 { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin: 4px 6px 8px; }
.flow-fallback [data-flow-list] { display: grid; gap: 4px; }
button.drawer-scrim {
    position: absolute;
    inset: 0;
    z-index: 5;
    border: 0;
    border-radius: 16px;
    background: rgba(16, 24, 40, 0.28);
    box-shadow: none;
    padding: 0;
}

@media (max-width: 1200px) {
    .stage-split { display: none; }
    .panel-toggle { display: inline-flex; }
    .builder-stage { grid-template-columns: minmax(0, 1fr); }
    .palette-panel, .inspector-panel {
        position: absolute;
        z-index: 6;
        top: 0;
        bottom: 0;
        width: min(340px, calc(100% - 20px));
        transition: transform 0.2s ease;
    }
    .palette-panel { left: 0; transform: translateX(calc(-100% - 16px)); }
    .inspector-panel { right: 0; transform: translateX(calc(100% + 16px)); }
    .palette-panel.is-open, .inspector-panel.is-open { transform: none; }
    .flow-fallback { display: block; }
    .palette-hint { display: none; }
    .tool-search { min-width: 0; max-width: 140px; }
}
@media (max-width: 1100px) {
    .shell.builder-mode { display: block; height: 100vh; overflow: hidden; }
    .shell.builder-mode .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 260px;
        height: 100vh;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        z-index: 30;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        background: #fff;
    }
    .shell.builder-mode.sidebar-open .sidebar { transform: none; }
    .shell.builder-mode.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(16, 24, 40, 0.28);
        z-index: 25;
    }
    .shell.builder-mode .nav { display: grid; overflow: visible; }
    .shell.builder-mode .nav-label { display: block; }
    .shell.builder-mode .workspace { height: 100vh; }
}
@media (max-width: 760px) {
    .builder-context { flex-direction: column; }
    body.is-studio .builder-context { flex-direction: row; align-items: center; height: 44px; }
    body.is-studio .builder-meta { display: none; }
    .builder-actions { justify-content: flex-start; }
    .canvas-toolbar { overflow: auto; }
    .shell.builder-mode .header { padding: 10px 12px; }
    .api-studio { grid-template-columns: 1fr; }
    .schema-stage { grid-template-columns: 1fr; }
    .api-rail { position: static; }
}

.api-page { display: flex; flex-direction: column; gap: 14px; }
.api-studio {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.api-rail {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.rail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rail-head h1 { font-size: 22px; letter-spacing: -0.03em; }
.rail-head .button { padding: 8px 14px; }
.rail-note, .rail-empty, .rail-docs { color: var(--muted); font-size: 13px; line-height: 1.45; }
.rail-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.rail-list { display: flex; flex-direction: column; gap: 8px; }
.api-card {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--canvas);
    text-decoration: none;
}
.api-card strong { font-size: 14px; }
.api-card em {
    font-style: normal;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.api-card.active { border-color: #ffb199; background: var(--accent-soft); }
.api-card.session-card { background: linear-gradient(180deg, #fff8f5, #fff); }
.api-card.draft { border-style: dashed; color: var(--accent); font-weight: 700; }
.verb-chip, .verb {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 0;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.verb { min-width: 88px; justify-content: center; cursor: pointer; }
.verb-GET { background: var(--success-soft); color: var(--success); }
.verb-POST { background: var(--accent-soft); color: var(--accent); }
.verb-PUT { background: #e8f1ff; color: #1d5fd0; }
.verb-PATCH { background: #f3e8ff; color: #7a3ff2; }
.verb-DELETE { background: var(--danger-soft); color: var(--danger); }
.api-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background:
        radial-gradient(520px 180px at 100% 0%, rgba(255, 79, 31, 0.08), transparent 60%),
        var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.api-hero { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.hero-copy { flex: 1; min-width: 0; display: grid; gap: 6px; }
.hero-kicker { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.lock-pill { background: var(--accent-soft); color: #c2410c; border-radius: 999px; padding: 4px 8px; letter-spacing: 0.04em; font-size: 11px; font-weight: 750; text-transform: uppercase; }
.hero-name, .hero-desc {
    border: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}
.hero-name { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; }
.hero-desc { color: #3a4048; font-weight: 500; }
.hero-name:focus, .hero-desc:focus { outline: none; box-shadow: none; }
.hero-actions { display: flex; gap: 8px; align-items: center; }
.api-banner {
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f7f8fa;
    color: #3a4048;
    font-size: 13px;
    line-height: 1.45;
}
.url-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: white;
}
.url-bar input { border: 0; box-shadow: none; background: transparent; }
.url-bar input:focus { box-shadow: none; }
.url-note { color: var(--muted); font-size: 13px; }
.key-row { max-width: 280px; }
.schema-tabs { display: flex; gap: 6px; }
.schema-tabs button {
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
}
.schema-tabs button.active { background: var(--ink); color: white; }
.schema-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 14px;
    align-items: start;
}
.schema-editor { display: flex; flex-direction: column; gap: 10px; }
.schema-intro strong { display: block; margin-bottom: 4px; }
.schema-intro p, .paste-sample p { color: var(--muted); font-size: 13px; font-weight: 500; }
.schema-empty {
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    color: var(--muted);
    background: repeating-linear-gradient(-45deg, #fff, #fff 8px, #f7f8fa 8px, #f7f8fa 16px);
}
.schema-fields { display: flex; flex-direction: column; gap: 8px; }
.schema-field, .header-row {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
}
.field-top, .header-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.header-row { grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr) auto; }
.field-name { font-weight: 700; }
.req-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.req-toggle input { width: auto; }
.type-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.type-pills button, .add-field, .icon-x {
    border: 1px solid var(--line-strong);
    background: white;
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}
.type-pills button.on { background: var(--ink); color: white; border-color: var(--ink); }
.item-pills { align-items: center; }
.item-pills span { font-size: 12px; color: var(--muted); font-weight: 700; }
.icon-x { width: 32px; height: 32px; padding: 0; border-radius: 10px; font-size: 18px; line-height: 1; }
.add-field {
    border-style: dashed;
    width: 100%;
    padding: 12px;
    color: var(--accent);
    background: var(--accent-soft);
}
.add-field.tiny { width: auto; padding: 6px 10px; }
.nested-fields { margin-left: 12px; padding-left: 12px; border-left: 2px solid #ffd5c8; }
.paste-sample, .api-connection {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    background: #fff;
}
.paste-sample summary, .api-connection summary { cursor: pointer; font-weight: 750; }
.paste-sample textarea { margin-top: 10px; }
.schema-preview {
    position: sticky;
    top: 0;
    padding: 14px;
    border-radius: 16px;
    background: #1c1e21;
    color: #f5f6f8;
}
.schema-preview .eyebrow { color: #ffb199; }
.schema-preview pre {
    margin: 8px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #f5f6f8;
    background: transparent;
}
.connection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.try-row { display: flex; align-items: center; gap: 12px; }
.try-row p { color: var(--success); font-size: 13px; font-weight: 700; }
.try-result { max-height: 280px; overflow: auto; }
.action-index { display: grid; gap: var(--space-4); align-content: start; }
.action-index > section > h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 15px; }
.session-panel { padding-bottom: 16px; }
.session-panel .card-head { margin-bottom: 8px; }
.session-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #ffd7cc;
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    background: #fff8f5;
    text-decoration: none;
    box-shadow: none;
}
.session-strip strong { display: block; font-size: 15px; }
.session-strip em { display: block; margin-top: 2px; color: var(--muted); font-style: normal; font-size: 13px; font-weight: 550; }
.session-go { color: var(--accent); font-size: 13px; font-weight: 750; }
.session-strip:hover { border-color: #ffb199; }
.workflow-board { display: flex; flex-direction: column; min-height: 360px; }
.workflow-board .count { color: #5c6370; font-size: 12px; font-weight: 700; background: #f3f4f6; border-radius: 999px; padding: 2px 8px; letter-spacing: 0; }
.workflow-board .table-toolbar h2 { margin: 0; }
.workflow-key { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #4b5160; }
@media (max-width: 760px) {
    .session-strip { grid-template-columns: auto minmax(0, 1fr); }
    .session-strip .lock-pill, .session-go { display: none; }
}
.content:has(.action-page) {
    padding: 0 0 28px;
    background:
        radial-gradient(900px 360px at 8% -8%, rgba(255, 79, 31, 0.10), transparent 55%),
        radial-gradient(700px 280px at 92% 0%, rgba(28, 30, 33, 0.05), transparent 50%),
        linear-gradient(180deg, #f3f4f7 0%, var(--canvas) 220px);
}
.action-page {
    --action-ink: #15171a;
    --action-soft: #f4f5f7;
    --action-line: rgba(28, 30, 33, 0.08);
    width: 100%;
    max-width: none;
    margin-inline: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 24px;
    font-family: "Sora", "Segoe UI", system-ui, sans-serif;
}
.action-page .bot-switch { margin-bottom: 0; }
.action-flash {
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--action-line);
    background: #fff;
}
.action-flash.saved { border-color: #b7e4c7; background: var(--success-soft); color: var(--success); }
.action-config { display: grid; gap: 16px; min-width: 0; }
.action-bar {
    position: sticky;
    top: 72px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 12px 16px;
    border: 1px solid var(--action-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(21, 23, 26, 0.06);
}
.action-bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.action-bar-copy { display: grid; gap: 2px; min-width: 0; }
.action-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}
.action-heading {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--action-ink);
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 999px;
    background: var(--action-soft);
}
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--action-ink); background: #eceef2; }
.name-field { min-width: 0; }
.key-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 550; }
.key-label code,
.action-page .muted code {
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 12px;
    font-weight: 500;
    color: #3d434b;
    background: #eef0f3;
    border-radius: 6px;
    padding: 1px 6px;
}
.action-page input,
.action-page textarea,
.action-page select {
    padding: 10px 12px;
    border-radius: 12px;
    border-color: #e2e5ea;
    background: #fff;
}
.action-page .action-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    min-height: 48px;
}
.action-page button:not(.icon-x):not(.icon-btn):not(.ghost):not(.add-field):not(.token-insert) {
    padding: 8px 14px;
    border-radius: 12px;
}
.card-head > .secondary { width: auto; flex: none; white-space: nowrap; }
.action-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.action-head-actions .secondary, .action-head-actions .ghost { display: inline-flex; align-items: center; gap: 6px; }
.action-head-actions svg, .icon-quiet svg, .icon-x svg { width: 16px; height: 16px; }
.icon-quiet {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}
.icon-quiet:hover { background: #f6f7f9; color: var(--ink); }
.action-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    gap: 20px;
    align-items: start;
    width: 100%;
}
.action-page .config-card {
    position: relative;
    display: grid;
    gap: 16px;
    padding: 22px 22px 20px;
    border: 1px solid var(--action-line);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), #fff 48%),
        #fff;
    box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 14px 36px rgba(21, 23, 26, 0.05);
    overflow: hidden;
}
.action-page .config-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), #ff8a5c);
}
.action-page .section-label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
.action-page .section-label .step {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #15171a;
    color: #fff;
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.action-page .config-card > h2,
.action-page .card-head h2,
.action-page .section-label h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--action-ink);
}
.action-page .config-card > h2::before,
.action-page .card-head h2::before,
.action-page .test-card h2::before { content: none; }
.action-page .card-head {
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.action-page .card-head .muted,
.action-page .section-label .muted { margin-top: 4px; line-height: 1.45; }
.action-page .identity-card {
    background:
        radial-gradient(520px 180px at 100% 0%, rgba(255, 79, 31, 0.10), transparent 60%),
        linear-gradient(180deg, #fff, #fffaf8);
}
.action-page .desc-field { min-width: 0; }
.action-page .count-field { position: relative; display: block; }
.action-page .count-field textarea { padding-bottom: 22px; min-height: 88px; }
.action-page .count-field .count { position: absolute; right: 12px; bottom: 8px; background: transparent; }
.basic-grid, .request-line, .auth-grid { display: grid; gap: 12px; }
.basic-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.request-line { grid-template-columns: 160px minmax(0, 1fr) 120px; align-items: end; }
input.is-known, input.is-known:focus { border-color: #14915f; box-shadow: 0 0 0 3px rgba(20, 145, 95, 0.16); }
input.is-warn, input.is-warn:focus { border-color: #b86e00; box-shadow: 0 0 0 3px rgba(184, 110, 0, 0.16); }
input.is-missing, input.is-missing:focus { border-color: #d92d20; box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.14); }
.access-error, .field-error { color: #d92d20; font-size: 12px; font-weight: 650; margin: 0; }
.field-warn { color: #b86e00; font-size: 12px; font-weight: 650; margin: 6px 0 0; display: block; }
.field.is-invalid .token-input,
.field.is-invalid .token-input:focus,
.choice-card.is-invalid .token-input,
.choice-card.is-invalid .token-input:focus,
.field.is-invalid > input,
.field.is-invalid > input:focus,
.field.is-invalid > textarea,
.field.is-invalid > textarea:focus,
.field.is-invalid > select,
.field.is-invalid > select:focus {
    border-color: #d92d20;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.14);
}
.source-block { display: grid; gap: 4px; }
.suggest-anchor { position: relative; min-width: 0; }
.suggest-anchor:focus-within, .action-page .token-field:focus-within { z-index: 4; }
.suggest-anchor > input, .action-page .param-row .token-field { width: 100%; }
.action-page .param-row .token-field { min-width: 0; }
.action-page .token-field.is-line .token-input,
.action-page .token-field.is-line .token-mirror { padding: 8px 52px 8px 10px; font-size: 14px; }
.action-page .token-field.is-line .token-mirror { color: #111; }
.action-page .token-field.is-line .token-input { color: transparent; caret-color: #111; }
.source-block > .access-error { margin: 0 8px 2px; }
.field-error { display: block; margin-top: 6px; }
.key-lock input { background: #f6f7f9; color: #4b5160; }
.key-lock .key-pin { width: 32px; height: 32px; display: grid; place-items: center; color: #8b919a; }
.key-lock .key-pin svg { width: 16px; height: 16px; }
.auth-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hint { color: var(--muted); font-size: 12px; font-weight: 550; }
.hint.count { justify-self: end; }
.belongs { margin: 0; color: #3a4048; font-size: 13px; }
.belongs strong { font-weight: 750; }
.method-select { font-weight: 800; letter-spacing: 0.04em; }
.method-GET { color: var(--success); }
.method-POST { color: var(--accent); }
.method-PUT { color: #1d5fd0; }
.method-PATCH { color: #7a3ff2; }
.method-DELETE { color: var(--danger); }
.req-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); }
.action-page .req-tabs button {
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    border-radius: 0;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
}
.action-page .req-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.editor-bar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.editor-bar > p { padding-top: 8px; }
.editor-bar p, .editor-help { color: var(--muted); font-size: 13px; font-weight: 500; margin: 0; }
.editor-side { display: grid; justify-items: end; gap: 8px; min-width: min(280px, 100%); }
.paste-toggle { white-space: nowrap; }
.json-preview {
    width: min(320px, 100%);
    margin: 0;
    max-height: 200px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #1c1e21;
    color: #f6f7f8;
    border: 0;
    border-radius: 14px;
    padding: 12px 14px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
    font-weight: 450;
    line-height: 1.45;
}
.schema-editor { display: grid; gap: 12px; }
.schema-fields { display: grid; gap: 8px; }
.param-block { display: grid; gap: 12px; }
.action-page .param-row {
    display: grid;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: linear-gradient(180deg, #fbfbfc, #f6f7f9);
    border: 1px solid #e8eaee;
    border-radius: 14px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}
.action-page .param-block > .param-row {
    grid-template-columns: 14px minmax(140px, 240px) 128px minmax(180px, 1fr) 32px;
    justify-content: start;
}
.action-page .param-source { grid-template-columns: minmax(120px, 200px) 148px minmax(140px, 1fr) 32px; }
.action-page .pair-row { grid-template-columns: minmax(140px, 220px) minmax(160px, 1fr) 32px; }
.action-page .param-row input,
.action-page .param-row select { padding: 8px 10px; }
.param-row {
    display: grid;
    grid-template-columns: 16px minmax(90px, 1fr) 120px minmax(140px, 1fr) 32px;
    gap: 8px;
    align-items: center;
}
.grip {
    width: 10px;
    height: 16px;
    background: radial-gradient(circle, #c5cad1 1.2px, transparent 1.3px);
    background-size: 5px 5px;
}
.action-page .req-toggle { color: #3a4048; font-size: 13px; }
.action-page .req-toggle input { accent-color: var(--accent); width: auto; }
.action-page .icon-x {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    background: transparent;
    color: #8b919a;
    box-shadow: none;
    display: grid;
    place-items: center;
}
.action-page .icon-x:hover { background: var(--danger-soft); color: var(--danger); }
.action-page .add-field {
    border: 1px dashed #ffb399;
    background: linear-gradient(180deg, #fff9f6, #fff1eb);
    color: var(--accent);
    box-shadow: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
}
.action-page .add-field:hover { background: #ffe8df; }
.action-page .lock-pill {
    flex: none;
    align-self: center;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 999px;
    background: #15171a;
    color: #fff;
}
.item-line { display: flex; align-items: center; gap: 8px; margin-left: 24px; font-size: 12px; color: var(--muted); }
.item-line select { max-width: 140px; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary span { display: grid; gap: 2px; }
.fold > summary strong { font-size: 16px; }
.fold > summary em { font-style: normal; color: var(--muted); font-size: 13px; font-weight: 500; }
.fold > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.8px solid #8b919a; border-bottom: 1.8px solid #8b919a; transform: rotate(45deg); margin-right: 6px; }
.fold[open] > summary::after { transform: rotate(225deg); }
.fold[open] > summary { margin-bottom: 12px; }
.test-card,
.action-page .response-rail {
    position: sticky;
    top: 156px;
    max-height: calc(100vh - 176px);
    overflow: auto;
    margin-top: 0;
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 20px 18px 22px;
    border: 1px solid rgba(255, 79, 31, 0.18);
    border-radius: 22px;
    background:
        linear-gradient(165deg, #1c1e21 0%, #2a2d33 42%, #1c1e21 100%);
    color: #f4f5f7;
    box-shadow: 0 18px 40px rgba(21, 23, 26, 0.18);
}
.action-page .response-rail .muted { color: rgba(244, 245, 247, 0.68); }
.action-page .response-rail .muted code {
    color: #ffe0d4;
    background: rgba(255, 79, 31, 0.18);
}
.action-page .rail-head { display: grid; gap: 6px; }
.action-page .rail-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ff8a5c;
}
.test-card h2,
.action-page .response-rail h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
}
.test-card h2::before { content: none; }
.test-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 750; color: #fff; }
.test-card [data-response-note] { margin: 0; overflow-wrap: anywhere; line-height: 1.5; }
.test-card [data-response-note] code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
    color: #3d434b;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 1px 5px;
}
.test-card textarea.code {
    min-height: 112px;
    max-height: 180px;
    resize: vertical;
    background: #1c1e21;
    color: #f6f7f8;
    border: 0;
    border-radius: 14px;
    padding: 14px;
    line-height: 1.45;
}
.test-card textarea.code:focus { box-shadow: 0 0 0 3px rgba(255, 79, 31, 0.2); }
.action-page .send {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff6a3d, var(--accent));
    box-shadow: 0 10px 24px rgba(255, 79, 31, 0.28);
}
.action-page .response-rail pre.code.light {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f0f2f5;
    border-radius: 16px;
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
}
.paste-modal {
    width: min(640px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: transparent;
    box-shadow: none;
}
.paste-modal::backdrop { background: rgba(28, 30, 33, 0.46); }
.confirm-modal { width: min(420px, calc(100vw - 32px)); }
.confirm-sheet { gap: 18px; }
.confirm-sheet .danger { box-shadow: none; }
.paste-sheet {
    display: grid;
    gap: 14px;
    padding: 22px;
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
}
.paste-copy { display: grid; gap: 4px; }
.paste-copy h2 { font-size: 22px; letter-spacing: -0.03em; }
.paste-sheet textarea {
    min-height: 240px;
    background: #1c1e21;
    color: #f6f7f8;
    border: 0;
    border-radius: 16px;
    padding: 16px;
}
.paste-actions { display: flex; justify-content: flex-end; gap: 8px; }
.create-bot-sheet { width: min(460px, 100%); }
.create-bot-sheet label { display: grid; gap: 6px; font-weight: 650; color: var(--ink); }
.create-bot-sheet input,
.create-bot-sheet textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
    box-shadow: none;
}
.create-bot-sheet textarea { resize: vertical; min-height: 88px; }
.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 36px 16px;
    text-align: center;
}
.empty-state strong { font-size: 16px; }
.empty-state .muted { max-width: 36ch; margin: 0; }
.empty-state button { margin-top: 6px; }
.settings-card { max-width: 560px; }
.test-response { display: grid; gap: 8px; min-width: 0; }
.response-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.response-meta [data-time] { color: var(--muted); font-size: 12px; font-weight: 700; }
.response-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
button.icon-btn.response-copy,
button.icon-btn.response-apply {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 10px;
    background: #fff;
}
button.icon-btn.response-copy svg,
button.icon-btn.response-apply svg { width: 15px; height: 15px; }
.ok-pill, .bad-pill { border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 800; }
.ok-pill { background: var(--success-soft); color: var(--success); }
.bad-pill { background: var(--danger-soft); color: var(--danger); }
pre.code.light {
    margin: 0;
    min-width: 0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: #f7f8fa;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--ink);
    line-height: 1.5;
    font-size: 12px;
}
.var-block { display: grid; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.var-head { display: grid; gap: 2px; }
.var-head span { color: var(--muted); font-size: 12px; }
.var-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.var-row input[type="checkbox"] { accent-color: var(--accent); width: auto; }
.more-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 650;
}
.more-menu a:hover { background: #f6f7f9; }
.more-menu button:disabled { opacity: 0.55; }
@media (max-width: 1100px) {
    .action-layout, .basic-grid, .request-line, .auth-grid { grid-template-columns: 1fr; }
    .test-card, .action-page .response-rail { position: static; max-height: none; }
    .param-row, .param-source, .pair-row,
    .action-page .param-row,
    .action-page .param-block > .param-row,
    .action-page .param-source,
    .action-page .pair-row { grid-template-columns: 1fr; }
    .action-bar { align-items: flex-start; flex-wrap: wrap; }
    .action-page { padding-inline: 16px; }
}
@media (min-width: 1800px) {
    .action-page { width: 100% !important; max-width: none !important; }
    .action-layout { grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); }
}
.bot-home { display: block; }
.bot-home-main { min-width: 0; }
.bot-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 20px;
    padding: 6px;
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 24px rgba(16, 24, 40, 0.04);
}
.bot-switch-group {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}
.bot-switch-group + .bot-switch-group {
    padding-left: 8px;
    border-left: 1px solid var(--line);
}
.bot-switch a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 12px;
    color: #5c6370;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    line-height: 1;
}
.bot-switch a svg { width: 15px; height: 15px; flex: none; }
.bot-switch a:hover { color: var(--ink); background: #f6f7f9; }
.bot-switch a.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 14px rgba(255, 79, 31, 0.22);
}
.bot-switch a.active:hover { background: var(--accent-hover); color: #fff; }
body.is-studio .builder-context { height: auto; min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
body.is-studio .bot-switch {
    margin: 0;
    padding: 3px;
    border-radius: 14px;
    background: #f7f4ee;
    border-color: #e6dfd4;
    box-shadow: none;
}
body.is-studio .bot-switch a { padding: 6px 9px; font-size: 12px; }
body.is-studio .bot-switch a svg { width: 14px; height: 14px; }
.bot-home .topbar h2 { font-size: 22px; letter-spacing: -0.03em; }
.bot-home .chart.is-short { height: 180px; grid-template-columns: minmax(0, 1fr); }
.bot-home .bar-label { font-size: 12px; white-space: nowrap; }
.bot-home .table-card .card-head { padding: 16px 20px 0; }
.bot-home .kpi-icon.tone-blue { background: #eaf2ff; color: #3b82f6; }
.bot-home .kpi-icon.tone-green { background: #e7f8f0; color: #18a06a; }
.bot-home .kpi-icon.tone-purple { background: #f4effc; color: #7c5cbf; }
.bot-home .kpi-icon.tone-orange { background: #fff1e8; color: #f97316; }
.kpi-spark { display: flex; align-items: flex-end; gap: 3px; height: 28px; margin-top: auto; padding-top: 12px; }
.kpi-spark i { flex: 1; border-radius: 3px 3px 1px 1px; background: #b9d0ff; display: block; }
.status-layout { display: flex; align-items: center; gap: 18px; min-height: 160px; }
.status-ring { width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.status-ring span { width: 96px; height: 96px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.status-ring strong { font-size: 22px; letter-spacing: -0.03em; }
.status-ring small { color: var(--muted); font-size: 12px; font-weight: 650; }
.status-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; flex: 1; }
.status-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 13px; font-weight: 650; }
.status-legend i { width: 10px; height: 10px; border-radius: 50%; }
.status-legend i.ok { background: #18a06a; }
.status-legend i.progress { background: #7c5cbf; }
.status-legend i.bad { background: #d92d20; }
.status-legend em { color: var(--muted); font-style: normal; }
@media (max-width: 980px) {
    .api-studio, .schema-stage, .connection-grid { grid-template-columns: 1fr; }
    .api-rail, .schema-preview { position: static; }
    .api-hero { flex-direction: column; }
}

.narrow-card { max-width: 640px; }
.form-gap { margin-top: 12px; }
.empty-state {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 28px 16px;
    text-align: center;
}
.empty-state strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.empty-state .muted { max-width: 42ch; margin: 0; font-size: 13px; line-height: 1.45; }
.empty-mark {
    width: 36px;
    height: 36px;
    margin-bottom: 4px;
    border-radius: 12px;
    background: var(--accent-soft) center / 18px 18px no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23ff4f1f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7z'/%3E%3Cpath d='M4 7l8 6 8-6'/%3E%3C/svg%3E");
}
.empty-state.compact { padding: 16px 8px; }
.empty-state .button, .empty-state button { margin-top: 8px; }
.legend { align-items: center; }
.content > section:not(.builder):not(.action-page) {
    width: min(1080px, 100%);
    margin-inline: auto;
}
.content > section:not(.builder):has(.kpi-grid),
.content > section:not(.builder):has(.table-card),
.content > section:not(.builder):has(.action-index),
.content > section:not(.builder):has(.dev-grid),
.content > section:not(.builder):has(.split),
.content > section:not(.builder):has(.detail-grid) {
    width: min(1640px, 100%);
}
.content > section.action-page,
.action-page {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
}
.action-page .action-form,
.action-page .action-layout {
    width: 100%;
    max-width: none;
}
.workspace:has(.action-index) { display: flex; flex-direction: column; }
.workspace:has(.action-index) > .content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.workspace:has(.action-index) > .content > section { display: flex; flex-direction: column; flex: 1; min-height: 0; width: min(1640px, 100%); }
.action-index { flex: 1; grid-template-rows: auto minmax(280px, 1fr); min-height: 420px; }
.workflow-board tbody td.empty { height: 240px; }
.type-pills button,
.schema-tabs button,
.action-page .req-tabs button,
.token-sides button,
.token-chips button,
button.token-insert,
button.extra-remove,
button.choice-remove,
button.icon-x,
button.icon-quiet,
button.sidebar-collapse,
button.toast-x,
button.verb,
.verb,
button.icon-btn,
button.profile {
    min-height: 0;
}
.card .meta-line { margin: 0 0 12px; }
.field-error, .error { font-size: 13px; }
@media (max-width: 1100px) {
    .shell.page-flat {
        height: auto;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
}
@media (min-width: 1600px) {
    .chart { height: 300px; }
    .content > section:not(.builder):has(.kpi-grid),
    .content > section:not(.builder):has(.table-card),
    .content > section:not(.builder):has(.action-index),
    .content > section:not(.builder):has(.dev-grid),
    .content > section:not(.builder):has(.split),
    .workspace:has(.action-index) > .content > section {
        width: min(1760px, 100%);
    }
    .content > section.action-page {
        width: 100%;
        max-width: none;
    }
}
@media (min-width: 1920px) {
    .content { padding-inline: 32px; }
    .chart { height: 320px; }
    .content > section:not(.builder):has(.kpi-grid),
    .content > section:not(.builder):has(.table-card),
    .content > section:not(.builder):has(.action-index),
    .workspace:has(.action-index) > .content > section {
        width: min(1960px, 100%);
    }
    .content > section.action-page {
        width: 100%;
        max-width: none;
    }
}
@media (min-width: 2560px) {
    .shell, .shell.page-flat { margin: 16px; height: calc(100vh - 32px); }
    .chart { height: 340px; }
    .content > section:not(.builder):has(.kpi-grid),
    .content > section:not(.builder):has(.table-card),
    .content > section:not(.builder):has(.action-index),
    .workspace:has(.action-index) > .content > section {
        width: min(2280px, 100%);
    }
    .content > section.action-page {
        width: 100%;
        max-width: none;
    }
    .content > section:not(.builder):not(.action-page):not(:has(.kpi-grid)):not(:has(.table-card)):not(:has(.action-index)):not(:has(.dev-grid)):not(:has(.split)):not(:has(.detail-grid)) {
        width: min(760px, 100%);
    }
}
@media (max-width: 1280px) {
    .clip { max-width: 180px; }
    .toolbar-controls select { min-width: 128px; }
}
