/* Techr design system. Tokens come from the Figma file (docs/design/figma/README.md). */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --c-primary: #0444e7;
  --c-primary-hover: #0337ba;
  --c-primary-soft: #eaf0fe;
  --c-primary-ink: #ffffff;
  --c-brand-ink: #00113c;

  --c-text: #111827;
  --c-text-2: #374151;
  --c-muted: #6b7280;
  --c-subtle: #9ca3af;

  --c-bg: #f9fafb;
  --c-surface: #ffffff;
  --c-surface-2: #f3f4f6;
  --c-border: #e5e7eb;
  --c-border-strong: #d1d5db;

  --c-danger: #dc2626;
  --c-danger-soft: #fef2f2;
  --c-success: #16a34a;
  --c-success-soft: #f0fdf4;
  --c-warning: #ea580c;
  --c-warning-soft: #fff7ed;
  --c-info: var(--c-primary);
  --c-info-soft: var(--c-primary-soft);
  --c-gold: #f5c451;
  --c-gold-soft: #fffbeb;
  --c-gold-ink: #b45309;
  --c-gold-icon: #d97706;

  /* Text on the dark brand navy (projector screen, dark bars) */
  --c-on-dark: #ffffff;
  --c-on-dark-2: #c9d3f5;
  --c-on-dark-muted: #9fb4ff;
  --c-on-dark-line: rgb(255 255 255 / 0.28);
  --c-on-dark-hover: rgb(255 255 255 / 0.12);

  --control-check: 18px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 1px rgb(0 14 51 / 0.05);
  --shadow-sm: 0 2px 10px rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 40px rgb(16 24 40 / 0.14);
  --ring: 0 0 0 3px rgb(4 68 231 / 0.25);

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 48px;

  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;

  --header-h: 88px;
  --container: 1280px;
  --aside-w: 273px;
}

@media (max-width: 767px) {
  :root {
    --header-h: 72px;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  /* Links to #sections land below the sticky header, with a little room, instead of under it. */
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-surface);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4 {
  margin: 0 0 var(--s-2);
  line-height: 1.25;
  font-weight: 700;
  color: var(--c-text);
}
h1 {
  font-size: var(--fs-2xl);
}
h2 {
  font-size: var(--fs-xl);
}
h3 {
  font-size: var(--fs-lg);
}
h4 {
  font-size: var(--fs-md);
}
p {
  margin: 0 0 var(--s-3);
}
a {
  color: var(--c-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
hr {
  border: 0;
  border-top: 1px solid var(--c-border);
  margin: var(--s-5) 0;
}
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -0.2em;
}

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted {
  color: var(--c-muted);
}
.subtle {
  color: var(--c-subtle);
}
.text-sm {
  font-size: var(--fs-sm);
}
.text-xs {
  font-size: var(--fs-xs);
}
.text-center {
  text-align: center;
}
.fw-600 {
  font-weight: 600;
}
.fw-normal {
  font-weight: 400;
}
code {
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--c-surface-2);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.spread {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.mt-0 {
  margin-top: 0;
}
.mb-0 {
  margin-bottom: 0;
}
.mt-4 {
  margin-top: var(--s-4);
}
.mt-6 {
  margin-top: var(--s-6);
}
@media (max-width: 767px) {
  .hide-sm {
    display: none !important;
  }
}
@media (min-width: 768px) {
  .hide-md {
    display: none !important;
  }
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-4);
}
@media (min-width: 768px) {
  .container {
    padding: 0 var(--s-7);
  }
}
/* Event pages run nearly full-bleed in the design (content spans ~1690px at 1728px wide). */
.container-wide {
  max-width: 1760px;
}
@media (min-width: 1200px) {
  .container-wide {
    padding: 0 45px;
  }
}
.site-main {
  flex: 1;
  width: 100%;
}
.page {
  padding-top: var(--s-6);
  padding-bottom: var(--s-8);
}
.prose {
  max-width: 72ch;
  color: var(--c-text-2);
}
.prose h1,
.prose h2,
.prose h3 {
  margin-top: var(--s-6);
}
.prose h1:first-child {
  margin-top: 0;
}
.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin: 0 0 var(--s-3);
}
.prose li {
  margin-bottom: var(--s-1);
}

/* ---------- Help wiki (/wiki/) ---------- */
.wiki-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
}
@media (min-width: 900px) {
  .wiki-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 45px;
  }
}
.wiki-aside {
  position: sticky;
  top: var(--s-5);
  align-self: start;
}
.wiki-nav {
  font-size: 13px;
}
.wiki-nav ul {
  list-style: none;
  margin: 0 0 var(--s-4);
  padding: 0;
}
.wiki-nav a {
  display: block;
  padding: 4px var(--s-2);
  border-radius: var(--r-md);
  color: var(--c-text-2);
}
.wiki-nav a:hover {
  background: var(--c-surface-2);
  text-decoration: none;
}
.wiki-nav a.is-active {
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-weight: 600;
}
.wiki-nav-home {
  margin-bottom: var(--s-4);
}
.wiki-nav-heading {
  padding: 0 var(--s-2) var(--s-1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.wiki-section {
  margin-top: var(--s-6);
}
.wiki-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-3);
}
.wiki-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  color: var(--c-text);
}
.wiki-card:hover {
  border-color: var(--c-primary);
  text-decoration: none;
}
.wiki-prose h1 {
  margin-top: var(--s-2);
}
.wiki-prose h2 {
  scroll-margin-top: var(--s-5);
}
.wiki-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--s-4);
  font-size: 13px;
}
.wiki-prose th,
.wiki-prose td {
  padding: var(--s-2);
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  vertical-align: top;
}
.wiki-prose blockquote {
  margin: 0 0 var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--c-primary);
  background: var(--c-primary-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.wiki-prose blockquote p:last-child {
  margin-bottom: 0;
}
.wiki-toc {
  margin: 0 0 var(--s-5);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.wiki-toc ul {
  margin: var(--s-1) 0 0;
}

/* ---------- Logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--c-brand-ink);
  text-decoration: none;
}
.logo:hover {
  text-decoration: none;
}
.logo-img {
  width: 140px;
  height: auto;
}
@media (max-width: 420px) {
  .logo-img {
    width: 116px;
  }
}

/* ---------- Site header (event / simplified) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(255 255 255 / 0.95);
  backdrop-filter: blur(6px);
}
.site-header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.site-header-end {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

/* Top bar pills (Figma Topbar-navigation): Tools (blue icon circle + label + bold chevron) and the bell. */
.top-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 15px 0 6px;
  border: 3px solid var(--c-surface-2);
  border-radius: 26px;
  background: var(--c-surface);
  font-size: 18px;
  color: #000;
}
/* On phones the Tools pill shrinks to its icon circle, the same size as the bell. */
@media (max-width: 767px) {
  .top-pill-tools {
    height: 44px;
    padding: 0 3px;
    gap: 0;
  }
  .top-pill-tools .top-pill-label,
  .top-pill-tools .top-chevron {
    display: none;
  }
  .top-pill-tools .top-circle {
    width: 32px;
    height: 32px;
  }
}
.top-circle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
}
.top-circle .icon {
  width: 20px;
  height: 20px;
}
.icon.top-chevron,
.user-pill .icon {
  width: 13px;
  height: 9px;
  color: var(--c-primary);
}
.top-bell {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border: 3px solid var(--c-surface-2);
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-primary);
}
.top-bell > .icon {
  width: 22px;
  height: 22px;
}
.top-bell.has-count > .badge-count {
  top: 0;
  right: -2px;
  min-width: 18px;
  height: 18px;
  border: 0;
  background: #fd0000;
  font-size: 10px;
}

/* ---------- Dropdown menu (details/summary) ---------- */
.menu {
  position: relative;
}
.menu > summary {
  list-style: none;
  cursor: pointer;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--s-2));
  min-width: 220px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: var(--s-2);
  z-index: 50;
}
.menu-panel-left {
  right: auto;
  left: 0;
}
.menu-header {
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--s-1);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px var(--s-4);
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-text);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.menu-item:hover {
  background: var(--c-surface-2);
  text-decoration: none;
}
.menu form {
  margin: 0;
}

