/* MVP-BUZZ design system, aligned with Microsoft Fluent 2 (web dark theme):
   the Microsoft palette and nothing else: Microsoft Blue #0078D4 for actions (hover #106EBE,
   pressed #005A9E), the four logo colours for the programs (MVP #00A4EF, RD #F25022, Student
   Ambassadors #7FBA00, new #FFB900), Fluent 2 neutrals and status colours, Segoe UI, 4-8 px radii.
   Flat surfaces, no decorative gradients. Motion is pure CSS (no JavaScript).

   One dark theme. Translucent tints are color-mix() of a token. */

@property --spin { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

:root {
  /* Microsoft palette */
  --ms-blue: #0078d4;
  --ms-blue-hover: #106ebe;
  --ms-blue-pressed: #005a9e;
  --ms-gray: #737373;
  --brand-70: var(--ms-blue-pressed);
  --brand-100: #2899f5;
  --ms-cyan: #00a4ef;
  --ms-red: #f25022;
  --ms-green: #7fba00;
  --ms-yellow: #ffb900;

  /* programs */
  --mvp: var(--ms-cyan);
  --rd: var(--ms-red);
  --mlsa: var(--ms-green);
  --new: var(--ms-yellow);

  /* Fluent 2 dark neutrals */
  --background: #141414;
  --surface: rgba(31, 31, 31, .9);
  --surface-solid: #292929;
  --foreground: #ffffff;
  --muted-foreground: #d6d6d6;
  --subtle-foreground: #adadad;
  --border: #3d3d3d;
  --input: #525252;
  --input-bg: #1f1f1f;
  --input-accent: #8a8a8a;
  --input-hover: #666666;
  --input-accent-hover: #a3a3a3;
  --muted: color-mix(in srgb, var(--foreground) 4%, transparent);
  --hover: color-mix(in srgb, var(--foreground) 7%, transparent);
  --scrim: rgba(10, 12, 16, .78);
  --glass: rgba(12, 14, 19, .6);
  --backdrop: rgba(0, 0, 0, .55);
  --shadow-color: rgba(0, 0, 0, .65);
  --code-bg: #0d0d0d;
  --avatar-bg: #1a1d24;
  --bubble-top: #1d2027;
  --bubble-bottom: #0f1115;
  --primary: var(--ms-blue);
  --primary-hover: var(--ms-blue-hover);
  --primary-foreground: #fff;
  --link: var(--brand-100);
  --ring: var(--foreground);
  --radius: 8px;
  --radius-sm: 4px;
  --shadow-lg: 0 0 2px rgba(0, 0, 0, .24), 0 14px 28px rgba(0, 0, 0, .28);

  /* status colours */
  --success-fg: #54b054;
  --danger-fg: #dc626d;
  --error-fg: #dc626d;
  --live: #54b054;
  --warning-fg: #ffb900;
  --bar-muted: #6b6b6b;

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: linear(0, 0.06, 0.205, 0.392, 0.586, 0.762, 0.907, 1.015, 1.086, 1.124, 1.135, 1.128, 1.109, 1.083, 1.057, 1.033, 1.013, 0.998, 0.989, 0.983, 0.982, 0.983, 0.985, 0.989, 0.992, 0.995, 0.998, 1, 1.001, 1.002, 1.002, 1.002, 1);
  --spring-soft: linear(0, 0.027, 0.095, 0.186, 0.287, 0.389, 0.488, 0.578, 0.659, 0.729, 0.789, 0.839, 0.88, 0.913, 0.939, 0.959, 0.974, 0.985, 0.994, 0.999, 1.003, 1.005, 1.006, 1.007, 1.007, 1.007, 1.006, 1.005, 1.005, 1.004, 1.003, 1.003, 1);

  /* PureLeaf */
  --pl-background: var(--background);
  --pl-control-bg: var(--surface);
  --pl-control-hover: var(--surface-solid);
  --pl-control-fg: var(--foreground);
  --pl-attribution-bg: rgba(10, 12, 16, .72);
  --pl-attribution-fg: var(--muted-foreground);
  --pl-focus: var(--primary);
  color-scheme: dark;
}

.app[data-style="road"] { --pl-background: #e9edf1; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
  font: 14px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

button { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.app { position: fixed; inset: 0; }
.map { position: absolute; inset: 0; }
.muted { color: var(--subtle-foreground); }

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
.surface-solid { background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------------ entrances */
@keyframes rise { from { opacity: 0; translate: 0 12px; } }
@keyframes slide-in-left { from { opacity: 0; translate: -28px 0; } }
@keyframes drop-in { from { opacity: 0; translate: 0 -14px; } }
@keyframes pop { from { opacity: 0; scale: .35; } }
@keyframes fade { from { opacity: 0; } }

.panel { animation: slide-in-left .7s var(--spring-soft) backwards; }
.panel > * { animation: rise .6s var(--spring-soft) backwards; animation-delay: calc(120ms + var(--n, 0) * 45ms); }
.panel > :nth-child(2) { --n: 1; }
.panel > :nth-child(3) { --n: 2; }
.panel > :nth-child(4) { --n: 3; }
.panel > :nth-child(5) { --n: 4; }
.panel > :nth-child(6) { --n: 5; }
.panel > :nth-child(7) { --n: 6; }
.panel > :nth-child(8) { --n: 7; }
.panel > :nth-child(9) { --n: 8; }
.toolbar { animation: drop-in .6s var(--spring-soft) .25s backwards; }

/* markers pop in on load and after each zoom, one after another */
.app[data-intro="true"] .pl-marker > *,
.pl-fade-in .pl-marker > * { animation: pop .65s var(--spring) backwards; animation-delay: var(--d, 0ms); }
.app[data-intro="true"] .pl-marker > * { animation-delay: calc(350ms + var(--d, 0ms) * 2); }
.pl-marker-layer.pl-fade-in { animation: none; }

/* ------------------------------------------------------------------ markers */
.pin {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 3px;
  background: var(--c);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, .6);
  transition: transform .45s var(--spring), box-shadow .2s;
}
.pl-marker:hover .pin, .pin[data-selected="true"] { transform: scale(1.2) translateY(-2px); }
.pin[data-selected="true"] {
  box-shadow: 0 0 0 3px var(--background), 0 0 0 5px var(--c), 0 10px 24px -6px var(--shadow-color);
}
.pin-initials, .pin-photo { position: absolute; inset: 3px; border-radius: 50%; }
.pin-initials {
  display: grid;
  place-items: center;
  background: var(--avatar-bg);
  font-weight: 650;
  font-size: 13px;
  letter-spacing: .02em;
}
.pin-photo { background: var(--photo) center / cover no-repeat; }
.pin-new, .bubble-new {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--new);
  border: 2px solid var(--background);
}
.pin-new::after, .bubble-new::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--new);
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping { 70%, 100% { scale: 2.4; opacity: 0; } }

.bubble {
  position: relative;
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  background: var(--ring);
  padding: 4px;
  box-shadow: 0 8px 22px -6px var(--shadow-color);
  transition: transform .45s var(--spring), --spin 1.1s var(--ease-out);
}
.bubble::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--ring);
  opacity: .2;
  z-index: -1;
  filter: blur(2px);
}
.pl-marker:hover .bubble { transform: scale(1.1); --spin: 360deg; }
.bubble span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, var(--bubble-top), var(--bubble-bottom));
  font-weight: 700;
  font-size: calc(var(--sz) * .27);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* ------------------------------------------------------------------ odometer */
