/* GreaseGiant Dashboard: how every kit element looks. Contract: crm/CONTRACTS.md §8.
 * Only tokens (tokens.css) are used here: no colour, size or space is written as a number of its
 * own, apart from hairlines and a few shapes. A screen never adds styles; it uses these elements
 * and the layout classes in section 2.
 *
 * 1 base · 2 layout classes for screens · 3 small things · 4 button and link · 5 field and form ·
 * 6 panel, tabs · 7 table · 8 cards · 9 map · 10 list · 11 dialog, drawer, tour · 12 menu, search ·
 * 13 toast · 14 timeline, summary · 15 loading and empty
 */

/* ---------- 1. base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Something the keyboard lands on is never hidden under the bar that stays at the top. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + var(--s-4)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-m);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}
/* A box with its own theme or its own density (the gallery shows both at once). */
[data-theme] { background-color: var(--bg); color: var(--text); }
[data-density] { font-size: var(--text-m); }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
.gg-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.gg-icon {
  width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 2. layout classes a screen may use ---------- */
.gg-page { display: flex; flex-direction: column; gap: var(--s-6); max-width: var(--page-max); margin: 0 auto; padding: var(--s-6) var(--s-6) var(--s-16); }
[data-density="simple"] .gg-page, .gg-page[data-density="simple"] { max-width: 880px; gap: var(--s-8); padding-top: var(--s-10); }
.gg-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.gg-title { font-size: var(--text-l); line-height: var(--lh-tight); font-weight: var(--w-strong); letter-spacing: -0.01em; }
.gg-heading { font-size: var(--text-m); line-height: var(--lh-tight); font-weight: var(--w-strong); }
.gg-sub { color: var(--text-2); margin-top: var(--s-1); }
.gg-text { max-width: 68ch; }
.gg-muted { color: var(--text-2); }
.gg-small { font-size: var(--text-s); }
.gg-label { font-size: var(--text-s); font-weight: var(--w-strong); color: var(--text-2); letter-spacing: 0.04em; text-transform: uppercase; }
.gg-code { font-family: var(--font-mono); font-size: var(--text-s); color: var(--text-2); }
.gg-stack { display: flex; flex-direction: column; gap: var(--gap); }
.gg-stack-tight { display: flex; flex-direction: column; gap: var(--s-2); }
.gg-stack-loose { display: flex; flex-direction: column; gap: var(--s-8); }
.gg-row { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; }
.gg-row-top { align-items: flex-start; }
.gg-row-apart { justify-content: space-between; }
.gg-grow { flex: 1 1 0; min-width: 0; }
.gg-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gg-grid-2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gg-grid-3 { display: grid; gap: var(--s-4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gg-grid-main { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .gg-grid-2, .gg-grid-3, .gg-grid-main { grid-template-columns: minmax(0, 1fr); } }
/* A page with a rail: beside the page, a narrow column of things to glance at that stays in view
   while the page scrolls (the reminders on the caller's screen). The rail reads at the dense
   sizes, one tight line under another, so a lot is in view at once; if the window is too short
   for all of it, the rail scrolls by itself. On a window too narrow for both it drops under the
   page and spreads out again. */
.gg-with-rail { display: grid; grid-template-columns: minmax(0, 880px) minmax(280px, 460px); gap: var(--s-2); justify-content: center; align-items: start; padding-inline-end: var(--s-6); }
.gg-with-rail > .gg-page { margin: 0; width: 100%; }
.gg-rail {
  --text-s: var(--dense-1); --text-m: var(--dense-2); --text-l: var(--dense-3); --gap: var(--s-3); --panel-pad: var(--s-4); --control-h: 32px;
  font-size: var(--text-m); line-height: 1.3; min-width: 0;
  position: sticky; top: calc(var(--topbar-h) + var(--s-4)); max-height: calc(100vh - var(--topbar-h) - var(--s-8)); overflow-y: auto; margin-top: var(--s-4);
}
.gg-rail .gg-stack-tight { gap: 2px; }
.gg-rail .gg-panel-head { min-height: 0; }
.gg-rail .gg-grid-3 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1279px) {
  .gg-with-rail { display: block; padding-inline-end: 0; }
  .gg-with-rail > .gg-page { margin: 0 auto; padding-bottom: var(--s-6); }
  .gg-rail { position: static; max-height: none; overflow: visible; max-width: 880px; margin: 0 auto; padding: 0 var(--s-6) var(--s-16); }
  .gg-rail .gg-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) { .gg-rail .gg-grid-3 { grid-template-columns: minmax(0, 1fr); } }
.gg-box { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--panel-pad); background: var(--bg); min-width: 0; }
.gg-end { text-align: end; justify-content: flex-end; }
.gg-divider { border: 0; border-top: 1px solid var(--line); margin: 0; }
.gg-swatch { display: flex; align-items: center; gap: var(--s-3); }
.gg-swatch-chip { width: var(--s-10); height: var(--s-10); border-radius: var(--radius); border: 1px solid var(--line); flex: none; }
.gg-swatch-chip[data-token="bg"] { background: var(--bg); }
.gg-swatch-chip[data-token="surface"] { background: var(--surface); }
.gg-swatch-chip[data-token="surface-2"] { background: var(--surface-2); }
.gg-swatch-chip[data-token="line"] { background: var(--line); }
.gg-swatch-chip[data-token="line-strong"] { background: var(--line-strong); }
.gg-swatch-chip[data-token="text"] { background: var(--text); }
.gg-swatch-chip[data-token="text-2"] { background: var(--text-2); }
.gg-swatch-chip[data-token="accent"] { background: var(--accent); }
.gg-swatch-chip[data-token="accent-soft"] { background: var(--accent-soft); }
.gg-swatch-chip[data-token="link"] { background: var(--link); }
.gg-swatch-chip[data-token="danger"] { background: var(--danger); }
.gg-swatch-chip[data-token="danger-soft"] { background: var(--danger-soft); }
.gg-swatch-chip[data-token="good"] { background: var(--good); }
.gg-swatch-chip[data-token="good-soft"] { background: var(--good-soft); }
.gg-swatch-chip[data-token="wait-soft"] { background: var(--wait-soft); }
.gg-space-bar { height: var(--s-3); background: var(--accent); border-radius: var(--radius); }
.gg-space-bar[data-s="1"] { width: var(--s-1); } .gg-space-bar[data-s="2"] { width: var(--s-2); }
.gg-space-bar[data-s="3"] { width: var(--s-3); } .gg-space-bar[data-s="4"] { width: var(--s-4); }
.gg-space-bar[data-s="5"] { width: var(--s-5); } .gg-space-bar[data-s="6"] { width: var(--s-6); }
.gg-space-bar[data-s="8"] { width: var(--s-8); } .gg-space-bar[data-s="10"] { width: var(--s-10); }
.gg-space-bar[data-s="12"] { width: var(--s-12); } .gg-space-bar[data-s="16"] { width: var(--s-16); }
.gg-type-s { font-size: var(--text-s); } .gg-type-m { font-size: var(--text-m); } .gg-type-l { font-size: var(--text-l); font-weight: var(--w-strong); line-height: var(--lh-tight); }

/* ---------- 3. small things ---------- */
.gg-logo { display: inline-flex; align-items: center; gap: var(--s-2); color: inherit; text-decoration: none; }
.gg-logo-mark { height: 28px; width: auto; flex: none; }
.gg-logo-body { fill: var(--logo-body); }
.gg-logo-hoop { fill: var(--logo-hoop); }
.gg-logo-band { fill: var(--accent); }
.gg-logo-lid { fill: var(--logo-lid); }
.gg-logo-word { font-family: var(--font-brand); font-weight: 900; font-size: var(--dense-3); letter-spacing: -0.02em; line-height: 1; }
.gg-logo-w1 { color: var(--logo-word-1); }
.gg-logo-w2 { color: var(--logo-word-2); }

gg-pill {
  display: inline-flex; align-items: center; gap: var(--s-1); max-width: 100%;
  padding: 0 var(--s-2); min-height: calc(var(--text-s) * 1.75);
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font-size: var(--text-s); font-weight: var(--w-strong); line-height: 1; white-space: nowrap;
}
gg-pill[tone="good"] { background: var(--good-soft); color: var(--good-text); border-color: transparent; }
gg-pill[tone="bad"] { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }
gg-pill[tone="wait"] { background: var(--wait-soft); color: var(--wait-text); border-color: transparent; }
gg-pill[tone="win"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }

gg-stat { display: block; padding: var(--panel-pad); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.gg-stat-label { color: var(--text-2); font-size: var(--text-s); font-weight: var(--w-strong); }
.gg-stat-value { font-size: var(--text-l); font-weight: var(--w-strong); line-height: var(--lh-tight); margin-top: var(--s-1); font-variant-numeric: tabular-nums; min-width: 3ch; width: fit-content; }
.gg-stat-hint { color: var(--text-2); font-size: var(--text-s); margin-top: var(--s-1); }
gg-stat[tone="good"] .gg-stat-hint { color: var(--good-text); }
gg-stat[tone="bad"] .gg-stat-hint { color: var(--danger-text); }
gg-stat[tone="wait"] .gg-stat-hint { color: var(--wait-text); }

gg-person { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; vertical-align: middle; }
.gg-person-face {
  width: calc(var(--text-m) * 2); height: calc(var(--text-m) * 2); flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--text-s); font-weight: var(--w-strong); color: var(--text);
}
.gg-person-words { display: flex; flex-direction: column; min-width: 0; line-height: var(--lh-tight); }
.gg-person-name { font-weight: var(--w-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-person-detail { color: var(--text-2); font-size: var(--text-s); }

gg-time, gg-money, gg-phone { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gg-money-minus { color: var(--danger-text); }

gg-shortcut { display: inline-flex; align-items: center; gap: var(--s-1); vertical-align: middle; }
.gg-key {
  display: inline-grid; place-items: center; min-width: 1.75em; height: 1.75em; padding: 0 var(--s-1);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-family: var(--font-mono); font-size: var(--text-s); line-height: 1;
}
.gg-key-then { color: var(--text-2); font-size: var(--text-s); }

/* ---------- 4. button and link ---------- */
gg-button { display: inline-flex; vertical-align: middle; max-width: 100%; }
gg-button[full] { display: flex; width: 100%; }
.gg-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--control-h); min-width: var(--control-h); width: 100%; padding: 0 var(--pad-x);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-size: var(--text-m); font-weight: var(--w-strong); line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.gg-btn:hover { background: var(--surface-2); }
.gg-btn:active { transform: translateY(1px); }
.gg-btn-icon-only { padding: 0; }
.gg-btn-words:empty { display: none; }
gg-button[variant="primary"] .gg-btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
gg-button[variant="primary"] .gg-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
gg-button[variant="danger"] .gg-btn { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
gg-button[variant="danger"] .gg-btn:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
gg-button[variant="quiet"] .gg-btn { background: transparent; border-color: transparent; }
gg-button[variant="quiet"] .gg-btn:hover { background: var(--surface-2); }
.gg-btn:disabled { cursor: not-allowed; background: var(--surface-2); border-color: var(--line); color: var(--text-2); opacity: 0.7; transform: none; }
gg-button[variant="quiet"] .gg-btn:disabled { background: transparent; border-color: transparent; }
gg-button[loading] .gg-btn { cursor: progress; }
gg-button[loading] .gg-btn > :not(.gg-btn-spin) { visibility: hidden; }
.gg-btn-spin, .gg-spinner {
  width: 1.1em; height: 1.1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: gg-spin 0.8s linear infinite;
}
.gg-btn-spin { position: absolute; inset: 0; margin: auto; }
@keyframes gg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gg-btn-spin, .gg-spinner { animation-duration: 2.4s; } }

.gg-link { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; border-radius: 2px; }
.gg-link:hover { text-decoration-thickness: 2px; }
gg-link[quiet] .gg-link { color: inherit; text-decoration: none; font-weight: var(--w-strong); }
gg-link[quiet] .gg-link:hover { text-decoration: underline; }
.gg-link-out .gg-icon { width: 1em; height: 1em; margin-inline-start: 0.15em; }

/* ---------- 5. field and form ---------- */
gg-field { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.gg-field-label { font-size: var(--text-s); font-weight: var(--w-strong); color: var(--text); }
[data-density="simple"] .gg-field-label { font-size: var(--text-s); }
.gg-field-opt { font-weight: var(--w-normal); color: var(--text-2); }
.gg-field-box { position: relative; display: flex; align-items: center; }
.gg-input {
  width: 100%; min-width: 0; height: var(--control-h); padding: 0 var(--pad-x);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: var(--text-m); line-height: var(--lh);
  appearance: none; -webkit-appearance: none;
}
textarea.gg-input { height: auto; min-height: calc(var(--control-h) * 2); padding-block: var(--s-2); resize: vertical; }
select.gg-input { padding-inline-end: calc(var(--pad-x) + 1.5em); cursor: pointer; }
.gg-input::placeholder { color: var(--text-2); opacity: 1; }
.gg-input:hover { border-color: var(--text); }
.gg-input:disabled { background: var(--surface-2); border-color: var(--line); color: var(--text-2); cursor: not-allowed; }
.gg-input:read-only:not(select) { background: var(--surface-2); }
.gg-input[aria-invalid="true"] { border-color: var(--danger-text); box-shadow: inset 0 0 0 1px var(--danger-text); }
.gg-field-caret { position: absolute; inset-inline-end: var(--s-2); pointer-events: none; color: var(--text-2); display: grid; }
.gg-field-prefix { position: absolute; inset-inline-start: var(--pad-x); color: var(--text-2); pointer-events: none; }
.gg-field-money .gg-input { padding-inline-start: calc(var(--pad-x) + 1em); font-variant-numeric: tabular-nums; }
.gg-field-number .gg-input, .gg-field-phone .gg-input { font-variant-numeric: tabular-nums; }
.gg-field-unit { margin-inline-start: var(--s-2); color: var(--text-2); white-space: nowrap; }
.gg-field-help { font-size: var(--text-s); color: var(--text-2); }
.gg-field-error { font-size: var(--text-s); color: var(--danger-text); font-weight: var(--w-strong); }
.gg-field-error .gg-icon { width: 1.1em; height: 1.1em; }

/* A toggle: the label sits beside the switch, and the real checkbox lies invisibly over the switch. */
gg-field.gg-field-is-toggle { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: var(--s-3); row-gap: var(--s-1); }
.gg-field-is-toggle .gg-field-box { grid-column: 1; grid-row: 1; min-height: var(--target); }
.gg-field-is-toggle .gg-field-label { grid-column: 2; grid-row: 1; font-size: var(--text-m); font-weight: var(--w-normal); cursor: pointer; }
.gg-field-is-toggle .gg-field-help, .gg-field-is-toggle .gg-field-error { grid-column: 2; }
.gg-toggle-track {
  display: block; width: calc(var(--target) * 1.5 + 4px); height: calc(var(--target) * 0.75 + 4px); min-width: 40px; min-height: 22px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); padding: 2px;
  transition: background-color var(--fast) var(--ease);
}
.gg-toggle-knob { display: block; height: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--line-strong); transition: transform var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.gg-toggle-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.gg-toggle-input:checked + .gg-toggle-track { background: var(--accent); border-color: var(--text); }
.gg-toggle-input:checked + .gg-toggle-track .gg-toggle-knob { background: var(--on-accent); transform: translateX(calc(var(--target) * 0.75)); }
.gg-toggle-input:focus-visible + .gg-toggle-track { outline: var(--focus-w) solid var(--focus); outline-offset: 2px; }
.gg-toggle-input:disabled { cursor: not-allowed; }
.gg-toggle-input:disabled + .gg-toggle-track { opacity: 0.55; }
/* A box to tick: the same layout as a toggle, the box at the top of a label that may run to several lines. */
.gg-field-is-check { align-items: start; }
.gg-field-is-check .gg-field-box { align-items: center; }
.gg-field-is-check .gg-field-label { line-height: var(--lh); padding-top: calc((var(--target) - var(--text-m) * var(--lh)) / 2); }
.gg-field-is-check .gg-check { flex: none; }

.gg-form { display: flex; flex-direction: column; gap: var(--s-4); }
[data-density="simple"] .gg-form { gap: var(--s-6); }
.gg-form-actions { display: flex; gap: var(--s-3); justify-content: flex-end; flex-wrap: wrap; }
.gg-check { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
[data-density="simple"] .gg-check { width: 24px; height: 24px; }

/* ---------- 6. panel, tabs ---------- */
gg-panel { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; scroll-margin-top: calc(var(--topbar-h) + var(--s-4)); }
.gg-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) var(--panel-pad); border-bottom: 1px solid var(--line); min-height: calc(var(--control-h) + var(--s-6)); }
.gg-panel-words { min-width: 0; }
.gg-panel-title { font-size: var(--text-m); font-weight: var(--w-strong); line-height: var(--lh-tight); }
.gg-panel-hint { color: var(--text-2); font-size: var(--text-s); margin-top: 2px; }
.gg-panel-actions { display: flex; gap: var(--s-2); flex: none; }
.gg-panel-actions:empty { display: none; }
.gg-panel-body, .gg-panel-state { padding: var(--panel-pad); }
gg-panel[flush] > .gg-panel-body { padding: 0; }
gg-panel[flush] > .gg-panel-body > gg-table > .gg-table-scroll,
gg-panel[flush] > .gg-panel-body > gg-list gg-table > .gg-table-scroll { border-inline: 0; border-top: 0; border-radius: 0; }

gg-tabs { display: block; min-width: 0; }
.gg-tabs-bar { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line); overflow-x: auto; }
.gg-tab {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--control-h); padding: 0 var(--pad-x);
  border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; cursor: pointer;
  color: var(--text-2); font-weight: var(--w-strong); white-space: nowrap; border-radius: var(--radius) var(--radius) 0 0;
}
.gg-tab:hover { color: var(--text); background: var(--surface-2); }
.gg-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); box-shadow: inset 0 -1px 0 var(--text); }
.gg-tab:focus-visible { outline-offset: -2px; }
.gg-tab-count { font-size: var(--text-s); font-weight: var(--w-strong); padding: 0 var(--s-2); border-radius: var(--radius); background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.gg-tab-panel { padding-top: var(--s-4); }

/* ---------- 7. table ---------- */
gg-table { display: block; min-width: 0; --gg-check-w: calc(var(--target) + var(--s-3)); }
.gg-table-scroll {
  position: relative; overflow: auto; max-height: calc(var(--row-h) + var(--gg-row-fit, var(--row-h)) * var(--gg-shown, 12) + 2px);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  overscroll-behavior: contain;
}
.gg-table-scroll:focus-visible { outline-offset: 0; }
.gg-table-head { position: sticky; top: 0; z-index: 2; }
.gg-table-space { position: relative; }
.gg-table-rows { will-change: transform; }
.gg-tr {
  display: grid; grid-template-columns: var(--gg-cols); align-items: center;
  height: var(--row-h); min-width: min-content; border-bottom: 1px solid var(--line);
}
.gg-tr-head { background: var(--surface-2); border-bottom-color: var(--line-strong); }
.gg-table-rows .gg-tr { height: var(--gg-row-fit, var(--row-h)); }
.gg-table-rows .gg-tr[data-i] { cursor: default; }
.gg-table-rows .gg-tr[data-i]:hover { background: var(--surface-2); }
.gg-tr[aria-selected="true"], .gg-tr[aria-selected="true"]:hover { background: var(--accent-soft); }
.gg-table-scroll:focus-visible .gg-tr-active { box-shadow: inset 3px 0 0 var(--focus); background: var(--surface-2); }
.gg-table-scroll:focus-visible .gg-tr-active[aria-selected="true"] { background: var(--accent-soft); }
.gg-th, .gg-td { min-width: 0; padding: 0 var(--pad-x); display: flex; align-items: center; height: 100%; }
.gg-th { font-size: var(--text-s); font-weight: var(--w-strong); color: var(--text-2); }
.gg-th-words, .gg-td-words { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-td { white-space: nowrap; overflow: hidden; }
.gg-td > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gg-td > gg-link, .gg-td > gg-person { display: block; }
.gg-td > gg-pill, .gg-td > .gg-check { flex: none; overflow: visible; }
.gg-th-btn {
  display: inline-flex; align-items: center; gap: var(--s-1); max-width: 100%; height: 100%;
  margin-inline: calc(var(--s-2) * -1); padding: 0 var(--s-2);
  border: 0; background: none; cursor: pointer; color: inherit; font-weight: inherit; border-radius: var(--radius);
}
.gg-th-btn:hover { color: var(--text); }
.gg-th-btn .gg-icon { width: 1em; height: 1em; opacity: 0.6; }
.gg-th[aria-sort="ascending"], .gg-th[aria-sort="descending"] { color: var(--text); }
.gg-th[aria-sort="ascending"] .gg-icon, .gg-th[aria-sort="descending"] .gg-icon { opacity: 1; }
.gg-th-btn:focus-visible { outline-offset: -2px; }
.gg-td-check { justify-content: center; padding: 0; }
.gg-table-note:empty { display: none; }
.gg-table-note { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); margin-top: -1px; }
gg-table[data-state="empty"] .gg-table-scroll, gg-table[data-state="error"] .gg-table-scroll { border-radius: var(--radius) var(--radius) 0 0; }
gg-table[data-state="loading"] .gg-table-note { border: 0; }
.gg-table-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: calc(var(--control-h) + var(--s-2)); padding-top: var(--s-2); color: var(--text-2); font-size: var(--text-s); }
.gg-table-pager { display: flex; align-items: center; gap: var(--s-2); }
.gg-table-page { font-variant-numeric: tabular-nums; }
.gg-table-count { font-variant-numeric: tabular-nums; }

