/* A copy of shared/ui/ui.css, written by tools/shared-ui.js: edit that file. */
/* The design HQ (hq.flx.es) and Regie (regie.flx.es) are both drawn with:
   light and dark tokens, the frame (a sidebar beside a raised sheet from
   860px up, a top bar and a row of tabs below that), cards, tiles, lists,
   tables, buttons and their busy state, chips, switches, forms, signing in,
   and the question dialog hqAsk() in ui.js opens. HQ made them, so they keep
   its hq- names. The type is Inter (assets/vendor/fonts.css), variable, its
   optical size following the font size.

   Edit shared/ui/ui.css; hq/assets/ui.css and regie/assets/ui.css are copies
   tools/shared-ui.js writes, and the deploy fails while one is stale. A
   site's own rules come after it, in its own stylesheet. */

:root {
  --bg: #f3f3f1;
  --sheet: #fbfbfa;
  --side: #ebebe8;
  --panel: #ffffff;
  --hover: rgba(23, 24, 27, 0.05);
  --line: #e4e3df;
  --line-soft: #eeedea;
  --text: #17181b;
  --muted: #676a72;
  --faint: #9a9ca3;
  --accent: #2f5fe3;
  --accent-2: #5b7ff0;
  --accent-soft: #e9eefc;
  --accent-ink: #ffffff;
  --ink: #17181b;
  --ink-on: #ffffff;
  --good: #1f7a4d;
  --good-soft: #e3f2e9;
  --warn: #93600f;
  --warn-soft: #fbf0db;
  --bad: #c2362b;
  --bad-soft: #fbe7e4;
  --violet: #6d4fd1;
  --shadow-sm: 0 1px 2px rgba(17, 18, 21, 0.05);
  --shadow: 0 1px 2px rgba(17, 18, 21, 0.04), 0 4px 12px -4px rgba(17, 18, 21, 0.08);
  --shadow-lg: 0 24px 56px -18px rgba(17, 18, 21, 0.28), 0 2px 8px rgba(17, 18, 21, 0.06);
  /* The names the desk's views were written against. */
  --surface: var(--panel);
  --surface-2: var(--side);
  --pick: var(--good);
  --pick-bg: var(--good-soft);
  --warn-bg: var(--warn-soft);
  --kotlin: var(--violet);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Dark follows the device, unless the page pins a look with data-theme on
   <html>. The tokens stand twice, for each way in; tools/shared-ui.js fails
   while the two blocks differ. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0e;
    --sheet: #111214;
    --side: #1d1e22;
    --panel: #17181b;
    --hover: rgba(255, 255, 255, 0.055);
    --line: #26272c;
    --line-soft: #1f2024;
    --text: #ececee;
    --muted: #9c9fa7;
    --faint: #6d7078;
    --accent: #8ba7ff;
    --accent-2: #5b7ff0;
    --accent-soft: #1a2139;
    --accent-ink: #0b0c0e;
    --ink: #f1f1f3;
    --ink-on: #111214;
    --good: #5dc28f;
    --good-soft: #122319;
    --warn: #e7b65c;
    --warn-soft: #2a2010;
    --bad: #f27b6f;
    --bad-soft: #2d1614;
    --violet: #a891f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px -6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 56px -16px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b0c0e;
    --sheet: #111214;
    --side: #1d1e22;
    --panel: #17181b;
    --hover: rgba(255, 255, 255, 0.055);
    --line: #26272c;
    --line-soft: #1f2024;
    --text: #ececee;
    --muted: #9c9fa7;
    --faint: #6d7078;
    --accent: #8ba7ff;
    --accent-2: #5b7ff0;
    --accent-soft: #1a2139;
    --accent-ink: #0b0c0e;
    --ink: #f1f1f3;
    --ink-on: #111214;
    --good: #5dc28f;
    --good-soft: #122319;
    --warn: #e7b65c;
    --warn-soft: #2a2010;
    --bad: #f27b6f;
    --bad-soft: #2d1614;
    --violet: #a891f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px -6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 56px -16px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.hq {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 var(--font);
  font-optical-sizing: auto;
  font-feature-settings: 'cv05', 'cv08';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--side); padding: 0.12em 0.4em; border-radius: 5px; }
