/* filter.events — product UI.
   Bootstrap is loaded for modal/offcanvas behaviour only; every visible
   component below is custom. Colour lives entirely in the tokens: light is the
   base, dark is a token swap, and "system" simply leaves data-theme unset so
   the media query decides. */

:root {
  color-scheme: light;

  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ececee;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --text: #09090b;
  --text-2: #52525b;
  --text-3: #a1a1aa;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-fg: #ffffff;
  --accent-soft: #eef2ff;
  --accent-line: #c7d2fe;

  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;

  --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.05);
  --shadow: 0 4px 12px rgba(9, 9, 11, 0.08), 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-lg: 0 16px 48px rgba(9, 9, 11, 0.14);

  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 76rem;
  --pad: clamp(1rem, 3.5vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #09090b;
    --surface: #131316;
    --surface-2: #1c1c20;
    --surface-3: #26262b;
    --line: #26262b;
    --line-strong: #3f3f46;
    --text: #fafafa;
    --text-2: #a1a1aa;
    --text-3: #71717a;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-fg: #ffffff;
    --accent-soft: #1e1b4b;
    --accent-line: #3730a3;

    --ok: #22c55e;
    --ok-soft: #0a2417;
    --warn: #f59e0b;
    --warn-soft: #2a1e05;
    --bad: #ef4444;
    --bad-soft: #2b1012;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #09090b;
  --surface: #131316;
  --surface-2: #1c1c20;
  --surface-3: #26262b;
  --line: #26262b;
  --line-strong: #3f3f46;
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-fg: #ffffff;
  --accent-soft: #1e1b4b;
  --accent-line: #3730a3;

  --ok: #22c55e;
  --ok-soft: #0a2417;
  --warn: #f59e0b;
  --warn-soft: #2a1e05;
  --bad: #ef4444;
  --bad-soft: #2b1012;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

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

.wrap,
.page {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.page {
  padding-block: 1.75rem 3rem;
}

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

.muted {
  color: var(--text-2);
}

/* --- topbar ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--pad);
  height: 3.6rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.logo-mark {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: var(--r-sm);
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #22d3ee));
  flex: 0 0 auto;
}

.tabs {
  display: flex;
  gap: 0.125rem;
  margin-left: 0.75rem;
}

.tabs button {
  appearance: none;
  background: none;
  border: 0;
  border-radius: var(--r);
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}

.tabs button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tabs button.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-left: auto;
}

.topbar-sep {
  width: 1px;
  height: 1.25rem;
  background: var(--line);
}

/* Declared with the topbar prefix so it beats .icon-btn's display, which is
   defined later in the file at equal specificity. */
.topbar .topbar-menu {
  display: none;
  margin-left: auto;
}

.topbar-drawer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 0.5rem var(--pad) 1rem;
}

.topbar-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.topbar-drawer button {
  appearance: none;
  background: none;
  border: 0;
  border-radius: var(--r);
  padding: 0.6rem 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.topbar-drawer button:hover {
  background: var(--surface-2);
}

.topbar-drawer .drawer-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0.75rem 0.5rem 0.25rem;
}

/* --- segmented theme control -------------------------------------------------- */

.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.segmented button {
  appearance: none;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  width: 1.625rem;
  height: 1.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  cursor: pointer;
  padding: 0;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.is-on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* --- buttons ------------------------------------------------------------------ */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover {
  background: var(--surface-2);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  border-color: transparent;
  background: none;
  box-shadow: none;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  color: var(--bad);
}

.btn-lg {
  height: 2.375rem;
  padding: 0 1rem;
  font-size: 0.875rem;
}

.btn-sm {
  height: 1.75rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* --- account ------------------------------------------------------------------ */

.avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  flex: 0 0 auto;
}

.account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.account-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.125rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 13rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.25rem;
  z-index: 60;
}

.menu[hidden] {
  display: none;
}

.menu-head {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu button {
  appearance: none;
  display: block;
  width: 100%;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.menu button:hover {
  background: var(--surface-2);
}

.menu button.is-danger {
  color: var(--bad);
}

/* --- page furniture ------------------------------------------------------------ */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.page-head h1 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.2rem;
}

.page-head p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.8125rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0;
}

.panel-body {
  padding: 1rem;
}

.cols {
  display: grid;
  gap: 0.75rem;
}

.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.stack {
  display: grid;
  gap: 1rem;
}

.stat {
  padding: 0.875rem 1rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-bottom: 0.3rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-delta {
  font-size: 0.75rem;
  color: var(--ok);
  margin-top: 0.2rem;
}

/* --- toolbar ------------------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.input,
.select {
  appearance: none;
  height: 2rem;
  padding: 0 0.625rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.select {
  padding-right: 1.6rem;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 0.75rem center, right 0.5rem center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.input:focus,
.select:focus,
.field .input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search {
  position: relative;
  flex: 1 1 15rem;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 0.55rem;
  color: var(--text-3);
  pointer-events: none;
}

.search .input {
  width: 100%;
  padding-left: 1.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.75rem;
  cursor: pointer;
}

.pill:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.pill.is-on {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-x {
  color: var(--text-3);
  display: inline-flex;
}

.pill-x:hover {
  color: var(--bad);
}

/* --- rows ---------------------------------------------------------------------- */

.rows {
  overflow: hidden;
}

.row-item {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  background: none;
  transition: background-color 0.1s ease;
}

.row-item:last-child {
  border-bottom: 0;
}

.row-item:hover,
.row-item:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.row-when {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.row-when b {
  display: block;
  color: var(--text);
  font-weight: 500;
}

.row-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.row-thumb {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r);
  object-fit: cover;
  background: var(--surface-2);
  flex: 0 0 auto;
}

.row-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-end {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.row-price {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  min-width: 3rem;
  text-align: right;
}

.row-going {
  font-family: var(--mono);
  color: var(--text-3);
  font-size: 0.75rem;
  min-width: 2.75rem;
  text-align: right;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 500;
}

.tag.is-free {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}

.tag.is-full {
  background: var(--bad-soft);
  border-color: transparent;
  color: var(--bad);
}

/* --- landing -------------------------------------------------------------------- */

.hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60rem 26rem at 50% -8rem, var(--accent-soft), transparent 70%);
}

.hero-inner {
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}

.badge-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 1.625rem;
  padding: 0 0.6rem 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.75rem;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.06;
  margin: 1.25rem 0 0.875rem;
}