/* ---------- 8. cards ---------- */
gg-cards { display: block; min-width: 0; }
.gg-cards-list { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
[data-density="simple"] .gg-cards-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s-4); }
.gg-card {
  position: relative; display: flex; flex-direction: column; gap: var(--s-2); min-width: 0;
  padding: var(--panel-pad); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.gg-card:hover { border-color: var(--line-strong); }
.gg-card:focus-within { border-color: var(--text); }
.gg-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); }
.gg-card-open { border: 0; background: none; padding: 0; text-align: start; cursor: pointer; font-weight: var(--w-strong); font-size: var(--text-m); line-height: var(--lh-tight); color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.gg-card-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.gg-card-open:focus-visible { outline: none; }
.gg-card-open:focus-visible::after { outline: var(--focus-w) solid var(--focus); outline-offset: 2px; }
.gg-card gg-pill, .gg-card gg-link, .gg-card gg-button, .gg-card gg-menu { position: relative; z-index: 1; }
.gg-card-sub { color: var(--text-2); font-size: var(--text-s); }
.gg-card-lines { display: grid; gap: var(--s-1); margin-top: var(--s-1); }
.gg-card-line { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--text-s); }
.gg-card-line dt { color: var(--text-2); flex: none; }
.gg-card-line dd { text-align: end; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-cards-more { display: flex; justify-content: center; padding-top: var(--s-3); min-height: 1px; }
.gg-cards-note:empty { display: none; }
.gg-cards-note { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
gg-cards[data-state="loading"] .gg-cards-note { border: 0; }

/* ---------- 9. map ---------- */
gg-map { display: block; min-width: 0; }
.gg-map-frame { position: relative; height: clamp(320px, 56vh, 640px); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); isolation: isolate; }
.gg-map-canvas { position: absolute; inset: 0; }
.gg-map-note { position: absolute; inset: 0; z-index: 1001; display: grid; place-items: center; pointer-events: none; }
.gg-map-note:empty { display: none; }
.gg-map-note > * { pointer-events: auto; }
gg-map:not([data-state="map"]) .gg-map-note { background: var(--surface); }
gg-map[data-state="loading"] .gg-map-note > gg-loading { position: absolute; inset: 0; }
gg-map[data-state="loading"] .gg-skel-block { height: 100%; border-radius: 0; }
.gg-map-empty { align-self: start; margin-top: var(--s-4); padding: var(--s-2) var(--s-3); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: var(--text-s); }
.gg-pin { border-radius: 50%; background: var(--text); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--text); cursor: pointer; }
.gg-pin-good { background: var(--good-text); }
.gg-pin-bad { background: var(--danger); }
.gg-pin-wait { background: var(--accent); }
.gg-slider { width: 100%; min-width: 0; height: var(--control-h); margin: 0; accent-color: var(--accent); cursor: pointer; }
.gg-slider:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: 3px; }
.gg-pin-truck { border-radius: 4px; border-width: 3px; box-shadow: 0 0 0 2px var(--text); }
.gg-pin:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: 3px; }
gg-map .leaflet-container { font: inherit; background: var(--surface-2); color: var(--text); }
gg-map .leaflet-tile-pane { filter: var(--map-filter); }
gg-map .leaflet-bar { border: 1px solid var(--line-strong); box-shadow: none; border-radius: var(--radius); overflow: hidden; }
gg-map .leaflet-bar a, gg-map .leaflet-bar a:hover { background: var(--surface); color: var(--text); border-bottom-color: var(--line); }
gg-map .leaflet-bar a:hover { background: var(--surface-2); }
gg-map .leaflet-bar a.leaflet-disabled { background: var(--surface-2); color: var(--text-2); }
gg-map .leaflet-bar a:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: -2px; }
gg-map .leaflet-container .leaflet-control-attribution { background: var(--surface); color: var(--text-2); font-size: var(--dense-1); padding: 0 var(--s-2); border-top-left-radius: var(--radius); }
gg-map .leaflet-container .leaflet-control-attribution a { color: var(--link); }
gg-map .leaflet-tooltip { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); font-size: var(--text-s); padding: var(--s-1) var(--s-2); }
gg-map .leaflet-tooltip-top::before { border-top-color: var(--line-strong); }
gg-map .leaflet-container:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: -2px; }