/* User menu pill (name + chevron + avatar) */
/* Outlined like every top-bar control (Figma manager user-profile): white, 3px #f3f4f6 ring. */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 10px 0 16px;
  border: 3px solid var(--c-surface-2);
  border-radius: 50px;
  background: var(--c-surface);
  font-size: 18px;
  color: #000;
}
.user-pill .avatar {
  --av: 32px;
}
.user-pill-name {
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .user-pill {
    padding-left: var(--s-2);
  }
  .user-pill-name {
    display: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--c-surface);
  --btn-fg: var(--c-text);
  --btn-bd: var(--c-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 42px;
  padding: 0 var(--s-5);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  text-decoration: none;
  background: var(--c-surface-2);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  --btn-bg: var(--c-primary);
  --btn-fg: var(--c-primary-ink);
  --btn-bd: var(--c-primary);
}
.btn-primary:hover {
  background: var(--c-primary-hover);
  border-color: var(--c-primary-hover);
}
.btn-secondary {
  --btn-bg: var(--c-surface);
  --btn-fg: var(--c-text);
  --btn-bd: var(--c-border-strong);
}
.btn-soft {
  --btn-bg: var(--c-surface-2);
  --btn-fg: var(--c-text);
  --btn-bd: var(--c-surface-2);
}
.btn-soft:hover {
  background: #e9ebef;
}
.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-primary);
  --btn-bd: transparent;
}
.btn-ghost:hover {
  background: var(--c-primary-soft);
}
.btn-danger {
  --btn-bg: var(--c-danger);
  --btn-fg: #fff;
  --btn-bd: var(--c-danger);
}
.btn-danger-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-danger);
  --btn-bd: transparent;
}
.btn-danger-ghost:hover {
  background: var(--c-danger-soft);
}
/* Outline button for dark navy surfaces (projector screen) */
.btn-on-dark {
  --btn-bg: transparent;
  --btn-fg: var(--c-on-dark);
  --btn-bd: var(--c-on-dark-line);
}
.btn-on-dark:hover {
  background: var(--c-on-dark-hover);
  border-color: var(--c-on-dark);
}
.btn-on-dark:focus-visible {
  outline: 2px solid var(--c-on-dark);
  outline-offset: 2px;
}
.btn-pill {
  border-radius: var(--r-pill);
}
.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: var(--fs-sm);
}
.btn-lg {
  min-height: 47px;
  padding: 0 var(--s-6);
  border-radius: 12px;
  font-size: var(--fs-md);
  font-weight: 700;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--r-pill);
}
.btn-google {
  --btn-bg: var(--c-surface);
  --btn-fg: var(--c-text);
  --btn-bd: var(--c-border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-google svg {
  width: 20px;
  height: 20px;
}

/* ---------- Chips & tags ---------- */
.chip {
  --chip-bg: var(--c-surface);
  --chip-fg: var(--c-text);
  --chip-bd: var(--c-border);
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 34px;
  padding: 0 var(--s-4);
  border: 1px solid var(--chip-bd);
  border-radius: var(--r-pill);
  background: var(--chip-bg);
  color: var(--chip-fg);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.chip:hover {
  text-decoration: none;
  border-color: var(--c-border-strong);
}
.chip.is-active,
.chip[aria-pressed="true"] {
  --chip-bg: var(--c-primary);
  --chip-fg: #fff;
  --chip-bd: var(--c-primary);
}
/* Company-type categories (map filters): coloured text on white; a ring in the colour when active */
.chip-startup { --cat: #d97706; }
.chip-scaleup { --cat: #ca8a04; }
.chip-accelerator { --cat: #ea7a0c; }
.chip-community { --cat: #0f9488; }
.chip-datacenter { --cat: #0ea5e9; }
.chip-funding { --cat: #dc2626; }
.chip-incubator { --cat: #7c3aed; }
.chip-innovation { --cat: var(--c-primary); }
.chip-university { --cat: #111827; }
.chip-nonprofit { --cat: #db2777; }
[class*="chip-"]:where(.chip) {
  --chip-fg: var(--cat);
  --chip-bd: var(--c-surface);
  box-shadow: var(--shadow-sm);
}
[class*="chip-"]:where(.chip).is-active,
[class*="chip-"]:where(.chip)[aria-pressed="true"] {
  --chip-bg: var(--c-surface);
  --chip-fg: var(--cat);
  --chip-bd: var(--cat);
  box-shadow: inset 0 0 0 1px var(--cat), var(--shadow-sm);
}

/* Pastel tags (idea categories, industries) */
.tag {
  --tag-bg: var(--c-surface-2);
  --tag-fg: var(--c-text-2);
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-size: 11px;
  font-weight: 600;
  line-height: 13px;
  white-space: nowrap;
  width: fit-content;
}
.tag-fintech { --tag-bg: #ecfeff; --tag-fg: #0e7490; }
.tag-envirotech { --tag-bg: var(--c-gold-soft); --tag-fg: var(--c-gold-ink); }
.tag-healthtech { --tag-bg: #fdf2f8; --tag-fg: #be185d; }
.tag-edtech { --tag-bg: #fff1f2; --tag-fg: #be123c; }
.tag-agritech { --tag-bg: #f7fee7; --tag-fg: #4d7c0f; }
.tag-devtools { --tag-bg: #eef2ff; --tag-fg: #4f46e5; }
.tag-climate { --tag-bg: #ecfdf5; --tag-fg: #059669; }
.tag-ai { --tag-bg: #f3ecfe; --tag-fg: #7e22ce; }
.tag-blue { --tag-bg: var(--c-primary-soft); --tag-fg: var(--c-primary); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 3px 10px;
  border-radius: var(--r-sm);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.4;
  width: fit-content;
}
.badge-warning {
  background: var(--c-warning-soft);
  color: var(--c-warning);
}
.badge-success {
  background: var(--c-success-soft);
  color: var(--c-success);
}
.badge-neutral {
  background: var(--c-surface-2);
  color: var(--c-text-2);
}
.badge-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--c-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 2px solid var(--c-surface);
}
.has-count {
  position: relative;
}
.has-count > .badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
}
.rank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  color: var(--c-primary);
  font-weight: 700;
  font-size: 15px;
  line-height: 18px;
}
.rank .icon {
  color: var(--c-gold-icon);
}
.count-box {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 25px;
  padding: 0 5px;
  border-radius: 5px;
  background: #f1f2f4;
  color: var(--c-primary);
  font-size: var(--fs-xs);
  font-weight: 600;
}

/* ---------- Cards ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s-5);
  min-width: 0;
}
.card-flat {
  box-shadow: none;
}
.card-muted {
  background: var(--c-bg);
  box-shadow: none;
}
.card-title {
  font-size: var(--fs-md);
  font-weight: 800;
  line-height: 19px;
  margin: 0 0 var(--s-3);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.card-head .card-title {
  margin: 0;
}

/* Header card: square number/icon box + title + subtitle + action (ideas / team headers) */
.hero-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: var(--s-5);
}
.hero-card > .btn {
  min-height: 44px;
  border-radius: 12px;
}
.hero-box {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  color: var(--c-primary);
  font-size: var(--fs-xl);
  font-weight: 800;
}
.hero-box .icon {
  width: 26px;
  height: 26px;
}
.hero-box-solid {
  background: var(--team-color, var(--c-primary));
  color: #fff;
}
.hero-text {
  flex: 1 1 200px;
  min-width: 0;
}
.hero-title {
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 27px;
  margin: 0;
}
.hero-sub {
  margin: 4px 0 0;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
@media (max-width: 520px) {
  .hero-card > .btn {
    width: 100%;
  }
}

/* Stat cards */
.stat-grid {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.stat-card {
  background: #fbfbfb;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: var(--s-4);
}
.stat-value {
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 27px;
  color: var(--c-text);
}
.stat-label {
  margin-top: var(--s-1);
  font-size: var(--fs-xs);
  color: #666;
}

/* Feed (organizer announcements) */
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.feed-item {
  display: flex;
  gap: var(--s-3);
}
.feed-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--c-primary-soft);
  color: var(--c-primary);
}
.feed-icon-schedule {
  background: var(--c-success-soft);
  color: var(--c-success);
}
.feed-icon-warning {
  background: var(--c-warning-soft);
  color: var(--c-warning);
}
.feed-title {
  font-weight: 700;
  margin: 0;
}
.feed-body {
  margin: 2px 0;
  color: var(--c-muted);
  font-size: var(--fs-sm);
}
.feed-time {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
}

/* ---------- Avatars ---------- */
.avatar {
  --av: 36px;
  display: inline-grid;
  place-items: center;
  width: var(--av);
  height: var(--av);
  flex: none;
  border-radius: var(--r-pill);
  background: var(--av-bg, #dbe5ff);
  color: var(--av-fg, var(--c-primary));
  font-size: calc(var(--av) * 0.38);
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  text-transform: uppercase;
  user-select: none;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-xs { --av: 24px; }
.avatar-sm { --av: 30px; }
.avatar-lg { --av: 48px; }
.avatar-xl { --av: 72px; }
.avatar-1 { --av-bg: #fde2cc; --av-fg: #9a3412; }
.avatar-2 { --av-bg: #d8e4fc; --av-fg: #1e40af; }
.avatar-3 { --av-bg: #fbd5f2; --av-fg: #9d174d; }
.avatar-4 { --av-bg: #d3f2dc; --av-fg: #166534; }
.avatar-5 { --av-bg: #fcd4d4; --av-fg: #991b1b; }
.avatar-6 { --av-bg: #e6dcfd; --av-fg: #5b21b6; }
.avatar-stack {
  display: inline-flex;
  align-items: center;
}
.avatar-stack > .avatar {
  border: 2px solid var(--c-surface);
  margin-left: calc(var(--av) * -0.3);
}
.avatar-stack > .avatar:first-child {
  margin-left: 0;
}
.avatar-more {
  --av-bg: var(--c-surface-2);
  --av-fg: var(--c-muted);
}

/* ---------- Forms ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label,
.field > label {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}
.input,
.select,
.textarea,
.field input:not([type="checkbox"], [type="radio"], [type="hidden"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px var(--s-4);
  border: 1px solid var(--c-border-strong);
  border-radius: 8px;
  background: var(--c-bg);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-md);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
@media (min-width: 768px) {
  .input,
  .select,
  .textarea,
  .field input:not([type="checkbox"], [type="radio"], [type="hidden"]),
  .field select,
  .field textarea {
    min-height: 52px;
    padding: 14px var(--s-4);
    font-size: 14px;
  }
}
.input::placeholder,
.textarea::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--c-subtle);
}
.input:focus,
.select:focus,
.textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  background: var(--c-surface);
  box-shadow: var(--ring);
}
.select,
.field select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
.textarea,
.field textarea {
  min-height: 120px;
  resize: vertical;
}
/* Rich text editor (MarkdownEditorWidget, frontend/src/editor.js): looks like the neighbouring inputs. The
   toolbar and editing surface only show once the script has started; before that it is just the textarea. */
.md-editor .md-box {
  display: none;
}
.md-editor.is-enhanced .md-box {
  display: block;
  border: 1px solid var(--c-border-strong);
  border-radius: 8px;
  background: var(--c-bg);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
.md-editor.is-enhanced .md-box:focus-within {
  border-color: var(--c-primary);
  background: var(--c-surface);
  box-shadow: var(--ring);
}
.md-editor.is-enhanced textarea {
  display: none;
}
.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-2);
  border-bottom: 1px solid var(--c-border);
}
.md-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-text-2);
  cursor: pointer;
}
.md-btn:hover {
  background: var(--c-surface-2);
}
.md-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.md-btn.is-active {
  background: var(--c-primary-soft);
  color: var(--c-primary);
}
.md-btn .icon {
  width: 18px;
  height: 18px;
}
.md-sep {
  width: 1px;
  height: 20px;
  margin: 0 var(--s-1);
  background: var(--c-border);
}
.md-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
}
.md-link-input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: 8px;
  background: var(--c-bg);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-sm);
}
.md-link-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: var(--ring);
}
.md-link-error {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-danger);
}
.md-surface {
  cursor: text;
}
.md-content {
  min-height: 120px;
  max-height: 480px;
  overflow-y: auto;
  padding: 12px var(--s-4);
  font-size: var(--fs-md);
  color: var(--c-text);
  outline: none;
}
@media (min-width: 768px) {
  .md-content {
    padding: 14px var(--s-4);
    font-size: 14px;
  }
}
.md-content > :first-child {
  margin-top: 0;
}
.md-content > :last-child {
  margin-bottom: 0;
}
.md-content p,
.md-content ul,
.md-content ol,
.md-content blockquote {
  margin: 0 0 var(--s-3);
}
.md-content h2,
.md-content h3 {
  margin: var(--s-4) 0 var(--s-2);
  font-weight: 800;
  line-height: 1.3;
}
.md-content h2 {
  font-size: var(--fs-lg);
}
.md-content h3 {
  font-size: var(--fs-md);
}
.md-content ul,
.md-content ol {
  padding-left: 1.25rem;
}
.md-content li > p {
  margin: 0;
}
.md-content blockquote {
  padding-left: var(--s-3);
  border-left: 3px solid var(--c-border-strong);
  color: var(--c-muted);
}
.md-content a {
  color: var(--c-primary);
  text-decoration: underline;
}
.field-check {
  flex-direction: row;
  align-items: center;
  gap: var(--s-2);
}
.field-check label {
  font-weight: 500;
}
.field-check input,
.check-row input {
  width: var(--control-check);
  height: var(--control-check);
  accent-color: var(--c-primary);
}
.field-check label .badge {
  margin-left: var(--s-2);
  vertical-align: middle;
}
.field-help {
  font-size: var(--fs-xs);
  color: var(--c-muted);
}
.field-help ul {
  margin: 0;
  padding-left: 1.1rem;
}
.field-error,
.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--c-danger);
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.input.is-invalid {
  border-color: var(--c-danger);
  background: var(--c-danger-soft);
}
.form-errors {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--c-danger-soft);
  color: var(--c-danger);
  font-size: var(--fs-sm);
}
.form-errors .errorlist {
  color: inherit;
}
.search-field {
  position: relative;
}
.search-field > .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-subtle);
}
.search-field > .input {
  padding-left: 42px;
  background: var(--c-surface);
}
.divider-text {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--c-subtle);
  font-size: var(--fs-sm);
}
.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--c-border);
}

/* ---------- Modal (<dialog class="modal">) ---------- */
.modal {
  width: min(720px, calc(100vw - 2 * var(--s-4)));
  max-height: calc(100vh - 2 * var(--s-4));
  padding: 0;
  border: 1px solid #e8ebef;
  border-radius: var(--r-xl);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 0 15px 16px rgb(0 0 0 / 0.03);
}
.modal::backdrop {
  background: rgb(255 255 255 / 0.75);
  backdrop-filter: blur(2px);
}
.modal-inner {
  padding: var(--s-6);
}
@media (min-width: 640px) {
  .modal-inner {
    padding: var(--s-7);
  }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.modal-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 29px;
  margin: 0;
}
.modal-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--c-muted);
}
.modal-close {
  border: 0;
  background: none;
  padding: var(--s-1);
  color: var(--c-muted);
  cursor: pointer;
  border-radius: var(--r-sm);
}
.modal-close .icon {
  width: 24px;
  height: 24px;
}

/* ---------- Alerts / messages ---------- */
.messages {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: var(--s-4) auto 0;
}
.alert {
  --al-bg: var(--c-info-soft);
  --al-fg: var(--c-info);
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--al-bg);
  color: var(--c-text);
  font-size: var(--fs-sm);
  border: 1px solid color-mix(in srgb, var(--al-fg) 18%, transparent);
}
.alert > .icon {
  color: var(--al-fg);
  margin-top: 1px;
}
.alert-body {
  flex: 1;
}
.alert-body p:last-child {
  margin: 0;
}
.alert-success {
  --al-bg: var(--c-success-soft);
  --al-fg: var(--c-success);
}
.alert-warning {
  --al-bg: var(--c-warning-soft);
  --al-fg: var(--c-warning);
}
.alert-error {
  --al-bg: var(--c-danger-soft);
  --al-fg: var(--c-danger);
}
.banner {
  padding: var(--s-2) var(--s-4);
  background: var(--c-warning-soft);
  color: var(--c-warning);
  border-bottom: 1px solid color-mix(in srgb, var(--c-warning) 25%, transparent);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
}

/* ---------- Table ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.table th,
.table td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.table th {
  background: var(--c-bg);
  color: var(--c-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Event page ---------- */
.event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
  padding-top: var(--s-6);
  padding-bottom: var(--s-8);
}
@media (min-width: 900px) {
  .event-layout {
    grid-template-columns: var(--aside-w) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0 45px;
  }
  .event-head {
    grid-column: 1;
    grid-row: 1;
  }
  .event-details {
    grid-column: 1;
    grid-row: 2;
    margin-top: var(--s-5);
    padding-top: var(--s-5);
    border-top: 1px solid var(--c-border);
  }
  .event-main {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}
@media (max-width: 899.98px) {
  /* Event page (.event-layout-home), one column: event head, How It Works, description, then the main
     content. Other event pages keep their main content first. */
  .event-layout-home .event-details { display: contents; }
  .event-layout-home .event-head { order: -3; }
  .event-layout-home .event-hiw { order: -2; }
  .event-layout-home .event-desc { order: -1; }
}
@media (min-width: 640px) and (max-width: 899.98px) {
  /* Tablet widths: event head and How It Works side by side, the description and everything else full width below. */
  .event-layout-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-layout-home > :not(.event-head),
  .event-layout-home .event-details > :not(.event-hiw),
  .event-layout-home:not(:has(> .event-details > .event-hiw)) > .event-head { grid-column: 1 / -1; }
}
.event-main {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  min-width: 0;
}

/* Organizer tools bar on the event page: first card in the main column, pinned under the top bar. */
:root { --org-tools-h: 56px; } /* height of the pinned bar; the team board's sticky Unassigned card sits below it */
/* One row, left-aligned: title and phase on the left, the tools beside them scrolling sideways when they don't
fit, so the pinned bar covers as little of the page as possible. Flush under the top bar so nothing shows through
a gap above it. */
.org-tools {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  box-shadow: var(--shadow-md);
}
.org-tools-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex: none;
}
.org-tools-head .card-title {
  margin: 0;
  font-size: var(--fs-sm);
  white-space: nowrap;
}
/* Medium screens: the phase badge carries enough context, so the title goes to make room for every tool. */
@media (min-width: 701px) and (max-width: 1365px) {
  .org-tools-head .card-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.org-tools-links {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 6px;
  position: relative; /* offsetParent for techr.js scrolling the current tool into view */
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.org-tools-links::-webkit-scrollbar {
  display: none;
}
.org-tools-links .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.org-tools-links .btn.is-active {
  background: var(--c-primary-soft);
  border-color: var(--c-primary);
  color: var(--c-primary);
}
/* Links to #sections land below the pinned bar too. */
html:has(.org-tools) {
  scroll-padding-top: calc(var(--header-h) + var(--org-tools-h) + var(--s-4));
}
/* Phones: one row of buttons you swipe sideways, so the pinned bar stays small. */
@media (max-width: 700px) {
  :root { --org-tools-h: 84px; }
  .org-tools {
    flex-direction: column; /* title above the swipeable row: there is no room beside it on a phone */
    align-items: stretch;
    gap: var(--s-2);
  }
  .org-tools-head .card-title {
    font-size: var(--fs-sm);
  }
  .org-tools-links {
    margin: 0 calc(-1 * var(--s-3));
    padding: 0 var(--s-3) 2px;
  }
}
.event-head > .badge {
  padding: 5px 10px;
  border-radius: 5px;
  background: #f1f2f4;
  font-size: 14px;
  font-weight: 800;
  line-height: 17px;
}
.event-title {
  font-size: var(--fs-xl);
  line-height: 27px;
  margin: 6px 0 var(--s-3);
}
.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--c-text-2);
}
.meta-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
}
.meta-list .icon {
  color: var(--c-primary);
  margin-top: 1px;
}
.event-desc {
  font-size: var(--fs-sm);
  color: var(--c-text-2);
  line-height: 20px;
}
.event-details h3 {
  font-size: 14px;
  font-weight: 800;
  line-height: 17px;
  margin-top: var(--s-5);
}
.event-details > :first-child {
  margin-top: 0;
}
/* Rendered organizer rich text (apps/core/markdown.py): wrap `{{ text|markdown }}` in an element with .rich. */
.rich > :first-child {
  margin-top: 0;
}
.rich > :last-child {
  margin-bottom: 0;
}
.rich p,
.rich ul,
.rich ol,
.rich blockquote {
  margin: 0 0 var(--s-3);
}
.rich h2,
.rich h3 {
  margin: var(--s-4) 0 var(--s-2);
  font-weight: 800;
  line-height: 1.3;
}
.rich h2 {
  font-size: var(--fs-md);
}
.rich h3 {
  font-size: var(--fs-sm);
}
.rich ul,
.rich ol {
  padding-left: 1.25rem;
}
.rich li + li {
  margin-top: var(--s-1);
}
.rich li > p {
  margin: 0;
}
.rich blockquote {
  padding-left: var(--s-3);
  border-left: 3px solid var(--c-border-strong);
  color: var(--c-muted);
}
.rich a {
  text-decoration: underline;
}
.how-it-works {
  font-size: var(--fs-sm);
  color: var(--c-text-2);
}
.how-it-works li::marker {
  font-weight: 500;
  color: var(--c-text);
}
.cta-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.cta-card .card-title {
  font-size: var(--fs-xl);
  margin: 0;
}
.cta-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
@media (min-width: 640px) {
  .cta-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
.placeholder-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) {
  .placeholder-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.skeleton {
  height: 132px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--c-border-strong);
  background: repeating-linear-gradient(-45deg, var(--c-bg), var(--c-bg) 10px, #fff 10px, #fff 20px);
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: var(--s-7) var(--s-4) var(--s-8);
  background: var(--c-bg);
  flex: 1;
}
.auth-card {
  width: 100%;
  max-width: 440px;
}
.auth-card h1 {
  font-size: var(--fs-2xl);
}
.auth-card .form {
  margin-top: var(--s-2);
}
.auth-card .messages {
  margin: 0 0 var(--s-4);
  padding: 0;
}
.provider-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-5);
  padding-bottom: var(--s-5);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  color: var(--c-muted);
}

/* ---------- Full app shell ---------- */
.app-body {
  background: var(--c-bg);
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--c-surface);
}
.app-header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--header-h);
  padding: var(--s-2) var(--s-4);
}
@media (min-width: 768px) {
  .app-header-inner {
    padding: var(--s-2) var(--s-6);
  }
}
.app-header-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.app-search {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 680px;
  align-items: center;
  gap: var(--s-2);
  padding: 5px 5px 5px var(--s-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}
.app-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-text);
  outline: none;
}
.app-search input::placeholder {
  color: var(--c-subtle);
}
.city-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 0 var(--s-3);
  border-left: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.city-pill .icon {
  color: var(--c-primary);
}
.round-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  color: #fff;
  cursor: pointer;
}
.round-btn:hover {
  background: var(--c-primary-hover);
}
.round-btn-ring {
  box-shadow: 0 0 0 4px var(--c-primary-soft);
}
.round-btn-light {
  background: var(--c-surface);
  color: var(--c-primary);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.round-btn-light:hover {
  background: var(--c-surface-2);
}
.tools-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px var(--s-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-md);
  color: var(--c-text);
}
.tools-pill .icon {
  color: var(--c-primary);
}
/* Phones and tablets: the search box shrinks to fit between the logo and the buttons, and drops the city label. */
@media (max-width: 1023px) {
  .city-pill {
    display: none;
  }
}
@media (max-width: 767px) {
  .app-header-inner {
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
  }
  .app-header .logo {
    flex: none;
  }
  .app-header .logo-img {
    width: 96px;
  }
  .app-search {
    padding: 4px var(--s-3);
  }
  .app-search input {
    font-size: 1rem; /* 16px, so iOS doesn't zoom the page on focus */
  }
  .app-search .round-btn {
    display: none; /* Enter submits */
  }
  .view-switch {
    gap: var(--s-1);
  }
  .view-switch .round-btn {
    width: 36px;
    height: 36px;
  }
  .app-header .user-pill .icon {
    display: none;
  }
}
.app-frame {
  flex: 1;
  display: flex;
  gap: var(--s-5);
  padding: var(--s-4);
  padding-bottom: var(--s-4);
}
@media (min-width: 768px) {
  .app-frame {
    padding: var(--s-5) var(--s-6) var(--s-6);
  }
}
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.app-rail {
  /* Phones: a bottom bar with Companies, Events and Jobs (the app shell only; event pages use their own header). */
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  justify-content: space-around;
  padding: var(--s-2);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
.rail-link {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-width: 64px;
  height: 52px;
  border-radius: var(--r-lg);
  color: var(--c-primary);
  background: var(--c-surface);
}
.rail-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
}
.rail-link:hover {
  background: var(--c-primary-soft);
}
.rail-link.is-active {
  background: var(--c-primary);
  color: #fff;
}
.rail-link .icon {
  width: 22px;
  height: 22px;
}
.rail-bottom {
  display: none;
}
@media (max-width: 767px) {
  /* Room for the fixed bottom bar. */
  .app-body { padding-bottom: 68px; }
  .app-frame-bleed { height: calc(100dvh - var(--header-h) - 68px); }
}
@media (min-width: 768px) {
  .rail-label { display: none; }
  .rail-link { width: 46px; min-width: 0; height: 46px; border-radius: var(--r-pill); }
  .app-frame {
    padding-bottom: var(--s-6);
  }
  .app-rail {
    display: flex;
    position: sticky;
    top: calc(var(--header-h) + var(--s-5));
    align-self: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--s-2);
    width: 74px;
    min-height: calc(100vh - var(--header-h) - 2 * var(--s-5));
    padding: var(--s-4) var(--s-3);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-sm);
  }
  .rail-link {
    background: var(--c-surface-2);
  }
  .rail-bottom {
    display: grid;
    margin-top: auto;
  }
}