.hero p {
  font-size: 1rem;
  color: var(--text-2);
  margin: 0 auto;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.demo {
  max-width: 40rem;
  margin: 2.5rem auto 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}

.demo-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.6875rem;
  color: var(--text-3);
}

.demo-body {
  padding: 0.875rem;
}

.demo-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  font-size: 0.9375rem;
}

.caret {
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  background: var(--accent);
  animation: blink 1.05s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.demo-out {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.kv {
  font-family: var(--mono);
  font-size: 0.6875rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}

.kv b {
  color: var(--text);
  font-weight: 500;
}

.locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  margin-top: 0.75rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 3rem 0 0.75rem;
}

.section-title h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

/* --- ask ------------------------------------------------------------------------ */

.ask-box {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 0.875rem;
}

.ask-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ask-input {
  width: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  resize: none;
  padding: 0;
}

.ask-input:focus {
  outline: none;
}

.ask-input::placeholder {
  color: var(--text-3);
}

.ask-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.ask-hint {
  font-size: 0.75rem;
  color: var(--text-3);
}

.kbd {
  font-family: var(--mono);
  font-size: 0.6875rem;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.reading {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--r-lg);
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
}

.reading p {
  margin: 0 0 0.625rem;
  font-size: 0.875rem;
}

/* --- callouts / empty / toasts --------------------------------------------------- */

.callout {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  margin: 0 0 1rem;
}

.callout.is-error {
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
  background: var(--bad-soft);
  color: var(--bad);
}

.callout.is-warn {
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  background: var(--warn-soft);
  color: var(--warn);
}

.empty {
  padding: 3rem 1rem;
  text-align: center;
}

.empty h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.empty p {
  margin: 0 auto;
  max-width: 30rem;
  color: var(--text-2);
  font-size: 0.8125rem;
}

.loading {
  padding: 4rem 1rem;
  text-align: center;
  color: var(--text-3);
  font-size: 0.8125rem;
}

.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  max-width: 22rem;
  animation: rise 0.16s ease;
}

.toast-item.is-bad {
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
  color: var(--bad);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* --- charts / map ---------------------------------------------------------------- */

#world-map {
  height: 20rem;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: var(--surface-2);
}

.leaflet-container {
  background: var(--surface-2);
  font-family: var(--sans);
}

:root[data-theme="dark"] .leaflet-tile-pane,
:root:not([data-theme="light"]) .leaflet-tile-pane {
  filter: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.85) saturate(0.4);
  }
}

:root[data-theme="dark"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.85) saturate(0.4);
}