/* ---------- 10. list ---------- */
gg-list { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.gg-list-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.gg-list-filters { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.gg-list-tools { display: flex; align-items: center; gap: var(--s-2); flex: none; }
.gg-list-find { width: 240px; max-width: 100%; }
.gg-list-filter:not(.gg-field-is-toggle) { width: 180px; max-width: 100%; }
[data-density="simple"] .gg-list-find { width: 320px; }
.gg-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); padding: 2px; gap: 2px; }
.gg-seg-btn {
  display: inline-flex; align-items: center; gap: var(--s-1); min-height: calc(var(--control-h) - 6px); padding: 0 var(--s-3);
  border: 0; border-radius: calc(var(--radius) - 2px); background: none; cursor: pointer; color: var(--text-2); font-weight: var(--w-strong); font-size: var(--text-s);
}
.gg-seg-btn:hover { color: var(--text); background: var(--surface-2); }
.gg-seg-btn[aria-checked="true"] { background: var(--text); color: var(--bg); }
.gg-seg-btn:disabled { cursor: not-allowed; opacity: 0.6; }
.gg-seg-btn:focus-visible { outline-offset: 1px; }
.gg-field-choice { align-items: flex-start; }

/* ---------- 11. dialog, drawer, tour ---------- */
dialog.gg-dialog-box, dialog.gg-drawer-box, dialog.gg-tour-card {
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
dialog.gg-dialog-box { width: min(560px, calc(100vw - var(--s-8))); max-height: calc(100vh - var(--s-16)); }
dialog.gg-dialog-box[data-size="s"] { width: min(420px, calc(100vw - var(--s-8))); }
dialog.gg-dialog-box[data-size="l"] { width: min(880px, calc(100vw - var(--s-8))); }
dialog.gg-dialog-box[open], dialog.gg-drawer-box[open] { display: flex; flex-direction: column; }
dialog.gg-drawer-box { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(520px, 100vw); border-radius: 0; border-width: 0 0 0 1px; }
dialog.gg-drawer-box[data-size="l"] { width: min(760px, 100vw); }
dialog.gg-dialog-box::backdrop, dialog.gg-drawer-box::backdrop { background: var(--overlay); }
.gg-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); flex: none; }
.gg-dialog-title { font-size: var(--text-m); font-weight: var(--w-strong); line-height: var(--lh-tight); }
[data-density="simple"] .gg-dialog-title { font-size: var(--text-m); }
.gg-dialog-body { padding: var(--s-5); overflow: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--s-4); }
.gg-dialog-actions { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); flex: none; flex-wrap: wrap; }

