@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
    --blue: #335599;
    --ink: #1e3443;
    --teal: #77cccc;
    --paper: #fffefa;
    --muted: #536773;
    --line: #d5e0e0;
    --mono: "IBM Plex Mono", Menlo, monospace;
    --sans: "DM Sans", "Trebuchet MS", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font-family: var(--sans); background: #eef5f3; background-image: radial-gradient(#b6d3d3 0.6px, transparent 0.6px); background-size: 12px 12px; }
a { color: var(--blue); text-underline-offset: 4px; }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button { border: 1px solid #b9cbcf; background: var(--paper); color: var(--ink); padding: 9px 13px; border-radius: 5px; }
button:hover:not(:disabled) { background: #e8f3f1; border-color: #607f8c; }
button:disabled { opacity: 0.5; cursor: wait; }
:focus-visible { outline: 3px solid #b56c0a; outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 20px; top: -100px; padding: 12px; background: white; z-index: 5; }
.skip-link:focus { top: 10px; }
.hero { background: var(--blue); color: white; padding: 24px max(4vw, calc((100vw - 1100px) / 2)); }
h1 { font: clamp(30px, 4vw, 44px)/1.15 "Lilita One", "Trebuchet MS", sans-serif; margin: 0; font-weight: 400; }
.hero p { font-size: 14px; margin: 10px 0 0; color: #e1f2f1; }
main { max-width: 1200px; padding: 24px 4vw; margin: auto; }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.editor-panel, .results-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
.example-queries { padding: 18px 20px; }
select { width: min(100%, 450px); padding: 9px 12px; font: inherit; font-size: 14px; color: var(--ink); border: 1px solid #b9cbcf; border-radius: 4px; background: white; }
.content-heading { padding: 0 20px; }
.editor-panel { overflow: hidden; }
.panel-heading { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.state, #result-meta { font: 11px var(--mono); color: var(--muted); }
.state::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #b38b36; margin-right: 7px; }
.state.ready::before { background: #327b60; }
.editor-shell { display: flex; height: 260px; background: #f8faf9; }
#line-numbers { flex: 0 0 45px; text-align: right; padding: 16px 10px 16px 0; margin: 0; color: #70848d; border-right: 1px solid #e1e9e8; overflow: hidden; user-select: none; }
.code-area { position: relative; flex: 1; min-width: 0; overflow: hidden; }
#query, #highlight, #line-numbers { font: 12px/1.8 var(--mono); tab-size: 4; }
#query, #highlight { position: absolute; inset: 0; width: 100%; height: 100%; padding: 16px; margin: 0; border: 0; white-space: pre; overflow: auto; border-radius: 0; }
#highlight { pointer-events: none; }
#highlight code { font: inherit; }
#query { background: transparent; color: transparent; caret-color: var(--ink); resize: none; -webkit-text-fill-color: transparent; }
#query::selection { background: #77cccc55; }
#query:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.token-keyword { color: #335599; font-weight: 500; }
.token-string { color: #7e4f21; }
.token-comment { color: #54776d; }
.token-number { color: #995571; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 9px; padding: 14px 20px 8px; align-items: center; }
.button-primary { background: var(--blue); color: white; border-color: var(--blue); }
.button-primary:hover:not(:disabled) { background: #284681; color: white; }
#query-error { margin: 10px 20px 16px; font-size: 12px; line-height: 1.6; color: #8c2f2f; background: #fff0eb; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.results-panel { margin-top: 20px; overflow: hidden; }
.result-options, .match-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 20px; font-size: 12px; color: var(--muted); }
.result-options label { color: var(--ink); display: flex; align-items: center; gap: 7px; }
.match-toolbar button { padding: 4px 9px; font-size: 11px; }
.result-set + .result-set { border-top: 2px solid var(--line); margin-top: 15px; }
.result-set-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 20px 12px; }
.result-set-heading > button { margin-left: auto; }
.result-set-heading h3 { font-size: 13px; margin: 0; }
.result-set-heading button { font-size: 11px; padding: 5px 8px; }
.table-scroll { overflow: auto; max-height: 560px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
th { position: sticky; top: 0; text-align: left; background: #edf3f2; padding: 12px 16px; font: 11px var(--mono); z-index: 1; border-bottom: 1px solid var(--line); }
td { padding: 0; border-bottom: 1px solid #e4ebea; vertical-align: top; }
.cell { display: block; min-height: 43px; width: 100%; padding: 13px 16px; border: 0; border-radius: 0; background: transparent; text-align: left; font: inherit; color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 130px; max-width: 550px; }
.cell.date-value { white-space: nowrap; }
.cell.categorical { background: var(--cell-bg); box-shadow: inset 3px 0 var(--cell-accent); }
.cell.is-match { outline: 2px solid #8d5710; outline-offset: -3px; background: #fff1cb; }
.cell[aria-pressed="true"] { box-shadow: inset 5px 0 #8d5710; }
.cell.null { color: #687b83; font-style: italic; }
.evidence-link { display: inline-block; margin: 0 16px 10px; font-size: 11px; }
.empty-state, .result-warning { padding: 15px 20px; color: var(--muted); font-size: 13px; }
.result-warning { color: #805914; background: #fff7df; }
.noscript { padding: 20px; }
@media (max-width: 760px) {
    .hero { padding: 22px 4vw; }
    main { padding-top: 18px; }
    .panel-heading { padding: 14px; flex-wrap: wrap; }
    .editor-actions, .example-queries { padding-left: 14px; padding-right: 14px; }
    .content-heading { padding-left: 14px; }
    #result-meta { font-size: 10px; }
}
@media (forced-colors: active) { #query { color: CanvasText; -webkit-text-fill-color: CanvasText; } #highlight { display: none; } }