:root[data-theme="light"] .leaflet-tile-pane,
:root:not([data-theme]) .leaflet-tile-pane {
  filter: grayscale(0.7) contrast(0.95);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.85) saturate(0.4);
  }
}

.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 85%, transparent) !important;
  color: var(--text-3);
  font-size: 0.625rem;
}

.leaflet-control-attribution a {
  color: var(--text-2);
}

.leaflet-bar a {
  background: var(--surface);
  color: var(--text);
  border-bottom-color: var(--line);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--r);
}

.marker-cluster {
  background: color-mix(in srgb, var(--accent) 25%, transparent) !important;
  border-radius: 50% !important;
}

.marker-cluster div {
  background: var(--accent) !important;
  color: var(--accent-fg) !important;
  border-radius: 50% !important;
  font-family: var(--sans) !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
}

.marker-cluster span {
  line-height: 30px !important;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 7rem;
}

.bar {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
}

.bar i {
  display: block;
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0.75;
  min-height: 2px;
}

.bar:hover i {
  opacity: 1;
}

.bar.is-peak i {
  opacity: 1;
}

.bars-axis {
  display: flex;
  gap: 2px;
  margin-top: 0.4rem;
}

.bars-axis span {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.5625rem;
  color: var(--text-3);
}

/* --- data table ----------------------------------------------------------------------- */

.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.dtable th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-2);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.dtable td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
}

.dtable tr:last-child td {
  border-bottom: 0;
}

.dtable .num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
}

.kv-row:last-child {
  border-bottom: 0;
}

/* --- forms ----------------------------------------------------------------------- */

.field {
  margin-bottom: 0.875rem;
}

.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.field .input {
  width: 100%;
  height: 2.25rem;
}

.hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.3rem;
}

/* --- dialog / sheet ---------------------------------------------------------------- */

.dialog {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  /* Bootstrap sets pointer-events:none on .modal-dialog and re-enables it on
     .modal-content; this replaces that element, so it must re-enable them. */
  pointer-events: auto;
}

.dialog-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}

.dialog-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

.dialog-sub {
  font-size: 0.8125rem;
  color: var(--text-2);
  margin: 0 0 1.25rem;
}

.dialog-switch {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-2);
  margin: 0.875rem 0 0;
}

.dialog-switch button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}

.sheet {
  background: var(--bg);
  width: min(30rem, 100vw);
  border-left: 1px solid var(--line);
}

.sheet-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem var(--pad);
  border-bottom: 1px solid var(--line);
}

.sheet-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem var(--pad) 2.5rem;
}

.sheet-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-lg);
  margin-bottom: 1rem;
}

.sheet-body h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 1.5rem 0 0.5rem;
}

.prose {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 22rem;
  overflow-y: auto;
}

.host {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
}

.host img,
.host .host-blank {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex: 0 0 auto;
}

/* --- responsive -------------------------------------------------------------------- */

@media (max-width: 900px) {
  .tabs,
  .topbar-end {
    display: none;
  }

  .topbar .topbar-menu {
    display: inline-flex;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
  }

  .footer-brand,
  .footer-index {
    grid-column: 1 / -1;
  }

  .footer-mark span {
    font-size: clamp(3rem, 22vw, 6rem);
  }

  .footer-base {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-item {
    grid-template-columns: 4.25rem minmax(0, 1fr);
    row-gap: 0.5rem;
  }

  .row-end {
    grid-column: 2;
  }

  #world-map {
    height: 15rem;
  }
}

@media (max-width: 520px) {
  .cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* --- globe (three.js) ------------------------------------------------------------ */

.globe-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  margin-top: 3rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(38rem 20rem at 80% 50%, var(--accent-soft), transparent 70%),
    var(--surface);
  overflow: hidden;
}

.globe-copy h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0.75rem 0 0.5rem;
}

.globe-copy p {
  margin: 0;
  font-size: 0.875rem;
  max-width: 40ch;
}

.globe-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 1rem;
}

/* Fixed aspect so the canvas has a size to measure before three.js boots. */
.globe-stage {
  aspect-ratio: 1 / 1;
  max-height: 22rem;
  margin-inline: auto;
  width: 100%;
  position: relative;
}

.globe-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 900px) {
  .globe-block {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }

  .globe-stage {
    max-height: 15rem;
    order: -1;
  }
}

/* --- mega menu -------------------------------------------------------------------- */

.mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: mega-in 0.13s ease;
}

.mega[hidden] {
  display: none;
}

@keyframes mega-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.mega-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  padding-block: 1.25rem 1.5rem;
}

