:root {
  --bg: #07080a;
  --card: #121418;
  --ink: #eceef2;
  --soft: rgba(236, 238, 242, 0.5);
  --line: rgba(236, 238, 242, 0.09);
  --accent: #5ad4e6;
  --keyword: #b79cff;
  --string: #a8e07a;
  --number: #ffb454;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 90% at 50% 0%, #14161b 0%, var(--bg) 62%);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 10px;
}

.sq { position: relative; width: min(344px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 34px 60px -34px rgba(0, 0, 0, 0.95); overflow: hidden; }
.sq__roll { display: block; overflow: hidden; }
.sq__roll > span { display: block; white-space: nowrap; }

.sq__tabs { display: flex; gap: 4px; padding: 10px 10px 0; }
.sq__tabs button { height: 28px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--soft); font: inherit; font-size: 12px; font-weight: 640; cursor: pointer; outline: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; transition: color 0.25s, background-color 0.25s; }
.sq__tabs button[aria-pressed="true"] { background: rgba(236, 238, 242, 0.08); color: var(--ink); }
.sq__tabs button:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }

/* the query: four lines of code, coloured by what each word is */
.sq__editor { position: relative; margin: 8px 10px 0; padding: 10px 12px; border-radius: 14px; background: #0b0c0f; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.sq__code { height: 76px; font-family: var(--mono); font-size: 12px; line-height: 19px; color: rgba(236, 238, 242, 0.82); white-space: pre; overflow: hidden; }
.sq__code .k { color: var(--keyword); }
.sq__code .s { color: var(--string); }
.sq__code .n { color: var(--number); }
.sq__code .c { border-radius: 4px; box-shadow: 0 0 0 2px transparent; transition: background-color 0.2s, box-shadow 0.2s, color 0.2s; cursor: default; }
.sq__code .c.is-on { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.sq__caret { display: inline-block; width: 1.500px; height: 14px; margin: 0 0 -2px 1px; background: var(--accent); }
.sq__run { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border: 0; border-radius: 10px; background: var(--ink); color: #101216; font: inherit; font-size: 12.500px; font-weight: 720; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.sq__run:focus-visible { box-shadow: 0 0 0 2px #0b0c0f, 0 0 0 4px var(--accent); }
.sq__run svg { width: 12px; height: 12px; fill: currentColor; }
.sq__run .sq__roll { height: 18px; line-height: 18px; }
.sq__sweep { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent) 45%, var(--accent) 55%, transparent); transform: translateX(-100%); opacity: 0; }

/* the result: a header and four rows on the same three columns */
.sq__table { margin: 8px 10px 0; height: 130px; font-size: 12px; overflow: hidden; }
.sq__tr { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr); height: 26px; align-items: center; border-bottom: 1px solid var(--line); }
.sq__tr > * { padding: 0 8px; height: 26px; line-height: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background-color 0.2s, color 0.2s; }
.sq__tr > :last-child { text-align: right; }
.sq__th { font-family: var(--mono); font-size: 11px; color: var(--soft); cursor: default; }
.sq__td { font-weight: 560; color: rgba(236, 238, 242, 0.86); }
.sq__table .is-on { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sq__th.is-on { color: var(--accent); }

.sq__foot { display: flex; align-items: center; height: 30px; padding: 0 18px; font-family: var(--mono); font-size: 11px; color: rgba(236, 238, 242, 0.42); white-space: nowrap; }

@media (hover: hover) {
  .sq__tabs button:hover { color: var(--ink); }
  .sq__run:hover { background: #ffffff; }
}

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; pointer-events: none; opacity: 0; fill: #ffffff; stroke: #101216; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); z-index: 5; }