.hq-i { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- frame ---- */

body.hq:not(.is-login) { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.hq-side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 16px 10px 12px 12px;
}
.hq-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 14.5px; letter-spacing: -0.015em; }
.hq-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.18), inset 0 0 0 9px rgba(255, 255, 255, 0.08), 0 2px 6px -1px color-mix(in srgb, var(--accent) 50%, transparent);
  flex: none;
  display: block;
}
.hq-mark.is-big { width: 52px; height: 52px; border-radius: 15px; justify-self: center; box-shadow: inset 0 0 0 9px rgba(255, 255, 255, 0.18), inset 0 0 0 16px rgba(255, 255, 255, 0.08), 0 10px 24px -8px color-mix(in srgb, var(--accent) 60%, transparent); }

.hq-nav { display: grid; gap: 1px; }
.hq-nav a, .hq-side-foot a, .hq-side-foot button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6.5px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: 0;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s, color 0.12s;
}
.hq-nav .hq-i, .hq-side-foot .hq-i { width: 17px; height: 17px; }
.hq-nav a:hover, .hq-side-foot a:hover, .hq-side-foot button:hover { background: var(--hover); color: var(--text); }
.hq-nav a.on, .hq-side-foot a.on { background: var(--panel); color: var(--text); font-weight: 580; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.hq-nav a.in { color: var(--text); }
.hq-subnav { display: grid; gap: 1px; margin: 1px 0 6px 27px; padding-left: 8px; border-left: 1px solid var(--line); }
.hq-subnav a { padding: 5px 10px; font-size: 13.5px; }
.hq-nav-head { margin: 18px 10px 6px; font-size: 11.5px; font-weight: 550; letter-spacing: 0.01em; color: var(--faint); }
.hq-nav a.is-out .hq-i:last-child { width: 13px; height: 13px; margin-left: auto; opacity: 0.55; }
.hq-count { margin-left: auto; font-size: 11.5px; font-weight: 650; background: var(--accent-soft); color: var(--accent); padding: 0 7px; line-height: 19px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.hq-side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 1px; }
.hq-side-foot form { margin: 0; }

/* The page sits on a raised sheet beside the sidebar. */
.hq-main { min-width: 0; margin: 8px 8px 8px 0; background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); min-height: calc(100vh - 16px); }
.hq-top { display: none; }
.hq-content { max-width: 1040px; margin: 0 auto; padding: 38px 44px 80px; }
.hq-tabs { display: none; }

/* ---- page parts ---- */

.hq-head { margin: 0 0 24px; }
.hq-head h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.028em; margin: 2px 0 0; font-weight: 700; }
.hq-date { color: var(--muted); margin: 0; font-size: 14px; }

.hq-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 18px; }
.hq-tile {
  display: grid;
  gap: 2px;
  padding: 15px 16px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
a.hq-tile:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--text) 20%); box-shadow: var(--shadow); transform: translateY(-1px); }
.hq-tile-k { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.hq-tile > b { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.2; }
.hq-tile-s { color: var(--muted); font-size: 12.5px; }

.hq-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px 18px; margin: 0 0 16px; box-shadow: var(--shadow-sm); }
.hq-card h2 { font-size: 15px; font-weight: 620; margin: 0 0 12px; letter-spacing: -0.012em; }
.hq-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.hq-cols .hq-card { margin: 0 0 16px; }