.mega-col h3 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 0.5rem;
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.125rem 0.5rem;
}

.mega-link {
  appearance: none;
  display: block;
  width: 100%;
  background: none;
  border: 0;
  border-radius: var(--r);
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-link:hover {
  background: var(--surface-2);
}

/* The topbar is the positioning context for the panel, and must not clip it. */
.topbar {
  position: sticky;
}

.tabs button.is-open {
  color: var(--text);
  background: var(--surface-2);
}

/* Chevron affordance on the tabs that carry a panel. */
.tabs button[data-view="events"]::after,
.tabs button[data-view="ask"]::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.3rem;
  vertical-align: 0.12em;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 3px solid currentColor;
  opacity: 0.45;
}

@media (max-width: 900px) {
  .mega {
    display: none !important;
  }

  .tabs button::after {
    display: none !important;
  }
}

/* --- hero canvas ------------------------------------------------------------------ */

.hero {
  position: relative;
  isolation: isolate;
}

/* Sits above the hero's gradient and below its content. Masked to fade out
   behind the headline so the type keeps full contrast. */
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
  /* Clears the headline but opens up much sooner than before, so the field is
     actually visible rather than only hinted at in the corners. */
  -webkit-mask-image: radial-gradient(105% 80% at 50% 40%, transparent 0%, transparent 12%, #000 44%);
  mask-image: radial-gradient(105% 80% at 50% 40%, transparent 0%, transparent 12%, #000 44%);
}

.hero-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

/* A soft scrim of the page background sits between the node field and the copy.
   This is what guarantees headline contrast: without it a bright node drifting
   behind a glyph pulled light mode down to 3.3:1. The field stays at full
   strength everywhere else. */
.hero-inner::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 130%;
  height: 118%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    closest-side,
    var(--bg) 0%,
    color-mix(in srgb, var(--bg) 92%, transparent) 42%,
    transparent 78%
  );
  z-index: -1;
  pointer-events: none;
}

/* --- footer ------------------------------------------------------------------------ */

.footer {
  position: relative;
  margin-top: 4rem;
  background: var(--surface);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

/* A single accent hairline across the top, brightest in the middle. */
.footer-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
}

/* Faint dot matrix, masked so it only shows near the top edge. */
.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(currentColor 0.9px, transparent 0.9px);
  background-size: 22px 22px;
  color: var(--text-3);
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 55%);
  mask-image: linear-gradient(180deg, #000, transparent 55%);
  pointer-events: none;
}

.footer-top,
.footer-base,
.footer-mark {
  position: relative;
  z-index: 1;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.15fr;
  gap: 2.5rem;
  padding-block: 2.75rem 2rem;
}

.footer-brand p {
  margin: 0.75rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-2);
  max-width: 34ch;
}

.footer-cta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-col h2 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 0.875rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer-col button,
.footer-col a {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text-2);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease;
}

.footer-col button:hover,
.footer-col a:hover {
  color: var(--text);
  transform: translateX(2px);
}

.footer-tag {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}

.footer-out {
  font-size: 0.6875rem;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.footer-col a:hover .footer-out {
  opacity: 0.5;
}

/* Live index panel — the one part of the footer that is not boilerplate. */
.footer-index dl {
  margin: 0 0 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-index dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.footer-index dt {
  font-size: 0.75rem;
  color: var(--text-2);
}

.footer-index dd {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.footer-sync {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dot-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-2);
}

.dot-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent);
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  70%,
  100% {
    box-shadow: 0 0 0 5px transparent;
  }
}

/* Oversized outlined wordmark: a graphic anchor rather than more copy. */
.footer-mark {
  padding: 0 var(--pad);
  max-width: var(--wrap);
  margin: 0 auto;
  line-height: 0.8;
  overflow: hidden;
}

.footer-mark span {
  display: block;
  font-size: clamp(4rem, 15.5vw, 11rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  opacity: 0.55;
  user-select: none;
  transform: translateY(0.14em);
}

.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--text-3);
}

.footer-base-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}


/* Restated last: the base .footer-top grid is declared after the main
   media-query block, so the small-screen override has to come after it. */