.odo { display: inline-flex; font-variant-numeric: tabular-nums; white-space: nowrap; }
.odo-d { display: inline-block; height: 1.15em; overflow: hidden; line-height: 1.15em; }
.odo-d > span {
  display: flex;
  flex-direction: column;
  translate: 0 calc(var(--v) * -1.15em);
  transition: translate .9s var(--spring) calc(var(--i) * 35ms);
  animation: odo-in 1.3s var(--spring-soft) backwards;
  animation-delay: calc(300ms + var(--i) * 70ms);
}
.odo-d i { font-style: normal; height: 1.15em; }
.odo-s { white-space: pre; }
@keyframes odo-in { from { translate: 0 0; } }

/* ------------------------------------------------------------------ side panel */
.panel {
  position: absolute;
  z-index: 20;
  left: 16px;
  top: 16px;
  bottom: 16px;
  width: 384px;
  border-radius: calc(var(--radius) + 4px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--foreground) 15%, transparent) transparent;
}
.panel-grip { display: none; }

.brand { display: flex; gap: 12px; align-items: center; }
.brand h1 { font-size: 20px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; }
.brand p { margin-top: 3px; color: var(--muted-foreground); font-size: 13px; }
/* logo: eight triangles that pop in one after the other, the inner diamond turning on hover */
.brand-mark { flex: none; display: block; overflow: visible; }
.brand-mark polygon { transform-box: view-box; transform-origin: 10.5px 10.5px; animation: piece .6s var(--spring) backwards; }
.brand-mark .bm-i { transition: transform .6s var(--spring); }
.brand-mark polygon:nth-child(1) { animation-delay: .20s; } .brand-mark polygon:nth-child(2) { animation-delay: .44s; }
.brand-mark polygon:nth-child(3) { animation-delay: .26s; } .brand-mark polygon:nth-child(4) { animation-delay: .50s; }
.brand-mark polygon:nth-child(5) { animation-delay: .32s; } .brand-mark polygon:nth-child(6) { animation-delay: .56s; }
.brand-mark polygon:nth-child(7) { animation-delay: .38s; } .brand-mark polygon:nth-child(8) { animation-delay: .62s; }
a:hover > .brand-mark .bm-i, .brand:hover .brand-mark .bm-i { transform: rotate(90deg); }
@keyframes piece { from { opacity: 0; transform: scale(.4); } }
@keyframes orbit { to { --spin: 360deg; } }

.demo-flag {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--ms-yellow) 30%, transparent);
  background: color-mix(in srgb, var(--ms-yellow) 8%, transparent);
  color: var(--warning-fg);
  font-size: 12px;
  font-weight: 600;
}

/* program selector: one click shows only that program, "Everyone" shows all */
.programs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.program {
  --c: var(--foreground);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--muted);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  isolation: isolate;
  transition: border-color .2s, background .2s, transform .35s var(--spring), opacity .2s;
}
.program::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c);
  transition: top .35s var(--spring), bottom .35s var(--spring);
}
.program::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}
.program-all::before {
  background: linear-gradient(var(--ms-red) 0 25%, var(--ms-green) 0 50%, var(--ms-cyan) 0 75%, var(--ms-yellow) 0);
}
.program-all::after { background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--brand-100) 16%, transparent), transparent 60%); }
.program strong { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.program > span { font-size: 12px; color: var(--muted-foreground); line-height: 1.2; }
.program em {
  position: absolute;
  top: 9px;
  right: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ms-yellow) 14%, transparent);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--warning-fg);
}
.program:hover { background: var(--hover); }
.program:active { transform: scale(.97); }
.program[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--c) 60%, transparent);
  background: color-mix(in srgb, var(--c) 8%, transparent);
}
.program[aria-checked="true"]::before { top: 0; bottom: 0; }
.program[aria-checked="true"]::after { opacity: 1; }
.program-all[aria-checked="true"] { border-color: color-mix(in srgb, var(--foreground) 28%, transparent); background: var(--hover); }

/* command palette search */
.command { position: relative; z-index: 2; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 6px 0 12px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  border: 1px solid var(--input);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search:focus-within { border-color: var(--brand-100); box-shadow: inset 0 -2px 0 var(--brand-100); background: color-mix(in srgb, var(--foreground) 6%, transparent); }
.search > svg { width: 18px; height: 18px; fill: var(--subtle-foreground); }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
}
.search input::placeholder { color: var(--subtle-foreground); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  animation: pop .35s var(--spring);
}
.search-clear:hover { background: var(--hover); }
.search-clear svg { width: 16px; height: 16px; fill: var(--muted-foreground); }

.command-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(440px, 60vh);
  overflow: auto;
  padding: 6px;
  border-radius: var(--radius);
  scrollbar-width: thin;
  transform-origin: top center;
  animation: command-in .3s var(--spring-soft);
}
@keyframes command-in { from { opacity: 0; scale: .97; translate: 0 -4px; } }
.command-group {
  padding: 8px 8px 4px;
  color: var(--subtle-foreground);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.command-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  text-align: left;
}
.command-item[aria-selected="true"] { background: var(--hover); }
.command-text { min-width: 0; flex: 1; }
.command-text b, .row b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.command-text small, .row small {
  display: block;
  color: var(--subtle-foreground);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.command-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.command-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--brand-100) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-100) 35%, transparent);
}
.command-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--link);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.command-icon[data-kind="country"], .command-icon[data-kind="state"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 1 7 7c0 5.25-7 13-7 13S5 14.25 5 9a7 7 0 0 1 7-7Zm0 4.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z'/%3E%3C/svg%3E");
}
.command-icon[data-kind="category"], .command-icon[data-kind="tech"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3V3Zm10 0h8v8h-8V3ZM3 13h8v8H3v-8Zm10 0h8v8h-8v-8Z'/%3E%3C/svg%3E");
}
.command-empty, .command-more { padding: 10px 8px; color: var(--subtle-foreground); font-size: 13px; }
mark { background: color-mix(in srgb, var(--ms-yellow) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* filters */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.field select {
  width: 100%;
  height: 40px;
  padding: 0 32px 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input);
  background: var(--muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a1a1aa'%3E%3Cpath d='m7 10 5 5 5-5H7Z'/%3E%3C/svg%3E") right 8px center / 18px no-repeat;
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  appearance: none;
  cursor: pointer;
  text-overflow: ellipsis;
  transition: border-color .15s, box-shadow .15s;
}
.field select:hover:not(:disabled) { border-color: color-mix(in srgb, var(--foreground) 20%, transparent); }
.field select:focus-visible { outline: 0; border-color: var(--brand-100); box-shadow: inset 0 -2px 0 var(--brand-100); }
.field select:disabled { opacity: .45; cursor: not-allowed; }
.field option, .field optgroup { background: var(--surface-solid); color: var(--foreground); }
.field option:disabled { color: var(--subtle-foreground); }

.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted-foreground); font-size: 13px; width: fit-content; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  flex: none;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--foreground) 16%, transparent);
  padding: 2px;
  transition: background .2s;
}
.toggle-track span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  transition: translate .45s var(--spring);
}
.toggle input:checked + .toggle-track { background: var(--primary); }
.toggle input:checked + .toggle-track span { translate: 16px 0; }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--ring); outline-offset: 2px; }

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip {
  --c: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 6px 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  animation: pop .4s var(--spring);
  max-width: 100%;
}
.chip i {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-style: normal;
  line-height: 1;
  background: color-mix(in srgb, var(--foreground) 10%, transparent);
}
.chip:hover i { background: color-mix(in srgb, var(--foreground) 25%, transparent); }

.summary { color: var(--muted-foreground); font-size: 13px; }
.summary strong { color: var(--foreground); }

.link {
  border: 0;
  background: none;
  padding: 0 4px;
  color: var(--link);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.panel-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--subtle-foreground);
  font-size: 11.5px;
}

