/* 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 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.

   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: #f5f4f0;
  --side: #eeece6;
  --panel: #ffffff;
  --hover: #e8e6df;
  --line: #e2dfd7;
  --line-soft: #eceae4;
  --text: #1d1f23;
  --muted: #6a6d74;
  --accent: #2f6b8f;
  --accent-2: #4f8fb5;
  --accent-soft: #e2edf4;
  --accent-ink: #ffffff;
  --good: #2e6b4f;
  --good-soft: #e3f0e8;
  --warn: #8a5a17;
  --warn-soft: #f7eed8;
  --bad: #b23b2e;
  --bad-soft: #f8e3e0;
  --violet: #6b52b8;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.05), 0 4px 16px rgba(20, 22, 26, 0.04);
  /* 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);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --side: #16191d;
    --panel: #1b1e23;
    --hover: #22262c;
    --line: #2a2f37;
    --line-soft: #23272e;
    --text: #e7e9ed;
    --muted: #959ba5;
    --accent: #6aaed4;
    --accent-2: #3d7ea6;
    --accent-soft: #1b2a35;
    --accent-ink: #0e1419;
    --good: #66b48d;
    --good-soft: #16271e;
    --warn: #e0bb6a;
    --warn-soft: #2c2414;
    --bad: #e2766a;
    --bad-soft: #2e1a18;
    --violet: #a690e8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    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: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
code { font-size: 0.88em; background: var(--side); padding: 0.1em 0.35em; border-radius: 4px; }
.hq-i { width: 18px; height: 18px; flex: none; }

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

body.hq:not(.is-login) { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.hq-side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--side);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
}
.hq-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.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);
  flex: none;
}
.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); }

.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: 8px 10px;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 14.5px;
  background: none;
  border: 0;
  width: 100%;
  cursor: pointer;
  text-align: left;
}
.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: 600; box-shadow: var(--shadow); }
.hq-nav a.in { color: var(--text); }
.hq-subnav { display: grid; gap: 1px; margin: 1px 0 6px 28px; }
.hq-subnav a { padding: 6px 10px; font-size: 13.5px; }
.hq-nav-head { margin: 18px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.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: 1px 7px; border-radius: 999px; }
.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; }

.hq-main { min-width: 0; }
.hq-top { display: none; }
.hq-content { max-width: 1040px; margin: 0 auto; padding: 34px 40px 72px; }
.hq-tabs { display: none; }

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

.hq-head { margin: 0 0 22px; }
.hq-head h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; margin: 2px 0 0; font-weight: 650; }
.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 16px; }
.hq-tile {
  display: grid;
  gap: 1px;
  padding: 14px 16px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.hq-tile:hover { border-color: var(--accent); }
.hq-tile-k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.hq-tile b { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hq-tile-s { color: var(--muted); font-size: 13px; }

.hq-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 16px; margin: 0 0 16px; box-shadow: var(--shadow); }
.hq-card h2 { font-size: 15px; font-weight: 650; margin: 0 0 10px; letter-spacing: -0.005em; }
.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 -8px; padding: 0; }
.hq-list li + li { border-top: 1px solid var(--line-soft); }
.hq-list li > a, .hq-li-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.hq-list li > a:hover { background: var(--hover); }
.hq-list.is-compact li > a, .hq-list.is-compact .hq-li-row { padding: 8px; }
.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: 13.5px; 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; }
.hq-pill { font-size: 11.5px; font-weight: 600; padding: 2px 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: 8px 12px; border-radius: 9px; margin: 10px 0 0; }

.hq-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.hq-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); }
.hq-table td { padding: 8px 6px; border-bottom: 1px solid var(--line-soft); }
.hq-table tr:last-child td { border-bottom: 0; }
.hq-table td:first-child a { color: var(--text); text-decoration: none; }
.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); }
.hq-dot-s.is-bad { background: var(--bad); }
.hq-dot-s.is-wait { background: var(--warn); }

.hq-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  justify-content: center;
}
.hq-btn:hover { border-color: var(--accent); }
.hq-btn.is-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hq-btn.is-quiet { background: transparent; color: var(--muted); }
.hq-btn.is-quiet:hover { color: var(--text); }
.hq-btn[disabled] { opacity: 0.55; cursor: default; }
/* 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-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.hq-row input { flex: 1 1 220px; }

input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=datetime-local], textarea, select {
  font: inherit;
  font-size: 14.5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

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

body.is-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.hq-login { width: min(360px, 100%); display: grid; gap: 14px; text-align: center; }
.hq-login h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }
.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; }
  .hq-side { display: none; }
  .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(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    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: 16px;
  background: var(--panel); color: var(--text); box-shadow: 0 24px 64px rgba(10, 12, 16, 0.28); overflow: auto; }
.hq-ask::backdrop { background: rgba(10, 12, 16, 0.5); }
.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; }
.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] { width: 100%; }
.hq-ask-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.hq-ask .hq-btn.is-danger { background: var(--bad); border-color: var(--bad); color: var(--panel); }
.hq-ask .hq-btn.is-danger:hover { border-color: 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; font-size: 11.5px; font-weight: 600; padding: 2px 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; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.hq-chip-btn:hover { border-color: var(--accent); }
.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); }
