/* GoVace app: design tokens, base and components.
   The rules are in docs/design-system.md. Brand colours come from
   brand-strategy/brand-book/tokens.json and are never changed here.
   Calm, paper-white, forest ink. Hairlines instead of shadows. No dashes in copy. */

/* ---------- tokens ---------- */
:root {
  /* brand (locked) */
  --forest: #1E3A32;
  --sage: #6E9C83;
  --mint: #9CC5AE;
  --paper: #F7F6F2;
  --cream: #F2F0E8;
  --night: #111312;

  /* derived brand steps */
  --forest-600: #183029;
  --forest-700: #122520;
  --forest-400: #2C5246;
  --sage-600: #557F69;

  /* surfaces */
  --bg: var(--paper);
  --bg-sunken: #F1EFE9;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;

  /* ink */
  --ink: #17211D;
  --ink-2: #47524C;
  --ink-3: #76807A;
  --ink-4: #A6ADA8;
  --ink-inv: #F4F2EA;

  /* lines */
  --line: rgba(30, 58, 50, 0.10);
  --line-2: rgba(30, 58, 50, 0.17);
  --line-3: rgba(30, 58, 50, 0.28);

  /* washes */
  --wash: rgba(30, 58, 50, 0.045);
  --wash-2: rgba(30, 58, 50, 0.08);
  --wash-mint: #E6F0EA;
  --wash-sage: #EEF3EF;

  /* states: muted, so they sit calmly beside forest and sage */
  --ok: #2C6A4F;      --ok-bg: #E2EFE7;
  --warn: #8A5A12;    --warn-bg: #F5EAD2;
  --bad: #9C3B2B;     --bad-bg: #F6E2DD;
  --info: #3F5870;    --info-bg: #E5EBF1;
  --mute: #5C6660;    --mute-bg: #EDECE6;

  /* type */
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-12: 12px; --t-13: 13px; --t-14: 14px; --t-15: 15px; --t-16: 16px;
  --t-18: 18px; --t-22: 22px; --t-28: 28px; --t-36: 36px; --t-44: 44px;

  /* shape */
  --r-6: 6px; --r-8: 8px; --r-10: 10px; --r-12: 12px; --r-14: 14px; --r-18: 18px; --r-24: 24px; --r-pill: 999px;

  /* space (4px grid) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* elevation: used only for things that float (menus, dialogs, toasts) */
  --float: 0 14px 36px -14px rgba(18, 37, 32, 0.22), 0 2px 8px rgba(18, 37, 32, 0.06);
  --float-sm: 0 6px 18px -8px rgba(18, 37, 32, 0.18), 0 1px 3px rgba(18, 37, 32, 0.05);
  --ring: 0 0 0 3px rgba(110, 156, 131, 0.34);

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.5, 0, 0.75, 0);
  --d-1: 120ms; --d-2: 200ms; --d-3: 320ms; --d-4: 480ms;

  /* layout */
  --sidebar: 252px;
  --content: 1080px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-14)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 0, "cv11" 1;
}
#root { min-height: 100dvh; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(156, 197, 174, 0.55); color: var(--ink); }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-8); }
[hidden] { display: none !important; }
.gv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.gv-display { font-size: clamp(30px, 3.2vw, var(--t-44)); line-height: 1.06; letter-spacing: -0.036em; font-weight: 500; text-wrap: balance; }
.gv-h1 { font-size: var(--t-28); line-height: 1.15; letter-spacing: -0.03em; font-weight: 500; }
.gv-h2 { font-size: var(--t-22); line-height: 1.2; letter-spacing: -0.025em; font-weight: 500; }
.gv-h3 { font-size: var(--t-16); line-height: 1.3; letter-spacing: -0.012em; font-weight: 500; }
.gv-lead { font-size: var(--t-16); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.gv-body { font-size: var(--t-14); color: var(--ink-2); }
.gv-small { font-size: var(--t-13); color: var(--ink-3); }
.gv-tiny { font-size: var(--t-12); color: var(--ink-3); }
.gv-mono { font-family: var(--mono); font-size: 0.93em; letter-spacing: -0.01em; }
.gv-num { font-variant-numeric: tabular-nums; }
.gv-strong { font-weight: 500; color: var(--ink); }
.gv-muted { color: var(--ink-3); }
.gv-link { color: var(--forest); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; transition: text-decoration-color var(--d-2) var(--ease); }
.gv-link:hover { text-decoration-color: var(--forest); }

/* ---------- buttons ---------- */
.gv-btn {
  --h: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: var(--r-pill);
  font-size: var(--t-14); font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  border: 1px solid transparent; user-select: none;
  transition: background-color var(--d-2) var(--ease), border-color var(--d-2) var(--ease), color var(--d-2) var(--ease), transform var(--d-1) var(--ease), opacity var(--d-2) var(--ease);
}
.gv-btn:active { transform: scale(0.98); }
.gv-btn:focus-visible { border-radius: var(--r-pill); }
.gv-btn svg { flex: none; }
.gv-btn--primary { background: var(--forest); color: var(--ink-inv); }
.gv-btn--primary:hover { background: var(--forest-600); }
.gv-btn--primary:active { background: var(--forest-700); }
.gv-btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.gv-btn--secondary:hover { background: var(--surface-2); border-color: var(--line-3); }
.gv-btn--ghost { color: var(--ink-2); }
.gv-btn--ghost:hover { background: var(--wash-2); color: var(--ink); }
.gv-btn--danger { background: var(--surface); color: var(--bad); border-color: rgba(156, 59, 43, 0.3); }
.gv-btn--danger:hover { background: var(--bad-bg); }
.gv-btn--sm { --h: 30px; padding: 0 12px; font-size: var(--t-13); gap: 6px; }
.gv-btn--lg { --h: 44px; padding: 0 22px; font-size: var(--t-15); }
.gv-btn--block { width: 100%; }
.gv-btn--icon { width: var(--h); padding: 0; }
.gv-btn[disabled], .gv-btn.is-disabled { opacity: 0.45; pointer-events: none; }
.gv-btn.is-busy { pointer-events: none; color: transparent !important; position: relative; }
.gv-btn.is-busy::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 6px; margin: -3px 0 0 -11px;
  background: radial-gradient(circle 3px, currentColor 98%, transparent) 0 0 / 8px 6px repeat-x;
  color: var(--ink-3); animation: gv-dots 900ms steps(4, end) infinite; clip-path: inset(0 100% 0 0);
}
.gv-btn--primary.is-busy::after { color: var(--ink-inv); }
@keyframes gv-dots { to { clip-path: inset(0 -34% 0 0); } }