.credit { margin-top: 4px; color: var(--muted-foreground); }
.credit a {
  color: var(--foreground);
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(90deg, var(--ms-red), var(--ms-green), var(--ms-cyan), var(--ms-yellow)) left bottom / 0 1.5px no-repeat;
  transition: background-size .45s var(--ease-out);
}
.credit a:hover { background-size: 100% 1.5px; }

/* ------------------------------------------------------------------ avatar */
.avatar {
  position: relative;
  flex: none;
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  padding: 2px;
  background: var(--c);
}
.avatar-initials, .avatar img {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 50%;
}
.avatar-initials {
  display: grid;
  place-items: center;
  background: var(--avatar-bg);
  font-weight: 650;
  font-size: calc(var(--sz) * .34);
}
.avatar img { object-fit: cover; animation: fade .3s; }

/* ------------------------------------------------------------------ toolbar */
.toolbar {
  position: absolute;
  z-index: 20;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: calc(var(--radius-sm) + 4px);
}
.segmented { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); }
.segmented-pill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(100% / 3);
  border-radius: var(--radius-sm);
  background: var(--primary);
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--brand-70) 60%, transparent);
  translate: calc(var(--idx, 0) * 100%) 0;
  transition: translate .55s var(--spring);
}
.toolbar button {
  position: relative;
  height: 34px;
  min-width: 86px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s;
}
.toolbar button:hover { color: var(--foreground); }
.segmented button[aria-checked="true"] { color: var(--primary-foreground); }
.toolbar .lang { min-width: 0; border-left: 1px solid var(--border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.toolbar .lang:hover { background: var(--hover); }

/* ------------------------------------------------------------------ drawer */
.drawer {
  position: absolute;
  z-index: 25;
  top: 70px;
  right: 16px;
  max-height: calc(100% - 170px);
  width: 384px;
  border-radius: calc(var(--radius) + 4px);
  display: flex;
  flex-direction: column;
  padding: 20px;
  translate: calc(100% + 32px) 0;
  opacity: 0;
  pointer-events: none;
  transition: translate .6s var(--spring-soft), opacity .25s;
}
.drawer[data-open="true"] { translate: 0 0; opacity: 1; pointer-events: auto; }
.drawer-close {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .15s, rotate .4s var(--spring);
}
.drawer-close svg { width: 16px; height: 16px; fill: var(--foreground); }
.drawer-close:hover { background: var(--hover); rotate: 90deg; }
.drawer-head { padding-right: 40px; margin-bottom: 12px; animation: rise .5s var(--spring-soft) backwards; }
.drawer-head h2 { font-size: 18px; letter-spacing: -.015em; }
.drawer-head p { color: var(--muted-foreground); }
.drawer-list { flex: 1 1 auto; min-height: 0; max-height: calc(100vh - 290px); overflow: auto; margin: 0 -8px; padding: 0 8px; scrollbar-width: thin; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 64px;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  text-align: left;
  animation: rise .45s var(--spring-soft) backwards;
}
.row > span { min-width: 0; }
.row:hover { background: var(--hover); }
.drawer-list .row:nth-child(2) { animation-delay: 40ms; }
.drawer-list .row:nth-child(3) { animation-delay: 80ms; }
.drawer-list .row:nth-child(4) { animation-delay: 120ms; }
.drawer-list .row:nth-child(5) { animation-delay: 160ms; }
.drawer-list .row:nth-child(6) { animation-delay: 200ms; }
.drawer-list .row:nth-child(7) { animation-delay: 240ms; }
.drawer-list .row:nth-child(8) { animation-delay: 280ms; }
.drawer-list .row:nth-child(n + 9) { animation-delay: 320ms; }
.dot-new { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--new); vertical-align: middle; }
.back { margin: 0 0 12px; align-self: flex-start; padding: 0; }

/* person card */
.card { display: flex; flex-direction: column; gap: 16px; overflow: auto; margin: -20px; padding: 0 20px 20px; scrollbar-width: thin; }
.card > * { animation: rise .55s var(--spring-soft) backwards; }
.card > :nth-child(2) { animation-delay: 60ms; }
.card > :nth-child(3) { animation-delay: 120ms; }
.card > :nth-child(4) { animation-delay: 180ms; }
.card > :nth-child(5) { animation-delay: 240ms; }
.card-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: 0 -20px;
  padding: 44px 20px 0;
  isolation: isolate;
  background: radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--c) 35%, transparent), transparent 70%);
  border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
  overflow: hidden;
}
.card-hero-bg {
  position: absolute;
  inset: -20px;
  z-index: -1;
  background: var(--photo) center / cover no-repeat;
  filter: blur(28px) saturate(1.6);
  opacity: .45;
  mask: linear-gradient(to bottom, #000 30%, transparent);
  -webkit-mask: linear-gradient(to bottom, #000 30%, transparent);
}
.card-hero .avatar { box-shadow: 0 0 0 4px var(--surface-solid), 0 12px 28px -8px var(--shadow-color); animation: pop .6s var(--spring) .1s backwards; }
.card-badges { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  background: var(--c);
}
.badge-new { background: var(--new); color: #1b1b1b; }
.card-title h2 { font-size: 21px; line-height: 1.2; letter-spacing: -.02em; }
.card-title p { margin-top: 4px; color: var(--muted-foreground); font-size: 13px; }
.card-facts { display: grid; grid-template-columns: 20px 1fr; gap: 10px 10px; margin: 0; padding: 14px; border-radius: var(--radius-sm); background: var(--muted); border: 1px solid var(--border); }
.card-facts dt { padding-top: 1px; }
.card-facts dt svg { width: 18px; height: 18px; fill: var(--c); }
.card-facts dd { margin: 0; }
.card-facts small { display: block; color: var(--subtle-foreground); font-size: 12px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 4px 10px; border-radius: 999px; background: var(--muted); border: 1px solid var(--border); font-size: 12px; animation: pop .45s var(--spring) backwards; }
.chips li.chip-strong { background: color-mix(in srgb, var(--c) 14%, transparent); border-color: color-mix(in srgb, var(--c) 40%, transparent); font-weight: 600; }
.chips li:nth-child(2) { animation-delay: 230ms; }
.chips li:nth-child(3) { animation-delay: 260ms; }
.chips li:nth-child(4) { animation-delay: 290ms; }
.chips li:nth-child(5) { animation-delay: 320ms; }
.chips li:nth-child(n + 6) { animation-delay: 350ms; }
.chips li:first-child { animation-delay: 200ms; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s, background .15s, transform .3s var(--spring);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--brand-70) 60%, transparent); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--ms-blue-pressed); }
.btn-ghost { background: var(--muted); border-color: var(--border); color: var(--foreground); }
.btn-ghost:hover { background: var(--hover); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }

/* empty state */
.toast {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 10px 16px;
  border-radius: var(--radius);
  translate: -50% 0;
  animation: toast-in .55s var(--spring);
}
@keyframes toast-in { from { opacity: 0; translate: -50% 24px; scale: .96; } }

/* ------------------------------------------------------------------ loading */
.veil {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--scrim);
  backdrop-filter: blur(8px);
  text-align: center;
  padding: 16px;
  color: var(--muted-foreground);
  animation: fade .3s;
}
.veil code { color: var(--subtle-foreground); font-size: 12px; max-width: 520px; }
.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(from var(--spin), var(--ms-red) 0 25%, var(--ms-green) 0 50%, var(--ms-cyan) 0 75%, var(--ms-yellow) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: orbit 1.1s linear infinite;
}