/* Map and list buttons side by side (header). */
.view-switch {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

/* Full-bleed variant for the map page: the map fills the area right of the rail, top-left corner rounded. */
.app-frame-bleed {
  gap: 0;
  padding: 0;
  height: calc(100dvh - var(--header-h));
}
.app-frame-bleed .app-main {
  gap: 0;
  position: relative;
  overflow: hidden;
  background: var(--c-surface-2);
}
@media (min-width: 768px) {
  .app-frame-bleed {
    padding: 0;
  }
  .app-frame-bleed .app-rail {
    position: static;
    align-self: stretch;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .app-frame-bleed .app-main {
    border-top-left-radius: var(--r-xl);
  }
}

/* ---------- Style guide ---------- */
.sg-section {
  padding: var(--s-7) 0;
  border-top: 1px solid var(--c-border);
}
.sg-section:first-of-type {
  border-top: 0;
}
.sg-on-dark { padding: var(--s-4); border-radius: var(--r-md); background: var(--c-brand-ink); }
.sg-swatches {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.sg-swatch {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: var(--fs-xs);
}
.sg-swatch > div {
  height: 56px;
}
.sg-swatch > p {
  margin: 0;
  padding: var(--s-2);
}
.sg-frame {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-bg);
}
.sg-frame .site-header,
.sg-frame .app-header {
  position: static;
}
.sg-frame .app-rail {
  position: static;
  min-height: 360px;
}

/* Inline one-field forms (e.g. assign a seat): input grows, button stays beside it */
.inline-form { display: flex; gap: var(--s-2); align-items: center; }
.inline-form .input { flex: 1; min-width: 0; }

/* Announcements + profile (agent C) */
.ann-banner {
  --ab-bg: var(--c-info-soft);
  --ab-fg: var(--c-info);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  background: var(--ab-bg);
  border: 1px solid color-mix(in srgb, var(--ab-fg) 25%, transparent);
}
.ann-banner-schedule { --ab-bg: var(--c-success-soft); --ab-fg: var(--c-success); }
.ann-banner-warning { --ab-bg: var(--c-warning-soft); --ab-fg: var(--c-warning); }
.ann-banner-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--ab-fg);
}
.ann-banner-icon .icon { width: 16px; height: 16px; }
.ann-banner-text { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-sm); line-height: 1.4; }
.ann-banner-title { font-weight: 700; margin-right: var(--s-1); }
.ann-banner-body { color: var(--c-text-2); }
.ann-dismiss { flex: none; margin-left: auto; align-self: flex-start; }
.ann-dismiss .btn { color: var(--c-muted); }
.ann-dismiss .btn:hover { color: var(--c-text); }
.ann-dismiss .btn-xs.btn-icon { width: 28px; min-height: 28px; }
.ann-head-actions { display: flex; align-items: center; gap: var(--s-1); }
.ann-head-actions .ann-dismiss { align-self: center; margin-left: 0; }
.btn-xs { min-height: 28px; padding: 2px var(--s-2); font-size: var(--fs-xs); }
.ann-compose { margin-bottom: var(--s-5); }
.ann-compose > summary { list-style: none; }
.ann-compose > summary::-webkit-details-marker { display: none; }
.ann-compose[open] > summary { margin-bottom: var(--s-4); }
.ann-compose-form {
  padding: var(--s-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
}
.ann-options { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.ann-options .field-check { flex-wrap: wrap; }
.ann-options .field-check .field-help { flex-basis: 100%; padding-left: 26px; }
.ann-options input:disabled + label { color: var(--c-subtle); }
.ann-item-text { flex: 1; min-width: 0; }
.ann-item-text .feed-body p { margin: 0 0 var(--s-2); }
.ann-item-text .feed-body p:last-child { margin: 0; }
.ann-pinned { font-size: var(--fs-xs); padding: 1px 6px; vertical-align: middle; }
.ann-admin { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); margin-top: var(--s-1); }
.ann-admin { justify-content: flex-start; }
.ann-manage-deleted .ann-item-text > :not(.ann-admin) { opacity: 0.6; }
.ann-delete { color: var(--c-danger); }
.profile-page { max-width: 720px; }
.profile-names { display: grid; gap: var(--s-4); }
@media (min-width: 640px) {
  .profile-names { grid-template-columns: 1fr 1fr; }
}
.check-group { border: 0; margin: 0; padding: 0; }
.check-grid { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}
.check-chip input { width: 16px; height: 16px; margin: 0; accent-color: var(--c-primary); }
.check-chip:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary); }
/* Settings editor (agent B) */
.settings-card-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.settings-card-title .icon {
  color: var(--c-primary);
}
.settings-alert {
  margin-bottom: var(--s-4);
}
.settings-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-size: var(--fs-sm);
}
.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--s-3);
  padding: var(--s-2) 0;
  border-top: 1px solid var(--c-border);
}
.settings-row:first-child {
  border-top: 0;
}
.settings-row dt {
  color: var(--c-muted);
}
.settings-row dd {
  margin: 0;
  color: var(--c-text);
  overflow-wrap: anywhere;
}
.settings-list-compact .settings-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 4px 0;
  border-top: 0;
}
.settings-list-compact dd {
  font-weight: 600;
  text-align: right;
}
.phase-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-size: var(--fs-sm);
}
.phase-step {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-1) var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-left: 3px solid var(--c-border);
  color: var(--c-text-2);
}
.phase-step.is-current {
  border-left-color: var(--c-primary);
  background: var(--c-primary-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--c-text);
  font-weight: 600;
}
.phase-at {
  color: var(--c-muted);
  font-weight: 400;
}
.phase-warn {
  flex-basis: 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  color: var(--c-warning);
  font-weight: 400;
}
.phase-warn .icon {
  flex: none;
  margin-top: 2px;
}
.change-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  font-size: var(--fs-sm);
}
.change-what {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  overflow-wrap: anywhere;
}
.change-values s {
  color: var(--c-muted);
}
.change-meta {
  font-size: var(--fs-xs);
  color: var(--c-muted);
}
/* Registration panel (agent A) */
.badge-danger {
  background: var(--c-danger-soft);
  color: var(--c-danger);
}
.reg-stat-of {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-muted);
}
.reg-search { min-width: min(100%, 380px); }
.reg-table tbody + tbody { border-top: 2px solid var(--c-border-strong); }
.reg-order td { background: var(--c-surface-2); }
.reg-order .badge { margin-left: var(--s-2); vertical-align: middle; }
.reg-actions { flex-wrap: wrap; gap: var(--s-1); }
.reg-actions form { margin: 0; }
.reg-reissue > summary { list-style: none; cursor: pointer; }
.reg-reissue > summary::-webkit-details-marker { display: none; }
.reg-reissue[open] > summary { background: var(--c-primary-soft); color: var(--c-primary); }
.reg-reissue > form { margin-top: var(--s-2); min-width: 280px; }
.reg-import { position: relative; }
.reg-import > summary { list-style: none; cursor: pointer; }
.reg-import > summary::-webkit-details-marker { display: none; }
.reg-import[open] > summary { background: var(--c-primary-soft); color: var(--c-primary); }
.reg-import-panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--s-2));
  z-index: 20;
  width: min(420px, calc(100vw - 32px));
  box-shadow: var(--shadow-md, var(--shadow-sm));
}
.reg-role-form {
  display: grid;
  gap: var(--s-2);
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) auto auto;
  align-items: center;
}
@media (max-width: 720px) {
  .reg-role-form { grid-template-columns: minmax(0, 1fr); }
}

/* Ideas dashboard (agent B) */
.ideas-dash-stats,
.stat-grid.ideas-dash-stats { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); }
.ideas-dash-help {
  margin-top: var(--s-1);
  font-size: var(--fs-xs);
  color: var(--c-subtle);
}
.ideas-dash-none { font-size: var(--fs-lg); }
.ideas-dash-bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  overflow: hidden;
}
.ideas-dash-bar > span {
  display: block;
  height: 100%;
  background: var(--c-primary);
  border-radius: inherit;
}
.ideas-dash-details > summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--c-text-2);
  list-style: none;
}
.ideas-dash-details > summary::-webkit-details-marker { display: none; }
.ideas-dash-chev { transition: transform 0.15s; color: var(--c-muted); }
.ideas-dash-details[open] .ideas-dash-chev { transform: rotate(180deg); }
.ideas-dash-people {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  font-size: var(--fs-sm);
}
.ideas-dash-people li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.ideas-dash-filters {
  display: grid;
  gap: var(--s-2);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
@media (max-width: 560px) {
  .ideas-dash-filters { grid-template-columns: minmax(0, 1fr); }
}
.ideas-dash-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.idea-dash-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.idea-dash-card.is-withdrawn { opacity: 0.6; }
.idea-dash-rank {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  color: var(--c-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.idea-dash-rank.is-top {
  background: var(--c-warning-soft);
  color: var(--c-warning);
}
.idea-dash-title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.idea-dash-desc {
  margin: 0;
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}
.idea-dash-votes {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-1) var(--s-3);
  margin-top: auto;
  padding-top: var(--s-2);
  border-top: 1px solid var(--c-border);
}
/* Ideas board (agent A) */
[x-cloak] { display: none !important; }
.ideas-board { display: flex; flex-direction: column; gap: var(--s-5); }
.ideas-note { display: flex; align-items: center; gap: var(--s-2); margin: 0; font-size: var(--fs-sm); }
.ideas-note .icon { flex: none; color: var(--c-primary); }
.tag-developer-tools { --tag-bg: #e3f6f1; --tag-fg: #047857; }
.tag-other { --tag-bg: #f1f2f6; --tag-fg: #475569; }
.idea-filters { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.idea-search { flex: 3 1 260px; }
.idea-category { flex: 1 1 180px; }
/* Search/filter rows: compact 38px controls on white (Figma search-filter-row). */
form[role="search"] .input,
form[role="search"] .select { min-height: 38px; padding-top: 8px; padding-bottom: 8px; border-radius: 8px; background-color: var(--c-surface); font-size: 14px; }
.idea-list { display: flex; flex-direction: column; gap: var(--s-3); }
.idea-grid {
  --gap: var(--s-5);
  display: grid;
  gap: var(--gap);
  /* Up to 3 columns, each at least 260px wide. */
  grid-template-columns: repeat(auto-fill, minmax(max(260px, calc((100% - 2 * var(--gap)) / 3)), 1fr));
}
.idea-card { display: flex; flex-direction: column; gap: 14px; padding: var(--s-5); box-shadow: none; border-color: #e8ebef; scroll-margin-top: calc(var(--header-h) + var(--s-4)); transition: box-shadow 0.15s ease, border-color 0.15s ease; }
.idea-card:hover { border-color: var(--c-border-strong); box-shadow: var(--shadow-md); }
.idea-card.is-voted { border-color: color-mix(in srgb, var(--c-primary) 35%, var(--c-border)); }
.idea-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.idea-title { margin: 0; font-size: var(--fs-md); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.idea-submitter { margin: 0; font-size: var(--fs-sm); color: var(--c-text-2); }
.idea-you { font-size: var(--fs-xs); padding: 0 6px; vertical-align: 1px; }
.idea-edited {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  width: fit-content;
  margin: 0;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--c-warning-soft);
  color: var(--c-warning);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.idea-desc { margin: 0; font-size: var(--fs-sm); line-height: 1.35; color: var(--c-text-2); overflow-wrap: anywhere; }
.idea-desc.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.idea-more {
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-primary);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.idea-votes { display: flex; align-items: center; gap: var(--s-2); margin: 0; color: var(--c-primary); font-size: 15px; font-weight: 600; }
.idea-card-foot { display: flex; flex-direction: column; gap: var(--s-2); margin-top: auto; }
.idea-card-foot .btn-block { min-height: 38px; }
.idea-card-foot .btn-soft:not(:disabled) { --btn-fg: var(--c-primary); }
.idea-card-foot form { margin: 0; }
.idea-hint { margin: 0; font-size: var(--fs-xs); color: var(--c-muted); text-align: center; }
.idea-final-pick { font-size: var(--fs-sm); }
.idea-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-1); }
.idea-danger { --btn-fg: var(--c-danger); }
.idea-danger:hover { background: var(--c-danger-soft); }
.idea-empty { text-align: center; color: var(--c-muted); }
.idea-picks .card-head { flex-wrap: wrap; }
.idea-picks-list { list-style: none; margin: 0 0 var(--s-2); padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.idea-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  min-height: 48px;
  padding: var(--s-1) var(--s-2) var(--s-1) var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  font-size: var(--fs-sm);
}
.idea-pick.is-empty { border-style: dashed; background: var(--c-bg); }
.idea-pick-rank {
  flex: none;
  min-width: 40px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-weight: 700;
  text-align: center;
}
.idea-pick.is-empty .idea-pick-rank { background: var(--c-surface-2); color: var(--c-muted); }
.idea-pick-title { flex: 1 1 140px; min-width: 0; color: var(--c-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea-pick-edited { flex: none; font-size: var(--fs-xs); }
.idea-pick-actions { display: flex; flex-wrap: wrap; flex: none; gap: 2px; margin-left: auto; }
.idea-pick-actions form { margin: 0; }
.idea-pick-btn { padding: 0 var(--s-2); --btn-fg: var(--c-text-2); }
.idea-pick-btn-text { font-size: var(--fs-xs); }
.idea-picks-sub { margin: 0 0 var(--s-2); }
.idea-howto { display: flex; flex-direction: column; gap: var(--s-2); }
.idea-howto .card-title { display: flex; align-items: center; gap: var(--s-2); margin: 0; }
.idea-howto .icon { color: var(--c-primary); }
.idea-howto-list { margin: 0; padding-left: var(--s-5); display: flex; flex-direction: column; gap: var(--s-1); font-size: var(--fs-sm); }
.idea-mypick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.idea-mypick form { margin: 0; }
/* Pick-change message, pinned to the bottom of the screen (the board keeps its scroll position). */
.idea-toast {
  position: fixed;
  left: 50%;
  bottom: var(--s-5);
  transform: translateX(-50%);
  z-index: 60;
  width: min(560px, calc(100vw - 2 * var(--s-4)));
  align-items: center;
  box-shadow: var(--shadow-md);
}
.idea-toast-close { flex: none; margin: calc(-1 * var(--s-1)) calc(-1 * var(--s-2)) calc(-1 * var(--s-1)) 0; }
.idea-counter { text-align: right; }
.idea-form-page .modal-head { margin-bottom: var(--s-2); }

/* Team page (agent B) */
.team-header .avatar-stack { margin-left: auto; }
.team-rename { flex-basis: 100%; }
.team-rename > summary { list-style: none; cursor: pointer; }
.team-rename > summary::-webkit-details-marker { display: none; }
.team-rename-form { margin-top: var(--s-3); max-width: 420px; }
@media (min-width: 640px) {
  .team-rename { flex-basis: auto; }
  .team-rename[open] { flex-basis: 100%; }
}
.team-grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.team-col { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
@media (min-width: 1180px) {
  .team-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
}
.team-idea-title { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 var(--s-1); }
.team-idea-desc { color: var(--c-text-2); font-size: var(--fs-sm); margin: 0 0 var(--s-4); }
.team-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.team-member { display: flex; gap: var(--s-3); align-items: flex-start; }
.team-member-text { min-width: 0; flex: 1; }
.team-member-name { font-weight: 600; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.team-member-name .badge { font-size: var(--fs-xs); padding: 1px 8px; }
.team-skills { margin-top: var(--s-1); gap: var(--s-1); }
.team-member-links { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-1); }
.team-member-links a { display: inline-flex; align-items: center; gap: 4px; }
.submission-deadline {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
  padding: var(--s-3);
  margin-bottom: var(--s-4);
  border-radius: var(--r-md);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: var(--fs-sm);
}
.submission-deadline > .icon { flex: none; margin-top: 2px; }
.submission-deadline strong { color: var(--c-text); }
.submission-deadline.is-closed { background: var(--c-surface-2); color: var(--c-muted); }
.submission-layout { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .submission-layout.has-questions { grid-template-columns: minmax(0, 1fr) 240px; }
}
.submission-main { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.submission-sub { font-size: var(--fs-sm); font-weight: 700; margin: var(--s-3) 0 var(--s-2); display: flex; align-items: center; gap: var(--s-1); }
.submission-run { white-space: pre-wrap; margin: 0 0 var(--s-3); }
.submission-edit > summary,
.submission-history > summary { cursor: pointer; }
.submission-edit > summary { list-style: none; }
.submission-edit > summary::-webkit-details-marker { display: none; }
.submission-form { margin-top: var(--s-4); }
.submission-history > summary { color: var(--c-muted); margin-bottom: var(--s-2); }
.submission-questions { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: var(--s-4); align-self: start; }
.submission-questions .submission-sub { margin-top: 0; }
.question-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: var(--s-2); font-size: var(--fs-sm); }
.quota-bar { height: 6px; border-radius: var(--r-pill); background: var(--c-surface-2); overflow: hidden; margin-bottom: var(--s-4); }
.quota-bar > span { display: block; height: 100%; background: var(--c-primary); border-radius: inherit; }
.team-upload { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-2); }
.team-upload input[type="file"] { flex: 1 1 180px; min-width: 0; font-size: var(--fs-sm); }
.file-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-bg);
}
.file-row form { margin: 0; }
.file-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text-2);
}
.file-text { flex: 1; min-width: 0; }
.file-name { margin: 0; font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { margin: 0; font-size: var(--fs-xs); color: var(--c-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .btn-icon { width: 32px; min-height: 32px; border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); }
.file-delete { color: var(--c-danger); }
.team-index { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.team-index-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  text-decoration: none;
}
.team-index-row:hover { border-color: var(--c-border-strong); text-decoration: none; }
.team-index-num {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--team-color, var(--c-primary));
  color: #fff;
  font-weight: 800;
}
.team-index-text { flex: 1; min-width: 0; }
.team-upload input[type="file"]::file-selector-button {
  margin-right: var(--s-2);
  padding: 6px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 0;
  font-size: inherit;
}

/* Teams finalize (agent A) */
.stat-grid.teams-stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.teams-stat-warn { background: var(--c-warning-soft); border-color: color-mix(in srgb, var(--c-warning) 30%, transparent); }
.teams-stat-warn .stat-value { color: var(--c-warning); }
.teams-steps { margin: 0; padding-left: 1.25rem; display: grid; gap: var(--s-2); font-size: var(--fs-sm); }
.teams-k { max-width: 220px; }
.teams-pick { border: 0; margin: 0; padding: 0; min-width: 0; }
.teams-pick-list, .teams-chosen { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: 2px; }
.teams-pick-row, .teams-chosen li {
  display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm); font-size: var(--fs-sm);
}
.teams-pick-row { cursor: pointer; }
.teams-pick-row:hover { background: var(--c-surface-2); }
.teams-pick-row input { flex: none; }
.teams-rank { flex: none; min-width: 2.25rem; font-weight: 700; color: var(--c-primary); }
.teams-pick-title { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.teams-pick-votes { flex: none; white-space: nowrap; }
.teams-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.teams-card { border-top: 4px solid var(--team, var(--c-primary)); display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
/* Header: number badge, name + idea (clamped to two lines so every card's member list starts level), size badge. */
.teams-card-head { display: flex; align-items: flex-start; gap: var(--s-3); padding-bottom: var(--s-3); border-bottom: 1px solid var(--c-border); }
.teams-card-head > div { flex: 1; min-width: 0; min-height: calc(var(--fs-md) * 2.6); }
.teams-card-head > .badge, .teams-card-head > form { flex: none; }
.teams-card-head > .badge { margin-top: 2px; }
.team-badge {
  flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r-md); background: var(--team, var(--c-primary)); color: #fff;
  font-weight: 800; font-size: var(--fs-lg);
}
.teams-card-title {
  margin: 0; font-size: var(--fs-md); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
/* Name plus idea line: one line each, so the header is as tall as a two-line name. */
.teams-card-title:has(+ .teams-card-idea) { -webkit-line-clamp: 1; line-clamp: 1; }
.teams-card-title a { color: inherit; text-decoration: none; }
.teams-card-title a:hover { text-decoration: underline; }
.teams-card-idea {
  margin: 2px 0 0; font-size: var(--fs-sm); line-height: 1.35; color: var(--c-text-2); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden;
}
.teams-members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
.teams-member { display: flex; align-items: center; gap: var(--s-2); min-width: 0; min-height: 36px; font-size: var(--fs-sm); padding: 2px var(--s-1); margin: 0 calc(-1 * var(--s-1)); border-radius: var(--r-sm); }
.teams-member > .avatar, .teams-member > .badge { flex: none; }
/* Drag and drop in the draft (static/js/team-draft.js); the lists stay big enough to drop on when a team is small. */
#preview[data-move-url] .teams-members { min-height: 48px; }
#preview[data-move-url] .teams-member { cursor: grab; touch-action: manipulation; }
#preview[data-move-url] .teams-member:hover { background: var(--c-surface-2); }
.teams-member.is-ghost { opacity: 0.4; background: var(--c-surface-2); }
.teams-member.is-chosen { cursor: grabbing; }
.teams-chip { display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); background: var(--c-surface); border: 1px solid var(--c-border); cursor: grab; font-weight: 600; }
.teams-chip.is-ghost { opacity: 0.4; }
.teams-member > .badge { padding: 1px 8px; font-size: var(--fs-xs); }
.teams-member-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.teams-member-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teams-member > .teams-member-name { flex: 1; }
.teams-member-text .teams-member-name { font-weight: 600; }
.teams-member-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); color: var(--c-muted); }
.teams-member.is-none { background: var(--c-warning-soft); }
.teams-member.is-none .teams-member-label { color: var(--c-warning); font-weight: 600; }
.teams-adjust { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; font-size: var(--fs-sm); }
.teams-adjust .select { width: auto; max-width: 100%; flex: 1 1 180px; }
.teams-adjust-label { min-width: 80px; font-weight: 600; }
.teams-publish { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); }
.teams-publish form { margin: 0; }

/* Team board (hackathon staff Teams page after publishing): static/js/team-board.js */
.team-board { display: grid; gap: var(--s-4); }
/* Header card above the board (outside the swapped #team-board): search row, then the help line. */
.team-board-head { padding: var(--s-3) var(--s-4); display: grid; gap: var(--s-2); }
.team-board-head[hidden] { display: none; }
.team-board-count { white-space: nowrap; }
.team-board-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.team-board-find { display: flex; align-items: center; gap: var(--s-3); flex: 1 1 360px; min-width: 0; }
.team-board-search { flex: 0 1 320px; min-width: 0; width: 100%; }
.team-board-search > .input { height: 36px; min-height: 36px; padding-top: 0; padding-bottom: 0; padding-left: 38px; padding-right: 34px; background: var(--c-surface); font-size: var(--fs-sm); }
.team-board-search > .icon { left: 12px; width: 16px; height: 16px; }
.team-board-search > .input::-webkit-search-cancel-button { display: none; }
.team-board-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--c-subtle); cursor: pointer; }
.team-board-clear:hover { background: var(--c-surface-2); color: var(--c-text); }
.team-board-clear .icon { width: 14px; height: 14px; }
.team-board-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s-2); }
.team-board-head-actions form { margin: 0; }
.team-board-unassigned {
  padding: var(--s-3) var(--s-4); display: grid; gap: var(--s-2);
  border-top: 4px solid var(--c-warning); background: var(--c-warning-soft);
}
/* Pinned below the sticky Organizer tools bar (--org-tools-h). */
.team-board-unassigned { position: sticky; top: calc(var(--header-h) + var(--s-2) + var(--org-tools-h) + var(--s-2)); z-index: 5; }
.team-board-strip {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-1) var(--s-3);
  border: 1px dashed var(--c-border); border-radius: var(--r-md); min-height: 36px;
}
.board-list-strip { flex: 1; min-height: 28px; }
.team-board-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-items: stretch; }
.board-col { padding: var(--s-3); gap: var(--s-2); align-content: start; }
.board-col.is-over { border-color: var(--c-danger); background: var(--c-danger-soft); }
.board-list { display: grid; gap: var(--s-1); min-height: 120px; align-content: start; }
.board-col .board-list { padding-bottom: var(--s-6); }
.board-list-unassigned, .board-list-strip { min-height: 0; }
.board-list-unassigned { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-1) var(--s-2); padding: 2px; max-height: 34vh; overflow-y: auto; }
.board-card {
  display: flex; align-items: center; gap: var(--s-2); min-height: 38px; padding: 2px var(--s-2); cursor: grab;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md);
  font-size: var(--fs-sm); min-width: 0;
}
.board-card-grip { display: inline-flex; flex: none; color: var(--c-muted); opacity: 0.6; }
.board-card-grip .icon { width: 14px; height: 14px; }
.board-card-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board-card .badge { flex: none; }
/* Lead marker: a flag icon (the word is screen-reader text) so names keep their room in a narrow column. */
.board-card-lead { flex: none; display: inline-flex; color: var(--c-success); }
.board-card-lead .icon { width: 14px; height: 14px; }
.board-col .board-card { gap: var(--s-1); padding: 2px var(--s-1); }
.board-col .board-card-grip { display: none; }
/* Checked-in mark (organizers only): a small green check; the time is its tooltip. */
.board-card-in { flex: none; display: inline-flex; color: var(--c-success); }
.board-card-in .icon { width: 14px; height: 14px; }
/* "2 / 5 checked in" counts: under the size badge in a team header (the header keeps its height), after the Unassigned title. */
.teams-card-head > .teams-card-count { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.teams-card-head > .teams-card-count > .badge { margin-top: 2px; }
.board-checkins { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); font-weight: 400; color: var(--c-muted); white-space: nowrap; }
.board-checkins .icon { width: 12px; height: 12px; }
.board-days { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.board-stats { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; }
.board-stat { display: flex; align-items: baseline; gap: var(--s-1); margin: 0; padding: var(--s-1) var(--s-3); background: #fbfbfb; border: 1px solid var(--c-border); border-radius: 8px; font-size: var(--fs-sm); color: #666; white-space: nowrap; }
.board-stat dd { margin: 0; font-size: var(--fs-md, 1rem); font-weight: 700; color: var(--c-text); }
.board-stat dt { margin: 0; font-size: var(--fs-xs); }
.board-card-quick { margin: 0; flex: none; }
.board-card-quick .btn-xs { min-height: 24px; padding: 0 var(--s-2); white-space: nowrap; }
.board-menu { flex: none; }
.board-menu-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm);
  color: var(--c-muted); cursor: pointer;
}
.board-menu-btn:hover, .board-menu[open] > .board-menu-btn { background: var(--c-surface-2); color: var(--c-text); }
.board-menu-btn:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.board-menu-panel { top: calc(100% + 2px); min-width: 190px; padding: var(--s-1); }
.board-menu-panel .menu-item { padding: 6px var(--s-3); }
.board-picker { width: min(420px, calc(100vw - 2 * var(--s-4))); }
.board-picker-inner { padding: var(--s-4); display: grid; gap: var(--s-2); }
.board-picker-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.board-picker-teams [hidden] { display: none; }
.board-picker-teams { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; }
.idea-team { display: flex; align-items: center; gap: var(--s-2); margin: 0; font-size: var(--fs-sm); }
.idea-team-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--team, var(--c-primary)); flex: none; }
.board-start { width: min(460px, calc(100vw - 2 * var(--s-4))); }
.board-start-people { display: grid; gap: 2px; max-height: 45vh; overflow-y: auto; align-content: start; }
.board-start-label { margin: var(--s-2) 0 0; font-size: var(--fs-xs); font-weight: 700; color: var(--c-muted); }
.board-start-person { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-2); border-radius: var(--r-md); cursor: pointer; }
.board-start-person:hover { background: var(--c-surface-2); }
.board-ideas { padding: var(--s-3) var(--s-4); display: grid; gap: var(--s-2); }
.board-ideas-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); max-height: 320px; overflow-y: auto; }
.board-idea { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-1) var(--s-2); border: 1px solid var(--c-border); border-radius: var(--r-md); }
.board-idea-text { display: grid; min-width: 0; }
.board-idea-title { font-weight: 600; overflow-wrap: anywhere; }
.teams-card-remove { margin: 0; }
.board-menu-sep { border: 0; border-top: 1px solid var(--c-border); margin: var(--s-1) 0; }
.board-menu-danger, .board-menu-danger:hover { color: var(--c-danger); }
.board-card.is-hit { border-color: var(--c-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-primary) 25%, transparent); }
.board-card.is-dim { opacity: 0.35; }
.board-card { transition: box-shadow 0.3s; }
.board-card.is-flash { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-primary) 45%, transparent); }
.board-card.is-ghost { opacity: 0.4; background: var(--c-surface-2); }
.board-card.is-chosen { cursor: grabbing; }
.board-empty { padding: var(--s-1) var(--s-2); border: 1px dashed var(--c-border); border-radius: var(--r-md); text-align: center; }
@media (max-width: 640px) {
  .team-board-toolbar { align-items: stretch; }
  .team-board-find { flex-basis: 100%; }
  .team-board-search { flex-basis: auto; }
  .team-board-head-actions { justify-content: flex-start; }
  .team-board-grid { grid-template-columns: 1fr; }
  .team-board-unassigned { position: static; }
}

