/* Prism. Ink on paper. The chrome stays quiet so the data is the only loud thing on the page. */

@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #17171a;
  --ink-2: #55544e;
  --ink-3: #6f6e66;
  --line: #e8e6df;
  --line-2: #d7d5cc;
  --hover: #f1efe9;
  --select: #e9e7df;
  --primary: #17171a;
  --primary-ink: #ffffff;
  --shadow: 0 1px 2px rgba(23, 23, 26, .06), 0 8px 28px rgba(23, 23, 26, .10);
  --shadow-soft: 0 1px 2px rgba(23, 23, 26, .04);
  --error: #b42323;
  --error-wash: #fbeeec;
  --good: #0a7d0a;
  --bad: #b42323;
  --code-keyword: #5b3fb5;
  --code-string: #0e7a55;
  --code-number: #a2520c;
  --code-comment: #85847c;
  --code-type: #1b5fb3;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
  --deemphasis: #c9c7be;
  --grid: #eeece6;
  --axis: #cfcdc4;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --radius: 10px;
  --rail: 232px;
}

:root[data-resolved="dark"] {
  color-scheme: dark;
  --bg: #111113;
  --surface: #1a1a1c;
  --surface-2: #161618;
  --ink: #f0efec;
  --ink-2: #b6b5ae;
  --ink-3: #85847d;
  --line: #2a2a2d;
  --line-2: #3b3b3f;
  --hover: #232326;
  --select: #2e2e32;
  --primary: #f0efec;
  --primary-ink: #17171a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 32px rgba(0, 0, 0, .5);
  --shadow-soft: none;
  --error: #f08a84;
  --error-wash: #331c1b;
  --good: #4cc04c;
  --bad: #f08a84;
  --code-keyword: #b3a4f5;
  --code-string: #6fd3a8;
  --code-number: #f0b070;
  --code-comment: #85847d;
  --code-type: #86b6ef;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --deemphasis: #4a4a4e;
  --grid: #262629;
  --axis: #3b3b3f;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.ic { flex: none; display: block; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.block { display: block; }
.center { text-align: center; }
.pad { padding: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-radius: 4px; }

/* The one flourish: a thin spectrum along the top while anything is working. */
html.is-busy::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 100;
  background: linear-gradient(90deg, #2a78d6, #1baf7a, #eda100, #eb6834, #6250d6, #2a78d6);
  background-size: 200% 100%; animation: prism-run 1.2s linear infinite;
}
@keyframes prism-run { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { html.is-busy::before { animation: none; } }

/* ---- Buttons and small controls ---- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary); opacity: .88; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
:root[data-resolved="dark"] .btn-danger { color: #1a1a1c; }
.btn-small { height: 28px; padding: 0 9px; font-size: 13px; border-radius: 7px; }
.btn-wide { width: 100%; height: 40px; }
.btn[disabled] { opacity: .5; cursor: default; }
.push-left { margin-right: auto; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn.tiny { width: 22px; height: 22px; }
.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--hover); color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.small-input { height: 30px; font-size: 13px; }
.select-small { width: 110px; height: 28px; font-size: 13px; }
.q-row .select-small { width: auto; max-width: 100%; }
.plain-input { width: 100%; border: 0; background: transparent; padding: 2px 0; border-bottom: 1px solid transparent; }
.plain-input:hover, .plain-input:focus { border-bottom-color: var(--line-2); outline: none; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field-hint { font-size: 12px; color: var(--ink-3); line-height: 1.4; word-break: break-word; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form.narrow { max-width: 360px; margin-top: 8px; }
.form-error { color: var(--error); background: var(--error-wash); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: flex-start; }
.row > * { flex: 1; min-width: 0; }
.row.grow-first > :first-child { flex: 3; }
.row-tight { display: flex; gap: 6px; }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--hover); border-radius: 8px; }
.seg-item { height: 26px; min-width: 38px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.seg-item.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.check { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.check:hover { background: var(--hover); }
.check-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-n { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.switch-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); }

/* ---- Popovers, menus, dialogs ---- */

.pop { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); max-height: min(70vh, 460px); overflow: auto; }
.pop-pick { width: 300px; }
.pop-filter { width: 280px; }
.menu { padding: 5px; min-width: 190px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--hover); }
.menu-item.on { font-weight: 500; }
.menu-item.danger { color: var(--error); }
.menu-item[disabled] { opacity: .5; cursor: default; }
.menu-item.split { cursor: default; flex-wrap: wrap; }
.menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-label.plain { border: 0; background: none; text-align: left; cursor: pointer; padding: 0; }
.menu-hint { color: var(--ink-3); font-size: 12px; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 3px; }
.menu-head { padding: 7px 8px 3px; color: var(--ink-3); font-size: 11.5px; font-weight: 500; }
.agg-row { display: flex; flex-wrap: wrap; gap: 2px; width: 100%; padding-left: 24px; }
.agg { border: 0; background: var(--hover); border-radius: 4px; padding: 1px 6px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.agg:hover { background: var(--select); color: var(--ink); }
.pick { padding: 5px; }
.pick-search { width: 100%; height: 30px; padding: 0 8px; margin-bottom: 4px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); }
.pick-empty { padding: 10px; color: var(--ink-3); }
.kind { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px; background: var(--hover); color: var(--ink-2); font: 500 10.5px/1 var(--mono); flex: none; }
.filter-edit { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.filter-title { font-weight: 600; }
.filter-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.filter-actions > :first-child { margin-right: auto; }
.value-list { max-height: 220px; overflow: auto; margin: 0 -4px; }
.date-pop { width: 250px; padding: 5px; }
.several-pop { max-height: 320px; overflow-y: auto; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 6px; cursor: pointer; }
.check-row:hover { background: var(--hover); }
.check-row input { flex: none; }
.date-custom { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; padding: 8px; margin-top: 5px; border-top: 1px solid var(--line); }
.date-custom .row { width: 100%; }
.date-custom .input { padding: 0 6px; font-size: 12.5px; }
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; background: rgba(15, 15, 18, .36); overflow: auto; }
.modal { width: min(460px, 100%); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.modal.wide { width: min(1040px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.modal-head h2 { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 8px 18px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 18px; }
.table-modal .grid-wrap { max-height: 66vh; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 10px; background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow); }
.toast-error { background: var(--error); color: #fff; }
:root[data-resolved="dark"] .toast-error { color: #1a1a1c; }
.toast-action { border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.up-toast { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: 280px; padding: 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.up-bar { height: 3px; background: var(--hover); border-radius: 2px; overflow: hidden; }
.up-bar-fill { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }

.palette-wrap { padding-top: 12vh; }
.palette { width: min(580px, 100%); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.palette-input { width: 100%; height: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 15px; outline: none; }
.palette-list { max-height: 50vh; overflow: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left; }
.palette-item.on { background: var(--hover); }
.palette-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-hint { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

/* ---- Shell ---- */

#app, .shell { height: 100%; }
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.public-shell { display: block; }
.main { min-width: 0; height: 100%; overflow: hidden; position: relative; }
.rail { display: flex; flex-direction: column; min-height: 0; height: 100%; padding: 12px 10px 10px; border-right: 1px solid var(--line); background: var(--surface-2); z-index: 30; }
.brand { display: flex; align-items: center; gap: 8px; padding: 2px 6px 12px; font: 600 16px/1 var(--sans); letter-spacing: -.01em; text-decoration: none; }
.brand.big { font-size: 20px; padding: 0; }
.logo-mark { flex: none; }
.rail-search { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-3); cursor: pointer; }
.rail-search span { flex: 1; text-align: left; }
.rail-search kbd { font: 500 11px var(--sans); color: var(--ink-3); }
.rail-nav { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; }
.rail-link, .rail-page { display: flex; align-items: center; gap: 9px; min-height: 30px; padding: 4px 8px; border-radius: 7px; text-decoration: none; color: var(--ink-2); }
.rail-link:hover, .rail-page:hover { background: var(--hover); color: var(--ink); }
.rail-link.on, .rail-page.on { background: var(--select); color: var(--ink); font-weight: 500; }
.rail-page span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-section { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding: 0 2px 4px 8px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.rail-pages { flex: 1; min-height: 40px; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.rail-hint { padding: 4px 8px; }
.rail-foot { padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.guest-note { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); }
.guest-note .btn { width: 100%; white-space: normal; height: auto; min-height: 28px; padding: 4px 8px; }
.rail-user { display: flex; align-items: center; gap: 4px; }
.user-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left; }
.user-btn:hover { background: var(--hover); }
.user-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--select); font-size: 11.5px; font-weight: 600; }
.user-ws { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-bar { display: none; }
.rail-veil { display: none; }

/* ---- Generic screens ---- */

.screen-scroll { height: 100%; overflow: auto; }
.screen { max-width: 760px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 12px; }
.screen.wide { max-width: 1120px; }
.screen-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.screen-head h1 { font: 500 28px/1.2 var(--serif); letter-spacing: -.01em; }
.screen-head h1.mono { font: 500 22px/1.2 var(--mono); }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.crumb { display: flex; align-items: center; gap: 4px; color: var(--ink-3); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.lead { margin-bottom: 8px; }
.screen-section { font-size: 13px; font-weight: 600; margin-top: 20px; }
.section-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list:empty { display: none; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; text-decoration: none; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--hover); }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-title.mono { font-size: 13px; }
.list-num { font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.empty { max-width: 420px; margin: 18vh auto 0; padding: 0 16px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty h2 { font: 500 22px/1.25 var(--serif); }
.dropzone { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); }
.dropzone > div { flex: 1; min-width: 0; }
.dropzone strong { color: var(--ink); font-weight: 600; }
.dropzone.over { border-color: var(--ink); background: var(--hover); }
.col-name { display: inline-flex; align-items: center; gap: 7px; }
.preview-box .grid-wrap { max-height: 420px; }
.metric-list { display: flex; flex-direction: column; gap: 10px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.metric-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.metric-head h3 { font-size: 15px; font-weight: 600; }
.metric-name { color: var(--ink-3); }
.metric-head .btn { margin-left: auto; }
.metric-desc { color: var(--ink-2); }
.metric-expr { background: var(--surface-2); border: 1px solid var(--line); padding: 8px 10px; border-radius: 7px; }
.metric-foot { display: flex; gap: 14px; flex-wrap: wrap; }
.history { display: flex; flex-direction: column; max-height: 60vh; overflow: auto; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.share { display: flex; flex-direction: column; gap: 14px; }
.share-link { align-items: center; }
.share-link .btn { flex: none; }

.welcome { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.welcome-box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.welcome-box h1 { font: 500 30px/1.15 var(--serif); letter-spacing: -.015em; margin: 14px 0 16px; }

/* ---- The page ---- */

.page-wrap { display: flex; height: 100%; min-width: 0; }
.page-scroll { flex: 1; min-width: 0; overflow: auto; }
.page-inner { max-width: 1120px; margin: 0 auto; padding: 26px 24px 80px; }
.page-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.page-title { font: 500 30px/1.2 var(--serif); letter-spacing: -.015em; width: 100%; border: 0; background: transparent; padding: 0; outline: none; }
input.page-title:focus { box-shadow: 0 1px 0 var(--line-2); }
.page-meta { display: flex; align-items: center; gap: 12px; min-height: 30px; color: var(--ink-3); font-size: 12.5px; flex-wrap: wrap; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.save-status:empty, .freshness:empty { display: none; }
.filter-bar { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; margin-bottom: 8px; background: var(--bg); }
.filter-bar.empty-bar { display: none; }
.input-chip { display: inline-flex; align-items: center; gap: 2px; height: 32px; max-width: 100%; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding-left: 10px; }
.input-label { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; margin-right: 4px; }
.input-value { display: inline-flex; align-items: center; gap: 6px; height: 100%; border: 0; background: transparent; padding: 0 8px 0 2px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.input-select { height: 100%; border: 0; background: transparent; padding: 0 6px 0 0; font-weight: 500; cursor: pointer; max-width: 200px; outline-offset: -2px; }
.input-text { height: 100%; width: 120px; border: 0; background: transparent; padding: 0 8px 0 2px; font-weight: 500; outline-offset: -2px; }
.input-gear { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 100%; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; opacity: 0; }
.input-chip:hover .input-gear, .input-gear:focus-visible { opacity: 1; }
.filter-add { height: 32px; }

.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.text-block { align-self: start; }
.w-12 { grid-column: span 12; }
.w-6 { grid-column: span 6; }
.w-4 { grid-column: span 4; }
.w-3 { grid-column: span 3; }
.has-panel .w-3 { grid-column: span 6; }
.has-panel .w-4, .has-panel .w-6 { grid-column: span 12; }
@container (min-width: 900px) { .has-panel .w-6 { grid-column: span 6; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 12px; min-width: 0; position: relative; transition: box-shadow .12s; }
.card.selected { box-shadow: 0 0 0 2px var(--ink); border-color: transparent; }
.card.is-hidden { border-style: dashed; background: var(--surface-2); padding-top: 6px; padding-bottom: 6px; }
.card.is-hidden .card-head { margin-bottom: 0; }
.card.is-hidden:not(.selected) .card-body, .card.is-hidden:not(.selected) .card-foot { display: none; }
.card.is-hidden.selected .card-head { margin-bottom: 6px; }
.card.dragging { opacity: .4; }
.block.drop-before { box-shadow: -3px 0 0 var(--ink); }
.card-head { display: flex; align-items: center; gap: 6px; min-height: 28px; margin-bottom: 6px; }
.card-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title.untitled { color: var(--ink-3); font-weight: 400; }
.card-actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .1s; }
.card:hover .card-actions, .card:focus-within .card-actions, .card.selected .card-actions { opacity: 1; }
@media (hover: none) { .card-actions { opacity: 1; } .input-gear { opacity: 1; } .grip { display: none !important; } }
/* Where they appear on hover, they shouldn't hold room the title could be using the rest of the time. */
@media (hover: hover) { .card-head > .card-actions { position: absolute; top: 12px; right: 10px; padding-left: 8px; background: var(--surface); border-radius: 6px; } }
.grip { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 24px; margin-left: -8px; border: 0; background: transparent; color: var(--ink-3); cursor: grab; opacity: 0; flex: none; }
.card:hover .grip, .text-block:hover .grip { opacity: 1; }
.card-body { min-height: 40px; transition: opacity .15s; }
.card-body:has(> .py-set) { min-height: 0; }
.py-silent { display: none; }
.is-loading .card-body, .explore-chart.is-loading { opacity: .5; }
.card-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.text-block { position: relative; min-width: 0; padding: 2px 0; }
.text-block .grip { position: absolute; left: -12px; top: 2px; }
/* In the card's margin, so a title lines up with what's under it whether the handle is showing or not. */
.card-head > .grip { position: absolute; left: -2px; top: 14px; margin: 0; width: 16px; }
.md { color: var(--ink); line-height: 1.55; }
.md.editable { cursor: text; border-radius: 6px; }
.md.editable:hover { background: var(--hover); box-shadow: 0 0 0 4px var(--hover); }
.md h2 { font: 500 22px/1.25 var(--serif); margin: 10px 0 4px; }
.md h3 { font: 500 17px/1.3 var(--serif); margin: 8px 0 4px; }
.md h4 { font-size: 14px; font-weight: 600; margin: 6px 0 2px; }
.md p + p { margin-top: 8px; }
.md ul, .md ol { margin: 4px 0; padding-left: 20px; }
.md code { background: var(--hover); padding: 1px 4px; border-radius: 4px; }
.md a { text-underline-offset: 2px; }
.text-edit { width: 100%; min-height: 72px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); resize: none; line-height: 1.5; outline: none; }
.text-edit:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.text-tools { display: flex; justify-content: flex-end; margin-top: 4px; }
.add-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.empty-page { padding: 40px; text-align: center; color: var(--ink-3); border: 1.5px dashed var(--line-2); border-radius: var(--radius); }
.made-with { color: var(--ink-3); font-size: 12.5px; text-underline-offset: 2px; }
.public-main .page-inner { padding-top: 34px; }

/* ---- Side panel ---- */

.panel { width: 0; flex: none; overflow: hidden; background: var(--surface); border-left: 0 solid var(--line); display: flex; flex-direction: column; }
.has-panel .panel { width: min(460px, 44vw); border-left-width: 1px; }
.panel-head { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.panel-title { flex: 1; min-width: 0; border: 0; background: transparent; font-weight: 600; font-size: 14px; outline: none; }
.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
.panel-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.panel-row .input { width: auto; max-width: 200px; height: 30px; font-size: 13px; }
.panel-section { font-size: 12.5px; font-weight: 600; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.code-holder { border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.code-holder:focus-within { outline: 2px solid var(--ink); outline-offset: -1px; }
.run-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.panel-status:empty { display: none; }
.sql-peek { font-size: 12.5px; color: var(--ink-2); }
.sql-peek summary { cursor: pointer; }
.sql-peek pre { margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); }
.panel-view { display: flex; flex-direction: column; gap: 12px; }
.view-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.view-types.compact { display: inline-flex; gap: 2px; }
.view-type { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 5px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 11.5px; }
.view-type:hover { background: var(--hover); color: var(--ink); }
.view-type.on { background: var(--select); color: var(--ink); font-weight: 500; }
.view-types.compact .view-type { padding: 5px 6px; }
.view-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* The sentence builder */
.q { display: flex; flex-direction: column; gap: 8px; }
.q-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 28px; }
.q-word { width: 46px; flex: none; color: var(--ink-3); font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; max-width: 100%; height: 28px; border-radius: 7px; background: var(--hover); }
.chip-main { border: 0; background: transparent; padding: 0 9px; height: 100%; cursor: pointer; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 7px; }
.chip-main:hover { background: var(--select); }
.chip-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 100%; margin-left: -6px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 0 7px 7px 0; }
.chip-x:hover { color: var(--ink); }
.chip-table .chip-main { font-family: var(--mono); font-size: 12.5px; }
.chip-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.chip-add { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border: 1px dashed var(--line-2); border-radius: 7px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.chip-add:hover { color: var(--ink); border-color: var(--ink-3); }
.chip-add span:empty { display: none; }

.sched-list { display: flex; flex-direction: column; }
.sched-list:empty { display: none; }
.sched-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }

.presence { display: inline-flex; gap: 3px; }
.presence:empty { display: none; }
.comment-count { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px; border: 0; border-radius: 6px; background: var(--hover); color: var(--ink-2); font-size: 12px; cursor: pointer; }
.pop-comments { width: 320px; }
.comments { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow: auto; }
.comment-meta { display: flex; align-items: baseline; gap: 6px; }
.comment-meta .push { margin-left: auto; color: var(--ink-3); }
.comment-body { white-space: pre-wrap; word-break: break-word; }
.row-end { display: flex; justify-content: flex-end; }
.add-row { flex-wrap: wrap; }
.add-ask { flex: 1 1 300px; min-width: 220px; }

.click-anchor { position: fixed; width: 1px; height: 1px; }
.schema-browser { margin-top: 10px; font-size: 13px; }
.schema-browser > summary { cursor: pointer; color: var(--ink-2); }
.schema-list { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; max-height: 300px; overflow: auto; }
.schema-table summary { display: flex; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 5px; cursor: pointer; list-style: none; color: var(--ink-3); }
.schema-table summary::-webkit-details-marker { display: none; }
.schema-table summary:hover { background: var(--hover); }
.schema-name { border: 0; background: none; padding: 0; font: 12.5px var(--mono); color: var(--ink); cursor: pointer; }
.schema-name:hover { text-decoration: underline; }
.schema-cols { display: flex; flex-direction: column; padding-left: 20px; }
.schema-col, .schema-metric { display: flex; align-items: center; gap: 8px; justify-content: space-between; width: 100%; padding: 2px 4px; border: 0; border-radius: 5px; background: none; text-align: left; cursor: pointer; }
.schema-metric { justify-content: flex-start; color: var(--ink-3); }
.schema-metric .mono { color: var(--ink); }
.schema-col:hover, .schema-metric:hover { background: var(--hover); }
.check-inline { display: flex; align-items: center; gap: 7px; height: 34px; cursor: pointer; }
.embed-row { margin-top: 8px; }
.grid tfoot td { position: sticky; bottom: 0; background: var(--surface); box-shadow: inset 0 1px 0 var(--line-2); font-weight: 600; border-bottom: 0; }
.is-embed .page-head .page-meta, .is-embed .made-with { display: none; }
.is-embed .page-inner { padding: 12px 12px 24px; max-width: none; }

@media print {
  body, .main, .screen-scroll, .page-scroll, .page-wrap { background: #fff !important; height: auto !important; overflow: visible !important; }
  .rail, .phone-bar, .rail-veil, .panel, .add-row, .page-actions, .card-actions, .grip, .input-gear, .filter-add, .toast, .tip, .save-status, .card.is-hidden { display: none !important; }
  .shell { display: block; }
  .page-inner { max-width: none; padding: 0; }
  .filter-bar { position: static; }
  .card, .text-block { break-inside: avoid; }
  .card { border-color: #ddd; }
  .grid-wrap { max-height: none; overflow: visible; }
  .grid th { position: static; }
}

.md-code { background: var(--hover); padding: 8px 10px; border-radius: 7px; margin: 6px 0; font-size: 12px; overflow: auto; max-height: 260px; }
.import-skips ul { margin: 4px 0 0; padding-left: 18px; }

.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--hover); }
.conn-tables { display: flex; flex-direction: column; gap: 10px; }
.conn-tables .list { max-height: 50vh; overflow: auto; }

.help-link { text-decoration: none; font-weight: 600; font-size: 14px; }

.py-sandbox { position: fixed; width: 0; height: 0; border: 0; visibility: hidden; }
.py-image { display: block; max-width: 100%; margin-top: 8px; border-radius: 6px; background: #fff; }
.py-stdout { margin-top: 8px; padding: 8px 10px; max-height: 220px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; font-size: 12px; color: var(--ink-2); }
.py-help { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.py-help code { background: var(--hover); padding: 0 4px; border-radius: 3px; }
.py-stop { margin-left: 8px; }

.explain { display: flex; flex-direction: column; gap: 14px; }
.explain-head { font-size: 16px; line-height: 1.45; }
.explain-head strong { font-weight: 600; }
.explain-compare { display: flex; align-items: center; gap: 8px; }
.explain-compare .input { width: auto; height: 30px; font-size: 13px; }
.explain-list { display: flex; flex-direction: column; }
.explain-row { display: grid; grid-template-columns: minmax(0, 1.5fr) auto auto minmax(70px, .8fr); gap: 4px 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.explain-row.head { color: var(--ink-3); font-size: 12px; padding: 4px 0; }
.explain-seg { min-width: 0; }
.explain-seg small { display: block; color: var(--ink-3); font-size: 12px; }
.explain-seg strong { font-weight: 500; }
.explain-num { text-align: right; font-size: 13px; }
.explain-bar { height: 8px; border-radius: 2px; background: var(--series-1); min-width: 2px; }
.explain-bar.against { background: var(--deemphasis); }
.explain-section { font-size: 12.5px; font-weight: 600; margin-top: 4px; }
@media (max-width: 560px) { .explain-row { grid-template-columns: minmax(0, 1fr) auto auto; } .explain-bar-wrap { display: none; } }

/* ---- Asking ---- */

.ask-bar { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 6px 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink-3); }
.ask-bar:focus-within { border-color: var(--ink); color: var(--ink); }
.ask-bar.big { min-height: 48px; border-radius: 12px; padding: 0 8px 0 14px; box-shadow: var(--shadow-soft); }
.ask-bar.big .ask-input { font-size: 15px; }
.ask-input { flex: 1; min-width: 0; height: 34px; border: 0; background: transparent; color: var(--ink); outline: none; }
.ask-input::placeholder { color: var(--ink-3); }
.ask-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ask-note:empty { display: none; }
.ask-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-suggest:empty { display: none; }
.ask-chip { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.ask-chip:hover { background: var(--hover); color: var(--ink); }
.home-ask { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.panel-ask { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }

/* ---- Explore ---- */

.explore { display: grid; grid-template-columns: 230px minmax(0, 1fr); height: 100%; }
.explore-side { border-right: 1px solid var(--line); background: var(--surface-2); min-height: 0; overflow: hidden; }
.explore-fields { height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px 8px; }
.field-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.field-group { padding: 10px 8px 3px; color: var(--ink-3); font-size: 11.5px; font-weight: 500; }
.field-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 3px 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.field-item:hover { background: var(--hover); }
.field-item.on { background: var(--select); font-weight: 500; }
.explore-main { min-width: 0; overflow: auto; padding: 18px 24px 40px; display: flex; flex-direction: column; gap: 12px; }
.explore-head { display: flex; align-items: flex-start; gap: 12px; }
.explore-builder { flex: 1; min-width: 0; }
.explore-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; }
.explore-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 8px; }
.explore-chart { min-height: 120px; transition: opacity .15s; }
.explore-chart .grid-wrap { max-height: 60vh; }

/* ---- Tables ---- */

.grid-wrap { overflow: auto; max-height: 460px; }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 500; color: var(--ink-2); box-shadow: inset 0 -1px 0 var(--line-2); white-space: nowrap; }
.grid th button { all: unset; display: block; padding: 6px 10px; cursor: pointer; width: 100%; box-sizing: border-box; }
.grid th button:hover { color: var(--ink); }
.grid th button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.grid th.num, .grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td { padding: 6px 10px; border-bottom: 1px solid var(--line); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: var(--surface-2); }
.grid td.null { color: var(--ink-3); }
.grid-more { padding: 8px 10px 0; font-size: 13px; color: var(--ink-2); }
.profile thead th { padding: 6px 10px; }

/* ---- Charts ---- */

.chart { display: block; max-width: 100%; overflow: visible; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.axis-zero { stroke: var(--axis); stroke-width: 1; }
.tick { fill: var(--ink-3); font: 11.5px var(--sans); font-variant-numeric: tabular-nums; }
.cat { fill: var(--ink); font: 12.5px var(--sans); }
.bar-value { fill: var(--ink-2); font: 12px var(--sans); font-variant-numeric: tabular-nums; }
.end-label { fill: var(--ink-2); font: 12px var(--sans); }
.end-label.dim { fill: var(--ink-3); }
.axis-title { fill: var(--ink-3); font: 12px var(--sans); }
.crosshair { stroke: var(--ink-3); stroke-width: 1; pointer-events: none; }
.ring { stroke: var(--surface); stroke-width: 2; }
.dot-hover { pointer-events: none; }
.mark { transition: opacity .08s; }
.mark.lift { opacity: .78; }
.mark:focus-visible { outline: none; opacity: .78; }
.clicky { cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item.dim { color: var(--ink-3); }
.legend-key { display: inline-block; flex: none; }
.legend-key.box { width: 10px; height: 10px; border-radius: 2px; }
.legend-key.line { width: 14px; height: 2px; border-radius: 1px; }
.chart-note { padding: 28px 8px; text-align: center; color: var(--ink-3); }
.chart-note.small { padding: 6px 0 0; text-align: left; font-size: 12px; }
.scale { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.scale-ramp { display: inline-flex; height: 8px; border-radius: 2px; overflow: hidden; }
.scale-ramp span { width: 18px; }
.tip { display: none; position: fixed; z-index: 80; pointer-events: none; max-width: 300px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); font-size: 12.5px; }
.tip-title { color: var(--ink-2); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 7px; line-height: 1.6; }
.tip-row.dim { color: var(--ink-3); }
.tip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.tip-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip-more { color: var(--ink-3); margin-top: 2px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 6px; }
.stat-value { font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.stat-delta { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; }
.stat-delta.good { color: var(--good); }
.stat-delta.bad { color: var(--bad); }
.stat-delta.flat { color: var(--ink-2); }
.stat-vs { color: var(--ink-3); font-weight: 400; }
.stat-note { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.block-error { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--error-wash); border-radius: 8px; }
.block-error-msg { color: var(--error); font-weight: 500; word-break: break-word; }
.block-error-hint { color: var(--ink-2); font-size: 13px; }
.block-error-actions { display: flex; gap: 4px; margin-top: 4px; }

/* ---- Small screens ---- */

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .phone-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 8px 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .phone-bar .brand { padding: 0; margin: 0; }
  .card-edit { display: none; }
  .rail { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .16s; }
  .rail.open { transform: none; box-shadow: var(--shadow); }
  .rail.open + .rail-veil { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(15, 15, 18, .3); }
  .page-inner, .screen { padding-left: 16px; padding-right: 16px; }
  .page-inner { padding-top: 16px; }
  .page-title { font-size: 25px; }
  .w-6, .w-4 { grid-column: span 12; }
  .w-3 { grid-column: span 6; }
  .stat-value { font-size: 26px; }
  .has-panel .page-scroll { display: none; }
  .has-panel .panel { width: 100%; border-left: 0; }
  .explore { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .explore-side { display: none; }
  .explore-main { padding: 12px 16px 32px; }
  .explore-head { flex-direction: column; }
  .input, .pick-search, .palette-input { font-size: 16px; }
  .btn, .chip-main, .menu-item { min-height: 36px; }
  .view-opts { grid-template-columns: 1fr; }
  .card-actions { opacity: 1; }
  .dropzone { flex-wrap: wrap; }
  .modal-wrap { padding: 16px; }
}

.used-by { margin: 0; }
.used-by:empty { display: none; }

.rail-star { flex: none; margin-left: auto; display: inline-flex; color: var(--ink-3); }
.rail-star svg path, .iconbtn.starred svg path { fill: currentColor; }
.rail-page span:first-child { min-width: 0; }

.locked-links { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.share-head { margin: 0; font-size: 14px; font-weight: 600; }
.locked-link { display: flex; align-items: center; gap: 8px; }
.locked-link .list-main { flex: 1; min-width: 0; }
.locked-new { display: flex; flex-direction: column; gap: 4px; }
.link-warning { margin: 0; color: var(--ink-2); padding-left: 10px; border-left: 2px solid var(--line-strong, var(--line)); }
.locked-note { color: var(--ink-2); }

.joins-line { margin: 0; }
.field-link { margin: 8px 12px 12px; font-size: 12.5px; text-align: left; }
.link-row { align-items: center; }
.link-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.joins-holder:empty { display: none; }

.embed-sample { margin: 0; padding: 12px; overflow: auto; font-size: 12px; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; white-space: pre; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 90; padding: 8px 12px; background: var(--ink); color: var(--surface); border-radius: 8px; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.main:focus { outline: none; }

.link-source { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }

.q-warn { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; padding: 8px 10px; border-left: 2px solid var(--line-2); color: var(--ink-2); background: var(--surface-2); border-radius: 0 6px 6px 0; }