/* ---------- fields ---------- */
.gv-field { display: grid; gap: 6px; }
.gv-label { font-size: var(--t-13); font-weight: 500; color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.gv-label small, .gv-label .gv-label-aside { font-weight: 400; color: var(--ink-3); font-size: var(--t-12); }
.gv-hint { font-size: var(--t-12); color: var(--ink-3); line-height: 1.45; }
.gv-error { font-size: var(--t-12); color: var(--bad); line-height: 1.45; }
.gv-input, .gv-select, .gv-textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-10);
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  font-size: var(--t-14); line-height: 1.4;
  transition: border-color var(--d-2) var(--ease), box-shadow var(--d-2) var(--ease), background-color var(--d-2) var(--ease);
}
.gv-input::placeholder, .gv-textarea::placeholder { color: var(--ink-4); }
.gv-input:hover, .gv-select:hover, .gv-textarea:hover { border-color: var(--line-3); }
.gv-input:focus, .gv-select:focus, .gv-textarea:focus { border-color: var(--sage-600); box-shadow: var(--ring); }
.gv-input--lg { height: 46px; padding: 0 14px; font-size: var(--t-15); border-radius: var(--r-12); }
.gv-textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.gv-select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2376807A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.gv-input.is-invalid, .gv-textarea.is-invalid { border-color: rgba(156, 59, 43, 0.55); }
.gv-input[disabled], .gv-select[disabled], .gv-textarea[disabled] { background: var(--bg-sunken); color: var(--ink-3); }
.gv-inputwrap { position: relative; }
.gv-inputwrap > .gv-input { padding-right: 40px; }
.gv-inputwrap > .gv-inputwrap-end { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: var(--r-8); display: grid; place-items: center; color: var(--ink-3); }
.gv-inputwrap > .gv-inputwrap-end:hover { color: var(--ink); background: var(--wash); }
.gv-inputwrap > .gv-inputwrap-start { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.gv-inputwrap.has-start > .gv-input { padding-left: 36px; }

/* switch */
.gv-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--t-14); }
.gv-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.gv-switch-track { width: 36px; height: 22px; border-radius: var(--r-pill); background: var(--line-3); position: relative; flex: none; transition: background-color var(--d-2) var(--ease); }
.gv-switch-track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(18, 37, 32, 0.25); transition: transform var(--d-3) var(--ease); }
.gv-switch input:checked + .gv-switch-track { background: var(--forest); }
.gv-switch input:checked + .gv-switch-track::after { transform: translateX(14px); }
.gv-switch input:focus-visible + .gv-switch-track { box-shadow: var(--ring); }
.gv-switch input:disabled + .gv-switch-track { opacity: 0.45; }