/* Judging (agent C) */
.jd-team-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--team-color, var(--c-primary));
  color: var(--c-on-dark);
  font-weight: 800;
  font-size: var(--fs-lg);
  line-height: 1;
}
.jd-team-badge-sm { width: 28px; height: 28px; border-radius: var(--r-sm); font-size: var(--fs-xs); }
.jd-team-inline { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; }
.jd-label {
  margin: var(--s-3) 0 var(--s-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.jd-flag { font-size: var(--fs-xs); padding: 1px var(--s-2); margin-left: var(--s-1); }

/* Organizer page */
.jd-questions, .jd-order, .jd-judge-cards, .jd-criteria, .jd-comments, .jd-podium {
  list-style: none;
  margin: 0;
  padding: 0;
}
.jd-questions { counter-reset: jdq; display: flex; flex-direction: column; gap: var(--s-2); }
.jd-question {
  counter-increment: jdq;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.jd-question::before {
  content: counter(jdq);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.jd-question-text { flex: 1 1 200px; display: flex; flex-direction: column; min-width: 0; }
.jd-question-actions { display: flex; gap: var(--s-1); }
.jd-question-actions form, .jd-order form { margin: 0; }
.jd-question-actions .btn-icon, .jd-order .btn-icon { width: 36px; min-height: 36px; }
.jd-edit { flex-basis: 100%; }
.jd-edit > summary { list-style: none; width: fit-content; }
.jd-edit > summary::-webkit-details-marker { display: none; }
.jd-edit[open] > summary { margin-bottom: var(--s-2); }
.jd-add { padding-top: var(--s-2); border-top: 1px solid var(--c-border); }
.jd-order { display: flex; flex-direction: column; gap: var(--s-1); }
.jd-order li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.jd-order li.is-current { border-color: var(--c-primary); background: var(--c-primary-soft); }
.jd-order-name { flex: 1; min-width: 0; font-weight: 600; }
.jd-judge-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-3); }
.jd-judge-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.jd-judge-head { display: flex; align-items: center; gap: var(--s-3); }
.jd-judge-head > .badge, .jd-judge-head > .avatar { flex: none; }
.jd-judge-head > .badge { align-self: flex-start; }
.jd-judge-name { flex: 1; min-width: 0; }
.jd-judge-title, .jd-judge-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-meter { display: flex; flex-direction: column; gap: var(--s-2); }
.jd-meter .quota-bar { margin-bottom: 0; }
.jd-meter-text { display: flex; justify-content: space-between; gap: var(--s-3); }
.jd-judge-actions { margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--c-border); }
.jd-board td { white-space: nowrap; }
.jd-grid-who { display: inline-flex; align-items: center; gap: var(--s-2); }
.jd-owes { color: var(--c-warning); font-weight: 600; }
.jd-tabs { margin-bottom: var(--s-1); }
.jd-judge-board th, .jd-judge-board td { white-space: nowrap; vertical-align: middle; }
.jd-sticky { position: sticky; left: 0; background: var(--c-surface); z-index: 1; text-align: left; }
.jd-row-outlier td { background: var(--c-warning-soft); }
.jd-row-outlier td.jd-sticky { background: var(--c-warning-soft); }
.jd-judge-team + .jd-judge-team > tr:first-child td { border-top: 1px solid var(--c-border); }
.jd-judge-board .jd-q { text-align: center; padding-left: var(--s-2); padding-right: var(--s-2); }
.jd-judge-board td { padding-top: var(--s-2); padding-bottom: var(--s-2); }
.jd-judge-board .input.jd-score-input {
  width: 2.75rem;
  min-height: 0;
  height: 32px;
  padding: 0 var(--s-1);
  font-size: var(--fs-sm);
  text-align: center;
  background: var(--c-surface, #fff);
  font-variant-numeric: tabular-nums;
}
.jd-score-input.is-missing { outline: 2px solid var(--c-warning); outline-offset: -1px; }
.jd-missing { color: var(--c-warning); font-weight: 600; }
.jd-layout { display: flex; gap: var(--s-1); justify-content: flex-end; }
/* Show / Track menus and Table | Cards on one row that wraps. The menus take a share of the row and shrink
with the screen (a select is otherwise as wide as its longest option and spills out of the card). */
.jd-board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-4); min-width: 0; }
.jd-board-bar .jd-layout { margin-left: auto; }
.jd-pickers { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); flex: 1 1 420px; min-width: 0; }
.jd-picker { display: flex; align-items: center; gap: var(--s-2); margin: 0; flex: 1 1 200px; min-width: 0; max-width: 340px; }
.jd-picker-label { font-size: var(--fs-sm); font-weight: 600; flex: none; }
.jd-pickers .select.jd-picker-select { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 0; height: 36px; padding: 0 var(--s-6) 0 var(--s-3); font-size: var(--fs-sm); text-overflow: ellipsis; }
@media (max-width: 640px) { .jd-picker { max-width: none; flex-basis: 100%; } }
.jd-was { display: block; font-size: var(--fs-xs); color: var(--c-muted); line-height: 1.2; margin-top: 2px; }
.jd-was:empty { display: none; }
.jd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-3); }
/* The leaderboard's All teams cards: four across, fewer as the screen narrows. */
.jd-cards:not(.jd-judge-cards-grid) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .jd-cards:not(.jd-judge-cards-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .jd-cards:not(.jd-judge-cards-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599.98px) { .jd-cards:not(.jd-judge-cards-grid) { grid-template-columns: minmax(0, 1fr); } }
.jd-judge-cards-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.jd-card { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); min-width: 0; }
.jd-card-outlier, .jd-card-tied { background: var(--c-warning-soft); }
.jd-card-error { border-color: var(--c-danger); }
.jd-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); }
.jd-card-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 var(--s-2); border-radius: var(--r-sm); background: var(--c-primary-soft); font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.jd-card-overall { margin-left: auto; }
.jd-card-average { font-size: var(--fs-xl); line-height: 1.1; font-variant-numeric: tabular-nums; }
/* All teams cards: equal height, same rows in the same place, footer pinned to the bottom. */
.jd-cards:not(.jd-judge-cards-grid) .jd-card { height: 100%; }
.jd-card-name { min-width: 0; flex: 1 1 auto; }
.jd-card-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Card header: placement (a word like "1st", never a box, so it can't be mistaken for the team number) | team name
with "Team 3" under it | the average, large. The team colour is a strip down the left edge. */
.jd-card-team { border-left: 4px solid var(--team-color, var(--c-border)); }
.jd-card-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--c-border); }
.jd-card-place, .jd-card-score { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.jd-card-place-num { font-size: var(--fs-lg); font-weight: 700; color: var(--c-primary); font-variant-numeric: tabular-nums; }
/* Trophy for the top 3 on the leaderboard (table # cell and card placement): gold, silver, bronze. */
.jd-trophy { --trophy: var(--c-gold-icon); display: inline-flex; align-items: center; gap: 2px; color: var(--trophy); font-weight: 700; }
.jd-trophy .icon { width: 16px; height: 16px; flex: none; }
.jd-trophy-2 { --trophy: #64748b; }
.jd-trophy-3 { --trophy: #a0522d; }
.jd-card-place.jd-trophy { display: flex; flex-direction: column; gap: 0; }
.jd-card-place.jd-trophy .icon { width: 20px; height: 20px; }
.jd-card-place.jd-trophy .jd-card-place-num { color: var(--trophy); }
.jd-card-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.jd-card-team-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-card-score-num { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.jd-card-label { font-size: var(--fs-xs); color: var(--c-muted); }
.jd-card-flag { color: var(--c-warning); font-weight: 600; }
.jd-card-perq { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: var(--s-1); margin: 0; font-variant-numeric: tabular-nums; }
.jd-card-perq > div { display: flex; flex-direction: column; align-items: center; padding: var(--s-1) 0; border-radius: var(--r-sm); background: var(--c-bg); }
.jd-card-perq dt { font-size: var(--fs-xs); color: var(--c-muted); }
.jd-card-perq dd { margin: 0; font-weight: 600; font-size: var(--fs-sm); }
.jd-cards:not(.jd-judge-cards-grid) .jd-card-foot { margin-top: auto; }
.jd-card-qs { display: flex; flex-direction: column; gap: var(--s-2); }
.jd-card-q { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.jd-card-q-text { flex: 1; min-width: 0; }
.jd-card-q-box { flex: none; text-align: center; }
.jd-card .input.jd-score-input { width: 2.75rem; min-height: 0; height: 32px; padding: 0 var(--s-1); font-size: var(--fs-sm); text-align: center; font-variant-numeric: tabular-nums; }
.jd-card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); justify-content: space-between; padding-top: var(--s-2); border-top: 1px solid var(--c-border); }
.jd-card-comment .textarea { width: 100%; display: block; margin: var(--s-1) 0; }
.jd-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c-primary); vertical-align: middle; }
.jd-comment-row td, .jd-row-note td { white-space: normal; background: var(--c-surface-2); }
.jd-comment-row .textarea { width: 100%; max-width: 48rem; display: block; margin: var(--s-1) 0; }
.jd-refresh { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); }
.jd-note { max-width: 420px; margin: var(--s-3) 0 var(--s-4); }
.field.jd-note input.input { min-height: 36px; padding: 6px var(--s-3); font-size: 14px; }
.jd-changed { display: inline-flex; align-items: center; gap: var(--s-1); }
.jd-row-tied td { background: var(--c-warning-soft); }
.jd-ties { padding-top: var(--s-3); border-top: 1px solid var(--c-border); }
.jd-tie { border: 1px solid var(--c-border); border-radius: var(--r-md); padding: var(--s-2) var(--s-3) var(--s-3); margin: 0; }
.jd-tie-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding-top: var(--s-2); }
.jd-tie-row label { display: inline-flex; align-items: center; gap: var(--s-2); }
.jd-tie-input { width: 80px; }

/* Judge scoring page */
.jd-judge { display: flex; flex-direction: column; gap: var(--s-5); }
.jd-page-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.jd-page-title { min-width: 0; }
.jd-page-h1 { margin: 0; font-size: var(--fs-xl); }
/* Not sticky here: the open team's header sticks under the site header instead. */
.jd-now { position: relative; }
.jd-now:empty { display: none; }
.jd-now-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--c-brand-ink);
  color: var(--c-on-dark);
  box-shadow: var(--shadow-md);
}
.jd-now-bar strong { color: var(--c-on-dark); }
.jd-now-here { background: var(--c-primary-soft); color: var(--c-text); box-shadow: none; }
.jd-now-here strong { color: var(--c-text); }
.jd-now-here-note { display: none; }
.jd-now-here .jd-now-here-note { display: inline; }
.jd-now-here .jd-now-go { display: none; }
.jd-now-text { flex: 1 1 180px; font-size: var(--fs-sm); }
.jd-accordion { display: flex; flex-direction: column; gap: var(--s-2); }
.jd-acc { border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); scroll-margin-top: calc(var(--header-h) + var(--s-2)); }
.jd-acc.is-presenting { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary); }
.jd-acc-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.jd-acc-head::-webkit-details-marker { display: none; }
.jd-acc-head:hover { background: var(--c-bg); }
.jd-acc.is-presenting > .jd-acc-head { background: var(--c-primary-soft); }
.jd-acc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jd-acc-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-acc-idea { font-size: var(--fs-sm); color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-acc-open-only { display: none; }
.jd-acc-now { flex: none; font-size: var(--fs-xs); }
.jd-progress { flex: none; font-size: var(--fs-xs); white-space: nowrap; }
.jd-acc-chevron { flex: none; transition: transform 0.15s; }
.jd-acc[open] > .jd-acc-head .jd-acc-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .jd-acc-chevron { transition: none; } }
/* The open team's header is a strong band that sticks under the site header while its questions scroll,
   so a judge always sees which team they are scoring. */