dialog.gg-tour-card { position: fixed; margin: 0; z-index: 90; width: min(340px, calc(100vw - var(--s-4))); padding: var(--s-4); border-color: var(--text); }
.gg-tour-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); }
.gg-tour-title { font-size: var(--text-m); font-weight: var(--w-strong); padding-top: var(--s-1); }
.gg-tour-text { color: var(--text-2); margin: var(--s-1) 0 var(--s-4); }
.gg-tour-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.gg-tour-count { color: var(--text-2); font-size: var(--text-s); }
.gg-tour-btns { display: flex; gap: var(--s-2); }
.gg-tour-ring { position: fixed; z-index: 89; border-radius: var(--radius); pointer-events: none; outline: 3px solid var(--accent); box-shadow: 0 0 0 5px var(--text), 0 0 0 9999px var(--overlay); }
gg-problem-box { display: block; }
.gg-problem-where { color: var(--text-2); font-size: var(--text-s); }

/* ---------- 12. menu, search ---------- */
gg-menu { display: inline-block; position: relative; vertical-align: middle; text-align: start; }
.gg-menu-pop {
  position: fixed; z-index: 80; min-width: 200px; max-width: min(340px, calc(100vw - var(--s-4))); overflow: auto;
  padding: var(--s-1); border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.gg-menu-item {
  display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: var(--control-h); padding: 0 var(--s-3) 0 var(--s-2);
  border: 0; border-radius: calc(var(--radius) - 2px); background: none; cursor: pointer; text-align: start; font-size: var(--text-m);
}
.gg-menu-item:hover, .gg-menu-item:focus-visible { background: var(--surface-2); }
.gg-menu-item:focus-visible { outline-offset: -2px; }
.gg-menu-item[aria-disabled="true"] { color: var(--text-2); cursor: not-allowed; opacity: 0.7; }
.gg-menu-danger { color: var(--danger-text); }
.gg-menu-mark { width: 1.25em; flex: none; display: grid; }
.gg-menu-words { flex: 1 1 auto; min-width: 0; }
.gg-menu-hint { color: var(--text-2); font-size: var(--text-s); font-family: var(--font-mono); }
.gg-menu-sep { height: 1px; background: var(--line); margin: var(--s-1) 0; }
.gg-menu-heading { padding: var(--s-2) var(--s-2) var(--s-1); color: var(--text-2); font-size: var(--text-s); font-weight: var(--w-strong); }

gg-search { display: block; position: relative; min-width: 0; }
.gg-search-box { position: relative; display: flex; align-items: center; }
.gg-search-pic { position: absolute; inset-inline-start: var(--s-3); color: var(--text-2); pointer-events: none; display: grid; }
.gg-search-input {
  width: 100%; height: var(--control-h); padding: 0 calc(var(--s-8) + var(--s-2)) 0 calc(var(--s-8) + var(--s-2));
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: var(--text-m);
  appearance: none; -webkit-appearance: none;
}
.gg-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.gg-search-input::placeholder { color: var(--text-2); opacity: 1; }
.gg-search-input:hover { border-color: var(--text); }
.gg-search-key { position: absolute; inset-inline-end: var(--s-2); pointer-events: none; }
.gg-search-input:focus ~ .gg-search-key { visibility: hidden; }
.gg-search-pop {
  position: absolute; z-index: 70; inset-inline: 0; top: calc(100% + var(--s-1)); max-height: min(60vh, 480px); overflow: auto;
  padding: var(--s-1); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.gg-search-note { padding: var(--s-3); color: var(--text-2); }
.gg-search-kind { padding: var(--s-2) var(--s-2) var(--s-1); color: var(--text-2); font-size: var(--text-s); font-weight: var(--w-strong); }
.gg-search-item { padding: var(--s-2) var(--s-3); border-radius: calc(var(--radius) - 2px); cursor: pointer; }
.gg-search-item:hover, .gg-search-item[aria-selected="true"] { background: var(--surface-2); }
.gg-search-item[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent); }
.gg-search-title { font-weight: var(--w-strong); }
.gg-search-sub { color: var(--text-2); font-size: var(--text-s); }

/* ---------- 13. toast ---------- */
gg-toast { position: fixed; z-index: 100; inset-inline: 0; bottom: var(--s-6); display: flex; justify-content: center; pointer-events: none; padding: 0 var(--s-4); }
.gg-toast-list { display: flex; flex-direction: column; gap: var(--s-2); align-items: center; max-width: 100%; }
.gg-toast-item {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-2); max-width: min(560px, 100%);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); border-radius: var(--radius);
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: var(--text-m);
  animation: gg-rise var(--fast) var(--ease);
}
/* It slides up; it never fades in, so a message is fully readable from the first moment. */
@keyframes gg-rise { from { transform: translateY(8px); } }
.gg-toast-pic { display: grid; flex: none; }
.gg-toast-text { flex: 1 1 auto; min-width: 0; padding: var(--s-1) 0; }
.gg-toast-item[data-tone="bad"] { background: var(--danger); color: var(--on-danger); }
.gg-toast-item[data-tone="good"] .gg-toast-pic { color: var(--accent); }
.gg-toast-item[data-tone="wait"] .gg-toast-pic { color: var(--accent); }
.gg-toast-item .gg-btn, .gg-toast-item .gg-btn:hover { color: inherit; background: transparent; border-color: transparent; }
.gg-toast-item .gg-btn:hover { text-decoration: underline; box-shadow: inset 0 0 0 1px currentColor; }
.gg-toast-item :focus-visible { outline-color: currentColor; }