@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
  }

  .footer-brand,
  .footer-index {
    grid-column: 1 / -1;
  }

  .footer-mark span {
    font-size: clamp(3rem, 21vw, 6rem);
  }

  .footer-base {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* --- auth dialog -------------------------------------------------------------------- */

.auth-dialog {
  max-width: 46rem;
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  padding: 0;
  overflow: hidden;
}

.auth-form {
  padding: 2rem 1.75rem 1.75rem;
}

.auth-logo {
  font-size: 0.8125rem;
  margin-bottom: 1.25rem;
}

.auth-split .dialog-title {
  font-size: 1.375rem;
}

.auth-split .dialog-sub {
  margin-bottom: 1.25rem;
}

/* Provider button + separator */
.btn-google {
  width: 100%;
  height: 2.375rem;
  gap: 0.55rem;
  font-weight: 500;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.125rem 0;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Right panel */
.auth-aside {
  position: relative;
  padding: 2rem 1.75rem;
  background: var(--surface-2);
  border-left: 1px solid var(--line);
  overflow: hidden;
}

.auth-aside-glow {
  position: absolute;
  inset: -40% -60% auto auto;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent), transparent 70%);
  opacity: 0.16;
  pointer-events: none;
}

.auth-aside-eyebrow {
  position: relative;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 1rem;
}

.auth-perks {
  position: relative;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-perks li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.auth-perks span {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 0.625rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.auth-perks b {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.auth-perks div {
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.45;
}

.auth-aside-stats {
  position: relative;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1.5rem;
}

.auth-aside-stats div {
  display: flex;
  flex-direction: column-reverse;
}

.auth-aside-stats dt {
  font-size: 0.6875rem;
  color: var(--text-3);
}

.auth-aside-stats dd {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Avatars from Google */
.avatar-img {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .auth-split {
    grid-template-columns: 1fr;
  }

  /* The panel is supporting copy; on a phone the form should own the screen. */
  .auth-aside {
    display: none;
  }

  .auth-form {
    padding: 1.75rem 1.25rem 1.5rem;
  }
}

/* The TLD half of the wordmark, de-emphasised so "filter" reads as the name. */
.logo-tld {
  color: var(--text-3);
  font-weight: 500;
}

.footer-mark span {
  text-transform: none;
}

/* --- legal pages -------------------------------------------------------------------- */

.legal {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem var(--pad) 4rem;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.legal-kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.legal h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
}

.legal-meta {
  color: var(--text-3);
  font-size: 0.8125rem;
  margin: 0 0 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.legal-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}

.legal-summary h2 {
  margin-top: 0;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 0;
  padding: 0;
}

.legal-summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

.legal-summary li {
  margin-bottom: 0.4rem;
}

.legal h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 2.25rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.legal h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.legal p {
  margin: 0 0 1rem;
  color: var(--text-2);
}

.legal strong {
  color: var(--text);
}

.legal ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--text-2);
}

.legal li {
  margin-bottom: 0.35rem;
}

.legal a {
  color: var(--accent);
  text-decoration: none;
}

.legal a:hover {
  text-decoration: underline;
}

.legal code {
  font-family: var(--mono);
  font-size: 0.8125em;
  padding: 0.1rem 0.3rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
}

.legal-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--line-strong);
}

.legal-table td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  vertical-align: top;
}

.legal-foot {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
}

.legal-address {
  font-style: normal;
  line-height: 1.6;
  padding: 0.9rem 1.1rem;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--text-2);
  margin: 0 0 1rem;
}

.legal-address strong {
  color: var(--text);
}

/* --- analytics opt-out ------------------------------------------------------------- */

.optout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1rem;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--r-lg);
}

.optout.is-off {
  border-color: var(--line);
  background: var(--surface);
}

.optout strong {
  display: block;
  font-size: 0.875rem;
  color: var(--text);
}

.optout span {
  font-size: 0.8125rem;
  color: var(--text-2);
}

/* Server-rendered landing copy. Visible and styled — never hidden, since hiding
   text a crawler reads is cloaking. It is replaced by the client on hydration. */
.ssr {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 3rem var(--pad);
}

.ssr h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.ssr h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

.ssr h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 1.25rem 0 0.25rem;
}

.ssr p,
.ssr li {
  color: var(--text-2);
  max-width: 68ch;
}

.ssr ul {
  padding-left: 1.1rem;
}

/* --- brand logo --------------------------------------------------------------------- */

.logo-img {
  height: 1.9rem;
  width: auto;
  display: block;
}

/* The supplied artwork is black ink on transparent, so it disappears on the
   dark theme. Inverting the image is exact here because the mark is pure
   greyscale — no hue to shift. */
:root[data-theme="dark"] .logo-img {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-img {
    filter: invert(1);
  }
}

.footer-brand .logo-img {
  height: 2.1rem;
}

.auth-logo .logo-img {
  height: 1.6rem;
}