.loading-progress { position: fixed; inset: 0; margin: auto; width: 64px; height: 64px; }
.loading-progress circle { fill: none; stroke: color-mix(in srgb, var(--foreground) 10%, transparent); stroke-width: 6px; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child {
  stroke: var(--primary);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray .05s ease-in-out;
}

#blazor-error-ui {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  background: #5a1d1d;
  color: #fff;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
#blazor-error-ui .reload { color: #fff; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  .panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    max-height: 82vh;
    border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
    padding: 6px 16px 16px;
    transition: transform .55s var(--spring-soft);
    animation-name: rise;
  }
  .panel[data-open="false"] { transform: translateY(calc(100% - 96px)); overflow: hidden; }
  .panel-grip {
    display: grid;
    place-items: center;
    height: 22px;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .panel-grip span { width: 44px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--foreground) 30%, transparent); }
  .brand h1 { font-size: 17px; }
  .programs { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .program { padding: 8px 8px 8px 10px; }
  .program strong { font-size: 15px; }
  .program > span { font-size: 10.5px; }
  .program em { display: none; }
  .toolbar { top: 12px; right: 12px; left: 12px; justify-content: space-between; }
  .toolbar button { min-width: 0; padding: 0 10px; }
  .segmented { flex: 1; }
  .drawer { top: 64px; left: 12px; right: 12px; width: auto; max-height: calc(100% - 180px); translate: 0 calc(100% + 120px); }
  .pl-zoom-control { display: none; }
  .toast { bottom: 112px; width: calc(100% - 32px); justify-content: space-between; }
}

/* profile card sections */
.socials { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.socials a {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground);
  transition: transform .35s var(--spring), color .15s, background .15s, border-color .15s;
  animation: pop .45s var(--spring) backwards;
}
.socials a:nth-child(2) { animation-delay: 40ms; } .socials a:nth-child(3) { animation-delay: 80ms; } .socials a:nth-child(n + 4) { animation-delay: 120ms; }
.socials svg { width: 16px; height: 16px; fill: currentColor; }
.socials a:hover { transform: translateY(-2px); color: #fff; }
.socials a[data-network="linkedin"]:hover { background: #0a66c2; border-color: #0a66c2; }
.socials a[data-network="github"]:hover { background: #24292f; border-color: #57606a; }
.socials a[data-network="facebook"]:hover { background: #0866ff; border-color: #0866ff; }
.socials a[data-network="youtube"]:hover { background: #ff0000; border-color: #ff0000; }
.socials a[data-network="twitter"]:hover, .socials a[data-network="x"]:hover { background: #000; border-color: #555; }
.socials a[data-network="instagram"]:hover { background: #d62976; border-color: #d62976; }
.socials a:not([data-network="linkedin"]):not([data-network="github"]):not([data-network="facebook"]):not([data-network="youtube"]):not([data-network="twitter"]):not([data-network="x"]):not([data-network="instagram"]):hover { background: var(--brand-70); border-color: var(--brand-70); }
.with-flag { display: flex; align-items: flex-start; gap: 8px; }
.with-flag .flag { margin-top: 3px; }
.card-section { display: flex; flex-direction: column; gap: 8px; }
.card-section h3 { margin: 0; color: var(--subtle-foreground); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.card-section h3:not(:first-child) { margin-top: 6px; }
.card-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card-split > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chips-quiet li { background: transparent; }
.bio { color: var(--muted-foreground); font-size: 13.5px; line-height: 1.6; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.bio[data-open="true"] { -webkit-line-clamp: unset; }
.card-section .link { align-self: flex-start; padding: 0; }
.card > :nth-child(6) { animation-delay: 300ms; }
.card > :nth-child(7) { animation-delay: 340ms; }
.card > :nth-child(8) { animation-delay: 380ms; }

/* ------------------------------------------------------------------ autocomplete + flags */
.flag { flex: none; width: 20px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px color-mix(in srgb, var(--foreground) 14%, transparent); }
.flag-none { display: inline-block; background: repeating-linear-gradient(45deg, var(--border) 0 3px, var(--surface-solid) 3px 6px); }
.chip .flag { width: 16px; height: 12px; margin-left: -2px; }
.filters .wide { grid-column: 1 / -1; }
.combo { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.combo-input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 6px 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input);
  border-bottom-color: var(--input-accent);
  background: var(--input-bg);
  transition: border-color .15s, box-shadow .15s;
}
.combo-input:hover { border-color: var(--input-hover); border-bottom-color: var(--input-accent-hover); }
.combo-input:focus-within { border-bottom-color: var(--brand-100); box-shadow: inset 0 -1px 0 var(--brand-100); }
.combo-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--foreground); font: inherit; font-size: 13.5px; text-overflow: ellipsis; }
.combo-input input::placeholder { color: var(--subtle-foreground); }
.combo[data-disabled="true"] .combo-input { opacity: .45; }
.combo-chevron { width: 18px; height: 18px; fill: var(--subtle-foreground); transition: rotate .35s var(--spring); }
.combo[data-open="true"] .combo-chevron { rotate: 180deg; }
.combo-clear { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 4px; background: none; cursor: pointer; animation: pop .3s var(--spring); }
.combo-clear:hover { background: var(--hover); }
.combo-clear svg { width: 14px; height: 14px; fill: var(--muted-foreground); }
.combo-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 320px;
  overflow: auto;
  padding: 4px;
  border-radius: var(--radius);
  scrollbar-width: thin;
  transform-origin: top center;
  animation: command-in .28s var(--spring-soft);
}
.combo-group { position: sticky; top: -4px; z-index: 1; margin: 0 -4px; padding: 8px 12px 4px; background: var(--surface-solid); color: var(--subtle-foreground); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.combo-option { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 4px; cursor: pointer; font-size: 13.5px; }
.combo-option[aria-selected="true"] { background: var(--hover); }
.combo-option[data-current="true"] { box-shadow: inset 2px 0 0 var(--brand-100); }
.combo-option[data-strong="true"] .combo-label { font-weight: 600; }
.combo-option[aria-disabled="true"] { opacity: .4; cursor: default; }
.combo-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-option em { font-style: normal; font-size: 11.5px; color: var(--subtle-foreground); font-variant-numeric: tabular-nums; }
.combo-empty { padding: 10px; color: var(--subtle-foreground); font-size: 13px; }

/* ------------------------------------------------------------------ events */
.events-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-70) 18%, transparent), transparent 70%);
}
.events-box[data-on="true"] { border-color: color-mix(in srgb, var(--brand-100) 45%, transparent); }
.events-box .toggle { color: var(--foreground); }
.events-title { font-weight: 600; }
.events-box p { color: var(--muted-foreground); font-size: 13px; }
.events-box b { color: var(--foreground); }
.events-box .link { padding: 0; margin: 0; font-weight: 500; }

/* event markers are drawn 44px right / 52px up from their place, with a short stem pointing to it,
   so they never cover the people of the same city */
.evmark { position: relative; }
.evstem {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: 40px;                 /* ~60% of the way back to the place (68px away) */
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-70), color-mix(in srgb, var(--brand-100) 0%, transparent));
  transform-origin: 0 50%;
  rotate: 130.24deg;           /* towards (-44, +52) */
  pointer-events: none;
}
.evpin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: #141414;
  box-shadow: 0 6px 16px -4px var(--shadow-color), 0 0 0 2px var(--brand-70);
  transition: transform .45s var(--spring);
  line-height: 1;
}
.evpin::before { content: ""; align-self: stretch; height: 9px; background: var(--brand-70); }
.evpin b { margin-top: 2px; font-size: 15px; font-weight: 800; }
.evpin small { font-size: 9px; font-weight: 700; text-transform: uppercase; color: #616161; margin-bottom: 3px; }
.pl-marker:hover .evpin, .evpin[data-selected="true"] { transform: scale(1.15) translateY(-2px); }
.evpin[data-selected="true"] { box-shadow: 0 0 0 3px var(--background), 0 0 0 5px var(--brand-100), 0 10px 24px -6px var(--shadow-color); }
.evbubble {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px 0 8px;
  border-radius: 8px;
  background: var(--brand-70);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px -4px var(--shadow-color), 0 0 0 2px rgba(255, 255, 255, .85);
  transition: transform .45s var(--spring);
}
.evbubble svg { width: 16px; height: 16px; fill: currentColor; }
.pl-marker:hover .evbubble { transform: scale(1.08); }

.evcard-head { display: flex; gap: 14px; align-items: flex-start; padding: 8px 36px 0 0; }
.evcard-head h2 { margin-top: 6px; font-size: 19px; line-height: 1.25; letter-spacing: -.015em; }
.evcal { flex: none; display: flex; flex-direction: column; align-items: center; width: 58px; border-radius: 8px; overflow: hidden; background: #fff; color: #141414; box-shadow: 0 8px 20px -8px var(--shadow-color); animation: pop .55s var(--spring) .05s backwards; }
.evcal small { align-self: stretch; padding: 3px 0; background: var(--brand-70); color: #fff; font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; }
.evcal b { padding: 4px 0 6px; font-size: 24px; font-weight: 800; line-height: 1; }
.evcal-sm { width: 40px; }
.evcal-sm small { font-size: 9px; padding: 2px 0; }
.evcal-sm b { font-size: 16px; padding: 3px 0 4px; }
.evbadge { --c: var(--brand-70); }
.evbadge[data-format="online"] { --c: var(--ms-gray); }
.evbadge[data-format="hybrid"] { --c: var(--ms-blue); }
.evplace { display: flex; align-items: center; gap: 8px; }
.evdesc { color: var(--muted-foreground); font-size: 13.5px; line-height: 1.6; }
.evsource { color: var(--subtle-foreground); font-size: 11.5px; }
.evcard .card-facts dt svg { fill: var(--brand-100); }
.evrow b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------------ developer docs + admin */
.api-link { margin-top: 6px; color: var(--link); font-weight: 600; text-decoration: none; }
.api-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.doc { position: fixed; inset: 0; overflow: auto; scroll-behavior: smooth; scroll-padding-top: 84px; background:
  var(--background); }
.doc-top {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1240px;
  margin: 12px auto 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  animation: drop-in .6s var(--spring-soft) backwards;
}
.doc-brand { display: flex; align-items: center; gap: 10px; color: var(--foreground); text-decoration: none; }
.doc-brand b { font-size: 16px; letter-spacing: -.02em; }
.doc-brand small { margin-left: 4px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted-foreground); font-size: 11px; font-weight: 600; }
.doc-top-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.doc-top-links a, .doc-top-links .link { padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted-foreground); text-decoration: none; font-weight: 600; font-size: 13px; margin: 0; }
.doc-top-links a:hover, .doc-top-links .link:hover { color: var(--foreground); background: var(--hover); text-decoration: none; }
.doc-top-links .lang { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: none; font-weight: 600; font-size: 12px; cursor: pointer; }

.doc-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; max-width: 1240px; margin: 0 auto; padding: 28px 20px 60px; }
.doc-nav { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - 100px); overflow: auto; scrollbar-width: thin; }
.doc-nav p { margin: 14px 0 4px; padding: 0 10px; color: var(--subtle-foreground); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.doc-nav p:first-child { margin-top: 0; }
.doc-nav a { padding: 5px 10px; border-radius: var(--radius-sm); color: var(--muted-foreground); text-decoration: none; font-size: 13.5px; border-left: 2px solid transparent; }
.doc-nav a:hover { color: var(--foreground); background: var(--hover); border-left-color: var(--brand-100); }
.doc-nav-support { margin-top: 18px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--muted); display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--subtle-foreground); }
.doc-nav-support a { padding: 0; border: 0; color: var(--link); font-weight: 600; }
.doc-nav-support a:hover { background: none; text-decoration: underline; }