/* ---------- 14. timeline, summary ---------- */
gg-timeline { display: block; min-width: 0; }
.gg-tl-day { font-size: var(--text-s); font-weight: var(--w-strong); color: var(--text-2); padding: var(--s-4) 0 var(--s-2); }
.gg-tl-day:first-child { padding-top: 0; }
.gg-tl-list { position: relative; }
.gg-tl-list::before { content: ""; position: absolute; inset-block: var(--s-3); inset-inline-start: 5px; width: 1px; background: var(--line); }
.gg-tl-item { position: relative; display: grid; grid-template-columns: 11px minmax(0, 1fr) auto; gap: var(--s-3); align-items: baseline; padding: var(--s-2) 0; }
.gg-tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); align-self: start; margin-top: 0.35em; position: relative; }
.gg-tl-item[data-tone="good"] .gg-tl-dot { background: var(--good-text); border-color: var(--good-text); }
.gg-tl-item[data-tone="bad"] .gg-tl-dot { background: var(--danger); border-color: var(--danger); }
.gg-tl-item[data-tone="wait"] .gg-tl-dot { background: var(--accent); border-color: var(--text); }
.gg-tl-item[data-tone="bad"] .gg-tl-sentence { color: var(--danger-text); font-weight: var(--w-strong); }
.gg-tl-detail { color: var(--text-2); font-size: var(--text-s); margin-top: 2px; }
.gg-tl-time { color: var(--text-2); font-size: var(--text-s); }
.gg-tl-more { display: flex; justify-content: center; padding-top: var(--s-3); }

