/* ============================================================
   IEM — AP Sales brand tokens + shared components.
   Load after vendor/fonts/fonts.css and vendor/radix-colors-3.0.0/colors.css.
   Ported from tools-funops/styles.css: same token names, so the CRM's
   tool.css ports as is, but AP Sales blue (New branding 2026) and light + dark.
   ============================================================ */

/* Radix scales give each step a job: 1–2 backgrounds, 3–5 components,
   6–8 borders, 9–10 solid colour, 11–12 text. Below, those steps get the
   names the apps use. Every text pair here passes WCAG AA (4.5:1) in both
   themes; docs/ui.html shows them all. */
:root {
  color-scheme: light dark;

  /* brand primitives (../ap-sales/src/styles.css) */
  --brand-blue:  #0062ff;
  --brand-ink:   #1c1c1e;
  --brand-bone:  #eae8df;
  --brand-paper: #f9f9f9;
  --brand-pitch: #111111;
  --brand-void:  #0a0a0b;

  /* Surfaces, in order. Each step must show on the one below it:
     page → panel → card/field → hover. */
  --base:    var(--brand-paper);  /* page */
  --surface: #ffffff;             /* panels, dialogs */
  --raised:  #ffffff;             /* cards, menus, fields */
  --hover:   var(--gray-3);       /* hover on --raised */
  --press:   var(--gray-4);
  --line:    var(--gray-6);       /* a border you can see */
  --line-strong: var(--gray-7);
  --line-soft: var(--gray-a4);

  /* Text, three levels. Small text uses --fg or --muted. --faint is for
     placeholders, icons and large numbers, never a word to read at 12–13px. */
  --fg:    var(--brand-ink);
  --muted: var(--gray-11);
  --faint: var(--gray-10);

  /* Accent: one, for the action to take. White on brand blue is 5:1. */
  --accent:       var(--brand-blue);
  --accent-hover: #0052d6;
  --accent-text:  #0052d6;        /* blue words and links: 5.4:1+ on any surface */
  --accent-soft:  rgb(0 98 255 / .1);
  --accent-line:  rgb(0 98 255 / .35);
  --on-accent:    #ffffff;
  --focus:        var(--accent-text);

  /* states */
  --danger:       #c0282d;        /* text; Radix 11 steps miss AA on their soft tints */
  --danger-fill:  #ce2c31;        /* buttons: white on it is 5.2:1 */
  --danger-hover: #b8262b;
  --danger-soft:  var(--red-3);
  --warn:         #935400;
  --warn-soft:    var(--amber-3);
  --warn-line:    var(--amber-6);
  --ok:           #187449;
  --ok-soft:      var(--green-3);

  /* Card colours: the one exception to the palette. Five tints that tell
     apart at a glance. */
  --amber:  var(--amber-9);
  --sky:    var(--sky-9);
  --rose:   var(--crimson-10);
  --violet: var(--violet-10);
  --lime:   var(--lime-9);

  /* Radii: a scale, not one value everywhere. */
  --r-xs:   6px;    /* chips, small keys */
  --r-sm:   8px;    /* buttons, icons, fields */
  --r-md:   10px;   /* cards, menus */
  --r-lg:   14px;   /* panels, dialogs */
  --r-pill: 999px;

  /* Depth. Values follow Open Props' shadow-2/5/6 (MIT), tuned per theme. */
  --shadow-card: 0 1px 2px rgb(20 20 25 / .06), 0 2px 6px -2px rgb(20 20 25 / .08);
  --shadow-pop:  0 12px 32px -8px rgb(20 20 25 / .18), 0 4px 10px -4px rgb(20 20 25 / .1);
  --shadow-drag: 0 20px 40px -10px rgb(20 20 25 / .25), 0 6px 14px -6px rgb(20 20 25 / .14);
  --backdrop:    rgb(20 20 25 / .4);

  /* Motion: quick and soft. Curves from Open Props (MIT): ease-out-4,
     ease-in-out-3, ease-spring-2. */
  --ease:        cubic-bezier(0, 0, .1, 1);
  --ease-in-out: cubic-bezier(.5, 0, .5, 1);
  --spring:      linear(0, .007, .029 2.2%, .118 4.7%, .625 14.4%, .826 19%, .902, .962,
                   1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%,
                   .999 61.6%, .995 71.2%, 1);
  --t-fast: 120ms;
  --t:      180ms;
  --t-slow: 320ms;

  /* Type: Plus Jakarta Sans for headings, Inter (stand-in for Elza) to read,
     DM Sans on buttons, DM Mono for values only. */
  --display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --button:  "DM Sans", var(--text);
  --mono:    "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --base:    var(--brand-void);
    --surface: var(--gray-2);
    --raised:  var(--gray-4);
    --hover:   var(--gray-5);
    --press:   var(--gray-6);
    --line:    var(--gray-6);
    --line-strong: var(--gray-7);
    --line-soft: var(--gray-a4);

    --fg:    var(--gray-12);
    --muted: var(--gray-11);
    --faint: var(--gray-10);

    --accent-text: #6ea3ff;       /* brand blue is only 3.9:1 on black */
    --accent-soft: rgb(0 98 255 / .2);
    --accent-line: rgb(110 163 255 / .45);

    --danger: var(--red-11);
    --warn:   var(--amber-11);
    --ok:     var(--green-11);

    --shadow-card: inset 0 1px 0 var(--gray-a3), 0 2px 6px -2px rgb(0 0 0 / .6);
    --shadow-pop:  inset 0 1px 0 var(--gray-a4), 0 16px 40px -8px rgb(0 0 0 / .75);
    --shadow-drag: inset 0 1px 0 var(--gray-a5), 0 24px 48px -10px rgb(0 0 0 / .8);
    --backdrop:    rgb(0 0 0 / .72);
  }
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* [hidden] must win: any `display: grid/flex` beats the browser's own rule,
   and menus and panels toggled with `hidden` stayed open. */