.doc-main { min-width: 0; max-width: 860px; }
.doc-main section { padding: 28px 0; border-bottom: 1px solid var(--border); animation: rise .6s var(--spring-soft) backwards; }
.doc-main section:nth-child(2) { animation-delay: 80ms; }
.doc-main section:nth-child(3) { animation-delay: 140ms; }
.doc-main h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -.03em; margin: 14px 0 12px; font-weight: 700; }
.doc-main h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-main h3 { font-size: 15.5px; margin: 22px 0 8px; }
.doc-main p { color: var(--muted-foreground); margin: 0 0 12px; line-height: 1.65; }
.doc-main a { color: var(--link); }
.doc-main code { font-family: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: .9em; }
.doc-main p code, .doc-main td code, .doc-facts code { padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--foreground) 7%, transparent); border: 1px solid var(--border); color: var(--foreground); }
.doc-hero { padding-top: 8px !important; }
.doc-pill { display: inline-flex; padding: 4px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--brand-100) 40%, transparent); background: color-mix(in srgb, var(--brand-100) 10%, transparent); color: var(--brand-100); font-size: 12px; font-weight: 600; }
.lead { font-size: 16.5px; }
.doc-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.doc-facts div { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--muted); min-width: 0; }
.doc-facts b { font-size: 14px; }
.doc-facts span { color: var(--subtle-foreground); font-size: 13px; overflow-wrap: anywhere; }
.verb { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 4px; background: var(--ms-green); color: #0f1a00; font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.note { font-size: 13px; padding: 10px 12px; border-left: 3px solid var(--brand-100); background: color-mix(in srgb, var(--brand-100) 7%, transparent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.doc-list { margin: 0; padding-left: 20px; color: var(--muted-foreground); line-height: 1.7; }
.doc-list li::marker { color: var(--brand-100); }

.doc-table { overflow-x: auto; margin: 12px 0 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc-table th { text-align: left; padding: 10px 12px; background: color-mix(in srgb, var(--foreground) 4%, transparent); color: var(--subtle-foreground); font-size: 12px; font-weight: 600; white-space: nowrap; }
.doc-table td { padding: 10px 12px; border-top: 1px solid var(--border); color: var(--muted-foreground); vertical-align: top; }
.doc-table td:first-child { color: var(--foreground); white-space: nowrap; }
.doc-table td small { display: block; color: var(--subtle-foreground); }

.code { margin: 10px 0 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.code figcaption { padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--subtle-foreground); font-size: 11.5px; font-weight: 600; background: color-mix(in srgb, var(--foreground) 3%, transparent); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; scrollbar-width: thin; }
.code code { font-family: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, monospace; color: #e6e6e6; }
.tok-c { color: #6a9955; font-style: italic; }
.tok-s { color: #ce9178; }
.tok-k { color: #569cd6; }
.tok-t { color: #4ec9b0; }
.tok-n { color: #b5cea8; }

.doc-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--muted); margin-bottom: 4px; }
.doc-tabs button { padding: 6px 12px; border: 0; border-radius: 3px; background: none; color: var(--muted-foreground); font-size: 13px; font-weight: 600; cursor: pointer; }
.doc-tabs button[aria-selected="true"] { background: var(--surface-solid); color: var(--foreground); box-shadow: inset 0 -2px 0 var(--brand-100); }

.doc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; border-radius: var(--radius); margin-top: 6px; }
.doc-form .field input, .console .field input, .console-key, .admin-login input, .quota {
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input);
  border-bottom-color: var(--input-accent);
  background: var(--input-bg);
  color: var(--foreground);
  font: inherit;
  font-size: 13.5px;
  min-width: 0;
}
.doc-form .field input:focus, .console .field input:focus, .console-key:focus, .admin-login input:focus, .quota:focus { outline: 0; border-bottom-color: var(--brand-100); box-shadow: inset 0 -1px 0 var(--brand-100); }
.doc-form-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.doc-error { color: var(--error-fg); font-size: 13px; }
.doc-key { padding: 18px; border-radius: var(--radius); border-color: color-mix(in srgb, var(--ms-green) 50%, transparent); animation: pop .5s var(--spring); }
.doc-key-value { display: block; margin: 10px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--code-bg); border: 1px dashed var(--ms-green); color: var(--ms-green); font-size: 15px; overflow-wrap: anywhere; user-select: all; }

.console { border-radius: var(--radius); overflow: hidden; }
.console-bar { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.console-bar select { height: 36px; padding: 0 30px 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--input); background: var(--input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23adadad'%3E%3Cpath d='m7 10 5 5 5-5H7Z'/%3E%3C/svg%3E") right 6px center / 18px no-repeat; color: var(--foreground); font: inherit; font-size: 13px; appearance: none; font-family: "Cascadia Code", Consolas, monospace; }
.console-key { flex: 1; min-width: 180px; font-family: "Cascadia Code", Consolas, monospace; }
.console-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
.console-params .field > span { font-family: "Cascadia Code", Consolas, monospace; font-size: 11.5px; }
.console-params select { height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--input); background: var(--input-bg); color: var(--foreground); padding: 0 8px; }
.console-url { display: block; padding: 10px 12px; color: var(--muted-foreground); font-size: 12.5px; overflow-wrap: anywhere; border-bottom: 1px solid var(--border); }
.console-meta { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 12px; font-size: 12.5px; color: var(--subtle-foreground); border-bottom: 1px solid var(--border); animation: fade .3s; }
.status { padding: 0 8px; border-radius: 4px; font-weight: 700; color: #fff; background: var(--ms-red); }
.status[data-ok="true"] { background: #107c10; }
.console-out { margin: 0; padding: 14px; max-height: 460px; overflow: auto; background: var(--code-bg); font-size: 12.5px; line-height: 1.55; animation: fade .3s; scrollbar-width: thin; }
.console-out code { font-family: "Cascadia Code", Consolas, monospace; color: #dcdcdc; }
.doc-foot { display: flex; flex-direction: column; gap: 4px; padding: 28px 0 0; color: var(--subtle-foreground); font-size: 12.5px; }
.doc-foot a { color: var(--foreground); font-weight: 600; text-decoration: none; }

/* API simulator */
.try { min-height: calc(100vh - 110px); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.preset { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: transform .3s var(--spring), color .15s, border-color .15s, background .15s; }
.preset:hover { color: var(--foreground); border-color: var(--brand-100); background: color-mix(in srgb, var(--brand-100) 10%, transparent); transform: translateY(-1px); }
.try-it { margin: -4px 0 10px; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--brand-100) 45%, transparent); background: color-mix(in srgb, var(--brand-100) 10%, transparent); color: var(--brand-100); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: transform .3s var(--spring), background .15s; }
.try-it:hover { background: color-mix(in srgb, var(--brand-100) 20%, transparent); transform: translateX(2px); }
.console-bar .verb { align-self: center; }
.console-bar select { min-width: 190px; }
.console-tabs { margin: 10px 12px 0; }
.code-langs { margin: 12px 12px 0; }
.console .code { margin: 10px 12px 12px; }
.console-headers { margin: 10px 12px 12px; max-height: 320px; overflow: auto; }
.console-headers td { font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.console-ids { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px 0; font-size: 12.5px; color: var(--subtle-foreground); }
.console-out { margin: 10px 12px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.console-empty { padding: 18px 12px; color: var(--subtle-foreground); font-size: 13px; }

.faq { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.faq dt { margin-top: 12px; font-weight: 600; color: var(--foreground); }
.faq dd { margin: 4px 0 0; color: var(--muted-foreground); line-height: 1.6; padding-left: 14px; border-left: 2px solid var(--border); }
#postman { padding-top: 8px !important; border-bottom: 0 !important; }

/* admin */
.admin-login { max-width: 420px; margin: 12vh auto 0; padding: 28px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 14px; animation: rise .6s var(--spring-soft); }
.admin-login h1 { font-size: 22px; letter-spacing: -.02em; }
.admin-login p { color: var(--muted-foreground); font-size: 13.5px; }
.admin-loading { display: grid; place-items: center; height: 60vh; }
.admin-main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; display: flex; flex-direction: column; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { --c: var(--brand-100); position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius); overflow: hidden; animation: rise .55s var(--spring-soft) backwards; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c); }
.kpi:nth-child(2) { animation-delay: 50ms; } .kpi:nth-child(3) { animation-delay: 100ms; } .kpi:nth-child(4) { animation-delay: 150ms; }
.kpi:nth-child(5) { animation-delay: 200ms; } .kpi:nth-child(6) { animation-delay: 250ms; }
.kpi > span { color: var(--subtle-foreground); font-size: 12.5px; font-weight: 600; }
.kpi b { font-size: 28px; letter-spacing: -.02em; }
.kpi > small { color: var(--subtle-foreground); font-size: 12px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel-card { padding: 18px; border-radius: var(--radius); animation: rise .6s var(--spring-soft) .15s backwards; min-width: 0; }
.panel-card.wide { grid-column: 1 / -1; }
.panel-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-card h2 { font-size: 16px; }
.panel-card h3 { font-size: 13px; margin: 16px 0 8px; color: var(--subtle-foreground); }
.state { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--foreground) 8%, transparent); }
.state[data-state="running"] { background: color-mix(in srgb, var(--brand-100) 18%, transparent); color: var(--brand-100); animation: breathe-bg 1.6s ease-in-out infinite; }
.state[data-state="succeeded"] { background: color-mix(in srgb, var(--live) 25%, transparent); color: var(--success-fg); }
.state[data-state="failed"] { background: color-mix(in srgb, var(--ms-red) 20%, transparent); color: var(--danger-fg); }
@keyframes breathe-bg { 50% { opacity: .55; } }
.admin-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.admin-facts dt { color: var(--subtle-foreground); }
.admin-facts dd { margin: 0; }
.admin-facts small { color: var(--subtle-foreground); margin-left: 4px; }
.admin-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 18px; }
.admin-actions small { color: var(--subtle-foreground); }
.btn-danger { background: #c50f1f; color: #fff; }
.btn-danger:hover { background: #a80000; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.stack-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--foreground) 6%, transparent); }
.stack-bar span { height: 100%; animation: grow .9s var(--spring-soft) backwards; transform-origin: left; }
@keyframes grow { from { scale: 0 1; } }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0; padding: 0; font-size: 12.5px; color: var(--muted-foreground); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.top-list li { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.top-list span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted-foreground); }
.top-list i { height: 8px; border-radius: 4px; background: var(--ms-blue); animation: grow .9s var(--spring-soft) backwards; transform-origin: left; }
.top-list b { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 8px; align-items: end; height: 180px; padding-top: 8px; }
.bar { position: relative; display: flex; flex-direction: column-reverse; height: 100%; padding-bottom: 18px; }
.bar span { display: block; width: 100%; border-radius: 3px 3px 0 0; min-height: 1px; animation: rise-bar .8s var(--spring-soft) backwards; transform-origin: bottom; }
.bar-key { background: var(--brand-100); }
.bar-anon { background: var(--bar-muted); border-radius: 0 !important; }
.bar small { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; color: var(--subtle-foreground); font-size: 11px; }
@keyframes rise-bar { from { scale: 1 0; } }
tr[data-revoked="true"] td { opacity: .45; }
.quota { width: 100px; }

/* admin: traffic, settings, security */
.traffic .live-toggle { color: var(--muted-foreground); font-size: 13px; }
.live-label[data-on="true"] { color: var(--live); font-weight: 700; }
.live-label[data-on="true"]::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--live); animation: ping-dot 1.6s ease-in-out infinite; }
@keyframes ping-dot { 50% { opacity: .3; } }
.traffic-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.traffic-kpis div { padding: 12px; border-radius: var(--radius-sm); background: var(--muted); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.traffic-kpis div > span { color: var(--subtle-foreground); font-size: 12px; font-weight: 600; }
.traffic-kpis b { font-size: 20px; }
.bars-24 { grid-template-columns: repeat(24, 1fr); gap: 4px; height: 140px; }
.bars-24 .bar small { font-size: 9.5px; }
.bar-err { background: var(--ms-red); }
.traffic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.traffic-grid .top-list li { grid-template-columns: 170px 1fr 44px; }
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.status-chip { display: inline-flex; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--foreground) 8%, transparent); font-variant-numeric: tabular-nums; }
.status-chip[data-class="2"] { background: color-mix(in srgb, var(--live) 30%, transparent); color: var(--success-fg); }
.status-chip[data-class="4"] { background: color-mix(in srgb, var(--ms-yellow) 18%, transparent); color: var(--warning-fg); }
.status-chip[data-class="5"] { background: color-mix(in srgb, var(--ms-red) 22%, transparent); color: var(--danger-fg); }
.consumers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.consumers li { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--muted); }
.consumers .who { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted-foreground); }
.tier { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: color-mix(in srgb, var(--foreground) 8%, transparent); }
.tier[data-tier="key"] { background: color-mix(in srgb, var(--brand-100) 18%, transparent); color: var(--brand-100); }
.tier[data-tier="blocked"] { background: color-mix(in srgb, var(--ms-red) 20%, transparent); color: var(--danger-fg); font-family: "Cascadia Code", Consolas, monospace; }
.live-table { max-height: 380px; overflow: auto; }
.live-table td { font-size: 12.5px; white-space: nowrap; }
.live-table td code { font-size: 12px; }
.live-table td.agent { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--subtle-foreground); }
.live-table tr.fresh td { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--brand-100) 22%, transparent); } }
.partner-form { display: grid; grid-template-columns: 1.3fr 1.3fr .8fr auto; gap: 8px; align-items: center; margin-top: 16px; }
.partner-form h3 { grid-column: 1 / -1; margin: 0 0 2px; }
.partner-form input, .settings-form input, .settings-form select, .settings-form textarea {
  height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--input); border-bottom-color: var(--input-accent);
  background: var(--input-bg); color: var(--foreground); font: inherit; font-size: 13px; min-width: 0;
}
.settings-form textarea { height: auto; padding: 8px 10px; resize: vertical; }
.settings-form { display: flex; flex-direction: column; gap: 12px; }
.settings-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.settings-form .muted a { color: var(--link); overflow-wrap: anywhere; }
.admin-buttons { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.saved { color: var(--live); font-weight: 600; font-size: 13px; animation: pop .4s var(--spring); }
.audit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; font-size: 12.5px; }
.audit li { display: grid; grid-template-columns: 150px 130px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.audit time { color: var(--subtle-foreground); }
.audit span { color: var(--muted-foreground); overflow-wrap: anywhere; }
.audit li[data-action="login_failed"] b, .audit li[data-action="ip_blocked"] b { color: var(--danger-fg); }

.integrations { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.integrations fieldset { margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.integrations legend { padding: 0 6px; font-weight: 600; }
.integrations legend small { color: var(--subtle-foreground); font-weight: 400; margin-left: 6px; }
.integrations > .admin-buttons { grid-column: 1 / -1; }
.integrations input { height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--input); border-bottom-color: var(--input-accent); background: var(--input-bg); color: var(--foreground); font: inherit; font-size: 13px; min-width: 0; }
.test-result { font-size: 13px; color: var(--danger-fg); animation: pop .35s var(--spring); }
.test-result[data-ok="true"] { color: var(--live); }
@media (max-width: 900px) { .integrations { grid-template-columns: 1fr; } }

/* donation: Microsoft red, a heart that beats, always in sight */
.heart { display: inline-block; color: currentColor; animation: beat 1.8s ease-in-out infinite; }
.donate-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ms-red);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--ms-red) 85%, transparent);
  transition: transform .35s var(--spring), background-color .2s;
  animation: donate-glow 2.8s ease-in-out infinite;
}
.donate-cta:hover { background: #d9431a; transform: translateY(-1px) scale(1.04); }
.donate-cta:active { transform: scale(.97); }
.donate-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.donate-cta-lg { height: 42px; padding: 0 22px; font-size: 15px; }
@keyframes donate-glow {
  0%, 100% { box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--ms-red) 85%, transparent), 0 0 0 0 color-mix(in srgb, var(--ms-red) 45%, transparent); }
  50% { box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--ms-red) 85%, transparent), 0 0 0 8px transparent; }
}
.toolbar .donate-cta { height: 34px; min-width: 0; margin-right: 4px; padding: 0 16px; border-radius: 999px; background: var(--ms-red); color: #fff; font-weight: 700; }
.toolbar .donate-cta:hover { background: #d9431a; color: #fff; }
.doc-top-links .donate-cta { height: 30px; margin: 0 4px; padding: 0 14px; font-size: 13px; }
.donate-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--ms-red) 45%, transparent);
  background: color-mix(in srgb, var(--ms-red) 9%, var(--surface-solid));
}
.donate-card h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.donate-card h2 .heart { color: var(--ms-red); }
.donate-card p { color: var(--muted-foreground); font-size: 13px; line-height: 1.5; margin: 0; }
.donate-card .donate-cta { align-self: stretch; }
.donate-card.wide { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 18px 20px; }
.donate-card.wide .donate-cta { align-self: center; flex: none; }
.donate-nudge {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(640px, calc(100vw - 32px));
  padding: 14px 44px 14px 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--ms-red) 45%, transparent);
  box-shadow: var(--shadow-lg);
  translate: -50% 0;
  animation: nudge-in .7s var(--spring) backwards;
}
.donate-nudge .heart.big { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ms-red); color: #fff; font-size: 20px; }
.donate-nudge p { flex: 1; display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 13px; color: var(--muted-foreground); line-height: 1.4; }
.donate-nudge p b { color: var(--foreground); font-size: 14px; }
.donate-nudge .donate-cta { flex: none; }
.nudge-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--subtle-foreground); cursor: pointer; }
.nudge-close:hover { background: var(--hover); color: var(--foreground); }
.nudge-close svg { width: 16px; height: 16px; fill: currentColor; }
@keyframes nudge-in { from { opacity: 0; translate: -50% 40px; } }
@media (max-width: 640px) {
  .toolbar .donate-cta .label { display: none; }
  .toolbar .donate-cta { width: 34px; padding: 0; }
  .toolbar .donate-cta .heart { font-size: 16px; }
  .doc-top-links .donate-cta .label { display: none; }
  .donate-nudge { flex-wrap: wrap; bottom: 12px; }
  .donate-nudge .donate-cta { width: 100%; }
  .donate-card.wide { flex-direction: column; align-items: stretch; }
}
@keyframes beat { 0%, 60%, 100% { scale: 1; } 30% { scale: 1.25; } }
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: var(--backdrop); backdrop-filter: blur(4px); animation: fade .25s; }
.modal {
  position: fixed;
  z-index: 61;
  left: 50%;
  top: 50%;
  width: min(440px, calc(100% - 32px));
  padding: 28px 24px 22px;
  border-radius: calc(var(--radius) + 4px);
  translate: -50% -50%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  animation: modal-in .5s var(--spring);
}
@keyframes modal-in { from { opacity: 0; scale: .92; } }
.modal h2 { font-size: 21px; letter-spacing: -.02em; }
.modal p { color: var(--muted-foreground); font-size: 14px; line-height: 1.55; }
.donate-heart { margin: 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-size: 24px; color: #fff;
  background: linear-gradient(135deg, var(--ms-red), var(--ms-yellow)); box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--ms-red) 70%, transparent); animation: pop .6s var(--spring) .1s backwards; }