gg-summary { display: block; padding: var(--panel-pad); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); min-width: 0; }
.gg-summary-title { font-size: var(--text-s); font-weight: var(--w-strong); color: var(--text-2); margin-bottom: var(--s-2); }
.gg-summary-text { max-width: 72ch; font-size: var(--text-m); }
.gg-summary-text + .gg-summary-text { margin-top: var(--s-2); }
[data-density="dense"] .gg-summary-text, :root:not([data-density]) .gg-summary-text { font-size: calc(var(--text-m) + 1px); }
.gg-summary-points { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.gg-summary-points li { padding: 2px var(--s-2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: var(--text-s); }
.gg-summary-foot { color: var(--text-2); font-size: var(--text-s); margin-top: var(--s-3); }
.gg-summary-note { color: var(--text-2); }

/* ---------- 15. loading and empty ---------- */
gg-loading { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
gg-loading[kind="spinner"] { flex-direction: row; align-items: center; color: var(--text-2); }
.gg-skel { background: var(--line); border-radius: calc(var(--radius) / 2); animation: gg-pulse 1.6s ease-in-out infinite; color: transparent; }
@keyframes gg-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .gg-skel { animation: none; } .gg-toast-item { animation: none; } }
.gg-skel-line { height: 0.8em; margin: 0.325em 0; display: block; }
.gg-skel-w0 { width: 92%; } .gg-skel-w1 { width: 64%; } .gg-skel-w2 { width: 78%; } .gg-skel-w3 { width: 48%; }
.gg-td .gg-skel-line { flex: 0 1 auto; }
.gg-skel-block { height: 160px; border-radius: var(--radius); }

gg-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-2); padding: var(--s-8) var(--s-4); color: var(--text); }
.gg-empty-pic { width: var(--s-10); height: var(--s-10); border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
gg-empty[tone="bad"] .gg-empty-pic { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }
.gg-empty-title { font-weight: var(--w-strong); }
.gg-empty-text { color: var(--text-2); max-width: 48ch; }
.gg-empty-actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); flex-wrap: wrap; justify-content: center; }