/* checkbox */
.gv-check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: var(--t-14); line-height: 1.4; }
.gv-check input { appearance: none; width: 18px; height: 18px; margin: 1px 0 0; flex: none; border-radius: 5px; border: 1px solid var(--line-3); background: var(--surface) center / 12px no-repeat; transition: background-color var(--d-2) var(--ease), border-color var(--d-2) var(--ease); }
.gv-check input:checked { background-color: var(--forest); border-color: var(--forest); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F4F2EA' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17.5 19 7'/%3E%3C/svg%3E"); }
.gv-check input:focus-visible { box-shadow: var(--ring); }

/* choice cards: one decision per screen */
.gv-choices { display: grid; gap: 10px; }
.gv-choice {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--r-14);
  background: var(--surface); border: 1px solid var(--line-2);
  transition: border-color var(--d-2) var(--ease), background-color var(--d-2) var(--ease), transform var(--d-1) var(--ease);
}
.gv-choice:hover { border-color: var(--line-3); background: var(--surface-2); }
.gv-choice:active { transform: scale(0.995); }
.gv-choice.is-on { border-color: var(--forest); background: var(--surface); box-shadow: inset 0 0 0 1px var(--forest); }
.gv-choice-icon { width: 36px; height: 36px; border-radius: var(--r-10); display: grid; place-items: center; background: var(--wash-sage); color: var(--forest); flex: none; }
.gv-choice-title { font-size: var(--t-15); font-weight: 500; letter-spacing: -0.01em; }
.gv-choice-text { font-size: var(--t-13); color: var(--ink-3); margin-top: 1px; }
.gv-choice-mark { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-3); display: grid; place-items: center; color: transparent; transition: all var(--d-2) var(--ease); }
.gv-choice.is-on .gv-choice-mark { background: var(--forest); border-color: var(--forest); color: var(--ink-inv); }
.gv-choice.is-locked { opacity: 0.62; }
.gv-choice.is-locked:hover { border-color: var(--line-2); background: var(--surface); }

/* ---------- surfaces ---------- */
.gv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-14); }
.gv-card-pad { padding: 20px 22px; }
.gv-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.gv-card-head .gv-h3 + .gv-small { margin-top: 2px; }
.gv-divide > * + * { border-top: 1px solid var(--line); }
.gv-well { background: var(--bg-sunken); border-radius: var(--r-12); padding: 14px 16px; }