.amounts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.amount { min-width: 72px; height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--input); background: var(--input-bg); color: var(--foreground); font-weight: 700; cursor: pointer; transition: transform .3s var(--spring), border-color .15s, background .15s; }
.amount:hover { border-color: var(--input-accent); }
.amount[aria-checked="true"] { border-color: var(--brand-100); background: color-mix(in srgb, var(--brand-100) 14%, transparent); transform: scale(1.04); }
.amount-input { display: flex; align-items: center; gap: 8px; justify-content: center; animation: pop .35s var(--spring); }
.amount-input input { width: 140px; height: 42px; text-align: center; font-size: 18px; font-weight: 700; border-radius: var(--radius-sm); border: 1px solid var(--input); border-bottom-color: var(--brand-100); background: var(--input-bg); color: var(--foreground); }
.amount-input span { color: var(--subtle-foreground); font-weight: 600; }
.btn-paypal { height: 46px; font-size: 15px; background: var(--ms-blue); box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--ms-blue) 80%, transparent); }
.btn-paypal:hover { background: var(--ms-blue-hover); }
.btn-paypal.disabled { opacity: .45; pointer-events: none; }
.modal .drawer-close { position: absolute; }

/* admin: tabs */
.admin-tabs { display: flex; gap: 2px; padding: 4px; border-radius: var(--radius); overflow-x: auto; scrollbar-width: none; animation: rise .5s var(--spring-soft) backwards; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; flex: none; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); color: var(--muted-foreground); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: color .2s, background-color .2s; }
.admin-tab:hover { color: var(--foreground); background: var(--hover); }
.admin-tab:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.admin-tab[aria-selected="true"] { color: var(--foreground); background: color-mix(in srgb, var(--brand-100) 12%, transparent); }
.admin-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; background: var(--brand-100); animation: tab-in .45s var(--spring); }
@keyframes tab-in { from { transform: scaleX(0); } }
.admin-tab em { padding: 0 7px; border-radius: 999px; font-style: normal; font-size: 11px; line-height: 18px; font-weight: 700; background: var(--hover); color: var(--muted-foreground); }
.admin-tab em[data-tone="live"] { padding: 0; background: none; color: var(--live); font-size: 10px; animation: ping-dot 1.6s ease-in-out infinite; }
.admin-tab em[data-tone="busy"] { background: color-mix(in srgb, var(--brand-100) 18%, transparent); color: var(--brand-100); }
.admin-tab em[data-tone="danger"], .admin-tab em[data-tone="warn"] { background: color-mix(in srgb, var(--ms-red) 18%, transparent); color: var(--danger-fg); }
.admin-tab em[data-tone="ok"] { background: color-mix(in srgb, var(--live) 18%, transparent); color: var(--success-fg); }
.admin-panel { display: flex; flex-direction: column; gap: 16px; animation: panel-in .4s var(--spring-soft); }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }
.panel-card.narrow { max-width: 640px; }
a.panel-card.summary { display: flex; flex-direction: column; color: inherit; text-decoration: none; border: 1px solid transparent; transition: border-color .2s, transform .35s var(--spring); }
a.panel-card.summary:hover { border-color: var(--border); transform: translateY(-2px); }
a.panel-card.summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.summary .stack-bar { margin-top: 16px; }
.summary-more { margin-top: auto; padding-top: 14px; color: var(--link); font-size: 13px; font-weight: 600; }
.traffic-kpis.mini { grid-template-columns: repeat(2, 1fr); margin-bottom: 10px; }
.bars-24.compact { height: 64px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; }
.panel-card h3.flush { margin-top: 0; }
.search-input { height: 32px; min-width: 240px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--input); border-bottom-color: var(--input-accent); background: var(--input-bg); color: var(--foreground); font: inherit; font-size: 13px; }
.search-input:focus { outline: 0; border-bottom-color: var(--brand-100); box-shadow: inset 0 -1px 0 var(--brand-100); }