/* ---------- 16. the assistant: the one place to ask ---------- */
:root { --asst-w: 440px; }
/* Its button in the menu: the one filled thing there, so it cannot be missed. */
.gg-nav-asst { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-1) 0; }
.gg-asst-launch .gg-btn { min-height: 44px; justify-content: flex-start; padding: 0 var(--s-3); border-radius: 12px; font-size: var(--dense-2); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.gg-asst-launch .gg-btn .gg-icon { width: 20px; height: 20px; }
.gg-asst-launch .gg-btn:hover { box-shadow: 0 0 0 5px var(--accent-soft), var(--shadow); }
.gg-asst-launch .gg-btn::after { content: ""; position: absolute; inset: -3px; border-radius: 14px; border: 2px solid var(--accent); opacity: 0; pointer-events: none; animation: gg-asst-ring 2.4s var(--ease) 1s 3; }
@keyframes gg-asst-ring { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08, 1.35); } }
.gg-asst-launch-sub { padding: 0 var(--s-2); font-size: var(--dense-1); color: var(--text-2); line-height: var(--lh-tight); }
/* The short one in the top bar shows only while the menu is tucked away. */
.gg-asst-launch-top { display: none; }
.gg-shell[data-nav-over] .gg-asst-launch-top { display: inline-flex; }
@media (max-width: 960px) { .gg-asst-launch-top { display: inline-flex; } .gg-top-tools > gg-button.gg-asst-launch-top .gg-btn-words { display: inline; } }
@media (prefers-reduced-motion: reduce) { .gg-asst-launch .gg-btn::after { animation: none; } }