/* ---------- badges, dots, avatars ---------- */
.gv-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: var(--t-12); font-weight: 500; white-space: nowrap; background: var(--mute-bg); color: var(--mute); }
.gv-badge--ok { background: var(--ok-bg); color: var(--ok); }
.gv-badge--warn { background: var(--warn-bg); color: var(--warn); }
.gv-badge--bad { background: var(--bad-bg); color: var(--bad); }
.gv-badge--info { background: var(--info-bg); color: var(--info); }
.gv-badge--forest { background: var(--forest); color: var(--ink-inv); }
.gv-badge--line { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }
.gv-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.gv-avatar { --size: 32px; width: var(--size); height: var(--size); border-radius: 28%; display: grid; place-items: center; flex: none; font-size: calc(var(--size) * 0.4); font-weight: 600; letter-spacing: -0.02em; background: var(--wash-mint); color: var(--forest); text-transform: uppercase; }
.gv-avatar--round { border-radius: 50%; }
.gv-avatar--forest { background: var(--forest); color: var(--mint); }
.gv-avatar[data-tone="1"] { background: #E9EDE2; color: #4B5A2E; }
.gv-avatar[data-tone="2"] { background: #E4ECEF; color: #2F5364; }
.gv-avatar[data-tone="3"] { background: #F1E8DB; color: #7A5521; }
.gv-avatar[data-tone="4"] { background: #EFE4E1; color: #7E4337; }

/* ---------- tabs (pill) ---------- */
.gv-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--bg-sunken); border: 1px solid var(--line); }
.gv-tab { height: 30px; padding: 0 14px; border-radius: var(--r-pill); font-size: var(--t-13); font-weight: 500; color: var(--ink-3); transition: color var(--d-2) var(--ease), background-color var(--d-2) var(--ease); display: inline-flex; align-items: center; gap: 6px; }
.gv-tab:hover { color: var(--ink); }
.gv-tab.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 37, 32, 0.08), 0 0 0 1px var(--line); }
.gv-tab .gv-count { font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- lists and tables ---------- */
.gv-rows { display: grid; grid-template-columns: minmax(0, 1fr); }
.gv-rows > * { min-width: 0; }
.gv-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; min-height: 56px; transition: background-color var(--d-2) var(--ease); }
.gv-row + .gv-row { border-top: 1px solid var(--line); }
a.gv-row:hover, button.gv-row:hover, .gv-row.is-link:hover { background: var(--surface-2); }
.gv-row-main { min-width: 0; flex: 1; }
.gv-row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-row-sub { font-size: var(--t-13); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-table { width: 100%; border-collapse: collapse; font-size: var(--t-14); }
.gv-table th { text-align: left; font-size: var(--t-12); font-weight: 500; color: var(--ink-3); padding: 10px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gv-table td { padding: 13px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.gv-table tr:last-child td { border-bottom: 0; }
.gv-table tbody tr { transition: background-color var(--d-2) var(--ease); }
.gv-table tbody tr.is-link { cursor: pointer; }
.gv-table tbody tr.is-link:hover { background: var(--surface-2); }

/* ---------- code line (the snippet) ---------- */
.gv-code { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: var(--r-12); background: var(--forest); color: #D8E6DD; font-family: var(--mono); font-size: var(--t-13); }
.gv-code code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.gv-code code::-webkit-scrollbar { display: none; }
.gv-code .gv-btn { background: rgba(244, 242, 234, 0.12); color: var(--ink-inv); border-color: transparent; }
.gv-code .gv-btn:hover { background: rgba(244, 242, 234, 0.2); }

/* ---------- banners ---------- */
.gv-banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r-12); background: var(--wash-sage); color: var(--ink-2); font-size: var(--t-13); line-height: 1.45; }
.gv-banner svg { flex: none; margin-top: 1px; color: var(--forest); }
.gv-banner--warn { background: var(--warn-bg); color: #5F4212; } .gv-banner--warn svg { color: var(--warn); }
.gv-banner--bad { background: var(--bad-bg); color: #6E2B20; } .gv-banner--bad svg { color: var(--bad); }
.gv-banner strong { font-weight: 500; color: var(--ink); }

/* ---------- lock (plan) ---------- */
.gv-lock { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 7px; border-radius: var(--r-pill); font-size: var(--t-12); font-weight: 500; background: var(--cream); color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- menu, dialog, toast ---------- */
.gv-menu { position: absolute; z-index: 60; min-width: 200px; padding: 6px; border-radius: var(--r-12); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--float); animation: gv-pop var(--d-2) var(--ease); transform-origin: top left; }
.gv-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: var(--r-8); font-size: var(--t-14); color: var(--ink); text-align: left; }
.gv-menu-item:hover, .gv-menu-item:focus-visible { background: var(--wash-2); box-shadow: none; }
.gv-menu-item svg { color: var(--ink-3); flex: none; }
.gv-menu-item--danger { color: var(--bad); } .gv-menu-item--danger svg { color: var(--bad); }
.gv-menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.gv-menu-label { padding: 6px 10px 4px; font-size: var(--t-12); color: var(--ink-3); }

.gv-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(17, 19, 18, 0.32); display: grid; place-items: center; padding: 20px; animation: gv-fade var(--d-2) var(--ease); }
.gv-dialog { width: min(480px, 100%); max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border-radius: var(--r-18); border: 1px solid var(--line); box-shadow: var(--float); padding: 26px 26px 22px; animation: gv-rise var(--d-3) var(--ease); }
.gv-dialog--wide { width: min(640px, 100%); }
.gv-dialog-title { font-size: var(--t-18); font-weight: 500; letter-spacing: -0.02em; }
.gv-dialog-text { margin-top: 8px; color: var(--ink-2); }
.gv-dialog-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }

.gv-toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.gv-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: var(--r-pill); background: var(--night); color: #EDEBE4; font-size: var(--t-13); box-shadow: var(--float); animation: gv-rise var(--d-3) var(--ease); }
.gv-toast svg { color: var(--mint); flex: none; }
.gv-toast--bad svg { color: #E9A99D; }
.gv-toast.is-leaving { animation: gv-leave var(--d-2) var(--ease-in) forwards; }

/* ---------- empty and loading ---------- */
.gv-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 48px 24px; color: var(--ink-3); }
.gv-empty-art { width: 44px; height: 44px; border-radius: var(--r-12); display: grid; place-items: center; background: var(--wash-sage); color: var(--forest); margin-bottom: 8px; }
.gv-empty .gv-h3 { color: var(--ink); }
.gv-empty p { max-width: 42ch; }
.gv-skel { border-radius: var(--r-8); background: var(--wash-2); animation: gv-breathe 1600ms ease-in-out infinite; }
@keyframes gv-breathe { 50% { opacity: 0.45; } }

/* ---------- progress ---------- */
.gv-progress { height: 4px; border-radius: var(--r-pill); background: var(--wash-2); overflow: hidden; }
.gv-progress > i { display: block; height: 100%; border-radius: inherit; background: var(--forest); transform-origin: left; transition: transform var(--d-4) var(--ease); }

/* ---------- motion ---------- */
@keyframes gv-fade { from { opacity: 0; } }
@keyframes gv-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes gv-pop { from { opacity: 0; transform: scale(0.97) translateY(-4px); } }
@keyframes gv-leave { to { opacity: 0; transform: translateY(6px); } }
.gv-enter { animation: gv-rise var(--d-4) var(--ease) both; }
.gv-enter > * { animation: gv-rise var(--d-4) var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.gv-stagger > * { animation: gv-rise var(--d-4) var(--ease) both; }
.gv-stagger > *:nth-child(1) { animation-delay: 40ms; }
.gv-stagger > *:nth-child(2) { animation-delay: 100ms; }
.gv-stagger > *:nth-child(3) { animation-delay: 160ms; }
.gv-stagger > *:nth-child(4) { animation-delay: 220ms; }
.gv-stagger > *:nth-child(5) { animation-delay: 280ms; }
.gv-stagger > *:nth-child(6) { animation-delay: 340ms; }
.gv-stagger > *:nth-child(n+7) { animation-delay: 400ms; }
.gv-exit { animation: gv-leave var(--d-2) var(--ease-in) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* ---------- small layout helpers ---------- */
.gv-stack { display: grid; gap: var(--gap, 16px); }
.gv-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 10px); }
.gv-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gv-grow { flex: 1; min-width: 0; }
.gv-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 640px) { .gv-grid-2 { grid-template-columns: 1fr; } }

/* tabs never wrap their labels; on a phone the strip scrolls sideways instead */
.gv-tab { white-space: nowrap; flex: none; }
@media (max-width: 640px) {
  .gv-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .gv-tabs::-webkit-scrollbar { display: none; }
}