.hq-list { list-style: none; margin: 0 -10px; padding: 0; }
.hq-list li { position: relative; }
.hq-list li + li::before { content: ''; position: absolute; top: 0; left: 10px; right: 10px; border-top: 1px solid var(--line-soft); }
.hq-list li > a, .hq-li-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: inherit; text-decoration: none; transition: background-color 0.12s; }
.hq-list li > a:hover { background: var(--hover); }
.hq-list li:hover::before, .hq-list li:hover + li::before { opacity: 0; }
.hq-list.is-compact li > a, .hq-list.is-compact .hq-li-row { padding: 8px 10px; }
.hq-src { display: inline-flex; align-items: center; gap: 6px; flex: none; width: 100px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.hq-src .hq-i { width: 16px; height: 16px; }
.hq-src.is-review { color: var(--warn); }
.hq-src.is-mail { color: var(--accent); }
.hq-src.is-issue { color: var(--violet); }
.hq-src.is-donation { color: var(--bad); }
.hq-src.is-pitch { color: var(--good); }
.hq-src.is-ideas { color: var(--warn); }
.hq-li-body { display: grid; min-width: 0; flex: 1; }
.hq-li-title { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.hq-li-meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-li-end { display: flex; align-items: center; gap: 8px; flex: none; color: var(--muted); }
.hq-li-end .hq-i { width: 15px; height: 15px; }
.hq-when { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hq-pill { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.hq-pill.is-good { background: var(--good-soft); color: var(--good); }
.hq-quiet { color: var(--muted); margin: 0; }
.hq-error { color: var(--bad); background: var(--bad-soft); padding: 9px 12px; border-radius: 10px; margin: 10px 0 0; }

.hq-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.hq-table th { text-align: left; color: var(--muted); font-weight: 520; font-size: 12.5px; padding: 6px 10px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.hq-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.hq-table tbody tr { transition: background-color 0.12s; }
.hq-table tbody tr:hover { background: var(--hover); }
.hq-table tr:last-child td { border-bottom: 0; }
.hq-table td:first-child a { color: var(--text); text-decoration: none; font-weight: 540; }
.hq-table td:first-child a:hover { color: var(--accent); }
.hq-delta { font-size: 11.5px; font-weight: 600; }
.hq-delta.is-up { color: var(--good); }
.hq-delta.is-down { color: var(--bad); }

.hq-health { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hq-health li { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.hq-dot-s { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.hq-dot-s.is-ok { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.hq-dot-s.is-bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.hq-dot-s.is-wait { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }

.hq-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s, transform 0.08s;
}
.hq-btn .hq-i { width: 16px; height: 16px; }
.hq-btn:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--text) 22%); background: color-mix(in srgb, var(--panel) 94%, var(--text)); }
.hq-btn:active { transform: translateY(1px); }
.hq-btn:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.hq-btn.is-primary { background: var(--ink); border-color: var(--ink); color: var(--ink-on); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.hq-btn.is-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--panel)); border-color: color-mix(in srgb, var(--ink) 86%, var(--panel)); }
.hq-btn.is-quiet { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.hq-btn.is-quiet:hover { color: var(--text); background: var(--hover); }
.hq-btn[disabled] { opacity: 0.5; cursor: default; transform: none; }
/* A button waiting on the server (hqWait in hq.js, busy() in the desk's
   script): a spinner in it, not the faded look of a button that cannot be
   pressed, and beside it a line saying how far the call has got. */
.is-busy, .is-busy[disabled], .hq-desk button.is-busy[disabled] { opacity: 1; cursor: progress; }
.is-busy::before {
  content: '';
  flex: none;
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 7px;
  vertical-align: -1px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: hq-spin 0.7s linear infinite;
}
.hq-btn.is-busy::before { margin-right: 0; }
@keyframes hq-spin { to { transform: rotate(360deg); } }
.hq-wait { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hq-wait.is-error { color: var(--bad); }
.hq-wait-bar { flex: none; width: 72px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.hq-wait-bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.4s ease; }
textarea.is-streaming { background: var(--accent-soft); }
textarea.is-fresh { animation: hq-fresh 1.6s ease-out; }
@keyframes hq-fresh { from { background-color: var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) {
  .is-busy::before { animation-duration: 2.4s; }
  textarea.is-fresh { animation: none; }
  .hq-wait-bar > i { transition: none; }
  .hq-btn, .hq-tile { transition: none; }
  .hq-btn:active, a.hq-tile:hover { transform: none; }
}
.hq-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.hq-row input { flex: 1 1 220px; }

/* Date and search fields are styled where a page uses them (.ls-search here): the stats dashboard HQ mounts brings its own. */
input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=datetime-local], .ls-search input[type=search], textarea, select {
  font: inherit;
  font-size: 14.5px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
:is(input, textarea, select):hover { border-color: color-mix(in srgb, var(--line) 60%, var(--text) 18%); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* ---- a list someone searches, filters and pages through (Flx\Shared\Listing) ---- */

.ls-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.ls-search { position: relative; flex: 1 1 240px; display: flex; margin: 0; }
.ls-search .hq-i { position: absolute; left: 11px; top: 50%; margin-top: -8px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.ls-search input[type=search] { width: 100%; padding-left: 34px; }
.ls-search input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.ls-chips { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--side); }
.ls-chips legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ls-chips label { position: relative; display: flex; }
.ls-chips input { position: absolute; opacity: 0; pointer-events: none; }
.ls-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 8px; font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background-color 0.12s, color 0.12s; }
.ls-chips span:hover { color: var(--text); }
.ls-chips span em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.ls-chips input:checked + span { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.ls-chips input:focus-visible + span { box-shadow: var(--ring); }
.ls-count { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.ls-more { display: flex; justify-content: center; padding: 14px 0 4px; }
.ls-none { display: grid; justify-items: center; gap: 6px; padding: 26px 12px 20px; text-align: center; color: var(--muted); }
.ls-none b { color: var(--text); font-weight: 600; }
.ls-none a { font-size: 13.5px; }

/* ---- signing in ---- */

body.is-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), var(--bg); }
.hq-login { width: min(380px, 100%); display: grid; gap: 14px; text-align: center; }
.hq-login h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -0.025em; font-weight: 700; }
.hq-token { text-align: left; }
.hq-token summary { cursor: pointer; color: var(--muted); font-size: 14px; text-align: center; list-style: none; }
.hq-token summary::-webkit-details-marker { display: none; }
.hq-token form { display: grid; gap: 8px; margin: 12px 0 8px; }
.hq-token .hq-quiet { font-size: 13px; text-align: center; }

/* ---- phone ---- */

@media (max-width: 1100px) {
  .hq-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  body.hq:not(.is-login) { display: block; background: var(--sheet); }
  .hq-side { display: none; }
  .hq-main { margin: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }
  .hq-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 10px 16px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--sheet) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .hq-top .hq-brand { padding: 0; }
  .hq-top-settings { color: var(--muted); display: grid; place-items: center; padding: 6px; background: none; border: 0; font: inherit; }
  .hq-top .hq-brand { margin-right: auto; }
  .hq-top-settings .hq-i { width: 21px; height: 21px; }
  .hq-content { padding: 18px 16px calc(92px + env(safe-area-inset-bottom)); }
  .hq-head h1 { font-size: 24px; }
  .hq-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hq-tile > b { font-size: 26px; }
  .hq-card { padding: 16px 14px 12px; border-radius: 13px; }
  .hq-src { width: auto; }
  .hq-src { font-size: 0; gap: 0; }
  .hq-src .hq-i { width: 18px; height: 18px; }
  .hq-li-end .hq-when { display: none; }
  .hq-tabs {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--panel) 90%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .hq-tabs a { position: relative; display: grid; justify-items: center; gap: 2px; min-width: 60px; padding: 4px 6px; font-size: 11px; color: var(--muted); text-decoration: none; }
  .hq-tabs a.on { color: var(--accent); }
  .hq-tabs a.is-out { opacity: 0.8; }
  .hq-tabs .hq-i { width: 23px; height: 23px; }
  .hq-dot { position: absolute; top: 0; right: 12px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
}

/* ---- hqAsk() in hq.js: a question before something goes, in place of confirm() ---- */

.hq-ask { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); overflow: auto; }
.hq-ask::backdrop { background: rgba(10, 12, 16, 0.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.hq-ask[open] { animation: hq-ask-in 0.14s ease-out; }
.hq-ask[open]::backdrop { animation: hq-ask-fade 0.14s ease-out; }
@keyframes hq-ask-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
@keyframes hq-ask-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hq-ask[open], .hq-ask[open]::backdrop { animation: none; } }
.hq-ask-box { display: grid; gap: 12px; padding: 20px 22px 18px; }
/* The same question in Web Awesome's dialog: its header holds the title, the
   box and the buttons keep the spacing the native one has. */
.hq-ask-wa { --width: min(460px, calc(100vw - 32px)); --spacing: 20px; }
.hq-ask-wa::part(dialog) { border: 1px solid var(--line); border-radius: 16px; }
.hq-ask-wa::part(title) { font-size: 17px; font-weight: 650; line-height: 1.35; letter-spacing: -0.005em; }
.hq-ask-wa .hq-ask-box { padding: 0; }
.hq-ask-wa .hq-ask-acts { margin-top: 0; width: 100%; }
.hq-ask-title { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.35; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.hq-ask-text { margin: -4px 0 0; color: var(--muted); font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.hq-ask-rows { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; padding: 12px 14px; font-size: 14px;
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 10px; }
.hq-ask-rows dt { color: var(--muted); }
.hq-ask-rows dd { margin: 0; overflow-wrap: anywhere; }
.hq-ask-rows dd.is-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.hq-ask-chip { font-size: 12.5px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-ask-note { margin: 0; padding: 8px 12px; border-radius: 9px; font-size: 13.5px; color: var(--warn); background: var(--warn-soft); }
.hq-ask input[type=text], .hq-ask-wa input[type=text] { width: 100%; }
.hq-ask-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
/* The dialog's own buttons outrank a page's button rules: a red label on the
   red button would leave it blank. */
.hq-ask .hq-ask-acts .hq-btn.is-danger, .hq-ask-wa .hq-ask-acts .hq-btn.is-danger { background: var(--bad); border-color: var(--bad); color: var(--panel); }
.hq-ask .hq-ask-acts .hq-btn.is-danger:hover, .hq-ask-wa .hq-ask-acts .hq-btn.is-danger:hover { border-color: var(--text); background: color-mix(in srgb, var(--bad) 88%, var(--text)); }
@media (max-width: 520px) {
  .hq-ask { margin: auto auto max(16px, env(safe-area-inset-bottom)); }
  .hq-ask-acts { flex-direction: column-reverse; }
  .hq-ask-acts .hq-btn { width: 100%; }
}

/* ---- shared small parts ---- */

.hq-eyebrow { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.hq-small { font-size: 13px; }
.hq-h2-gap { margin-top: 22px !important; }
.hq-card-link { font-size: 13px; font-weight: 500; margin-left: 8px; }
.hq-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; line-height: 18px; padding: 1px 8px; border-radius: 999px; background: var(--side); color: var(--muted); white-space: nowrap; }
.hq-chip.is-feature { background: var(--accent-soft); color: var(--accent); }
.hq-chip.is-kotlin { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.hq-chip.is-flutter { background: var(--accent-soft); color: var(--accent); }
.hq-chip.is-dead { background: var(--bad-soft); color: var(--bad); }
.hq-chip-btn { font: inherit; font-size: 13px; font-weight: 520; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-sm); transition: border-color 0.12s, background-color 0.12s; }
.hq-chip-btn:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--text) 22%); }
.hq-chip-btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.hq-chip-btn[disabled] { opacity: 0.6; cursor: default; }
.hq-chip-btn.is-quiet { background: transparent; color: var(--muted); }
.hq-chip-btn.is-pitch { border-color: var(--good); color: var(--good); }
.hq-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.hq-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.hq-crumbs a { color: var(--muted); text-decoration: none; }
.hq-crumbs a:hover { color: var(--text); }
.hq-crumbs .hq-i { width: 14px; height: 14px; }
.hq-crumbs-end { margin-left: auto; display: flex; gap: 4px; }
.hq-crumbs-end .hq-btn { padding: 6px 10px; font-size: 13px; }
.hq-head-row { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.hq-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.hq-section-head h2 { font-size: 20px; letter-spacing: -0.015em; margin: 2px 0 0; }
.hq-more summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 8px 0 0; }
.hq-progress { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.hq-progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.hq-switches { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hq-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.hq-switch input { position: absolute; opacity: 0; pointer-events: none; }
.hq-switch span { width: 34px; height: 20px; border-radius: 10px; background: var(--line); position: relative; flex: none; transition: background 0.15s; }
.hq-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.hq-switch input:checked + span { background: var(--good); }
.hq-switch input:checked + span::after { transform: translateX(14px); }
.hq-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hq-table-wrap { overflow-x: auto; margin: 0 -2px; }
.hq-tile.is-warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); }
.hq-tile.is-warn .hq-tile-s { color: var(--warn); }
.hq-empty-state { text-align: center; padding: 40px 20px; }
.hq-empty-state h1 { font-size: 22px; margin: 0 0 6px; }

/* A button for what cannot be undone, and the chips for the other kinds of word. */
.hq-btn.is-danger { border-color: var(--bad); color: var(--bad); }
.hq-chip.is-good { background: var(--good-soft); color: var(--good); }
.hq-chip.is-warn { background: var(--warn-soft); color: var(--warn); }

/* ---- Web Awesome's components on these tokens ----
   Its theme (assets/vendor/wa.css) sits in a cascade layer; these lines sit
   in none, so they win, and the components take the sites' colours, corners
   and type. Its own dark tokens come with the wa-dark class, which ui.js
   keeps in step with the page's look. */

:root {
  --wa-font-family-body: inherit;
  --wa-font-family-heading: inherit;
  --wa-font-size-m: 14.5px;
  --wa-shadow-l: var(--shadow-lg);
  --wa-font-size-s: 13px;
  --wa-color-text-normal: var(--text);
  --wa-color-text-quiet: var(--muted);
  --wa-color-text-link: var(--accent);
  --wa-color-surface-default: var(--panel);
  --wa-color-surface-raised: var(--panel);
  --wa-color-surface-lowered: var(--bg);
  --wa-color-surface-border: var(--line);
  --wa-color-neutral-border-quiet: var(--line-soft);
  --wa-color-neutral-border-normal: var(--line);
  --wa-color-neutral-fill-quiet: var(--hover);
  --wa-color-brand-fill-loud: var(--accent);
  --wa-color-brand-on-loud: var(--accent-ink);
  --wa-color-brand-fill-quiet: var(--accent-soft);
  --wa-color-brand-on-quiet: var(--accent);
  --wa-color-brand-border-loud: var(--accent);
  --wa-color-danger-fill-loud: var(--bad);
  --wa-color-focus: var(--accent);
  --wa-form-control-background-color: var(--panel);
  --wa-form-control-border-color: var(--line);
  --wa-form-control-value-color: var(--text);
  --wa-form-control-label-color: var(--text);
  --wa-form-control-hint-color: var(--muted);
  --wa-form-control-placeholder-color: var(--muted);
  --wa-form-control-activated-color: var(--accent);
  --wa-form-control-border-radius: 9px;
  --wa-form-control-label-font-weight: 600;
  --wa-border-radius-s: 7px;
  --wa-border-radius-m: 10px;
  --wa-border-radius-l: 14px;
  --wa-panel-border-radius: 16px;
  --wa-color-overlay-modal: rgba(10, 12, 16, 0.5);
}
/* A component waits unstyled until its script has run; it takes no room
   meanwhile, rather than flashing its raw content. */
:not(:defined):is(wa-dialog, wa-select, wa-switch, wa-copy-button) { visibility: hidden; }