[hidden] { display: none !important; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }

body {
  background: var(--base);
  color: var(--fg);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-soft); color: var(--fg); }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.15; }

/* width:100% matters: .wrap sits in a column flex with auto margins, which
   turns off stretch. Without it, it shrinks to its content. */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

/* ---- labels: small, plain, readable ---- */
.label {
  font-family: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.label--accent { color: var(--accent-text); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.text-link {
  font-family: var(--button);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.text-link:hover { color: var(--fg); border-bottom-color: var(--accent); }
.text-link--accent { color: var(--accent-text); }

.rule { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }

/* ---- page: footer always at the bottom ---- */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.page > main { flex: 1; }

/* ---- nav ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 13px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--base);
}
.nav__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.nav__brand svg { height: 22px; width: auto; }

.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
  color: var(--muted);
}
.crumbs a { text-decoration: none; transition: color var(--t-fast) var(--ease); }
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { color: var(--muted); }
.crumbs .here { color: var(--fg); font-weight: 500; }

/* ---- footer ---- */
.legal {
  border-top: 1px solid var(--line-soft);
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  justify-content: space-between;
  background: var(--base);
}
.legal p { margin: 0; }

/* the AP Sales emblem, wherever it shows */
.emblem { fill: var(--accent); }

/* ---- account (nav, right): avatar button + menu ---- */
.account { display: flex; align-items: center; min-width: 0; }
.account__btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 0; max-width: 260px;
  padding: 4px 8px 4px 4px;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-pill);
  font-family: var(--button); font-size: 14px; font-weight: 500; color: var(--fg);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.account__btn:hover, .account__btn[aria-expanded="true"] { background: var(--hover); border-color: var(--line); }
.account__first { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__chev { flex: none; color: var(--muted); }
.avatar {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent); color: var(--on-accent);
  font-family: var(--display); font-size: 13px; font-weight: 700;
}
.account__menu { width: 260px; }
.account__who { display: grid; gap: 2px; padding: 6px 10px 8px; min-width: 0; }
.account__who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__name { font-weight: 600; font-size: 14px; }
.account__menu .rule { margin: 4px 0; }

/* ---- menus that open (lib/pop.js places them: position, left, top) ---- */
.pop-menu {
  z-index: 120;
  display: grid; gap: 1px;
  min-width: 180px; max-width: min(340px, calc(100vw - 16px));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 5px;
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-pop);
  animation: pop-in var(--t) var(--ease);
}
/* a slide only, no zoom: pop.js measures the menu as it opens */
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }

/* one item in a menu */
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 8px 10px; text-align: left;
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--fg); font-family: var(--text); font-size: 14px; cursor: pointer; text-decoration: none;
}
.opt:hover, .opt:focus-visible { background: var(--hover); outline: none; }
.opt.is-on { color: var(--accent-text); }
.opt .ico { flex: none; color: var(--muted); }

/* ---- Home ---- */
.home__eyebrow { margin: 48px 0 8px; }
.home h1, .home__lede { margin: 0; }
.home__lede { margin-top: 8px; color: var(--muted); }
@media (max-width: 480px) { .account__first { display: none; } }

/* ---- sign-in, not invited: one card in the middle ---- */
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth__card {
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 32px;
}
.auth__card h1 { font-size: 28px; margin: 0; }
.auth__card .label { margin: 0; }
.auth__emblem { width: 36px; height: 36px; margin-bottom: 12px; }
.auth__lede { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.auth__busy { min-height: 42px; display: grid; place-items: center; }
.auth__fine { margin: 4px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
@media (max-width: 480px) { .auth__card { padding: 26px 20px; } }

/* ---- app grid (Home) ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 40px 0 96px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  text-decoration: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  align-content: start;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
    transform var(--t) var(--ease);
}
a.card:hover { background: var(--hover); border-color: var(--line-strong); }
a.card:active { transform: scale(.99); }
.card__icon {
  grid-row: span 3;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.card__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card__go {
  margin-top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--button);
  font-size: 14px; font-weight: 600;
  color: var(--accent-text);
}
.card__go svg { transition: transform var(--t) var(--ease); }
a.card:hover .card__go svg { transform: translateX(3px); }
.card--soon { box-shadow: none; background: transparent; border-style: dashed; }

/* ---- buttons ---- */
.btn {
  font-family: var(--button);
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--ghost {
  background: var(--raised);
  color: var(--fg);
  border: 1px solid var(--line);
}
.btn--ghost:hover:not(:disabled) { background: var(--hover); border-color: var(--line-strong); }
.btn--danger { background: var(--danger-fill); color: #ffffff; }
.btn--danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn--sm { font-size: 13px; line-height: 18px; padding: 7px 12px; gap: 7px; }
.btn--block { width: 100%; }

/* The quiet button for toolbars. The name «mono» comes from funops, where
   the CRM uses it a hundred times; it is no longer mono or uppercase. */
.btn-mono {
  font-family: var(--button);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 7px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn-mono:hover:not(:disabled) { color: var(--fg); background: var(--hover); }
.btn-mono:active:not(:disabled) { transform: scale(.97); }
.btn-mono:disabled { opacity: .45; cursor: not-allowed; }
.btn-mono--danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }

.icon-btn {
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}
.icon-btn:hover:not(:disabled) { color: var(--fg); background: var(--hover); }
.icon-btn:active:not(:disabled) { transform: scale(.92); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ---- fields ---- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > .label { color: var(--fg); }
.field__hint { margin: 0; font-size: 13px; color: var(--muted); }
.field__error { margin: 0; font-size: 13px; color: var(--danger); }

.input {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--fg);
  font-family: var(--text);
  font-size: 14px;
  line-height: 20px;
  padding: 8px 10px;
  min-width: 0;
  width: 100%;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input:hover:not(:disabled):not(:focus) { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--faint); }
.input:disabled { opacity: .55; cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--danger); }
textarea.input { resize: vertical; min-height: 80px; }
select.input {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* visible focus everywhere; fields show it with their own ring */
:where(a, button, textarea, select, [tabindex], [contenteditable="true"]):focus-visible,
:where(input[type="checkbox"], input[type="radio"]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.input:focus-visible { outline: none; }

/* ---- chips ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; line-height: 18px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--hover);
  color: var(--fg);
}
.chip--accent { background: var(--accent-soft); color: var(--accent-text); }
.chip--ok     { background: var(--ok-soft); color: var(--ok); }
.chip--warn   { background: var(--warn-soft); color: var(--warn); }
.chip--danger { background: var(--danger-soft); color: var(--danger); }

/* ---- dialog ----
   Comes in on a small spring instead of popping: you see where it came from
   and that it sits on top. */
dialog {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  padding: 0;
  max-width: min(560px, calc(100vw - 32px));
}
dialog[open] { animation: dlg-in var(--t-slow) var(--spring); }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(6px); }
dialog[open]::backdrop { animation: fade-in var(--t) var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }

.notice { padding: 32px 32px 24px; display: grid; gap: 18px; }
.notice h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
}
.notice h2 em { font-style: normal; color: var(--accent-text); }
.notice p { margin: 0; color: var(--muted); font-size: 15px; }
.notice p.notice__lead { color: var(--fg); font-size: 16px; line-height: 1.5; }
.notice .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---- callout: an inline warning or note ---- */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0;
  font-size: 14px;
  color: var(--fg);
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.callout .ico { flex: none; margin-top: 2px; color: var(--warn); }
.callout--danger { background: var(--danger-soft); border-color: var(--red-6); }
.callout--danger .ico { color: var(--danger); }

@media (max-width: 480px) {
  .notice { padding: 26px 20px 22px; gap: 14px; }
  .notice h2 { font-size: 24px; }
}

/* ---- drag (lib/drag.js writes these classes) ---- */
body.dragging { cursor: grabbing; user-select: none; }
.is-dragged { opacity: .3; }
.drag-ghost {
  position: fixed; z-index: 200; pointer-events: none;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-drag);
  outline: 1px solid var(--accent-line);
}
.drop-ph {
  display: grid; place-items: center;
  border: 1px dashed var(--accent-line); border-radius: var(--r-md);
  background: var(--accent-soft);
}
.drop-ph__label { font-family: var(--mono); font-size: 12px; color: var(--accent-text); }

/* ---- utility ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* thin scrollbars inside panels */
.scroll-slim { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.scroll-slim::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll-slim::-webkit-scrollbar-track { background: transparent; }
.scroll-slim::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
.scroll-slim::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ---- first-visit tour (lib/tour.js, driver.js) ----
   Pages that run a tour also link vendor/driver.js-1.9.0/driver.css, before
   this file. driver.css ships white: here it takes the brand tokens. */
.driver-popover.tour {
  background: var(--raised);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  font-family: var(--text);
  padding: 18px 18px 14px;
  min-width: 280px;
  max-width: 340px;
}
.driver-popover.tour .driver-popover-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  padding-right: 24px;
}
.driver-popover.tour .driver-popover-description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 6px;
}
.driver-popover.tour .driver-popover-close-btn { color: var(--muted); top: 6px; right: 4px; }
.driver-popover.tour .driver-popover-close-btn:hover,
.driver-popover.tour .driver-popover-close-btn:focus-visible { color: var(--fg); }
.driver-popover.tour .driver-popover-footer { margin-top: 16px; gap: 10px; }
.driver-popover.tour .driver-popover-progress-text {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.driver-popover.tour .driver-popover-navigation-btns { gap: 6px; }
/* driver.js writes an inline `display: block` on «Back», even on the first
   step where it's disabled: without !important a dead button shows. In the
   DOM it comes after «Next» (lib/tour.js, for focus); here it goes back left. */
.driver-popover.tour .driver-popover-prev-btn.driver-popover-btn-disabled { display: none !important; }
.driver-popover.tour .driver-popover-prev-btn { order: -1; }
.driver-popover.tour .driver-popover-navigation-btns button + button { margin-left: 0; }
.driver-popover.tour .driver-popover-footer-btn {
  font-family: var(--button);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  text-shadow: none;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.driver-popover.tour .driver-popover-footer-btn:hover { background: var(--hover); }
.driver-popover.tour .driver-popover-footer-btn:active { transform: scale(.97); }
.driver-popover.tour .driver-popover-next-btn {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}
.driver-popover.tour .driver-popover-next-btn:hover { background: var(--accent-hover); }
.driver-popover.tour .driver-popover-footer-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.driver-popover.tour .driver-popover-arrow-side-left { border-left-color: var(--raised); }
.driver-popover.tour .driver-popover-arrow-side-right { border-right-color: var(--raised); }
.driver-popover.tour .driver-popover-arrow-side-top { border-top-color: var(--raised); }
.driver-popover.tour .driver-popover-arrow-side-bottom { border-bottom-color: var(--raised); }
.driver-popover.tour { animation: pop-in-tour var(--t-slow) var(--spring); }
@keyframes pop-in-tour { from { opacity: 0; transform: translateY(6px) scale(.97); } }

@media (max-width: 720px) {
  .nav { padding: 12px 16px; }
  .legal { padding: 14px 16px; }
  .wrap { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