.jd-acc[open] > .jd-acc-head {
  position: sticky;
  top: var(--header-h);
  z-index: 15;
  background: var(--c-brand-ink);
  color: var(--c-on-dark);
  border-radius: var(--r-md) var(--r-md) 0 0;
  border-bottom: 4px solid var(--c-primary);
}
.jd-acc[open] > .jd-acc-head:hover { background: var(--c-brand-ink); }
.jd-acc[open] > .jd-acc-head .jd-acc-idea { color: var(--c-on-dark-muted); }
.jd-acc[open] .jd-acc-open-only { display: inline; }
.jd-acc[open] > .jd-acc-head .jd-team-badge { box-shadow: 0 0 0 2px var(--c-on-dark); }
.jd-acc-body { padding: var(--s-4) var(--s-3); }
.jd-form-card { scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.jd-form-head { display: flex; gap: var(--s-3); align-items: flex-start; margin-bottom: var(--s-4); }
.jd-form-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.jd-links { margin-bottom: var(--s-3); }
@media (min-width: 900px) { .jd-acc-body { padding: var(--s-5); } }
.jd-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s-5); }
.jd-fieldset:disabled .jd-scale-btn { cursor: not-allowed; opacity: 0.6; }
.jd-q-head { display: flex; flex-direction: column; margin-bottom: var(--s-2); }
.jd-q-text { font-weight: 700; }
/* 1-10 on a single row at every width: compact buttons on phones (about 28px wide at 360px), roomier from 600px. */
.jd-scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
@media (min-width: 600px) {
  .jd-scale { gap: var(--s-2); }
}
.jd-scale-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.jd-scale-btn {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.jd-scale-btn:hover { background: var(--c-surface-2); }
.jd-scale-input:checked + .jd-scale-btn { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-primary-ink); }
.jd-scale-input:focus-visible + .jd-scale-btn { box-shadow: var(--ring); }
.jd-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.jd-form-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
@media (max-width: 599.98px) {
  .jd-form-foot { flex-direction: column; align-items: stretch; }
  .jd-form-buttons { display: grid; grid-template-columns: 1fr 1fr; }
}
.jd-save-status { font-size: var(--fs-sm); color: var(--c-muted); }
.jd-status-ok { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--c-success); }
.jd-status-error { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--c-danger); }

/* Presentation controls */
.jd-stage-mini { display: flex; align-items: center; gap: var(--s-3); }
.jd-present-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.jd-present-buttons form { margin: 0; }

/* Projector screen: dark navy, sized in viewport units so it reads from the back of the room. */
.jd-screen-body {
  --screen-gap: 4vw;
  --screen-pad-x: 6vw;
  --screen-pad-y: 6vh;
  --screen-radius: 2vmin;
  --screen-badge: 22vmin;
  --screen-badge-font: 12vmin;
  --screen-kicker: 2.4vmin;
  --screen-h1: 8vmin;
  --screen-title: 4.2vmin;
  --screen-text: 3vmin;
  --screen-small: 2.4vmin;
  --screen-caption: 2.2vmin;
  --screen-sponsor-name: 2.6vmin;
  --screen-sponsor-name-lg: 4vmin;
  --screen-sponsor-name-gold: 3.2vmin;
  --screen-sponsor-name-sm: 2.2vmin;
  --screen-qr: 28vmin;
  --screen-tile-w: 22vmin;
  --screen-tile-h: 11vmin;
  background: var(--c-brand-ink);
  color: var(--c-on-dark);
}
.jd-screen { flex: 1; display: flex; min-height: 100vh; position: relative; }
.jd-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--screen-gap);
  padding: var(--screen-pad-y) var(--screen-pad-x);
}
.jd-stage-main { display: flex; align-items: center; gap: var(--screen-gap); min-width: 0; }
.jd-stage-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--screen-badge);
  height: var(--screen-badge);
  border-radius: calc(var(--screen-radius) * 2);
  background: var(--team-color, var(--c-primary));
  color: var(--c-on-dark);
  font-size: var(--screen-badge-font);
  font-weight: 800;
}
.jd-stage-text { min-width: 0; }
.jd-stage-kicker { margin: 0 0 1vh; font-size: var(--screen-kicker); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-on-dark-muted); }
.jd-stage-team { margin: 0; color: var(--c-on-dark); font-size: var(--screen-h1); line-height: 1.05; }
.jd-stage-title { margin: 2vh 0 0; font-size: var(--screen-title); font-weight: 700; }
.jd-stage-idea, .jd-stage-members { margin: 1.5vh 0 0; font-size: var(--screen-text); color: var(--c-on-dark-2); }
.jd-stage-links { list-style: none; margin: 3vh 0 0; padding: 0; font-size: var(--screen-small); color: var(--c-on-dark-2); word-break: break-all; }
.jd-stage-links li { display: flex; align-items: center; gap: 1vmin; }
.jd-stage-qr { margin: 0; flex: none; text-align: center; font-size: var(--screen-caption); color: var(--c-on-dark-2); }
.jd-qr { width: var(--screen-qr); height: var(--screen-qr); margin-bottom: 1vh; border-radius: var(--screen-radius); overflow: hidden; background: var(--c-surface); }
.jd-qr svg { width: 100%; height: 100%; }
.jd-stage-idle { text-align: center; margin: 0 auto; }
.jd-fullscreen { position: absolute; right: var(--s-4); bottom: var(--s-4); }
:fullscreen .jd-fullscreen { display: none; }
@media (max-width: 700px) {
  .jd-stage, .jd-stage-main { flex-direction: column; text-align: center; }
}

/* Results */
.jd-place { font-size: var(--fs-sm); }
.jd-scores { margin: 0; display: flex; flex-direction: column; }
.jd-score-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--c-border);
  font-size: var(--fs-sm);
}
.jd-score-row dt { color: var(--c-text-2); }
.jd-score-row dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--c-muted); }
.jd-score-row dd strong { color: var(--c-text); }
.jd-score-total { border-bottom: 0; font-weight: 700; }
.jd-score-total dt { color: var(--c-text); }
.jd-comments { display: flex; flex-direction: column; gap: var(--s-2); }
.jd-comments li { padding: var(--s-3); border-radius: var(--r-md); background: var(--c-bg); font-size: var(--fs-sm); }
.jd-criteria { counter-reset: jdc; display: flex; flex-direction: column; gap: var(--s-2); }
.jd-criteria li { counter-increment: jdc; display: flex; flex-direction: column; padding-left: var(--s-7); position: relative; }
.jd-criteria li::before {
  content: counter(jdc);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.jd-podium { display: flex; flex-direction: column; gap: var(--s-2); }
.jd-podium-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.jd-podium-1 { border-color: var(--c-gold); background: var(--c-gold-soft); }
.jd-place-num { flex: none; min-width: 44px; font-weight: 800; color: var(--c-gold-ink); }
.jd-podium-text { min-width: 0; }
.jd-podium-name { font-weight: 700; color: var(--c-text); }

/* Team chat (Sprint 4, agent A) */
.chat { padding: 0; overflow: hidden; container-type: inline-size; }
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--c-surface-2);
}
.chat-head .card-title { margin: 0; }
.chat-online { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--c-muted); font-size: var(--fs-sm); }
.chat-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--c-success); }
.chat-body { display: grid; grid-template-columns: minmax(170px, min(280px, 36%)) minmax(0, 1fr); min-height: 460px; }
.chat-contacts .avatar { --av: 36px; }
.chat-contacts .badge-count { flex: none; }
.chat-contacts { background: var(--c-bg); border-right: 1px solid var(--c-border); padding: var(--s-2) 0; min-width: 0; }
.chat-channels,
.chat-people { list-style: none; margin: 0; padding: 0; }
.chat-contacts-label { margin: var(--s-3) var(--s-3) var(--s-1); font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.chat-contact {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--c-text);
  cursor: pointer;
  text-decoration: none;
}
.chat-contact:hover { background: var(--c-surface-2); text-decoration: none; }
.chat-contact.is-active { background: #eff6ff; }
.chat-contact-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-contact-name { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-contact-preview { font-size: var(--fs-xs); color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-channel-icon { --av-bg: var(--c-surface-2); --av-fg: var(--c-text-2); }
.chat-channel-icon-org { --av-bg: #7c3aed; --av-fg: #fff; }
.chat-unread { border: 0; }
.chat-unread[hidden] { display: none; }
.chat-avatar-wrap { position: relative; flex: none; }
.chat-presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: var(--r-pill);
  background: var(--c-success);
  border: 2px solid var(--c-bg);
}
.chat-profile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 var(--s-3) var(--s-2) var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.chat-profile-name { margin: 0; font-weight: 600; font-size: var(--fs-sm); display: flex; align-items: center; gap: var(--s-2); }
.chat-profile .badge { font-size: var(--fs-xs); padding: 1px 8px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-pane-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--c-surface-2); }
.chat-pane-title { margin: 0; font-size: 14px; font-weight: 500; }
.chat-note {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
  padding: var(--s-2) var(--s-5);
  background: var(--c-bg);
  color: var(--c-muted);
  font-size: var(--fs-xs);
  border-bottom: 1px solid var(--c-border);
}
.chat-log { flex: 1; overflow-y: auto; max-height: 520px; min-height: 260px; padding: var(--s-4) var(--s-5); overscroll-behavior: contain; }
.chat-older { margin: 0 0 var(--s-3); text-align: center; color: var(--c-muted); font-size: var(--fs-xs); }
.chat-messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.chat-empty { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); text-align: center; padding: var(--s-6) 0; }
.chat-messages:has(> li) + .chat-empty { display: none; }
.chat-msg { display: flex; gap: var(--s-3); align-items: flex-start; }
.chat-msg-main { flex: 1; min-width: 0; }
.chat-msg-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2); margin: 0; }
.chat-msg-author { font-weight: 700; font-size: var(--fs-sm); }
.chat-msg-meta time { color: var(--c-subtle); font-size: var(--fs-xs); }
.chat-msg-badge { font-size: 11px; padding: 0 6px; }
.chat-msg-body { color: var(--c-text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.chat-msg-removed { display: flex; align-items: center; gap: var(--s-1); margin: 0; color: var(--c-muted); font-size: var(--fs-sm); font-style: italic; }
.chat-msg-notice { display: flex; align-items: center; gap: var(--s-1); margin: var(--s-1) 0 0; color: var(--c-success); font-size: var(--fs-xs); }
.chat-msg-menu { flex: none; opacity: 0.55; }
.chat-msg:hover .chat-msg-menu,
.chat-msg-menu[open],
.chat-msg-menu:focus-within { opacity: 1; }
.chat-msg-more { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm); color: var(--c-muted); }
.chat-msg-more:hover { background: var(--c-surface-2); }
.chat-msg:nth-last-child(-n+2):not(:nth-child(-n+2)) .chat-msg-menu .menu-panel { top: auto; bottom: calc(100% + var(--s-1)); }
.chat-report { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-top: 1px solid var(--c-border); margin-top: var(--s-1); }
.chat-report input { width: 100%; padding: 6px 10px; border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); font: inherit; font-size: var(--fs-sm); }
.chat-composer { padding: var(--s-3) var(--s-5); border-top: 1px solid var(--c-surface-2); }
.chat-composer-row { display: flex; gap: var(--s-3); align-items: flex-end; }
.chat-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 160px;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  font: inherit;
  font-size: var(--fs-sm);
  resize: none;
}
.chat-composer textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--ring); background: var(--c-surface); }
.chat-send { min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-pill); }
.chat-error { margin: var(--s-1) 0 0; }
.chat-error:empty { display: none; }
.chat-help { margin: var(--s-2) 0 0; color: var(--c-muted); font-size: var(--fs-xs); }
@container (max-width: 520px) {
  .chat-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .chat-contacts { border-right: 0; border-bottom: 1px solid var(--c-border); padding: var(--s-2); }
  .chat-channels { display: flex; gap: var(--s-2); }
  .chat-channels > li { flex: 1; min-width: 0; }
  .chat-channels .chat-contact { border-radius: var(--r-md); padding: var(--s-2); }
  .chat-channels .chat-contact-preview,
  .chat-channels .chat-channel-icon { display: none; }
  .chat-contacts-label,
  .chat-people { display: none; }
  .chat-log { max-height: 60vh; padding: var(--s-3) var(--s-4); }
  .chat-pane-head,
  .chat-note,
  .chat-composer { padding-left: var(--s-4); padding-right: var(--s-4); }
}
.chat-inbox,
.chat-reports { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.chat-inbox-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-2); border-top: 1px solid var(--c-border); color: var(--c-text); text-decoration: none; }
.chat-inbox > li:first-child .chat-inbox-row { border-top: 0; }
.chat-inbox-row:hover { background: var(--c-surface-2); text-decoration: none; }
.chat-inbox-row.is-unread .chat-contact-name { font-weight: 800; }
.chat-inbox-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--team-color, var(--c-primary));
  color: #fff;
  font-weight: 800;
  font-size: var(--fs-sm);
}
.chat-inbox-meta { display: flex; align-items: center; gap: var(--s-2); flex: none; }
.chat-report-item { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4) 0; border-top: 1px solid var(--c-border); }
.chat-reports > li:first-child { border-top: 0; padding-top: 0; }
.chat-report-quote { margin: 0; padding: var(--s-2) var(--s-3); border-left: 3px solid var(--c-border-strong); background: var(--c-bg); border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* ---------- Per-team submission reopen ---------- */
.submission-reopen {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  margin: calc(-1 * var(--s-2)) 0 var(--s-4);
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-md);
}
.submission-reopen .cluster { align-items: center; }
.submission-reopen-select { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: var(--fs-sm); }

/* ---------- Launch QA (agent: launch) ---------- */
/* Skip link: hidden until focused with the keyboard */
.skip-link:focus,
.skip-link:focus-visible {
  position: fixed;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 100;
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--s-2) var(--s-4);
  clip: auto;
  overflow: visible;
  white-space: normal;
  background: var(--c-surface);
  color: var(--c-primary);
  font-weight: 600;
  border-radius: var(--r-md);
  box-shadow: var(--ring), var(--shadow-md);
}

/* Small text on tinted backgrounds: darker orange / green so it passes WCAG AA (4.5:1) */
.banner,
.badge-warning {
  color: #c2410c;
}
.badge-success {
  color: #15803d;
}
.feed-time {
  color: var(--c-muted);
}

/* Auth pages: help line under the card, tips list on "not on the ticket list" */
.auth-column {
  width: 100%;
  max-width: 440px;
}
.auth-help {
  margin: var(--s-4) 0 0;
}
.auth-tips {
  margin: 0;
  padding-left: 1.25rem;
  font-size: var(--fs-sm);
  color: var(--c-text-2);
}
.auth-tips li + li {
  margin-top: var(--s-2);
}

/* Error pages (404 / 403; 500, 400 and CSRF are self-contained in templates/errors/standalone.html) */
.error-card {
  max-width: 560px;
  margin: var(--s-7) auto;
  text-align: center;
}
.error-card .badge {
  margin: 0 auto var(--s-3);
}
.error-actions {
  justify-content: center;
  margin: var(--s-5) 0 var(--s-4);
}

/* Event page CTA: a POST button (sign out / switch email) sits in the row like the links */
.cta-actions > form {
  display: flex;
  margin: 0;
}
.cta-actions > form > .btn {
  flex: 1;
}

/* Tables that turn into stacked cards on phones (Your tickets). Cells carry data-label. */
@media (max-width: 599.98px) {
  .table-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .table-stack,
  .table-stack tbody,
  .table-stack tr,
  .table-stack td {
    display: block;
    width: 100%;
  }
  .table-stack tr {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--c-border);
  }
  .table-stack tr:last-child {
    border-bottom: 0;
  }
  .table-stack td {
    padding: var(--s-1) 0;
    border: 0;
    text-align: left;
  }
  .table-stack td.num {
    text-align: left;
  }
  .table-stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .table-stack td:empty {
    display: none;
  }
  .table-stack-actions {
    padding-top: var(--s-2);
  }
}


/* ---------- Direct uploads (agent: uploads) ---------- */
.upload-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.upload-status[hidden] { display: none; }
.upload-progress { flex: 1 1 100%; height: 6px; border-radius: var(--r-pill); background: var(--c-surface-2); overflow: hidden; }
.upload-progress > span { display: block; width: 0; height: 100%; background: var(--c-primary); border-radius: inherit; transition: width 0.2s ease; }
.upload-message { flex: 1 1 auto; margin: 0; color: var(--c-muted); }
.upload-status.is-error .upload-progress > span { background: var(--c-danger); }
.upload-status.is-error .upload-message { color: var(--c-danger); }
.team-upload.is-busy button[type="submit"] { opacity: 0.6; pointer-events: none; }

