* { box-sizing: border-box; }
:root { color-scheme: dark; --page: #101318; --panel: #171c23; --line: #2e3743; --text: #ecf0f5; --muted: #a6b2c0; --accent: #91dfc2; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.5 system-ui, sans-serif; }
a { color: var(--accent); }
.top { min-height: 64px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px clamp(16px, 4vw, 56px); border-bottom: 1px solid var(--line); background: #141820; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand-icon { color: var(--accent); background: #213932; padding: 3px 8px; border-radius: 6px; }
nav, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.user, .muted { color: var(--muted); }
.small { font-size: .87rem; }
.workspace { max-width: 1360px; margin: auto; padding: 32px clamp(16px, 4vw, 56px); }
.auth { max-width: 460px; margin: 48px auto; padding: 0 16px; }
.auth-card, .padded { padding: 22px; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
h1 { margin: 0 0 4px; font-size: clamp(1.65rem, 4vw, 2.1rem); line-height: 1.15; }
h2, .panel-head label { margin: 0; font-size: 1rem; font-weight: 700; }
p { margin: .55rem 0; }
.auth-card h1 { margin-bottom: 18px; font-size: 1.6rem; }
.auth-card form { margin: 18px 0; }
.stack { display: grid; gap: 16px; min-width: 0; }
label { display: grid; gap: 6px; font-weight: 600; }
input, select, textarea { width: 100%; color: var(--text); background: #11161e; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; font: inherit; }
textarea { display: block; resize: vertical; min-height: 140px; max-height: 55vh; border-width: 0 0 1px; border-radius: 0; padding: 16px; font: .94rem/1.65 ui-monospace, monospace; }
button { border: 1px solid transparent; border-radius: 6px; padding: 7px 12px; background: var(--accent); color: #10241e; cursor: pointer; font: inherit; font-size: .88rem; font-weight: 700; }
button:disabled { cursor: default; opacity: .55; }
.secondary { background: transparent; color: var(--text); border-color: var(--line); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.page-heading, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-heading { margin-bottom: 22px; }
.panel-head { min-height: 55px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.status-tag { padding: 4px 9px; border: 1px solid #3b6455; border-radius: 5px; color: var(--accent); font-size: .8rem; white-space: nowrap; }
.console { display: grid; grid-template-columns: minmax(185px, 246px) minmax(0, 1fr); gap: 16px; align-items: start; }
.schema { padding: 16px; overflow-wrap: anywhere; }
.group-name { margin-bottom: 14px; }
details { border-top: 1px solid var(--line); padding: 9px 0; }
summary { cursor: pointer; font-family: ui-monospace, monospace; }
details ul { padding-left: 22px; color: var(--muted); font: .8rem/1.6 ui-monospace, monospace; }
.sample { margin-top: 8px; }
.editor-note, .result-message { padding: 4px 16px; }
.table-scroll { overflow: auto; max-height: 440px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); max-width: 32rem; overflow-wrap: anywhere; }
th { position: sticky; top: 0; background: #202733; }
td { white-space: pre-wrap; }
.event, .setup-key { font-family: ui-monospace, monospace; }
.setup-key { display: block; padding: 10px; background: #101318; border-radius: 6px; overflow-wrap: anywhere; }
.form-row { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.form-row label:first-child { flex: 1 1 230px; max-width: 360px; }
.notice { padding: 9px 12px; margin: 0 0 16px; border-radius: 6px; color: #a8efce; background: #203c32; }
.notice p { margin: 0; }
.error { color: #ffcbc8; background: #49282b; }
.result-message.error { margin: 12px 16px; }
.query-workspace { max-width: 1760px; }
.query-workspace textarea { min-height: 116px; }
.result-scroll { max-height: clamp(270px, 53vh, 620px); border-radius: 0 0 10px 10px; }
.result-grid { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.result-grid th, .result-grid td { min-width: 7.5rem; max-width: none; overflow-wrap: normal; padding: 8px 12px; border-right: 1px solid var(--line); }
.result-grid thead th { z-index: 2; }
.result-grid .column-name { display: block; white-space: nowrap; font-family: ui-monospace, monospace; }
.result-grid td { white-space: nowrap; background: var(--panel); font: .83rem/1.55 ui-monospace, monospace; }
.result-grid .cell-value { display: block; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; }
.result-grid .row-index { position: sticky; left: 0; min-width: 4rem; width: 4rem; text-align: center; }
.result-grid thead .row-index { z-index: 3; }
.result-grid tbody .row-index { top: auto; z-index: 1; padding: 4px; background: #19212a; }
.result-grid tbody tr:nth-child(even) td { background: #151a21; }
.result-grid tbody tr:hover td, .result-grid tbody tr:focus-within td { background: #22312f; }
.row-open { padding: 3px 9px; color: var(--accent); background: transparent; font-variant-numeric: tabular-nums; }
.row-open:hover { background: #263932; }
.value-marker { color: var(--muted); font-size: .8rem; font-style: italic; }
.row-dialog { width: min(720px, calc(100% - 28px)); max-height: min(82vh, 740px); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); }
.row-dialog::backdrop { background: #080c12b8; }
.row-dialog .panel-head { position: sticky; top: 0; background: var(--panel); }
.row-fields { margin: 0; }
.row-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); font: .85rem/1.55 ui-monospace, monospace; overflow-wrap: anywhere; }
.row-field dt { color: var(--muted); }
.row-field dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 480px) { .row-field { grid-template-columns: minmax(0, 1fr); gap: 3px; } }
@media (max-width: 660px) { .console { grid-template-columns: minmax(0, 1fr); } .top nav { width: 100%; } .user { overflow-wrap: anywhere; } }