/* admin: security */
.security-score .score { font-size: 13px; color: var(--subtle-foreground); }
.security-score .score b { font-size: 22px; color: var(--foreground); }
.security-score[data-full="true"] .score b { color: var(--success-fg); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--muted); animation: rise .5s var(--spring-soft) backwards; }
.checks li:nth-child(2) { animation-delay: 40ms; } .checks li:nth-child(3) { animation-delay: 80ms; } .checks li:nth-child(4) { animation-delay: 120ms; }
.checks li:nth-child(5) { animation-delay: 160ms; } .checks li:nth-child(6) { animation-delay: 200ms; } .checks li:nth-child(7) { animation-delay: 240ms; }
.checks i { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-style: normal; font-size: 12px; font-weight: 800; }
.checks li[data-ok="true"] i { background: color-mix(in srgb, var(--live) 20%, transparent); color: var(--success-fg); }
.checks li[data-ok="true"] i::before { content: "✓"; }
.checks li[data-ok="false"] { border-color: color-mix(in srgb, var(--ms-yellow) 45%, transparent); }
.checks li[data-ok="false"] i { background: color-mix(in srgb, var(--ms-yellow) 22%, transparent); color: var(--warning-fg); }
.checks li[data-ok="false"] i::before { content: "!"; }
.checks span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.checks small { color: var(--subtle-foreground); font-size: 12px; }
.panel-card p.muted + .btn { margin-top: 12px; }
.account-form { display: flex; flex-direction: column; gap: 12px; }
.account-form input { height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--input); border-bottom-color: var(--input-accent); background: var(--input-bg); color: var(--foreground); font: inherit; font-size: 13px; }
.code-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.code-form input { height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--input); border-bottom-color: var(--input-accent); background: var(--input-bg); color: var(--foreground); font: inherit; font-size: 13px; }
.code-input { width: 130px; text-align: center; letter-spacing: .35em; font-family: "Cascadia Code", Consolas, monospace !important; font-size: 16px !important; font-weight: 700; }
.admin-login .code-input { width: 100%; }
.totp-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; }
.totp-qr { display: block; margin-top: 10px; border-radius: var(--radius-sm); background: #fff; padding: 6px; }
.totp-secret { display: inline-block; margin: 4px 0; padding: 4px 8px; border-radius: var(--radius-sm); background: var(--muted); border: 1px solid var(--border); font-family: "Cascadia Code", Consolas, monospace; letter-spacing: .05em; overflow-wrap: anywhere; }
.totp-steps .api-link { display: block; }
.sessions { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sessions li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.sessions li[data-current="true"] { border-color: color-mix(in srgb, var(--brand-100) 45%, transparent); }
.sessions .device { display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.sessions .device small { color: var(--subtle-foreground); font-size: 12px; }
.audit li small.muted { margin-left: 4px; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .search-input { min-width: 0; width: 100%; }
  .doc-body { grid-template-columns: 1fr; gap: 0; }
  .doc-nav { display: none; }
  .doc-facts { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .traffic-kpis { grid-template-columns: repeat(2, 1fr); }
  .traffic-grid { grid-template-columns: 1fr; }
  .partner-form { grid-template-columns: 1fr; }
  .audit li { grid-template-columns: 1fr; }
  .doc-form { grid-template-columns: 1fr; }
  .doc-top { margin: 8px 8px 0; }
  .doc-top-links a:not(:last-of-type) { display: none; }
}

/* ------------------------------------------------------------------ accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}