/* ---------- Tracks & prizes: public (agent: prizes-pub) ---------- */
.pz-tracks, .pz-prizes, .pz-winners, .pz-won, .sp-logos, .jd-sponsor-wall { list-style: none; margin: 0; padding: 0; }
.pz-tracks { display: flex; flex-direction: column; gap: var(--s-3); }
.pz-track { display: flex; flex-direction: column; gap: var(--s-1); }
.pz-prizes { display: flex; flex-direction: column; gap: var(--s-2); }
.pz-prize {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.pz-prize-won { border-color: #f5c451; background: #fffbeb; }
.pz-prize-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pz-prize-name { margin: 0; font-weight: 700; }
.pz-prize-value { flex: none; max-width: 45%; white-space: normal; text-align: right; }
.pz-winner { display: flex; align-items: center; gap: var(--s-1); margin-top: var(--s-1); font-size: var(--fs-sm); font-weight: 600; }
.pz-winner .icon, .pz-won-item > .icon { color: #d97706; flex: none; }
.pz-winners { display: flex; flex-direction: column; gap: var(--s-2); }
.pz-winners-item { display: flex; align-items: center; gap: var(--s-3); }
.pz-winners-text { min-width: 0; }
.pz-won { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-3); }
.pz-won-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  background: #fffbeb;
  font-size: var(--fs-sm);
}
.pz-won-item > .icon { margin-top: 3px; }
.pz-track-tag { margin-top: var(--s-1); }

/* Sponsors: a logo grid per tier, headline tiles larger */
.sp-logos { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-4); }
.sp-item { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); width: 140px; }
.sp-item.sp-tier-headline { width: 220px; }
.sp-item.sp-tier-gold { width: 170px; }
.sp-tier-label { font-size: var(--fs-xs); color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sp-logo {
  display: grid;
  place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr); /* a fixed cell, so the logo's height: 100% can't grow the box */
  width: 100%;
  height: 72px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  text-align: center;
  text-decoration: none;
}
a.sp-logo:hover { border-color: var(--c-border-strong); box-shadow: var(--shadow-sm); }
.sp-tier-headline .sp-logo { height: 112px; padding: var(--s-3) var(--s-4); }
.sp-tier-gold .sp-logo { height: 88px; }
.sp-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sp-logo-name { font-weight: 700; font-size: var(--fs-sm); line-height: 1.3; overflow-wrap: anywhere; }
.sp-tier-headline .sp-logo-name { font-size: var(--fs-lg); }

/* Projector: sponsor wall while nobody is presenting. Tier sizes step down like the event page sponsor list. */
.jd-stage-idle { width: 100%; max-width: 90vw; }
.jd-sponsors { margin-top: 7vh; }
.jd-sponsor-wall { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: calc(var(--screen-radius) * 1.25); }
.jd-sponsor {
  display: grid;
  place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  width: var(--screen-tile-w);
  height: var(--screen-tile-h);
  padding: 1.5vmin 2vmin;
  border-radius: var(--screen-radius);
  background: var(--c-surface);
  color: var(--c-brand-ink);
}
.jd-sponsor-headline { width: calc(var(--screen-tile-w) * 1.65); height: calc(var(--screen-tile-h) * 1.65); padding: 2.5vmin 3vmin; }
.jd-sponsor-gold { width: calc(var(--screen-tile-w) * 1.25); height: calc(var(--screen-tile-h) * 1.25); box-shadow: 0 0 0 0.5vmin var(--c-gold); }
.jd-sponsor-silver { width: var(--screen-tile-w); height: var(--screen-tile-h); }
.jd-sponsor-bronze { width: calc(var(--screen-tile-w) * 0.85); height: calc(var(--screen-tile-h) * 0.85); padding: 1.2vmin 1.6vmin; }
.jd-sponsor-community { width: calc(var(--screen-tile-w) * 0.7); height: calc(var(--screen-tile-h) * 0.7); padding: 1vmin 1.4vmin; }
.jd-sponsor img { display: block; width: 100%; height: 100%; object-fit: contain; }
.jd-sponsor-name { font-weight: 800; font-size: var(--screen-sponsor-name); line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.jd-sponsor-headline .jd-sponsor-name { font-size: var(--screen-sponsor-name-lg); }
.jd-sponsor-gold .jd-sponsor-name { font-size: var(--screen-sponsor-name-gold); }
.jd-sponsor-bronze .jd-sponsor-name, .jd-sponsor-community .jd-sponsor-name { font-size: var(--screen-sponsor-name-sm); }

/* ---------- Tracks & prizes: organizer (agent: prizes-org) ---------- */
.tag-track { --tag-bg: var(--c-warning-soft); --tag-fg: #9a3412; gap: 4px; }
.tag-track .icon { width: 1em; height: 1em; }
.idea-tags { display: inline-flex; flex-wrap: wrap; gap: var(--s-1); min-width: 0; }
.pz-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.pz-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.pz-item-text { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.pz-item-actions { display: flex; gap: 2px; }
.pz-item-actions form { margin: 0; }
.pz-item-actions .btn-icon { width: 36px; min-height: 36px; }
.pz-logo {
  flex: none;
  display: grid;
  place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  color: var(--c-muted);
  overflow: hidden;
}
.pz-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pz-winner-box { flex-basis: 100%; display: flex; flex-direction: column; gap: var(--s-1); }
.pz-winner-form { flex-wrap: wrap; }
.pz-winner-form .select { flex: 1 1 200px; min-width: 0; max-width: 360px; }
.pz-edit { flex-basis: 100%; }
.pz-edit > summary { list-style: none; width: fit-content; }
.pz-edit > summary::-webkit-details-marker { display: none; }
.pz-edit[open] > summary { margin-bottom: var(--s-2); }
.pz-add { padding-top: var(--s-2); border-top: 1px solid var(--c-border); }
.pz-new-company { margin: 0; padding: var(--s-3); border: 1px dashed var(--c-border); border-radius: var(--r-md); display: flex; flex-direction: column; gap: var(--s-3); }
.pz-new-company legend { padding: 0 var(--s-1); }
.pz-track-filter { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-bottom: var(--s-2); }
.pz-lb-track { margin-left: var(--s-1); vertical-align: middle; }

/* ---------- Single-column event pages (organizer settings) ---------- */
/* Organizer tool pages: one full-width column, the same width on every tool. */
@media (min-width: 900px) {
  .event-layout.event-layout-solo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .event-layout-solo .event-main { grid-column: 1; grid-row: auto; }
}
.crumbs-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.crumbs-back { flex: none; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.crumbs li { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; }
.crumbs li + li::before { content: "/"; color: var(--c-subtle); }
.crumbs a { color: var(--c-muted); }
.crumbs a:hover { color: var(--c-primary); }
.crumbs [aria-current="page"] { color: var(--c-text); font-weight: 600; }

/* ---------- Confirm dialog (static/js/techr.js askConfirm) ---------- */
.confirm-dialog { width: min(440px, calc(100vw - 2 * var(--s-4))); }
.confirm-body { display: flex; flex-direction: column; gap: var(--s-5); padding: var(--s-5); margin: 0; }
.confirm-message { margin: 0; font-size: var(--fs-md); line-height: 1.5; }
.confirm-actions { justify-content: flex-end; }

/* ---------- Files for all teams (team/_files.html, settings/_files.html) ---------- */
.file-group-title { margin: var(--s-4) 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--c-muted); }
.file-group-title + .file-list, .file-group-title + p { margin-top: var(--s-2); }

/* Profile photo card: big avatar beside the upload / remove controls. */
.profile-photo { display: flex; gap: var(--s-4); align-items: flex-start; }
.profile-photo > .stack { flex: 1; min-width: 0; }
.profile-photo input[type="file"] { max-width: 100%; font-size: var(--fs-sm); color: var(--c-muted); }
/* Native file inputs: the browse button looks like btn-secondary btn-sm. */
input[type="file"]::file-selector-button {
  min-height: 36px;
  margin-right: var(--s-3);
  padding: 0 var(--s-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--c-surface-2); }
@media (max-width: 560px) { .profile-photo { flex-direction: column; } }

/* Welcome / coming-soon page for people who signed up without a ticket. */
.welcome-page { max-width: 680px; }
.welcome-hero .hero-box { margin: 0; }
.check-row { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-sm); }
.check-row input { margin: 1px 0 0; flex: none; }

/* Cloudflare Turnstile widget on sign-up and password reset. */
.turnstile { min-height: 65px; }

/* Company pages (staff-only until release): logo tile, related-company cards, list rows. */
.avatar-square {
  border-radius: var(--r-md);
}
.avatar-square img {
  object-fit: contain;
  background: var(--c-surface);
}
.company-head {
  flex-wrap: nowrap;
  align-items: flex-start;
}
.company-head-body {
  min-width: 0;
}
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-3);
}
.company-mini,
.company-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  color: inherit;
  text-decoration: none;
}
.company-row {
  align-items: center;
  flex-wrap: wrap;
}
.company-mini:hover,
.company-row:hover {
  border-color: var(--c-border-strong);
  text-decoration: none;
}
.company-mini-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-1);
  flex: 1;
  min-width: 0;
}
.company-row-end {
  margin-left: auto;
}
.company-location {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}
.company-location-icon {
  color: var(--c-primary);
  flex: none;
}

/* Notifications bell panel (event header): items reuse the feed icon/title/body styles. */
.bell-panel {
  width: 340px;
  max-width: calc(100vw - 2 * var(--s-4));
}
.bell-title {
  margin: 0 0 var(--s-2);
  font-weight: 700;
}
.bell-feed {
  gap: var(--s-1);
}
.bell-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-sm);
  color: inherit;
  text-decoration: none;
}
a.bell-item:hover {
  background: var(--c-surface-2);
  text-decoration: none;
}
.bell-item-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.bell-dot {
  width: 8px;
  height: 8px;
  margin-top: var(--s-2);
  flex: none;
  border-radius: 50%;
  background: var(--c-danger);
}
.bell-empty {
  margin: 0;
  padding: var(--s-2) var(--s-3) var(--s-1);
  color: var(--c-muted);
  font-size: var(--fs-sm);
}
/* The app-wide bell (notifications app): time and "why" under each item, and the links under the list. */
.bell-meta {
  color: var(--c-subtle);
  font-size: var(--fs-xs);
}
.bell-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1);
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--c-border);
}
.bell-dot-inline {
  display: inline-block;
  margin: 0 var(--s-1) 0 0;
  vertical-align: middle;
}
.follow-form {
  display: inline-block;
  margin: 0;
}
@media (max-width: 640px) {
  /* Anchor the panel to the header instead of the bell so it fits between the page gutters. */
  .site-header-inner {
    position: relative;
  }
  .bell-menu {
    position: static;
  }
  .bell-panel {
    right: var(--s-4);
    left: var(--s-4);
    width: auto;
    max-width: none;
  }
}

/* Directory map */
.dir-map {
  position: absolute;
  inset: 0;
}
/* More specific than MapLibre's .maplibregl-map { position: relative }, which loads after this file. */
.dir-map > .dir-map-canvas {
  position: absolute;
  inset: 0;
}
.dir-chips {
  position: absolute;
  z-index: 5;
  top: var(--s-4);
  left: var(--s-4);
  right: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  pointer-events: none;
}
.dir-chips > * {
  pointer-events: auto;
}
.dir-chip-row {
  display: flex;
  gap: var(--s-2);
  min-width: 0;
  padding: var(--s-1) 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.dir-chip-row::-webkit-scrollbar {
  display: none;
}
.dir-chip-row .chip,
.dir-chips .chip {
  flex: none;
  min-height: 32px;
  padding: 0 var(--s-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  border-color: transparent;
}
/* White chips with the words in the type or category colour. The map's chip rows scroll sideways, which clips
   anything outside them, so their shadow is a tight one that fits in the row's few pixels of padding. */
.dir-chip-row .chip,
.dir-chips .chip {
  --chip-bg: var(--c-surface);
  --chip-bd: transparent;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}
/* Every filter pill on the directory pages (companies, events, jobs: map and grid) stays white when selected,
   with the words and a 2px ring in its colour (Techr blue for pills without a category colour): the border
   itself plus 1px inside it, so the ring is flush with the pill's edge. The hackathon pages keep the filled
   style. */
:is(.dir-chip-row, .dir-chips, .co-chips, .ev-chips, .sm-chips, .sm-format) .chip:is(.is-active, [aria-pressed="true"]) {
  --chip-bg: var(--c-surface);
  --chip-fg: var(--cat, var(--c-primary));
  --chip-bd: var(--cat, var(--c-primary));
  border-color: var(--cat, var(--c-primary));
  box-shadow: inset 0 0 0 1px var(--cat, var(--c-primary));
}
:is(.dir-chip-row, .dir-chips) .chip:is(.is-active, [aria-pressed="true"]) {
  box-shadow: inset 0 0 0 1px var(--cat, var(--c-primary)), 0 1px 2px rgb(0 0 0 / 0.12);
}
.dir-arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.dir-arrow:hover {
  background: var(--c-primary-hover);
}
.dir-arrow .icon {
  width: 16px;
  height: 16px;
}
.dir-map .maplibregl-ctrl-top-left {
  top: 56px;
}
.dir-maptiler-logo {
  display: block;
  margin: 0 0 0 10px;
  line-height: 0;
}
.dir-notice {
  position: absolute;
  z-index: 6;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-sm);
  color: var(--c-danger);
}
.dir-notice[hidden] {
  display: none;
}
/* Docked panel: one white card floating over the map on the right; everything inside scrolls with it. On phones the
   same element is a bottom sheet (peek / half / full, set by data-snap on .dir-map and dragged in directory-map.js). */
.dir-map {
  --sheet-bar-h: 0px;
}
.dir-panel {
  position: absolute;
  z-index: 6;
  top: var(--s-4);
  right: var(--s-4);
  bottom: var(--s-4);
  width: 450px;
  max-width: calc(100% - 2 * var(--s-4));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--r-xl);
  background: var(--c-surface);
  box-shadow: 5px 5px 15px rgb(0 0 0 / 0.1);
}
.dir-panel-content {
  position: relative;
}
.dir-panel-error {
  margin: 0;
  padding: var(--s-5);
  color: var(--c-muted);
}
.dir-sheet-bar,
.dir-safe-probe {
  display: none;
}
.dir-hover-popup .maplibregl-popup-content {
  width: 300px;
  padding: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
@media (max-width: 767px) {
  .dir-map {
    --sheet-h: calc(100dvh - var(--header-h) - var(--s-2));
    --sheet-peek: 88px;
    --sheet-bar-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
  }
  .dir-chips {
    right: var(--s-2);
    left: var(--s-2);
  }
  .dir-arrow {
    display: none;
  }
  /* The sheet is as tall as it gets (full) and slid down with a transform, so dragging never reflows anything. */
  .dir-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-width: none;
    height: var(--sheet-h);
    overflow-y: hidden;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: 0 -6px 20px rgb(0 0 0 / 0.14);
    transform: translate3d(0, calc(100% - var(--sheet-peek) - var(--safe-b)), 0);
    transition: transform 0.25s ease;
    will-change: transform;
  }
  .dir-map[data-snap="half"] .dir-panel {
    transform: translate3d(0, 50%, 0);
    overflow-y: auto;
  }
  .dir-map[data-snap="full"] .dir-panel {
    transform: translate3d(0, 0, 0);
    overflow-y: auto;
  }
  .dir-panel.is-dragging {
    transition: none;
    overflow-y: hidden;
  }
  /* At half the lower part of the sheet is off screen: pad the content so its end can still be scrolled to. */
  .dir-map[data-snap="half"] .dir-panel-content {
    padding-bottom: calc(var(--sheet-h) / 2);
  }
  .dir-map[data-snap="full"] .dir-panel-content {
    padding-bottom: var(--safe-b);
  }
  .dir-sheet-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: var(--sheet-bar-h);
    background: var(--c-surface);
    touch-action: none;
    user-select: none;
  }
  .dir-sheet-handle {
    display: grid;
    place-items: center;
    width: 100%;
    height: 28px;
    padding: 0;
    border: 0;
    background: none;
    cursor: grab;
    touch-action: none;
  }
  .dir-sheet-grip {
    width: 40px;
    height: 4px;
    border-radius: var(--r-pill);
    background: var(--c-border-strong);
  }
  .dir-sheet-title {
    width: 100%;
    padding: 0 var(--s-5);
    overflow: hidden;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* The bar's title is for the peek state; once open, the panel's own heading takes over. */
  .dir-map[data-snap="half"] .dir-sheet-title,
  .dir-map[data-snap="full"] .dir-sheet-title {
    display: none;
  }
  .dir-map[data-snap="half"],
  .dir-map[data-snap="full"] {
    --sheet-bar-h: 28px; /* just the grip; sticky panel heads sit right under it */
  }
  .dir-safe-probe {
    display: block;
    position: absolute;
    width: 0;
    height: env(safe-area-inset-bottom, 0px);
    visibility: hidden;
    pointer-events: none;
  }
  /* MapTiler's logo and the attribution stay above the sheet while it is a peek or half. */
  .dir-map .maplibregl-ctrl-bottom-left {
    bottom: calc(var(--sheet-peek) + var(--safe-b));
    transition: bottom 0.25s ease;
  }
  .dir-map[data-snap="half"] .maplibregl-ctrl-bottom-left {
    bottom: calc(var(--sheet-h) / 2);
  }
  .dir-map[data-snap="full"] .maplibregl-ctrl-bottom-left {
    display: none;
  }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .dir-panel,
  .dir-map .maplibregl-ctrl-bottom-left {
    transition: none;
  }
}
@media (min-width: 768px) {
  .dir-chips {
    right: calc(450px + 2 * var(--s-4) + var(--s-2));
  }
}

/* ---------- Directory panel: company panel, hover card, building card, ecosystem card, list view ---------- */
/* The type colour arrives as --cat (inline, from CompanyType.colour). The docked panel is the surface: the .co-panel
   fragments inside it draw no card of their own. The hover card is the only one with its own surface. */
.co-panel,
.co-card {
  --cat: var(--c-primary);
  color: var(--c-text);
}
.co-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
[x-cloak] { display: none !important; }
.co-banner {
  --cat: var(--c-primary);
  position: relative;
  height: 76px;
  /* Companies have no cover image: a pattern tinted by the type colour. */
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--cat) 55%, #fff) 0, transparent 42%),
    radial-gradient(circle at 12% 110%, color-mix(in srgb, var(--cat) 40%, #fff) 0, transparent 38%),
    repeating-linear-gradient(135deg, rgb(255 255 255 / 0.1) 0 3px, transparent 3px 22px),
    color-mix(in srgb, var(--cat) 55%, #0a1a2b);
}
.co-banner-sm { height: 52px; }
/* An uploaded banner covers the strip (the pattern stays underneath while it loads). */
.co-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
/* The preview on the edit page: the uploaded 3:1 image at a readable size. */
.co-banner-edit { height: auto; aspect-ratio: 3 / 1; max-width: 30rem; border-radius: var(--r-lg); overflow: hidden; }
/* Pinned at the top right of the panel while its content scrolls (zero height, so the banner starts at the top). */
.co-close-bar {
  position: sticky;
  top: var(--sheet-bar-h);
  z-index: 4;
  height: 0;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.co-close-bar .co-close { position: relative; top: var(--s-3); right: var(--s-3); pointer-events: auto; }
.co-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.co-close:hover { background: var(--c-surface-2); }
.co-close-plain { margin-left: auto; box-shadow: none; background: var(--c-surface-2); }
.co-panel-body,
.co-card-body { padding: 0 var(--s-5) var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); }
.co-logo-wrap { margin-top: -24px; position: relative; align-self: flex-start; }
.co-logo-wrap .avatar { border: 3px solid var(--c-surface); background-color: var(--c-surface); box-shadow: var(--shadow-sm); }
.co-name { margin: var(--s-1) 0 0; font-size: 1.375rem; line-height: 1.2; font-weight: 700; }
.co-type { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--c-text-2); font-size: var(--fs-sm); }
.co-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat); flex: none; }