/* The window. Not a dialog: the page behind stays in use. */
.gg-asst { position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 0; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: var(--dense-2); --text-s: var(--dense-1); --text-m: var(--dense-2); --text-l: var(--dense-3); --control-h: 36px; --pad-x: var(--s-3); --gap: var(--s-3); --panel-pad: var(--s-3); }
.gg-asst[hidden] { display: none; }
.gg-asst[data-mode="side"] { inset-block: 0; inset-inline-end: 0; width: min(var(--asst-w), 100vw); border-width: 0 0 0 1px; }
.gg-asst[data-mode="float"] { width: 400px; height: min(620px, calc(100vh - var(--s-12))); min-width: 320px; min-height: 360px; max-width: 100vw; max-height: 100vh; border-radius: 14px; overflow: hidden; resize: both; }
.gg-asst[data-mode="full"] { inset: 0; border: 0; }
.gg-asst[data-mode="full"] .gg-asst-panel { width: 100%; max-width: 920px; margin-inline: auto; }
@media (min-width: 1280px) { html[data-gg-asst="side"] .gg-shell { margin-inline-end: var(--asst-w); } }
.gg-asst-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); background: var(--accent); color: var(--on-accent); }
.gg-asst[data-mode="float"] .gg-asst-head { cursor: grab; touch-action: none; user-select: none; }
.gg-asst-title { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.gg-asst-badge { font-size: var(--dense-3); line-height: 1; }
.gg-asst-name { font-size: var(--dense-2); font-weight: var(--w-strong); }
.gg-asst-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.gg-asst-head gg-button .gg-btn { color: var(--on-accent); min-height: 32px; min-width: 32px; }
.gg-asst-head gg-button .gg-btn:hover, .gg-asst-head gg-button .gg-btn[aria-pressed="true"] { background: var(--accent-hover); }
.gg-asst-head gg-button .gg-btn:focus-visible { outline-color: var(--on-accent); }
.gg-asst-body, .gg-asst-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.gg-asst-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-4); }
.gg-asst-scroll[hidden] { display: none; }
.gg-asst-welcome { display: flex; flex-direction: column; gap: var(--s-3); }
.gg-asst-welcome[hidden] { display: none; }
.gg-asst-hello { font-size: var(--dense-3); font-weight: var(--w-strong); line-height: var(--lh-tight); }
.gg-asst-h { font-size: var(--dense-2); font-weight: var(--w-strong); }
.gg-asst-starters { display: flex; flex-direction: column; gap: var(--s-2); }
.gg-asst-starter { display: flex; }
.gg-asst-starter .gg-btn { min-height: 52px; padding: var(--s-2) var(--s-3); justify-content: flex-start; text-align: start; white-space: normal; line-height: var(--lh); border-color: var(--line); border-inline-start: 4px solid var(--accent); }
.gg-asst-starter .gg-btn:hover { background: var(--accent-soft); }
.gg-asst-starter .gg-btn-words { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.gg-asst-starter-kind { font-size: var(--dense-1); font-weight: var(--w-strong); color: var(--text-2); letter-spacing: 0.04em; text-transform: uppercase; }
.gg-asst-starter-text { font-weight: var(--w-normal); }
.gg-asst-log { display: flex; flex-direction: column; gap: var(--s-4); }
.gg-asst-log:empty { display: none; }
.gg-asst-msg { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; padding: var(--s-3); border: 1px solid var(--line); border-radius: 12px 12px 12px 2px; background: var(--bg); overflow-wrap: anywhere; }
.gg-asst-msg[data-from="you"] { align-self: flex-end; max-width: 88%; padding: var(--s-2) var(--s-3); border-color: transparent; border-radius: 12px 12px 2px 12px; background: var(--accent-soft); }
.gg-asst-msg[data-from="you"] .gg-asst-who { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gg-asst-who { display: flex; align-items: center; gap: var(--s-2); }
.gg-asst-list { display: flex; flex-direction: column; gap: var(--s-1); padding-inline-start: var(--s-5); }
ul.gg-asst-list { list-style: disc; }
ol.gg-asst-list { list-style: decimal; }
.gg-asst-steps { padding: var(--s-3) var(--s-3) var(--s-3) var(--s-8); border-radius: var(--radius); background: var(--surface-2); }
.gg-asst-table { max-width: 100%; overflow-x: auto; }
.gg-asst-open .gg-link { font-weight: var(--w-strong); }
.gg-asst-checked-mark { color: var(--good-text); font-weight: var(--w-strong); }
.gg-asst-rate { display: flex; align-items: center; gap: 2px; margin-top: calc(-1 * var(--s-1)); }
.gg-asst-rate gg-button .gg-btn { min-height: 28px; min-width: 28px; padding: 0; color: var(--text-2); }
.gg-asst-rate gg-button .gg-btn[aria-pressed="true"] { color: var(--text); background: var(--accent-soft); }
.gg-asst-working { color: var(--text-2); }
.gg-asst-form { flex: none; display: block; padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); background: var(--surface); }
.gg-asst-form[hidden] { display: none; }
.gg-asst-form .gg-form { gap: var(--s-2); }
.gg-asst-form-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.gg-asst-form-row > gg-button { flex: none; }
.gg-asst-form-links { display: flex; align-items: center; gap: 0; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.gg-asst-form-links gg-button .gg-btn { font-weight: var(--w-normal); font-size: var(--dense-1); color: var(--text-2); padding: 0 var(--s-2); min-height: 28px; }
/* A phone: whichever way it was left, it is the whole screen, and the three ways are not offered. */
@media (max-width: 640px) {
  .gg-asst[data-mode] { inset: 0; width: auto; height: auto; max-height: none; border: 0; border-radius: 0; resize: none; left: 0 !important; top: 0 !important; }
  .gg-asst-tools gg-button[data-mode] { display: none; }
}

/* ---------- 17. a page for a customer (the offer and agreement page: screen.bare) ----------
 * The website's look in the kit's tokens: paper, ink, one yellow, a serif for the big words,
 * cards with soft corners. Phone first; it only widens. Every colour is a token, so light and
 * dark both read. */
.gg-cust { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(120% 60% at 50% 0%, var(--accent-soft), transparent 70%), var(--bg); }
.gg-cust-bar { display: flex; align-items: center; justify-content: center; padding: var(--s-5) var(--s-4); border-bottom: 1px solid var(--line); }
.gg-cust-bar .gg-logo-mark { height: var(--s-8); }
.gg-cust-bar .gg-logo-word { font-size: var(--simple-2); }
.gg-cust-main { width: 100%; max-width: 44rem; margin: 0 auto; padding: var(--s-6) var(--s-4) var(--s-16); display: flex; flex-direction: column; gap: var(--s-6); }
.gg-cust-head { display: flex; flex-direction: column; gap: var(--s-2); }
.gg-cust-title { font-family: var(--font-brand); font-size: clamp(var(--simple-3), 8vw, calc(var(--simple-3) * 1.4)); font-weight: var(--w-normal); line-height: var(--lh-tight); letter-spacing: -0.02em; color: var(--text); overflow-wrap: anywhere; }
.gg-cust-facts { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.gg-cust-fact { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) * 2); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.gg-cust-fact[data-lead] { background: var(--accent-soft); border-color: var(--accent); }
.gg-cust-fact-wide { grid-column: 1 / -1; }
.gg-cust-fact-label { font-size: var(--dense-1); font-weight: var(--w-strong); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.gg-cust-fact-value { font-family: var(--font-brand); font-size: var(--simple-2); line-height: var(--lh-tight); color: var(--text); font-variant-numeric: tabular-nums; }
.gg-cust-fact[data-lead] .gg-cust-fact-value { font-size: calc(var(--simple-3) * 0.9); }
.gg-cust-places { list-style: none; margin: var(--s-1) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); font-size: var(--simple-1); }
.gg-cust-places li { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); align-items: start; line-height: var(--lh); overflow-wrap: anywhere; }
.gg-cust-places li::before { content: ""; width: var(--s-2); height: var(--s-2); margin-top: 0.55em; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--line-strong); }
.gg-cust-doc { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) * 2); padding: var(--s-6) var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); font-size: var(--simple-1); line-height: 1.65; color: var(--text); }
.gg-cust-doc p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.gg-cust-doc-title { font-family: var(--font-brand); font-size: var(--simple-2); line-height: var(--lh-tight); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); }
.gg-cust-form { background: var(--surface); border: 1px solid var(--line); border-top: var(--s-1) solid var(--accent); border-radius: calc(var(--radius) * 2); padding: var(--s-6) var(--s-5); box-shadow: var(--shadow); }
.gg-cust-form .gg-form-actions { justify-content: stretch; }
.gg-cust-form .gg-form-actions gg-button, .gg-cust-form .gg-form-actions .gg-btn { flex: 1 1 auto; width: 100%; }
.gg-cust-said { font-size: var(--simple-1); color: var(--danger-text); font-weight: var(--w-strong); }
.gg-cust-said:empty { display: none; }
.gg-cust-done { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) * 2); padding: var(--s-8) var(--s-5); display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); }
.gg-cust-done:focus { outline: none; }
.gg-cust-ring { width: var(--s-16); height: var(--s-16); border-radius: 50%; display: grid; place-items: center; background: var(--good-soft); color: var(--good-text); }
.gg-cust-ring .gg-icon { width: var(--s-8); height: var(--s-8); }
.gg-cust-done[data-tone="bad"] .gg-cust-ring { background: var(--danger-soft); color: var(--danger-text); }
.gg-cust-done[data-tone="wait"] .gg-cust-ring { background: var(--wait-soft); color: var(--wait-text); }
.gg-cust-done-title { font-family: var(--font-brand); font-size: var(--simple-3); line-height: var(--lh-tight); color: var(--text); overflow-wrap: anywhere; }
.gg-cust-done-text { font-size: var(--simple-1); color: var(--text-2); max-width: 40ch; line-height: var(--lh); }
@media (min-width: 640px) {
  .gg-cust-main { padding-top: var(--s-10); gap: var(--s-8); }
  .gg-cust-doc, .gg-cust-form { padding: var(--s-8); }
  .gg-cust-form .gg-form-actions { justify-content: flex-end; }
  .gg-cust-form .gg-form-actions gg-button, .gg-cust-form .gg-form-actions .gg-btn { flex: 0 0 auto; width: auto; }
}