.co-tabs {
  display: flex;
  gap: var(--s-4);
  margin-top: var(--s-2);
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.co-tab {
  padding: var(--s-2) 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.co-tab.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }
.co-soon-note { margin: 0; font-size: var(--fs-xs); color: var(--c-muted); }
.co-card .co-soon-note { margin-top: var(--s-2); }
.co-section { padding-top: var(--s-2); }
.co-details { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.co-details li { display: flex; gap: var(--s-3); align-items: flex-start; font-size: var(--fs-sm); color: var(--c-text-2); }
.co-details .icon { flex: none; width: 16px; height: 16px; color: var(--c-muted); margin-top: 2px; }
.co-related { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); align-items: baseline; }
.co-industries { gap: var(--s-1); }
.co-industries .tag { padding: 3px 8px; }
.co-social { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.co-icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-text-2);
}
.co-icon-btn:hover { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary); text-decoration: none; }
.co-icon-btn .icon { width: 16px; height: 16px; }
.co-heading { margin: 0; font-size: 1rem; font-weight: 700; }
.co-rows { display: flex; flex-direction: column; gap: var(--s-2); }
.co-row,
.co-list-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  color: inherit;
  text-decoration: none;
}
.co-row:hover,
.co-list-row:hover { border-color: var(--c-border-strong); background: var(--c-surface-2); text-decoration: none; }
.co-row-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1; min-width: 0; }
.co-row-name { overflow-wrap: anywhere; }

/* The building card's head stays pinned while the list scrolls under it. */
.co-site-head {
  position: sticky;
  top: var(--sheet-bar-h);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5) var(--s-3);
  background: var(--c-surface);
}
.co-site-head .co-name { margin: 0; font-size: 1.25rem; }
.co-site-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--c-primary-soft); color: var(--c-primary); flex: none; }
.co-site-title { min-width: 0; }
.co-site .co-panel-body { gap: var(--s-3); }

.co-card { width: 300px; max-width: calc(100vw - 2 * var(--s-4)); box-shadow: var(--shadow-lg); }
.co-card .co-logo-wrap { margin-top: -20px; }
.co-card-body { padding: 0 var(--s-4) var(--s-4); gap: var(--s-1); }
.co-card-name { margin: var(--s-1) 0 0; font-size: 1.125rem; font-weight: 700; line-height: 1.2; }
.co-card-text { margin: var(--s-1) 0 0; font-size: var(--fs-sm); color: var(--c-text-2); }

/* Ecosystem card: title, blurb, type tiles, then the companies in view, all in the one panel. */
.co-ecosystem .co-panel-body { padding-top: var(--s-5); gap: var(--s-3); }
.co-eco-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.co-eco-head .co-name { margin: 0; font-size: 1.25rem; }
.co-eco-blurb { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); }
.co-eco-head[hidden], .co-eco-blurb[hidden], .co-eco-bar[hidden], .co-tiles[hidden] { display: none; }
.co-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.co-tile { display: block; min-width: 0; padding: var(--s-2) var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); color: inherit; text-decoration: none; }
.co-tile:hover { border-color: var(--cat); text-decoration: none; }
.co-tile[aria-pressed="true"] { border-color: var(--cat); box-shadow: inset 0 0 0 1px var(--cat); background: color-mix(in srgb, var(--cat) 6%, var(--c-surface)); }
.co-tile-name, .co-tile-count { display: block; }
.co-tile-name { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); font-size: var(--fs-xs); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.co-tile-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--c-surface-2); color: var(--cat); flex: none; }
.co-tile-icon .icon { width: 14px; height: 14px; }
.co-tile-count { margin-top: var(--s-1); font-size: 1.125rem; font-weight: 700; line-height: 1.2; }

/* Filtered mode: a compact bar ("Accelerators - 1 company", Clear, All types) with the results right under it. */
.co-eco-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.co-eco-bar-title { margin: 0; min-width: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
.co-eco-bar-actions { display: flex; gap: var(--s-2); flex: none; }
.co-eco-list { display: flex; flex-direction: column; gap: var(--s-3); }
.co-eco-list:empty { display: none; }
.co-eco-section { display: flex; flex-direction: column; gap: var(--s-2); }
.co-eco-section-title { margin: 0; font-size: var(--fs-sm); font-weight: 700; }
.co-eco-cards { display: flex; flex-direction: column; gap: var(--s-2); }
.co-eco-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); padding: var(--s-3) 0; }
.co-eco-empty p { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); }

.co-list { max-width: 900px; width: 100%; margin: 0 auto; }
.co-chips { display: flex; gap: var(--s-2); overflow-x: auto; padding: var(--s-1) 0 var(--s-2); scrollbar-width: thin; }
.co-chips .chip { flex: none; }
/* Industry and size filters: a disclosure above the rows on the list, the same checkbox chips on the map card. */
.co-filters > summary { display: inline-flex; list-style: none; cursor: pointer; }
.co-filters > summary::-webkit-details-marker { display: none; }
.co-filters-form { margin-top: var(--s-3); padding: var(--s-4); border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); }
.co-filters .check-chip { padding: var(--s-1) var(--s-3); font-size: var(--fs-xs); font-weight: 600; }
.co-filters legend { margin-bottom: var(--s-2); }
.co-filters [data-eco-clear][hidden] { display: none; }
.co-list-rows { display: flex; flex-direction: column; gap: var(--s-3); }
.co-list-row { align-items: flex-start; }
/* Compact variant for the viewport list when nothing is filtered: no description line. */
.co-list-row-sm { align-items: center; padding: var(--s-2) var(--s-3); gap: var(--s-2); }
.co-clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* Claiming, team and edit pages (Sprint 7): a single readable column of cards. */
.co-manage { max-width: 760px; }
.co-actions { margin-top: var(--s-2); }
.co-record {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-sm);
  overflow-x: auto;
  user-select: all;
}
.co-location { padding-top: var(--s-4); border-top: 1px solid var(--c-border); }

/* Events directory (Sprint 8, design MAIN-EVENTS): listing grid, cards, event page, company events. */
.ev-list { max-width: 1160px; width: 100%; margin: 0 auto; }
.ev-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.ev-head h1 { font-size: 1.75rem; font-weight: 800; }
.ev-chips { display: flex; gap: var(--s-2); overflow-x: auto; padding: var(--s-1) 0; scrollbar-width: none; }
.ev-chips .chip { flex: none; }
.ev-search { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.ev-search-field { flex: 1 1 240px; max-width: 420px; }
.ev-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 640px) { .ev-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .ev-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .ev-grid { grid-template-columns: repeat(4, 1fr); } }
.ev-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}
.ev-card:hover { border-color: var(--c-border-strong); box-shadow: var(--shadow-md); }
.ev-card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.ev-card-link:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.ev-cover {
  --cat: var(--c-primary);
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--cat) 14%, var(--c-surface));
}
.ev-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
/* A cover built in the template for an event without a picture (events slice 5c): the category colour, a soft
   dot pattern, the organizer's logo or initials and the format. Everything mixes with the surface token, so
   it follows light and dark. */
.ev-cover-wide { aspect-ratio: 1200 / 630; }
.ev-gen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  border-radius: inherit;
  overflow: hidden;
  background-color: color-mix(in srgb, var(--cat) 16%, var(--c-surface));
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--cat) 30%, transparent) 1.5px, transparent 0),
    linear-gradient(135deg, color-mix(in srgb, var(--cat) 14%, transparent), transparent 60%);
  background-size: 16px 16px, 100% 100%;
}
.ev-gen-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ev-gen-mark img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.ev-gen-format {
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--cat);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.sm-format { grid-template-columns: 1fr auto; align-items: center; }
.sm-format .chip { min-height: 32px; padding: 0 var(--s-3); font-size: var(--fs-xs); font-weight: 600; }
.ev-badge { position: absolute; left: var(--s-2); bottom: calc(-1 * var(--s-4)); }
.ev-badge .avatar { border: 2px solid var(--c-surface); box-shadow: var(--shadow-sm); background-color: var(--c-surface); }
.ev-tag {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--cat);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.ev-tag-static { position: static; background: color-mix(in srgb, var(--cat) 12%, var(--c-surface)); }
.ev-body { display: flex; flex-direction: column; gap: var(--s-2); flex: 1; padding-top: var(--s-2); }
.ev-org { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-2); }
.ev-title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.25; }
.ev-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.ev-facts li { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-sm); color: var(--c-text-2); }
.ev-facts .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--c-muted); }
.ev-facts-lg { gap: var(--s-2); }
.ev-facts-lg li { font-size: var(--fs-md); }
.ev-summary { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--c-border); }
.ev-price { font-weight: 700; }
.ev-more { color: var(--c-primary); font-size: var(--fs-sm); font-weight: 600; }
.ev-page { max-width: 760px; width: 100%; margin: 0 auto; }
.ev-detail-cover { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--r-lg); }

/* The event window over the map, list and calendar (decision #90; static/js/event-modal.js). The content is the
   page's own (.ev-detail) without its card frame; the bar sticks to the top while the content scrolls. */
.modal-event { width: min(760px, calc(100vw - 2 * var(--s-4))); max-height: calc(100dvh - 2 * var(--s-4)); overflow-y: auto; overscroll-behavior: contain; }
.modal-event[open] { animation: ev-modal-in 160ms ease-out; }
@keyframes ev-modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal-event[open] { animation: none; } }
.ev-modal-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); padding: var(--s-2) var(--s-3); background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.ev-modal-body { padding: var(--s-4); }
.ev-modal-body .ev-detail { border: 0; box-shadow: none; padding: 0; background: none; }
#ev-title:focus { outline: none; }
.ev-modal-note { color: var(--c-muted); }
/* On the map pages (wider than a phone) the window is a panel over the map area instead: the same 16px insets and
   look as the column, which stays beside it. event-modal.js sets --ev-dock-right to clear the column. */
.modal-event.is-docked {
  position: absolute;
  z-index: 8;
  inset: var(--s-4) var(--ev-dock-right, var(--s-4)) var(--s-4) var(--s-4);
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: 5px 5px 15px rgb(0 0 0 / 0.1);
}
.ev-share-status { margin-right: auto; font-size: var(--fs-sm); color: var(--c-muted); opacity: 0; transition: opacity 200ms; }
.ev-share-status.is-shown { opacity: 1; }
.ev-share-link { flex: 1 1 12rem; min-width: 0; font-size: var(--fs-sm); padding: 4px 8px; border: 1px solid var(--c-border); border-radius: var(--r-sm); background: var(--c-surface); color: var(--c-text); }
@media (prefers-reduced-motion: reduce) { .ev-share-status { transition: none; } }
/* Served open at an event's address and not yet adopted by the script (no JavaScript, or before it runs): a phone gets
   the full-screen sheet in flow-free form, a wider screen the docked panel above. */
/* ...and without JavaScript the panel starts clear of the column (450px wide, 16px insets). */
.modal-event.is-preopen.is-docked { --ev-dock-right: calc(450px + 2 * var(--s-4)); }
@media (max-width: 767px) {
  .modal-event.is-preopen { position: fixed; z-index: 60; inset: 0; width: auto; max-width: none; height: auto; max-height: none; margin: 0; border: 0; border-radius: 0; }
}
/* A shorter cover in the window (the page keeps the wide one); the generated cover keeps its logo centred. */
.modal-event .ev-detail-cover,
.modal-event .ev-cover-wide {
  aspect-ratio: auto;
  height: 220px;
  object-fit: cover;
}
/* Phones: a full-screen sheet. */
@media (max-width: 767px) {
  .modal-event { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
}
.ev-map { width: 100%; max-width: 480px; height: auto; border-radius: var(--r-lg); border: 1px solid var(--c-border); }
.co-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.co-event { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); color: inherit; text-decoration: none; }
.co-event:hover { border-color: var(--c-border-strong); text-decoration: none; }
.co-event-when { font-size: var(--fs-xs); color: var(--c-muted); }
.co-event-title { font-weight: 600; }
.ev-manage-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--c-border); }
.ev-manage-row:first-of-type { border-top: 0; }

/* Profiles (Sprint 9) */
.pp-page { max-width: 760px; width: 100%; margin: 0 auto; }
.pp-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.pp-who { flex: 1; min-width: 0; }
.pp-who h1 { font-size: 1.5rem; font-weight: 800; overflow-wrap: anywhere; }
.pp-headline { color: var(--c-text-2); }
.pp-heading { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--c-muted); text-transform: none; }
.pp-companies { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.co-person { flex-direction: row; align-items: center; gap: var(--s-3); }
.co-person > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Job board and job page (Sprint 9, design MAIN-JOBS) */
.jb-list { max-width: 1160px; width: 100%; margin: 0 auto; }
.jb-filters { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.jb-filters .field { margin: 0; }
.jb-search { flex: 1 1 240px; max-width: 420px; }
.jb-grid { grid-template-columns: 1fr; }
@media (min-width: 900px) { .jb-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .jb-grid { grid-template-columns: repeat(3, 1fr); } }
.jb-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}
.jb-card:hover { border-color: var(--c-border-strong); box-shadow: var(--shadow-md); }
.jb-company { display: flex; align-items: center; gap: var(--s-3); padding-bottom: var(--s-3); border-bottom: 1px solid var(--c-border); }
.jb-company-text { display: flex; flex-direction: column; min-width: 0; }
.jb-company-name { font-weight: 700; color: var(--c-text); overflow-wrap: anywhere; }
.jb-address { font-size: var(--fs-xs); color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-main { display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.jb-title { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
.jb-title a { color: var(--c-text); }
.jb-tags { gap: var(--s-2); }
.jb-tag { padding: 2px 12px; border-radius: var(--r-pill); background: var(--c-surface-2); color: var(--c-muted); font-size: var(--fs-sm); }
.jb-facts .icon { color: var(--c-primary); }
.jb-excerpt { margin: 0; padding-top: var(--s-3); border-top: 1px solid var(--c-border); color: var(--c-text-2); font-size: var(--fs-sm); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.jb-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.jb-actions .btn { flex: 1 1 120px; justify-content: center; }
.jb-salary { font-size: 1.75rem; font-weight: 800; color: var(--c-text); }

/* ---------- Events and jobs maps (Sprint 9b): the column beside the map (design MAIN-EVENTS right column) ---------- */
/* Same panel and bottom sheet as the company map (.dir-panel); the column inside is a title, the filters and
   compact cards. The category colour arrives as --cat (inline, from the item's category). */
.sm-col { display: flex; flex-direction: column; background: var(--c-surface); color: var(--c-text-2); }
.sm-head {
  position: sticky;
  top: var(--sheet-bar-h);
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-2);
  background: var(--c-surface);
}
.sm-title { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--c-text); }
.sm-count { font-size: var(--fs-sm); color: var(--c-muted); }
.sm-controls { display: flex; flex-direction: column; gap: var(--s-3); padding: 0 var(--s-5) var(--s-3); }
.sm-suggest { padding: 0 var(--s-5) var(--s-3); }
.sm-search { margin: 0; }
.sm-search-field {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  color: var(--c-muted);
}
.sm-search-field:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.sm-search-field .icon { flex: none; width: 18px; height: 18px; }
.sm-search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-sm);
}
.sm-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.sm-chips[hidden] { display: none; }
.sm-chips .chip { min-height: 32px; padding: 0 var(--s-3); font-size: var(--fs-xs); font-weight: 600; }
.sm-selects { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }
.sm-selects .field { margin: 0; }
.sm-selects .field select { min-height: 38px; padding: 6px var(--s-3); font-size: var(--fs-sm); }
.sm-list { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-2) var(--s-5) var(--s-5); }
.sm-list:empty { display: none; }
.sm-section { display: flex; flex-direction: column; gap: var(--s-2); }
.sm-section-title { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); }
.sm-cards { display: flex; flex-direction: column; gap: var(--s-3); }
.sm-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); padding: var(--s-3) 0; }
.sm-empty p { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); }
.sm-card {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  cursor: default;
}
.sm-card[data-place] { cursor: pointer; }
.sm-card:hover { border-color: var(--c-border-strong); }
.sm-card.is-current { border-color: var(--cat); box-shadow: inset 0 0 0 2px var(--cat), var(--shadow-sm); background: color-mix(in srgb, var(--cat) 8%, var(--c-surface)); }
.ev-card.is-current { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.cal-row.is-current, .cal-item.is-current, .cal-bar.is-current { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.co-event.is-current { background: var(--c-primary-soft); border-radius: var(--r-md); }
.sm-card.is-selected { border-color: var(--cat); box-shadow: inset 0 0 0 1px var(--cat), var(--shadow-sm); background: color-mix(in srgb, var(--cat) 5%, var(--c-surface)); }
.sm-thumb {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  align-self: flex-start;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--cat) 14%, var(--c-surface));
}
.sm-thumb > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sm-thumb-logo { background: var(--c-surface-2); }
.sm-card-body { display: flex; flex-direction: column; gap: var(--s-1); flex: 1; min-width: 0; }
.sm-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); }
.sm-card-title { margin: 0; min-width: 0; font-size: 0.9375rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.sm-card-title a { color: var(--c-text); }
.sm-tag {
  flex: none;
  padding: 1px 8px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--cat) 12%, var(--c-surface));
  color: var(--cat);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.sm-sub { margin: 0; font-size: var(--fs-xs); color: var(--c-muted); overflow-wrap: anywhere; }
.sm-facts { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.sm-fact { padding: 1px 8px; border-radius: var(--r-sm); background: var(--c-surface-2); font-size: var(--fs-xs); color: var(--c-text-2); }
.sm-card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-top: var(--s-1); }
.sm-price { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); }
.sm-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  color: #fff;
}
.sm-go:hover { background: var(--c-primary-hover); color: #fff; text-decoration: none; }
.sm-go .icon { width: 14px; height: 14px; }
@media (max-width: 767px) {
  /* The sheet's bar already shows the title while it is a peek. */
  .dir-map[data-snap="peek"] .sm-col { visibility: hidden; }
  .sm-head { padding: var(--s-3) var(--s-4) var(--s-2); }
  .sm-controls { padding: 0 var(--s-4) var(--s-3); }
  .sm-list { padding: var(--s-2) var(--s-4) var(--s-5); }
}

/* Section switch on the map page (Sprint 9c, directory-map-hub.js): the outgoing column and chip row fade out, the
   incoming ones fade in with a small upward slide. Pins fade through MapLibre paint opacity. */
.dir-leave {
  opacity: 0;
  transition: opacity 0.12s ease-out;
}
.dir-enter {
  animation: dir-enter 0.18s ease-out both;
}
@keyframes dir-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dir-leave {
    opacity: 1;
    transition: none;
  }
  .dir-enter {
    animation: none;
  }
}

/* TEMPORARY compare panel (directory-map-compare.js): staff only. Temporary staff-only preview: remove once the map look is chosen. Remove it with the script.
   A small floating panel over the map to try look options live. */
.dir-compare {
  position: absolute;
  z-index: 7;
  left: var(--s-4);
  bottom: 56px;
  width: 320px;
  max-width: calc(100% - 2 * var(--s-4));
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-xs);
}
.dir-compare-title {
  padding: var(--s-2) var(--s-3);
  font-weight: 700;
  cursor: pointer;
}
.dir-compare-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-height: 62vh;
  overflow-y: auto;
  padding: 0 var(--s-3) var(--s-3);
}
.dir-compare-group { display: flex; flex-direction: column; gap: 2px; }
.dir-compare-label { font-weight: 600; color: var(--c-muted); }
.dir-compare-row { display: flex; flex-wrap: wrap; gap: 4px; }
.dir-compare-btn,
.dir-compare-copy {
  padding: 3px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  cursor: pointer;
}
.dir-compare-btn[aria-pressed="true"] { border-color: var(--c-primary); background: var(--c-primary); color: #fff; }
.dir-compare-note { margin: 0; color: var(--c-muted); }
.dir-compare-out { width: 100%; font: inherit; font-size: 11px; }
.dir-compare-out[hidden] { display: none; }
@media (max-width: 767px) {
  .dir-compare { bottom: 110px; }
}
.dir-compare-section { border-top: 1px solid var(--c-border); padding: 4px 0; }
.dir-compare-section-title { font-weight: 700; cursor: pointer; padding: 2px 0; }
.dir-compare-field { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 0; }
.dir-compare-field .dir-compare-label { flex: 1; min-width: 0; }
.dir-compare-input { width: 120px; font: inherit; font-size: 11px; padding: 2px 4px; border: 1px solid var(--c-border); border-radius: 4px; background: var(--c-surface); color: var(--c-text); }
.dir-compare-slider { display: inline-flex; align-items: center; gap: 4px; }
.dir-compare-range { width: 110px; }
.dir-compare-value { min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.dir-compare-nested { margin: 2px 0 2px 8px; }
.dir-compare-colour { width: 36px; height: 22px; padding: 0; border: 1px solid var(--c-border); border-radius: 4px; background: none; cursor: pointer; }

/* ---------- Switch (a checkbox with role="switch") ---------- */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch-track {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--c-border-strong);
  transition: background 0.15s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
  transition: transform 0.15s;
}
.switch input:checked + .switch-track {
  background: var(--c-primary);
}
.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}
.switch input:focus-visible + .switch-track {
  box-shadow: var(--ring);
}
@media (prefers-reduced-motion: reduce) {
  .switch-track,
  .switch-track::after {
    transition: none;
  }
}

/* ---------- Notification settings: a section per group, a row per kind ---------- */
.ns-page {
  max-width: 820px;
}
.ns-group {
  padding: 0;
  overflow: hidden;
}
.ns-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--s-5) var(--s-5) var(--s-3);
}
.ns-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-weight: 600;
}
.ns-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ns-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 176px;
  align-items: center;
  gap: var(--s-4);
  padding: 14px var(--s-5);
}
.ns-list .ns-row {
  border-top: 1px solid var(--c-border);
}
.ns-colhead {
  padding-top: 0;
  padding-bottom: 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.ns-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ns-label {
  font-weight: 600;
  color: var(--c-text);
}
.ns-desc {
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
.ns-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ns-cap {
  display: none;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.ns-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-success);
}
.ns-status-muted {
  font-weight: 500;
  color: var(--c-subtle);
}
.ns-email .ns-select {
  min-height: 40px;
  padding: 8px 36px 8px 12px;
  font-size: 14px;
  background-position: right 10px center;
}
.ns-actions {
  justify-content: flex-start;
}
@media (max-width: 639px) {
  .ns-colhead {
    display: none;
  }
  .ns-row {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 10px;
  }
  .ns-text {
    grid-column: 1 / -1;
  }
  .ns-cap {
    display: inline;
  }
  .ns-email {
    justify-content: flex-end;
  }
  .ns-email .ns-select {
    width: auto;
    max-width: 100%;
  }
}

/* Programs: event weeks and festivals (events slice 4). --program is the program's own colour. */
.ev-program-page { --program: var(--c-primary); }
.ev-program-head { border-top: 4px solid var(--program); }
.ev-program-badge { position: relative; z-index: 2; background: color-mix(in srgb, var(--c-primary) 12%, var(--c-surface)); color: var(--c-primary); text-decoration: none; }
.ev-program-chip { --chip-bd: var(--program, var(--c-border)); }
.ev-program-chip:is(.is-active, [aria-pressed="true"]) { --chip-bg: var(--program, var(--c-primary)); --chip-bd: var(--program, var(--c-primary)); }
.ev-program-filters { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.ev-program-filters .select { width: auto; max-width: 100%; }
.ev-program-day-title { font-size: var(--fs-md); font-weight: 700; padding-top: var(--s-3); border-top: 1px solid var(--c-border); }
.ev-program-day:first-of-type .ev-program-day-title { border-top: 0; padding-top: 0; }
.ev-program-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); color: inherit; text-decoration: none; }
.ev-program-row:hover { border-color: var(--c-border-strong); text-decoration: none; }
.ev-program-time { flex: 0 0 9.5rem; font-size: var(--fs-sm); color: var(--c-text-2); font-weight: 600; }
.ev-program-what { display: flex; flex-direction: column; flex: 1 1 14rem; min-width: 0; }
.ev-program-map { max-width: 640px; }
.ev-program-line { padding-top: var(--s-1); }
.ev-program-submit summary { list-style: none; cursor: pointer; }
.ev-program-submit ul { list-style: none; margin: var(--s-2) 0 0; padding: 0; }

/* ---------- Calendars (events slice 5a): month grid, week agenda, company panel, add to calendar ---------- */
.cal-bar-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.cal-step { display: flex; align-items: center; gap: var(--s-2); }
.cal-nav .round-btn { width: 36px; height: 36px; }
.cal-nav .round-btn .icon { width: 16px; height: 16px; }
.cal-title { min-width: 9.5rem; text-align: center; font-size: 1.25rem; font-weight: 800; }
.cal-modes { display: flex; gap: var(--s-2); }
.cal-subscribe-panel { width: 300px; max-width: calc(100vw - 32px); }
.cal-subscribe > summary, .ev-add-cal > summary { list-style: none; cursor: pointer; }
.cal-wide { display: none; }
.cal-narrow { display: block; }
@media (min-width: 640px) {
  .cal-wide { display: block; }
  .cal-narrow { display: none; }
}
.cal-month { border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--c-surface-2); font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); text-align: center; }
.cal-weekdays span { padding: var(--s-2) 0; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--c-border); }
.cal-day { background: var(--c-surface); box-shadow: inset 1px 0 0 var(--c-border); }
.cal-day:first-of-type { box-shadow: none; }
.cal-day.is-out { background: var(--c-bg); }
.cal-day.is-today { background: var(--c-primary-soft); }
.cal-num { position: relative; z-index: 1; justify-self: start; margin: var(--s-1); min-width: 24px; padding: 2px 6px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-2); text-align: center; text-decoration: none; }
.cal-num:hover { background: var(--c-surface-2); text-decoration: none; }
.cal-num.is-today { background: var(--c-primary); color: #fff; }
.cal-num.is-out { color: var(--c-subtle); }
.cal-items { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0 var(--s-1) var(--s-1); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-item { display: flex; align-items: center; gap: var(--s-1); min-width: 0; padding: 2px var(--s-1); border-radius: 4px; font-size: var(--fs-xs); color: var(--c-text); text-decoration: none; }
.cal-item:hover { background: var(--c-surface-2); text-decoration: none; }
.cal-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--cat, var(--c-primary)); }
.cal-item-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item-time { color: var(--c-muted); }
.cal-more { padding: 0 var(--s-1); font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); }
.cal-bar {
  position: relative;
  z-index: 1;
  align-self: center;
  margin: 0 var(--s-1);
  padding: 0 var(--s-2);
  height: 1.25rem;
  line-height: calc(1.25rem - 2px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--cat, var(--c-primary)) 45%, var(--c-surface));
  border-left: 3px solid var(--cat, var(--c-primary));
  border-radius: 4px;
  background: color-mix(in srgb, var(--cat, var(--c-primary)) 16%, var(--c-surface));
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
}
.cal-bar:hover { background: color-mix(in srgb, var(--cat, var(--c-primary)) 28%, var(--c-surface)); text-decoration: none; }
.cal-bar.is-program { background: color-mix(in srgb, var(--cat, var(--c-primary)) 26%, var(--c-surface)); }
.cal-bar.is-before { margin-left: 0; border-left-width: 1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.is-after { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-repeat, .ev-repeats { display: inline-block; margin-left: var(--s-1); padding: 0 5px; border: 1px solid var(--c-border-strong); border-radius: var(--r-pill); font-size: 10px; font-weight: 600; line-height: 1.4; color: var(--c-muted); white-space: nowrap; }
.cal-agenda-day { padding-top: var(--s-3); border-top: 1px solid var(--c-border); font-size: var(--fs-md); font-weight: 700; }
.cal-agenda > section:first-child .cal-agenda-day, .cal-weekview > section:first-child .cal-agenda-day { border-top: 0; padding-top: 0; }
.cal-agenda-day.is-today { color: var(--c-primary); }
.cal-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--c-border); border-left: 4px solid var(--cat, var(--c-primary)); border-radius: var(--r-lg); background: var(--c-surface); color: inherit; text-decoration: none; }
.cal-row:hover { border-color: var(--c-border-strong); border-left-color: var(--cat, var(--c-primary)); text-decoration: none; }
.cal-row-time { flex: 0 0 9.5rem; font-size: var(--fs-sm); color: var(--c-text-2); font-weight: 600; }
.cal-row-what { display: flex; flex-direction: column; flex: 1 1 14rem; min-width: 0; }
/* The company panel's compact grid: dots on days with events, tap a day to list it. */
.cal-nav-compact { justify-content: space-between; flex-wrap: nowrap; }
.cal-nav-compact .cal-title { min-width: 0; font-size: 1rem; }
.cal-nav-compact .round-btn { width: 32px; height: 32px; }
.cal-mini-head, .cal-mini-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mini-head span { padding: var(--s-1) 0; text-align: center; font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); }
.cal-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 40px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; font: inherit; font-size: var(--fs-xs); color: var(--c-text-2); }
button.cal-cell { cursor: pointer; }
button.cal-cell:hover { background: var(--c-surface-2); }
.cal-cell.is-out { color: var(--c-subtle); }
.cal-cell.is-today .cal-cell-num { font-weight: 800; color: var(--c-primary); }
.cal-cell.is-selected { background: var(--c-primary-soft); color: var(--c-primary); }
.cal-dots { display: flex; gap: 2px; height: 5px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--cat, var(--c-primary)); }
/* The events header has a third view button (calendar): tighten it so the header still fits at 375px. */
@media (max-width: 420px) {
  .app-header .logo-img { width: 84px; }
  .view-switch { gap: 2px; }
  .view-switch .round-btn { width: 32px; height: 32px; }
  .view-switch .round-btn-ring { box-shadow: 0 0 0 3px var(--c-primary-soft); }
}

/* Interested (events slice 5b): the button on an event card sits above the card's whole-card link. */
.ev-interested-compact { position: relative; z-index: 2; }
.ev-feed-url { word-break: break-all; }

/* ---------- Sponsored placements (events slice 6a) ----------
   Every sponsored thing says so ("Sponsored", "Featured"). The splash layer is a container, so the same rules draw the
   card on a map page and in the admin's desktop and phone preview frames: under 640px of layer width the card is a
   compact one at the bottom. Motion respects prefers-reduced-motion. */
.pl-splash-layer {
  position: absolute;
  inset: 0 var(--pl-right, 0px) 0 0;
  z-index: 8; /* above the temporary staff compare panel (7), so it never covers the Sponsored card */
  pointer-events: none;
  container-type: inline-size;
}
@media (min-width: 768px) {
  .dir-map > .pl-splash-layer { right: calc(450px + 2 * var(--s-4)); }
}
.dir-map { --pl-bottom: calc(var(--sheet-peek, 0px) + var(--safe-b, 0px)); }
.pl-splash {
  pointer-events: auto;
  position: absolute;
  top: 68px;
  left: 50%;
  translate: -50% 0;
  width: min(460px, calc(100% - 2 * var(--s-4)));
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
  animation: pl-drop 0.25s ease-out;
}
.pl-splash[hidden] { display: none; }
.pl-img { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
/* Rich media (slice 6b): the fallback image fills the box; the video or sandboxed frame is laid over it once it is on screen. */
.pl-media { position: relative; width: 100%; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--c-surface-2, #f3f4f6); }
.pl-media .pl-img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.pl-live { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; object-fit: cover; background: transparent; }
iframe.pl-live { opacity: 0; transition: opacity 0.2s; }
iframe.pl-live.is-ready { opacity: 1; }
.pl-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); padding: var(--s-4); }
.pl-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-muted); }
.pl-headline { margin: 0; font-size: 1.125rem; font-weight: 800; line-height: 1.25; }
.pl-text { margin: 0; font-size: var(--fs-sm); color: var(--c-text-2); }
.pl-close {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--c-surface) 92%, transparent);
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.pl-close:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.pl-close .icon { width: 16px; height: 16px; }
@keyframes pl-drop { from { opacity: 0; translate: -50% -8px; } }
@keyframes pl-rise { from { opacity: 0; translate: 0 8px; } }
@container (max-width: 639px) {
  .pl-splash {
    top: auto;
    bottom: calc(var(--pl-bottom, 0px) + var(--s-3));
    left: var(--s-3);
    translate: none;
    display: grid;
    grid-template-columns: 112px 1fr;
    width: calc(100% - 2 * var(--s-3));
    animation-name: pl-rise;
  }
  .pl-splash .pl-img { height: 100%; aspect-ratio: auto; }
  .pl-splash .pl-media { height: 100%; aspect-ratio: auto; }
  .pl-splash:not(:has(.pl-img)) { grid-template-columns: 1fr; }
  .pl-splash .pl-body { padding: var(--s-3); padding-right: 44px; gap: var(--s-1); }
  .pl-splash .pl-headline { font-size: var(--fs-md); }
  .pl-splash .pl-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.pl-card {
  margin-bottom: var(--s-4);
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}
.pl-card .pl-headline { font-size: var(--fs-md); }
.pl-badge {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.pl-badge-inline { position: static; flex: none; }
.pl-flag { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-primary); }
.ev-card.is-featured { border-color: color-mix(in srgb, var(--c-primary) 45%, var(--c-border)); }
.cal-row.is-featured { box-shadow: inset 3px 0 0 var(--c-primary); }
.cal-bar.is-featured, .cal-item.is-featured { font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .pl-splash { animation: none; }
  .pl-live { display: none; }
}
/* The admin's placement preview (templates/placements/preview.html): fixed mock maps. */
.pl-frames { display: flex; flex-wrap: wrap; gap: var(--s-6); align-items: flex-start; }
.pl-frame-wrap { margin: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.pl-frame { position: relative; overflow: hidden; border: 1px solid var(--c-border-strong); border-radius: var(--r-lg); background: linear-gradient(135deg, color-mix(in srgb, var(--c-primary) 8%, var(--c-surface)), color-mix(in srgb, var(--c-primary) 18%, var(--c-surface))); }
.pl-frame-desktop { width: 1200px; height: 520px; zoom: 0.65; }
.pl-frame-phone { width: 375px; height: 640px; }
.pl-frame-column { width: 450px; height: 420px; background: var(--c-surface); }
.pl-frame-sheet { height: 360px; background: var(--c-surface); }
.pl-frame-pin { width: 320px; height: 220px; display: grid; place-items: center; }
.pl-mock-panel { position: absolute; top: var(--s-4); right: var(--s-4); bottom: var(--s-4); width: 450px; border-radius: var(--r-xl); background: var(--c-surface); box-shadow: var(--shadow-md); }
.pl-mock-sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 88px; border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--c-surface); box-shadow: 0 -6px 20px rgb(0 0 0 / 0.14); }
.pl-mock-column { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }
.pl-mock-line { height: 56px; border-radius: var(--r-lg); background: var(--c-surface-2); }
.pl-pin-glow { position: absolute; width: 90px; height: 90px; border-radius: 50%; background: rgba(251, 191, 36, 0.5); filter: blur(12px); transform: translateY(-8px); }
.pl-pin { position: relative; }

/* Header search suggestions and the all-types results page (search step 2). Same panel as the header menus. */
.app-search { position: relative; }
.search-suggest { left: 0; right: 0; top: calc(100% + var(--s-2)); max-height: min(70vh, 520px); overflow-y: auto; padding: var(--s-2); z-index: 60; }
.search-suggest[hidden] { display: none; }
.search-group-head { padding: var(--s-2) var(--s-3) var(--s-1); font-size: var(--fs-xs, 0.75rem); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-muted); }
.search-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); color: var(--c-text); text-decoration: none; }
.search-row:hover, .search-row[aria-selected="true"] { background: var(--c-surface-2); text-decoration: none; }
.search-row[aria-selected="true"] { outline: 2px solid var(--c-primary); outline-offset: -2px; }
.search-row-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-row-title, .search-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-row-all { margin-top: var(--s-1); border-top: 1px solid var(--c-border); border-radius: 0 0 var(--r-sm) var(--r-sm); color: var(--c-primary); font-weight: 600; font-size: var(--fs-sm); }
.search-rows { display: flex; flex-direction: column; gap: var(--s-1); }
.search-page .search-row { border: 1px solid var(--c-border); background: var(--c-surface); border-radius: var(--r-md); }
.search-page .search-row:hover { background: var(--c-surface-2); border-color: var(--c-border-strong); }
.search-page .search-row-title, .search-page .search-row-sub { white-space: normal; }
