:root {
  /* Idiap brand palette (www.idiap.ch/en, September 2026) */
  --primary: #125cf7;
  --primary-50: #eff4ff;
  --primary-100: #dbe6fe;
  --primary-200: #bfd2fe;
  --primary-300: #93b4fd;
  --primary-400: #608dfa;
  --primary-light: #608dfa;
  --primary-pale: #eff4ff;
  --primary-dark: #101d44;
  --primary-hover: #1147d4;
  --secondary: #00aeff;
  --secondary-100: #e0f2fe;
  --accent: #125cf7;
  --bg: #ffffff;
  --bg-light: #fafafa;
  --bg-dark: #f5f5f5;
  --text: #212121;
  --text-light: #737373;
  --text-muted: #525252;
  --text-white: #ffffff;
  --border: #e5e5e5;
  --success: #00c758;
  --warning: #edb200;
  --error: #fb2c36;
  /* Shape tokens */
  --radius: 8px;
  --radius-button: 6px;
  --radius-media: 8px;
  --radius-panel: 12px;
  --radius-pill: 999px;
  --shadow: 0 2px 12px rgba(16, 29, 68, 0.06);
  --shadow-hover-blue: 0 0 100px 0 color-mix(in srgb, #125cf7 10%, transparent);
  --font-sans: "Geist Sans", "Geist Variable", system-ui, sans-serif;
  --font-mono: "Geist Mono", "Geist Mono Variable", ui-monospace, monospace;
  --max-width: 1280px;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------ Idiap-style motion */
/* Route change: soft crossfade via View Transitions API (Next/React VT on Idiap). */
@supports (view-transition-name: none) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.35s;
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }

  ::view-transition-old(root) {
    animation-name: cpai-route-fade-out;
  }

  ::view-transition-new(root) {
    animation-name: cpai-route-fade-in;
  }
}

@keyframes cpai-route-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes cpai-route-fade-in {
  from {
    opacity: 0;
  }
}

/* Scroll reveal: opacity + slight rise, 700ms ease-out (Idiap section blocks). */
.reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity 0.7s cubic-bezier(0, 0, 0.2, 1),
    transform 0.7s cubic-bezier(0, 0, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  @supports (view-transition-name: none) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
      animation: none !important;
    }
  }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ---------------------------------------------------------------- Navbar */
.navbar {
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 6rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
}

.nav-brand__logo {
  display: block;
  height: 48px;
  width: calc(48px * 1450.200711 / 398.90661);
  max-width: min(100%, 280px);
  object-fit: contain;
  object-position: left center;
}
.nav-brand__logo--en {
  display: none;
}
html[lang="en"] .nav-brand__logo--fr {
  display: none;
}
html[lang="en"] .nav-brand__logo--en {
  display: block;
}

.nav-brand__divider {
  width: 1px;
  height: 36px;
  background: var(--primary-100);
}

.nav-brand__cpai-logo {
  display: block;
  width: auto;
  height: 42px;
  max-width: 126px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-button);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--primary);
  background: transparent;
}

.nav-link:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.nav-link.active {
  color: var(--primary);
  background: transparent;
}

.nav-link-with-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-notification-badge {
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--error);
  color: var(--text-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.nav-account-menu {
  position: relative;
}

.nav-account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 0;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}

.nav-account-toggle:hover,
.nav-account-menu.open .nav-account-toggle {
  color: var(--primary);
}

.nav-account-toggle__chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
  transition: transform 0.2s;
}

.nav-account-menu.open .nav-account-toggle__chevron {
  transform: translateY(0.12rem) rotate(225deg);
}

.nav-account-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  z-index: 120;
  width: max-content;
  min-width: 14rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.nav-account-menu.open .nav-account-dropdown {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-account-dropdown .nav-link {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.nav-account-logout {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--bg);
}

.language-switcher__button {
  min-width: 2.25rem;
  padding: 0.3rem 0.45rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.language-switcher__button.active {
  background: var(--primary);
  color: var(--text-white);
}

.content-locale-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.content-locale-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--bg);
}

.content-locale-tab {
  min-width: 2.4rem;
  padding: 0.3rem 0.55rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.content-locale-tab.active {
  background: var(--primary);
  color: var(--text-white);
}

.content-locale-bar .btn {
  text-transform: none;
  letter-spacing: 0;
}

/* --------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--radius-button);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s, color 0.2s, border-color 0.2s;
  text-align: center;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--primary-100);
  color: var(--primary);
}
.btn-secondary:hover {
  background: var(--primary-200);
}

.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover {
  background: #d9202c;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
}

.btn-text {
  background: transparent;
  color: var(--text);
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
.btn-text:hover,
.btn-text:focus-visible {
  color: var(--primary);
}
.btn-text::after {
  content: "→";
  color: var(--primary);
  transition: transform 0.2s;
}
.btn-text:hover::after,
.btn-text:focus-visible::after {
  transform: translateX(0.25rem);
}

.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}

/* SSO button */
.btn-sso {
  background: var(--primary);
  color: var(--text-white);
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  margin-top: 0.5rem;
}
.btn-sso:hover {
  background: var(--primary-hover);
}

/* Login divider */
.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  color: var(--text-light);
  font-size: 0.875rem;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ------------------------------------------------------------------ Hero */
.hero {
  background: var(--bg);
  color: var(--text);
  padding: 5.5rem 1.5rem 5rem;
  margin: 0 -1.5rem;
  text-align: left;
  border-radius: 0;
}

.hero .hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
}

.hero h1 {
  max-width: 1050px;
  font-size: clamp(2.4rem, 4.8vw, 3.75rem);
  margin-bottom: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
  text-wrap: balance;
}

.hero p {
  font-size: 1.1rem;
  max-width: 740px;
  margin: 0 0 2rem;
  color: var(--text-muted);
  font-weight: 400;
}

.hero-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero .btn-secondary {
  background: var(--bg);
  color: var(--primary);
  border: 1.5px solid var(--primary-200);
}

.hero .btn-secondary:hover {
  background: var(--primary-50);
  border-color: var(--primary);
}

.hero .btn-outline {
  border-color: var(--border);
  color: var(--text);
}

.hero .btn-outline:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--text-white);
}

/* -------------------------------------------------------------- Sections */
.section {
  padding: 4rem 0;
}

.section--activities-band,
.section--news-band {
  margin: 0 -1.5rem;
  padding: 5rem 1.5rem;
  border-radius: 0;
}

.section--activities-band {
  --carousel-band: var(--bg-light);
  background: var(--carousel-band);
}

.section--news-band {
  --carousel-band: var(--primary-50);
  background: var(--carousel-band);
}

[data-card-carousel] {
  /* Extend the band behind the overhanging card without widening the page. */
  box-shadow: 0 0 0 100vmax var(--carousel-band);
  clip-path: inset(0 -100vmax);
}

.section-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 2rem;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.section-heading .section-title {
  margin-bottom: 0;
}

.section-cta {
  text-align: left;
  margin-top: 1.75rem;
}

/* ----------------------------------------------------------------- Cards */
/* Content-sized cards continue beyond the column, as on Idiap's homepage. */
.card-carousel__track {
  --carousel-gap: 1.5rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(var(--carousel-content-width, 100%) / 3 - var(--carousel-gap));
  gap: var(--carousel-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.5rem;
  scrollbar-width: none;
  margin: -0.5rem;
  margin-right: calc(-0.5rem - var(--carousel-overhang, 0px));
  padding: 0.5rem;
  padding-right: calc(0.5rem + var(--carousel-overhang, 0px));
}

.card-carousel__track::-webkit-scrollbar {
  display: none;
}

.card-carousel__track > .card {
  scroll-snap-align: start;
  min-width: 0;
  height: auto;
}

.card-carousel__track > .card.is-clipped:not(:focus-visible) {
  opacity: 0.5;
}

.card-carousel__track.is-scrollable {
  cursor: grab;
}

.card-carousel__track.is-scrollable > .card {
  cursor: inherit;
  user-select: none;
  -webkit-user-select: none;
}

.card-carousel__track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.card-carousel__track:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: var(--radius);
}

@media (max-width: 1050px) {
  .card-carousel__track {
    grid-auto-columns: calc(var(--carousel-content-width, 100%) / 2 - var(--carousel-gap));
  }
}

@media (max-width: 640px) {
  .card-carousel__track {
    --carousel-gap: 1rem;
    grid-auto-columns: calc(var(--carousel-content-width, 100%) * 0.9);
  }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

.card-grid--events {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.card-grid--news {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .card-grid--news {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .card-grid--news {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg);
  border: 0;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s ease;
}
.card:hover {
  box-shadow: var(--shadow-hover-blue);
  transform: none;
  border-color: transparent;
}

.card-category {
  display: inline-flex;
  align-items: center;
  background: var(--primary-pale);
  color: var(--primary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0;
}

.card-category--solid {
  background: var(--primary);
  color: var(--text-white);
}

.card-category--overlay {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 12%, transparent);
}

.card-badges-row,
.detail-badges-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.card-badges-row .card-category,
.detail-badges-row .card-category {
  margin-bottom: 0;
}

.card-badges-row .news-theme-badges,
.detail-badges-row .news-theme-badges {
  margin-bottom: 0;
}

.card--event {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
  border: 1px solid var(--border);
}

/* Public content cards share Idiap's blue interaction treatment. Keep status
   badges and the pale date panel distinct so their meaning stays readable. */
:is(.card--event, .card--news) {
  --card-foreground: var(--text);
  --card-icon: var(--primary);
  --card-category-bg: var(--primary);
  --card-category-text: var(--text-white);
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.3s ease;
}

:is(.card--event, .card--news):focus-visible {
  --card-foreground: var(--text-white);
  --card-icon: var(--text-white);
  --card-category-bg: var(--bg);
  --card-category-text: var(--primary);
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover-blue);
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  :is(.card--event, .card--news):hover {
    --card-foreground: var(--text-white);
    --card-icon: var(--text-white);
    --card-category-bg: var(--bg);
    --card-category-text: var(--primary);
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-hover-blue);
  }

  :is(.card--event, .card--news):hover .card-arrow-icon {
    transform: translate(0.15rem, -0.15rem);
  }
}

:is(.card--event, .card--news):focus-visible .card-arrow-icon {
  transform: translate(0.15rem, -0.15rem);
}

.card--event .card-category--solid {
  background: var(--card-category-bg);
  color: var(--card-category-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.card-event-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 1;
}

.card-event-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  min-width: 0;
  flex: 1;
}

.card .card-event-title {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--card-foreground);
  margin: 0;
  overflow-wrap: anywhere;
  transition: color 0.3s ease;
}

.card-event-date {
  flex-shrink: 0;
  background: var(--secondary-100);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  padding: 1rem 1.15rem;
  border-bottom-left-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 7.5rem;
}

.card-event-date__time {
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

.card-event-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
}

.card-event-location {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--card-foreground);
  min-width: 0;
  transition: color 0.3s ease;
}

.card-event-location span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-pin-icon,
.card-arrow-icon {
  flex-shrink: 0;
  color: var(--card-icon, var(--primary));
  transition: color 0.3s ease, transform 0.3s ease;
}

.card-pin-icon {
  width: 1em;
  height: 1em;
}

.card-arrow-icon {
  width: 1.75rem;
  height: 1.75rem;
}

.card--news {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
}

.card-news-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.card-news-badges {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem;
  pointer-events: none;
}

.card--news .card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--bg-dark);
  overflow: hidden;
  flex: none;
}

.card--news .card-cover--empty {
  background:
    linear-gradient(135deg, var(--primary-100) 0%, var(--secondary-100) 100%);
}

.card--news .card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card--news .card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  background: transparent;
}

.card-news-date {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--card-foreground);
  letter-spacing: 0;
  transition: color 0.3s ease;
}

.card-news-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.card .card-news-title {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
  color: var(--card-foreground);
  min-width: 0;
  overflow-wrap: anywhere;
  transition: color 0.3s ease;
}

.card--news .card-arrow-icon {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  align-self: flex-end;
}

.detail-cover {
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 0;
  margin-left: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.card-badge-paid {
  background: #e8f7ec;
  color: #1f7a38;
  border: 1px solid #b9e5c5;
}
.card-badge-fee {
  background: #fff4e5;
  color: #8a5300;
  border: 1px solid #ffd9a8;
}
.card-badge-private {
  background: #eaf2f8;
  color: #1b4f72;
  border: 1px solid #aed6f1;
}
.card-badge-normal {
  background: #fef5e7;
  color: #9a7d0a;
  border: 1px solid #f8c471;
}
.card-badge-public {
  background: #e8f8f5;
  color: #117864;
  border: 1px solid #a3e4d7;
}
.card-badge-language {
  background: #f1eefb;
  color: #4a2f8f;
  border: 1px solid #d5c8f2;
}
.card-badge-now {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff2df;
  color: #8a3b00;
  border: 1px solid #ffbf75;
  box-shadow: 0 0 0 rgba(245, 127, 23, 0);
  animation: nowBadgeGlow 1.8s ease-in-out infinite;
}
.card-badge-now::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #f97316;
  box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
  flex: 0 0 auto;
  animation: nowBadgeDot 1.4s ease-out infinite;
}
.card-badge-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eef6ff;
  color: #1d4f91;
  border: 1px solid #9ec5f0;
}
.card-badge-soon::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #3b82f6;
  flex: 0 0 auto;
}

@keyframes nowBadgeGlow {
  0%,
  100% {
    transform: rotate(-1deg) scale(1);
    box-shadow: 0 0 0 rgba(245, 127, 23, 0);
  }
  50% {
    transform: rotate(1deg) scale(1.025);
    box-shadow: 0 0.35rem 0.9rem rgba(245, 127, 23, 0.16);
  }
}

@keyframes nowBadgeDot {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
  }
  70% {
    box-shadow: 0 0 0 0.45rem rgba(249, 115, 22, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card:is(.card--event, .card--news),
  .card:is(.card--event, .card--news) *,
  .btn-text::after {
    transition: none;
  }

  :is(.card--event, .card--news) .card-arrow-icon,
  .btn-text::after {
    transform: none !important;
  }

  .card-badge-now,
  .card-badge-now::before {
    animation: none;
  }
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 400;
}

.card p {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ----------------------------------------------------------------- Forms */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.field-label-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}
.field-label-row label {
  margin-bottom: 0;
}
.field-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border: 1px solid var(--primary-light);
  border-radius: 999px;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}
.field-info:hover {
  background: #d7ecfa;
}
.field-info:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.datetime-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.activity-session-list {
  display: grid;
  gap: 1rem;
}

.activity-session-card {
  border: 1px solid var(--border, #d5dce3);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface-muted, #f7f9fb);
}

.activity-session-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.activity-session-card__title {
  margin: 0;
  font-size: 1rem;
}

.activity-session-actions {
  margin-top: 0.85rem;
}

.activity-session-meta {
  display: grid;
  gap: 0.35rem;
}

.activity-session-meta__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.field-sub-label {
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 500;
}

.field-help {
  color: var(--text-light);
  font-size: 0.85rem;
  margin: -0.5rem 0 1rem;
}

.field-help--after {
  margin-top: 0.45rem;
  margin-bottom: 0;
  line-height: 1.45;
}

.field-hint {
  color: var(--text-light);
  font-size: 0.85rem;
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.email-autocomplete,
.project-autocomplete {
  position: relative;
}

.email-autocomplete__list,
.project-autocomplete__list {
  position: absolute;
  z-index: 20;
  right: 0;
  left: 0;
  top: calc(100% + 0.25rem);
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-light);
  box-shadow: var(--shadow);
}

.email-autocomplete__option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-autocomplete__option {
  display: block;
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.email-autocomplete__option:last-child,
.project-autocomplete__option:last-child {
  border-bottom: 0;
}

.email-autocomplete__option:hover,
.email-autocomplete__option.active,
.project-autocomplete__option:hover,
.project-autocomplete__option.active {
  background: var(--primary-pale);
}

.email-autocomplete__meta {
  flex: 0 1 auto;
  color: var(--text-light);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.birthdate-field {
  padding: 1rem;
}

.birthdate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.birthdate-grid--year-only {
  grid-template-columns: minmax(0, 14rem);
}

.birthdate-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.birthdate-field .field-sub-label,
.phone-field .field-sub-label {
  margin-bottom: 0;
}

.phone-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.4fr);
  gap: 0.75rem;
}

.phone-select-group,
.phone-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.register-intro {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.register-intro p {
  margin: 0 0 0.85rem;
  line-height: 1.55;
}

.register-intro p:last-child {
  margin-bottom: 0;
}

.alumni-register-box {
  margin: 1.25rem 0 1.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.alumni-register-check {
  align-items: flex-start;
  margin-bottom: 0;
}

.alumni-register-check span {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.alumni-register-check .field-help {
  margin: 0;
}

.preference-help {
  margin: -0.15rem 0 0.75rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.form-check input[type="checkbox"] {
  width: auto;
}
.legal-notice {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}

.legal-notice__title {
  margin: 0;
  padding: 1rem 1.1rem;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.35;
}

.legal-notice__body {
  max-height: 26rem;
  padding: 1rem 1.1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
  line-height: 1.55;
}

.legal-notice__body:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: -2px;
}

.legal-notice__introduction,
.legal-notice__section p {
  margin: 0 0 0.8rem;
}

.legal-notice__section h3,
.legal-notice__section h4 {
  margin: 1.15rem 0 0.55rem;
  color: var(--text);
  line-height: 1.35;
}

.legal-notice__section h3 {
  font-size: 1.05rem;
}

.legal-notice__section h4 {
  font-size: 0.98rem;
}

.legal-notice__section--major + .legal-notice__section--section h4 {
  margin-top: 0.8rem;
}

.legal-notice__section p:last-child {
  margin-bottom: 0;
}

.legal-consent {
  align-items: flex-start;
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--bg);
}
.legal-consent input[type="checkbox"] {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.form-label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: var(--text);
}

.field-help--tight {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.form-highlight-panel,
.birthdate-field {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfdff 0%, var(--primary-pale) 100%);
  box-shadow: var(--shadow);
}

.form-section {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.form-section:first-child,
.admin-form-panel > form > .form-section:first-of-type,
.form-card > form > .form-section:first-of-type,
.form-card > form > .research-profile-fieldset > .form-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.form-section__title {
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--primary);
}

.form-section__intro {
  margin: -0.35rem 0 1rem;
  color: var(--text-light);
  font-size: 0.88rem;
  line-height: 1.5;
}

.form-section__intro + .form-section__intro {
  margin-top: -0.55rem;
}

.form-section__body > .form-group:last-child,
.form-section__body > .form-row:last-child {
  margin-bottom: 0;
}

.form-inset {
  margin: 0.85rem 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: inset 0 1px 0 rgba(18, 150, 219, 0.05);
}

.form-inset__title {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.form-inset__intro {
  margin: -0.25rem 0 0.85rem;
  color: var(--text-light);
  font-size: 0.88rem;
}

.form-expandable-panel {
  margin: 1.25rem 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, #fbfdff 0%, var(--primary-pale) 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-expandable-panel.is-expanded {
  border-color: var(--primary-light);
}

.form-expandable-panel__toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0;
  padding: 1rem 1.15rem;
  cursor: pointer;
}

.form-expandable-panel__toggle input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.form-expandable-panel__toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.form-expandable-panel__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.form-expandable-panel__hint {
  color: var(--text-light);
  font-size: 0.88rem;
  line-height: 1.45;
}

.form-expandable-panel__body {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid rgba(18, 150, 219, 0.18);
  background: var(--bg);
}

.form-expandable-panel__intro {
  margin: 1rem 0 0.25rem;
  color: var(--text-light);
  font-size: 0.88rem;
}

.form-expandable-panel .form-section {
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.form-expandable-panel .form-section:first-child {
  padding-top: 0.25rem;
  border-top: none;
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.choice-group--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.choice-group--grid .choice-chip {
  width: 100%;
  border-radius: var(--radius);
  justify-content: flex-start;
}

.choice-chip input[type="radio"],
.choice-chip input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.choice-chip:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-pale);
  box-shadow: inset 0 0 0 1px rgba(18, 150, 219, 0.12);
}

.choice-chip__label {
  font-size: 0.9rem;
  line-height: 1.3;
}

.preference-option-list {
  display: grid;
  gap: 0.75rem;
}

.preference-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.preference-option input[type="checkbox"] {
  width: auto;
  margin: 0.2rem 0 0;
  flex-shrink: 0;
}

.preference-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-pale);
  box-shadow: inset 0 0 0 1px rgba(18, 150, 219, 0.12);
}

.preference-option__copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.preference-option__label {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.preference-option__description {
  color: var(--text-light);
  font-size: 0.85rem;
  line-height: 1.45;
}

.choice-followup {
  margin-top: 0.65rem;
  padding-left: 0.15rem;
}

.choice-followup .field-sub-label {
  display: block;
  margin-bottom: 0.35rem;
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.form-card {
  max-width: 600px;
  margin: 2rem auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.form-card h2 {
  margin-bottom: 1.5rem;
  color: var(--text);
  font-weight: 600;
}

/* ---------------------------------------------------------------- Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.alert-error {
  background: #fde8e8;
  color: var(--error);
  border: 1px solid #f5c6cb;
}
.alert-success {
  background: #d4edda;
  color: var(--success);
  border: 1px solid #c3e6cb;
}

/* ------------------------------------------------------------ Detail page */
.detail-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.detail-header h1 {
  font-size: 2.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--text-light);
  font-size: 0.95rem;
}
.detail-body {
  max-width: 800px;
  line-height: 1.8;
}
.detail-body p {
  margin-bottom: 1rem;
}

/* -------------------------------------------------------------- About */
.about-page {
  max-width: 940px;
  margin: 0 auto;
}

.about-intro {
  margin-bottom: 3rem;
}

.about-intro p,
.about-contact p {
  margin-bottom: 1rem;
  color: var(--text-light);
  font-size: 1.05rem;
}

.about-intro a {
  color: var(--primary);
}

.about-video,
.about-projects {
  margin-top: 3rem;
}

.about-video h2,
.about-projects h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-list {
  display: grid;
  gap: 1rem;
}

.project-item {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.project-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.project-item a {
  color: var(--primary);
  text-decoration: none;
}

.project-item a:hover {
  text-decoration: underline;
}

.project-item p {
  color: var(--text-light);
}

.project-item .project-subtitle {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.about-contact {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.activity-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 2rem;
}

.activity-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.activity-entry-auth {
  margin-top: 1.25rem;
}

.btn-calendar {
  background: #eaf2f8;
  color: var(--primary-dark);
  border: 1px solid #aed6f1;
  box-shadow: 0 1px 3px rgba(14, 47, 68, 0.12);
}

.btn-calendar:hover {
  background: var(--primary);
  color: var(--text-white);
}

.btn-copy-markdown {
  background: #eef6eb;
  color: #27563a;
  border: 1px solid #b9d6c1;
  box-shadow: 0 1px 3px rgba(39, 86, 58, 0.12);
}

.btn-copy-markdown:hover {
  background: #27563a;
  color: var(--text-white);
}

.copy-markdown-message {
  margin-top: 0.75rem;
}

.activity-share-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(
      180deg,
      rgba(234, 246, 253, 0.92),
      rgba(255, 255, 255, 0.98)
    ),
    var(--bg);
  box-shadow: var(--shadow);
}

.activity-share-copy {
  flex: 1 1 16rem;
  min-width: 0;
}

.activity-share-copy h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.activity-share-copy p {
  margin: 0 0 0.75rem;
  color: var(--text-light);
}

.activity-share-url {
  word-break: break-all;
  font-size: 0.92rem;
}

.activity-share-url a {
  color: var(--primary-dark);
}

.activity-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.activity-share-message {
  margin-top: 0.75rem;
}

.activity-share-qrcode {
  flex: 0 0 auto;
  width: 220px;
  height: 220px;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 2px 8px rgba(14, 47, 68, 0.08);
}

.activity-interactions {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.activity-interactions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.activity-interactions h2 {
  font-size: 1.35rem;
  margin: 0;
}

.activity-interaction-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.activity-interaction-form,
.activity-inline-reply-form {
  display: grid;
  gap: 0.55rem;
}

.activity-interaction-form label,
.activity-inline-reply-form label {
  font-weight: 600;
}

.activity-interaction-form textarea,
.activity-inline-reply-form textarea {
  width: 100%;
  min-height: 6rem;
  resize: vertical;
}

.activity-inline-reply-form textarea {
  min-height: 4.5rem;
}

.activity-interaction-form .btn,
.activity-inline-reply-form .btn {
  justify-self: start;
}

.activity-interaction-message {
  margin: 0.75rem 0;
}

.activity-interaction-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.activity-interaction-empty {
  padding: 1rem;
  color: var(--text-light);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.activity-interaction-item {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.activity-interaction-item-answer {
  background: #f7fbfe;
}

.activity-interaction-item-feedback {
  background: #fffaf0;
}

.activity-interaction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-light);
  font-size: 0.86rem;
}

.activity-interaction-kind {
  color: var(--primary-dark);
  background: var(--primary-pale);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-weight: 700;
}

.activity-interaction-text {
  margin: 0;
  white-space: normal;
}

.activity-interaction-children {
  display: grid;
  gap: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.detail-workflow-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

.activity-registration-note {
  display: inline-block;
  margin-left: 0.75rem;
  margin-bottom: 0;
}

.activity-detail-actions .activity-registration-note {
  margin-left: 0;
}

.activity-registration-disabled {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.activity-registration-disabled .field-help {
  margin: 0;
}

.approval-diff {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(
      180deg,
      rgba(234, 246, 253, 0.92),
      rgba(255, 255, 255, 0.98)
    ),
    var(--bg);
  box-shadow: var(--shadow);
}

.approval-diff__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.approval-diff__summary-label {
  font-weight: 700;
  color: var(--primary-dark);
}

.approval-diff__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.approval-diff__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--primary-pale);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.approval-diff__empty-summary {
  color: var(--text-light);
}

.approval-diff__table {
  display: grid;
  gap: 0.75rem;
}

.approval-diff__header-row,
.approval-diff__row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.approval-diff__header-row {
  padding: 0 0.75rem;
  color: var(--text-light);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.approval-diff__row {
  padding: 0.9rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(217, 225, 231, 0.9);
}

.approval-diff__row--changed {
  border-color: rgba(18, 150, 219, 0.28);
  background: linear-gradient(
    90deg,
    rgba(255, 243, 230, 0.78),
    rgba(236, 247, 221, 0.78)
  );
}

.approval-diff__field-label {
  font-weight: 700;
  color: var(--primary-dark);
}

.approval-diff__value {
  min-width: 0;
}

.approval-diff__value--current,
.approval-diff__value--suggested {
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.approval-diff__value--current.approval-diff__value--changed {
  background: rgba(255, 237, 230, 0.9);
  border-color: rgba(203, 116, 81, 0.28);
  box-shadow: inset 3px 0 0 rgba(203, 116, 81, 0.5);
}

.approval-diff__value--suggested.approval-diff__value--changed {
  background: rgba(231, 245, 232, 0.92);
  border-color: rgba(82, 148, 92, 0.28);
  box-shadow: inset 3px 0 0 rgba(82, 148, 92, 0.5);
}

.approval-diff__value--same {
  background: rgba(245, 247, 249, 0.72);
}

.approval-diff__placeholder {
  color: var(--text-light);
  font-style: italic;
}

.approval-diff__text {
  white-space: pre-wrap;
  word-break: break-word;
}

.approval-diff__html {
  margin: 0;
}

.approval-diff__html > :first-child {
  margin-top: 0;
}

.approval-diff__html > :last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------- Filter bar */
.filter-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
}

.activity-advanced-filters {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-light);
}

.activity-advanced-filters > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.activity-advanced-filters > summary::-webkit-details-marker {
  display: none;
}

.activity-advanced-filters > summary:focus-visible,
.filter-help > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.activity-advanced-filters > summary::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.5rem;
  border-right: 2px solid var(--text-light);
  border-bottom: 2px solid var(--text-light);
  transform: rotate(-45deg);
  vertical-align: 0.15rem;
}

.activity-advanced-filters[open] > summary::before {
  transform: rotate(45deg);
  vertical-align: 0.25rem;
}

.activity-filter-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  padding: 0 1rem 1rem;
}

.activity-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

.activity-filter-label-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.2rem;
}

.activity-filter-label-row label {
  margin: 0;
}

.filter-help {
  position: relative;
  display: inline-flex;
  font-weight: 400;
}

.filter-help > summary {
  list-style: none;
  cursor: pointer;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-help > summary::-webkit-details-marker {
  display: none;
}

.filter-help > summary:hover,
.filter-help[open] > summary {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-help-bubble {
  position: absolute;
  z-index: 6;
  top: calc(100% + 0.35rem);
  left: 0;
  width: min(16rem, 70vw);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 4px 16px rgba(33, 33, 33, 0.08);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text);
}

.filter-help-bubble p {
  margin: 0 0 0.4rem;
  color: var(--text-light);
}

.filter-help-bubble a {
  color: var(--primary);
}

.activity-filter-field select,
.activity-filter-field input {
  min-height: 2.55rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.activity-filter-field select:focus,
.activity-filter-field input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(18, 150, 219, 0.14);
}

.activity-filter-actions {
  display: flex;
  align-items: end;
}

.activity-filter-actions .btn {
  width: 100%;
  min-height: 2.55rem;
}

.activity-section + .activity-section {
  margin-top: 2.5rem;
}

.activity-section-header {
  margin-bottom: 1rem;
}

.activity-section-title {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.activity-section-description,
.activity-empty-state {
  color: var(--text-light);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.pagination-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border, #ccc);
  background: var(--bg-white, #fff);
  color: inherit;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.pagination-btn:hover:not([disabled]) {
  background: var(--bg-light, #f5f5f5);
}
.pagination-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.pagination-info {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- Footer */
.footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.9);
  padding: 4rem 0 1.5rem;
  margin-top: auto;
}
.footer-logo {
  display: block;
  width: auto;
  height: 40px;
}
.footer-brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.footer-brand-divider {
  width: 1px;
  height: 34px;
  background: rgba(255, 255, 255, 0.35);
}
.footer-cpai-logo {
  display: block;
  width: auto;
  height: 38px;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-section h3 {
  color: var(--text-white);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-section a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}
.footer-section a:hover {
  color: var(--text-white);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}
.footer-version {
  margin: 0.75rem 0 0;
}
.footer-version-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.footer-version-btn:hover,
.footer-version-btn:focus-visible {
  color: var(--text-white);
  outline: none;
}

.changelog-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 19, 28, 0.45);
}
.changelog-dialog {
  width: min(100%, 640px);
  max-height: min(85vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
}
.changelog-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.changelog-dialog-header h2 {
  margin: 0;
  font-size: 1.35rem;
}
.changelog-dialog-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-light);
  font-size: 0.9rem;
}
.changelog-dialog-body {
  overflow: auto;
  padding: 1rem 1.25rem 1.25rem;
}
.changelog-release + .changelog-release {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.changelog-release-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.changelog-release-header h3 {
  margin: 0;
  font-size: 1.1rem;
}
.changelog-release-header time {
  color: var(--text-light);
  font-size: 0.9rem;
}
.changelog-section + .changelog-section {
  margin-top: 0.75rem;
}
.changelog-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.changelog-items {
  margin: 0;
  padding-left: 1.2rem;
}
.changelog-items li + li {
  margin-top: 0.25rem;
}
.weekly-summary-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 19, 28, 0.45);
}
.weekly-summary-dialog {
  width: min(100%, 720px);
  max-height: min(85vh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
}
.weekly-summary-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.weekly-summary-dialog-header h2 {
  margin: 0;
  font-size: 1.35rem;
}
.weekly-summary-dialog-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-light);
  font-size: 0.9rem;
}
.weekly-summary-dialog-body {
  overflow: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.weekly-summary-hint,
.weekly-summary-empty {
  margin: 0;
  color: var(--text-light);
}
.weekly-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.weekly-summary-item label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.weekly-summary-item label:hover {
  border-color: var(--primary-light);
  background: var(--bg-light);
}
.weekly-summary-item input {
  margin-top: 0.2rem;
}
.weekly-summary-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.weekly-summary-item-title {
  font-weight: 600;
}
.weekly-summary-item-meta {
  color: var(--text-light);
  font-size: 0.9rem;
}
.weekly-summary-preview h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.weekly-summary-markdown {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}
.weekly-summary-dialog-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.weekly-summary-dialog-message {
  margin: 0;
  min-height: 1.25rem;
}
.weekly-summary-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.changelog-empty {
  margin: 0;
  color: var(--text-light);
}

/* --------------------------------------------------------------- Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

/* --------------------------------------------------------------- Profile */
.profile-card {
  max-width: 700px;
  margin: 2rem auto;
}
.profile-field {
  display: flex;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bg-dark);
}
.profile-field dt {
  font-weight: 600;
  min-width: 200px;
  color: var(--text-light);
}
.profile-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.profile-review-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-review-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 19, 28, 0.45);
}

.profile-review-dialog {
  width: min(100%, 520px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.profile-review-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-review-dialog-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.profile-review-dialog-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.profile-registrations {
  max-width: 920px;
  margin: 0 auto 2rem;
  padding-top: 0.5rem;
}

.profile-registrations-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-registrations-header h1,
.profile-registrations-header h2 {
  margin: 0 0 0.35rem;
}

.profile-registrations-header p {
  margin: 0;
  color: var(--text-light);
}

.profile-registration-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  color: var(--text-light);
  font-size: 0.9rem;
}

.profile-registration-summary span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}

.profile-registration-group {
  margin-top: 1.25rem;
}

.profile-registration-group h2,
.profile-registration-group h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.profile-registration-list {
  display: grid;
  gap: 0.75rem;
}

.profile-registration-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(14, 47, 68, 0.06);
}

.profile-registration-item--past {
  background: #f8fafb;
}

.profile-registration-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.profile-registration-title-row h3,
.profile-registration-title-row h4 {
  margin: 0;
  font-size: 1rem;
}

.profile-registration-title-row a {
  color: var(--primary-dark);
  text-decoration: none;
}

.profile-registration-title-row a:hover {
  text-decoration: underline;
}

.profile-registration-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.profile-registration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.profile-registration-empty {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-light);
  background: #f8fafb;
}

/* ----------------------------------------------------------- Notifications */
.notifications-page {
  max-width: 920px;
  margin: 0 auto;
}

.notifications-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.notifications-header .section-title {
  margin-bottom: 0.35rem;
}

.notifications-subtitle {
  color: var(--text-light);
  max-width: 42rem;
}

.notifications-header-actions,
.notification-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.notifications-header-actions {
  justify-content: flex-end;
}

.notifications-filters {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.notifications-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.notifications-list {
  display: grid;
  gap: 0.75rem;
}

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.notification-item.is-unread {
  border-color: var(--primary-light);
  background: #f7fbfe;
  box-shadow: inset 3px 0 0 var(--primary);
}

.notification-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
  color: var(--text-light);
  font-size: 0.82rem;
}

.notification-kind,
.notification-state {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.notification-kind {
  background: var(--primary-pale);
  color: var(--primary);
}

.notification-state {
  background: var(--bg-dark);
  color: var(--text-light);
}

.notification-item.is-unread .notification-state {
  background: #fde8e8;
  color: var(--error);
}

.notification-item h2 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.notification-item p {
  color: var(--text-light);
}

.notification-actions {
  align-content: flex-start;
  justify-content: flex-end;
  min-width: 9rem;
}

.notifications-empty {
  padding: 2rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-light);
  text-align: center;
}

.notifications-pagination {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

/* ----------------------------------------------------------------- Admin */
.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
}
.admin-tab {
  padding: 0.6rem 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.admin-tab:hover {
  color: var(--text);
}
.admin-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.admin-toolbar--split {
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.admin-activity-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.admin-sort-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 10rem;
}

.admin-sort-picker label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

.admin-sort-picker select {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.admin-debug-subtabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.admin-debug-subtab {
  padding: 0.45rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.admin-debug-subtab:hover {
  color: var(--text);
}

.admin-debug-subtab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-env-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.admin-env-toolbar .form-group {
  flex: 1 1 16rem;
  margin: 0;
}

.admin-env-table .env-value--sensitive {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-light);
}

.admin-debug-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.debug-email-filter {
  min-width: 0;
}

.admin-debug-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
}

.diagnostics-panel {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.diagnostics-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.diagnostics-header h2 {
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.diagnostics-version {
  display: grid;
  gap: 0.25rem;
  color: var(--text-light);
  font-size: 0.88rem;
  text-align: right;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.usage-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.usage-header h2 {
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.usage-period-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.usage-report-hint {
  margin: 0 0 1rem;
}

.usage-report-status {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  background: var(--primary-pale);
  color: var(--primary-dark);
  font-size: 0.92rem;
}

.usage-report-status--ok {
  background: #e8f6ec;
  color: #1f7a38;
}

.usage-report-status--error {
  background: #fdeceb;
  color: #a1281f;
}

.usage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.usage-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.usage-card h3 {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.usage-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.usage-card-detail {
  color: var(--text-light);
  font-size: 0.85rem;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.usage-grid--top-content {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.usage-panel {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.usage-panel h3 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.usage-line-chart {
  width: 100%;
  overflow-x: auto;
}

.usage-line-chart svg {
  display: block;
  width: 100%;
  min-width: 280px;
  height: auto;
}

.usage-line-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.usage-line-axis {
  stroke: var(--text-light);
  stroke-width: 1.5;
}

.usage-line-x-label,
.usage-line-y-label {
  fill: var(--text-light);
  font-size: 11px;
}

.usage-line-dot {
  stroke: var(--bg);
  stroke-width: 1.5;
}

.usage-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

.usage-line-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.usage-line-legend-swatch {
  width: 0.85rem;
  height: 0.2rem;
  border-radius: 999px;
}

.usage-top-table td:first-child {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostic-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.85rem;
  min-width: 0;
}

.diagnostic-card--warn {
  border-left-color: #d97706;
}

.diagnostic-card--error {
  border-left-color: #dc2626;
}

.diagnostic-card__title {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.diagnostic-card__value {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  overflow-wrap: anywhere;
}

.diagnostic-card__meta {
  display: grid;
  gap: 0.2rem;
  color: var(--text-light);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.diagnostics-events {
  margin-top: 1rem;
}

.diagnostics-events summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.diagnostics-events-table {
  min-width: 760px;
}

.debug-table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.admin-table th,
.admin-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}
.admin-sort-button:hover {
  color: var(--primary);
}
.admin-sort-button:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: 4px;
}
.admin-sort-indicator {
  position: relative;
  width: 0.55rem;
  height: 0.85rem;
  flex: 0 0 0.55rem;
  color: currentColor;
  opacity: 0.45;
}
.admin-sort-indicator::before,
.admin-sort-indicator::after {
  content: "";
  position: absolute;
  left: 0.05rem;
  border-left: 0.23rem solid transparent;
  border-right: 0.23rem solid transparent;
}
.admin-sort-indicator::before {
  top: 0.04rem;
  border-bottom: 0.32rem solid currentColor;
}
.admin-sort-indicator::after {
  bottom: 0.04rem;
  border-top: 0.32rem solid currentColor;
}
.admin-table th[aria-sort="ascending"] .admin-sort-indicator,
.admin-table th[aria-sort="descending"] .admin-sort-indicator {
  opacity: 1;
}
.admin-table th[aria-sort="ascending"] .admin-sort-indicator::after {
  opacity: 0.2;
}
.admin-table th[aria-sort="descending"] .admin-sort-indicator::before {
  opacity: 0.2;
}
.admin-table tbody tr:hover {
  background: var(--bg-light);
}
.admin-table tbody tr.admin-row--needs-action,
.admin-activity-card.admin-row--needs-action {
  background: #fff8e5;
  box-shadow: inset 4px 0 0 #d99b00;
}
.admin-table tbody tr.admin-row--needs-action:hover,
.admin-activity-card.admin-row--needs-action:hover {
  background: #fff1c2;
}

.admin-actions--aligned {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: stretch;
  min-width: 12rem;
}

.admin-actions--aligned > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  min-width: 8.25rem;
  padding: 0.35rem 0.7rem;
  box-sizing: border-box;
  white-space: nowrap;
}

.admin-activity-layout--cards {
  display: grid;
  gap: 1rem;
}

.admin-activity-card {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.admin-activity-card__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
}

.admin-activity-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
  align-items: center;
}

.admin-activity-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-light);
  color: var(--text-light);
  font-size: 0.82rem;
  line-height: 1.3;
}

.admin-activity-chip--featured {
  background: #fff4d6;
  color: #7a5b00;
}

.admin-activity-card__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem 1rem;
}

.admin-activity-meta-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-light);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.admin-activity-card__actions {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.debug-history-table {
  min-width: 1080px;
}

.debug-history-empty {
  text-align: center;
  color: var(--text-light);
  padding: 1.5rem 0.5rem;
}

.debug-resource-cell,
.debug-actor-cell,
.debug-details-cell {
  display: grid;
  gap: 0.2rem;
}

.debug-resource-cell strong,
.debug-actor-cell strong {
  color: var(--text);
}

.debug-resource-cell span,
.debug-actor-cell span,
.debug-details-cell span,
.debug-when-cell,
.debug-muted {
  color: var(--text-light);
  font-size: 0.88rem;
}

.debug-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.debug-pagination-label {
  color: var(--text-light);
  font-size: 0.95rem;
}

.debug-pagination-actions {
  display: flex;
  gap: 0.5rem;
}

.debug-pagination-actions .btn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.admin-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}
.admin-table tr.is-inactive td {
  color: var(--text-muted, #667085);
}
.status-active {
  background: #d4edda;
  color: #155724;
}
.status-disabled {
  background: #fde8e8;
  color: #922b21;
}
.admin-action-required-badge {
  display: inline-block;
  width: fit-content;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: #fdf2e9;
  color: #7d6608;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
}
.status-draft {
  background: #fff3cd;
  color: #856404;
}
.status-published {
  background: #d4edda;
  color: #155724;
}
.status-created,
.status-updated,
.status-role_updated,
.status-account_enabled,
.status-approved,
.status-ai_usage_succeeded,
.status-internal,
.status-registered {
  background: #d4edda;
  color: #155724;
}
.status-deleted,
.status-account_disabled,
.status-ai_usage_failed,
.status-rejected {
  background: #fde8e8;
  color: #922b21;
}
.status-waitlisted,
.status-pending {
  background: #fff3cd;
  color: #856404;
}
.status-declined {
  background: #fde8e8;
  color: #922b21;
}

.role-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 500;
}
.role-user {
  background: var(--bg-dark);
  color: var(--text);
}
.role-admin {
  background: #e8daef;
  color: #6c3483;
}
.role-superadmin {
  background: #f9e79f;
  color: #7d6608;
}
.role-pi {
  background: #d4efdf;
  color: #1e8449;
}
.role-event_officer {
  background: #e8f6f3;
  color: #117864;
}
.role-communications {
  background: #d6eaf8;
  color: #2471a3;
}
.role-staff {
  background: #fdf2e9;
  color: #b9770e;
}
.role-guest {
  background: #ebf5fb;
  color: #21618c;
}
.role-delegated {
  background: #fef9e7;
  color: #7d6608;
}
.status-rejected,
.status-expired {
  background: #f5b7b1;
  color: #922b21;
}
.status-approved {
  background: #d4efdf;
  color: #1e8449;
}
.status-pending {
  background: #fcf3cf;
  color: #7d6608;
}
.status-waitlisted,
.status-external {
  background: #ebf5fb;
  color: #1f618d;
}
.status-declined {
  background: #fde8e8;
  color: #922b21;
}
.status-curated {
  background: #f4ecf7;
  color: #6c3483;
}
.status-private {
  background: #eaecee;
  color: #566573;
}
.status-no-registration {
  background: var(--bg-dark);
  color: var(--text-light);
}
.status-registration-closed {
  background: #fde8e8;
  color: #922b21;
}
.status-room-booked {
  background: #d4efdf;
  color: #1e8449;
}
.status-room-pending {
  background: #fcf3cf;
  color: #7d6608;
}
.room-booking-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  max-width: 18rem;
  color: #922b21;
  font-size: 0.86rem;
  line-height: 1.35;
}
.room-booking-warning-icon {
  flex: 0 0 auto;
}
.registration-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.registration-table {
  background: var(--bg);
}
.registration-promotion-history {
  margin-top: 1.5rem;
}
.registration-promotion-history h4 {
  margin: 0 0 0.75rem;
}
.account-type {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 500;
}
.account-type-sso {
  background: #ebf5fb;
  color: #1f618d;
  border: 1px solid #aed6f1;
}
.account-type-public {
  background: #f4ecf7;
  color: #6c3483;
  border: 1px solid #d2b4de;
}
.account-type-guest {
  background: #ebf5fb;
  color: #21618c;
  border: 1px solid #aed6f1;
}
.alert-warning {
  background: #fdf2e9;
  color: #7d6608;
  border: 1px solid #f5b041;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}
.alert-info {
  background: #ebf5fb;
  color: #1f618d;
  border: 1px solid #aed6f1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}
.alert-info p {
  margin: 0 0 0.5rem;
}
.alert-info p:last-child {
  margin-bottom: 0;
}

.role-select {
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
}

.admin-form-panel {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-form-panel h3 {
  margin-bottom: 1rem;
}
.admin-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.superadmin-field-list {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.superadmin-field-list .status-badge {
  background: var(--bg-light);
  color: var(--text-light);
  border: 1px solid var(--border);
}

.superadmin-json-editor {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.platform-controls-panel {
  background: #fdf2e9;
  border: 1px solid #f5b041;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.platform-controls-header h2 {
  margin: 0 0 0.35rem;
}

.platform-controls-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.platform-control-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.platform-control-card p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.platform-control-card--stopped {
  border-color: #e74c3c;
  background: #fdedec;
}

.platform-control-card .btn {
  align-self: flex-start;
}

.email-burst-panel {
  margin-bottom: 1.25rem;
}

.email-burst-panel--frozen {
  background: #fdedec;
  border-color: #e74c3c;
}

.email-burst-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-top: 0.85rem;
}

.email-burst-threshold {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) auto;
  gap: 0.4rem 0.6rem;
  align-items: center;
}

.email-burst-threshold label {
  grid-column: 1 / -1;
  color: var(--text-light);
  font-size: 0.82rem;
}

.email-burst-threshold input {
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
}

.lightweight-register-card,
.research-profile-form-card {
  max-width: 760px;
  margin: 2rem auto;
}

.research-profile-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.research-profile-card .field-help {
  margin-top: 0.65rem;
}

.register-intro,
.research-profile-intro {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.profile-heading-row,
.profile-badges,
.research-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-heading-row {
  justify-content: space-between;
}

.account-type-research {
  background: #e8f7f0;
  color: #176b4d;
  border: 1px solid #9ad7bd;
}

.research-profile-card,
.research-project-explanation,
.content-api-key-card,
.mcp-api-key-card {
  margin-top: 2rem;
  padding: 1.25rem;
  border: 1px solid #9ad7bd;
  border-radius: var(--radius);
  background: #f3fbf7;
}

.research-profile-card h2,
.research-project-explanation h2,
.content-api-key-card h2,
.mcp-api-key-card h2 {
  margin-top: 0;
}

.content-api-key-card {
  border-color: #c5d4e8;
  background: #f6f9fc;
}

.mcp-api-key-card {
  margin-top: 2rem;
  border-color: #c5d4e8;
  background: #f6f9fc;
}

.mcp-api-key-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.mcp-api-key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem;
  border: 1px solid #d9e2ef;
  border-radius: var(--radius);
  background: #fff;
}

.mcp-api-key-form {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #d9e2ef;
}

.mcp-client-config {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.75rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
}

.content-api-key-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0 1rem;
}

.content-api-key-value {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
}

.research-hero {
  margin-bottom: 2.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eefaf5, #eef5ff);
  border: 1px solid #b9d8ce;
}

.research-hero h1 {
  margin-top: 0.75rem;
}

.research-landing > h2 {
  margin-top: 2rem;
}

.communication-language-fieldset {
  border: 0;
  padding: 0;
}

/* ------------------------------------------------- Quill editor overrides */
.ql-container {
  min-height: 200px;
  font-size: 1rem;
  font-family: inherit;
}
.ql-editor {
  min-height: 200px;
}
.admin-form-panel .ql-toolbar {
  border-radius: var(--radius) var(--radius) 0 0;
  border-color: var(--border);
}
.admin-form-panel .ql-container {
  border-radius: 0 0 var(--radius) var(--radius);
  border-color: var(--border);
}
.ql-editor img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.blog-activity-insert-toolbar {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.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;
}

.blog-activity-insert-toolbar__activity {
  flex: 1 1 20rem;
  min-width: 0;
}

.blog-activity-insert-toolbar__placement {
  flex: 0 1 11rem;
}

.form-group .blog-activity-insert-toolbar__qrcode {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.45rem;
  padding: 0 0.25rem;
  margin-bottom: 0;
  white-space: nowrap;
  cursor: pointer;
}

.form-group .blog-activity-insert-toolbar__qrcode input {
  width: auto;
  padding: 0;
  margin: 0;
}

.blog-activity-insert-toolbar .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ql-editor .ql-align-right,
.rich-content .ql-align-right {
  text-align: right;
}

.ql-editor img[src*="/qrcode.png"],
.rich-content img[src*="/qrcode.png"] {
  width: 220px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
}

/* --------------------------------------------------- Rich content display */
.rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.rich-content h1,
.rich-content h2,
.rich-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.rich-content p {
  margin-bottom: 0.8rem;
  line-height: 1.7;
}
.rich-content blockquote {
  border-left: 4px solid var(--primary-light);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-light);
}
.rich-content pre {
  background: var(--bg-light);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
}
.rich-content ul,
.rich-content ol {
  margin-left: 1.5rem;
  margin-bottom: 0.8rem;
}

.activity-participant-content {
  margin-top: 2rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--bg-light);
}

.activity-participant-content h2 {
  margin-top: 0;
}

@media (max-width: 960px) {
  .approval-diff__header-row,
  .approval-diff__row {
    grid-template-columns: 1fr;
  }

  .approval-diff__header-row {
    display: none;
  }

  .approval-diff__field-label {
    margin-bottom: 0.4rem;
  }
}

/* ------------------------------------------------------------ Responsive */
@media (max-width: 1100px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 6rem;
    left: 0;
    right: 0;
    z-index: 110;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
    max-height: calc(100dvh - 6rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-auth {
    margin-left: 0;
    flex-direction: column;
    width: 100%;
  }
  .nav-account-menu,
  .nav-account-dropdown {
    width: 100%;
  }
  .nav-account-toggle {
    display: none;
  }
  .nav-account-dropdown,
  .nav-account-menu.open .nav-account-dropdown {
    display: flex;
    position: static;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .nav-account-dropdown .nav-link {
    justify-content: center;
  }
  .language-switcher,
  #language-switcher-slot {
    width: 100%;
  }
  .language-switcher__button {
    flex: 1;
  }
}

@media (max-width: 768px) {
  body {
    overflow-x: clip;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #app.container {
    padding-left: 0;
    padding-right: 0;
  }

  #app.container > .section {
    padding: 3rem 1rem;
  }

  #app.container > .loading {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #app.container > .form-card {
    margin: 1.5rem 1rem;
    max-width: none;
  }

  .section-title {
    font-size: 1.85rem;
    margin-bottom: 1.25rem;
  }

  .nav-brand__logo {
    height: 40px;
    width: calc(40px * 1450.200711 / 398.90661);
    max-width: 220px;
  }
  .nav-brand__divider {
    height: 30px;
  }
  .nav-brand__cpai-logo {
    height: 34px;
    max-width: 102px;
  }
  .hero {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    padding: 3.5rem 1.25rem;
  }
  .section--activities-band,
  .section--news-band {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    padding: 3rem 1.25rem;
  }
  .card-event-top {
    flex-direction: column;
  }
  .card-event-date {
    width: 100%;
    border-radius: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
    min-width: 0;
  }
  .card-event-date__time {
    margin-top: 0;
    width: 100%;
  }
  .hero h1 {
    font-size: clamp(2rem, 6.5vw, 3rem);
  }
  .hero p {
    font-size: 1rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn {
    width: 100%;
  }

  .card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .filter-btn {
    flex: 0 0 auto;
  }

  .activity-filter-panel {
    grid-template-columns: 1fr;
  }

  .filter-help-bubble {
    width: min(16rem, calc(100vw - 2.5rem));
  }

  .activity-detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .activity-detail-actions .btn {
    width: 100%;
  }

  .activity-interaction-form .btn,
  .activity-inline-reply-form .btn {
    width: 100%;
  }

  .activity-interaction-children {
    padding-left: 0.75rem;
  }

  .activity-auth-actions {
    width: 100%;
  }

  .activity-entry-auth .activity-auth-actions .btn {
    flex: 1 1 0;
  }

  .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .admin-tab {
    flex: 0 0 auto;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .footer {
    padding: 2.5rem 0 1.25rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .birthdate-grid {
    grid-template-columns: 1fr;
  }
  .phone-field-grid {
    grid-template-columns: 1fr;
  }
  .datetime-field-grid {
    grid-template-columns: 1fr;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .profile-field {
    flex-direction: column;
  }
  .profile-field dt {
    min-width: auto;
    margin-bottom: 0.25rem;
  }
  .profile-registrations-header,
  .profile-registration-item {
    grid-template-columns: 1fr;
  }
  .profile-registrations-header {
    flex-direction: column;
  }
  .profile-registration-summary,
  .profile-registration-actions {
    justify-content: flex-start;
  }
  .admin-debug-toolbar {
    grid-template-columns: 1fr;
  }
  .diagnostics-header {
    flex-direction: column;
  }
  .diagnostics-version {
    text-align: left;
  }
  .notifications-header,
  .notification-item {
    grid-template-columns: 1fr;
  }
  .notifications-header {
    display: grid;
  }
  .notifications-header-actions,
  .notification-actions {
    justify-content: flex-start;
  }
  .debug-pagination {
    flex-direction: column;
    align-items: stretch;
  }
  .debug-pagination-actions {
    justify-content: space-between;
  }
}

/* --------------------------------------------------------------- Newsletter */
.newsletter-panel {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.newsletter-panel h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}
.newsletter-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.newsletter-stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.newsletter-stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.newsletter-stat-value {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}
.newsletter-stat-sub {
  font-size: 0.8rem;
  color: var(--text-light);
}
.newsletter-form .form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.newsletter-form .form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}
.newsletter-form input,
.newsletter-form select,
.newsletter-form textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--bg);
  font: inherit;
}
.newsletter-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.newsletter-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.newsletter-template-grid--dialog {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.newsletter-template-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.55rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.newsletter-template-card:hover,
.newsletter-template-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 147, 208, 0.15);
}
.newsletter-template-thumb {
  position: relative;
  height: 132px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
}
.newsletter-template-preview-scaler {
  transform: scale(0.24);
  transform-origin: top left;
  width: 420%;
  pointer-events: none;
}
.newsletter-template-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.newsletter-template-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
}
.newsletter-template-description {
  color: var(--text-light);
  font-size: 0.78rem;
  line-height: 1.35;
}
.newsletter-template-loading {
  color: var(--text-light);
  font-size: 0.9rem;
}
.newsletter-hint {
  font-size: 0.85rem;
  color: var(--text-light);
}
.newsletter-hint code {
  background: var(--bg-dark);
  padding: 0 0.25rem;
  border-radius: 4px;
}
.newsletter-empty {
  color: var(--text-light);
  font-style: italic;
}
.newsletter-job-card {
  margin-top: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.newsletter-job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.newsletter-job-title {
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.newsletter-job-stage {
  color: var(--text-light);
  font-size: 0.9rem;
}
.newsletter-progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.newsletter-progress-row progress {
  width: 100%;
  height: 0.75rem;
  accent-color: var(--primary);
}
.newsletter-job-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.newsletter-agent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.newsletter-agent-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  background: var(--bg-light);
}
.newsletter-agent-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.newsletter-agent-label {
  font-weight: 500;
}
.newsletter-agent-meta {
  margin-top: 0.25rem;
  color: var(--text-light);
  font-size: 0.8rem;
}
.newsletter-agent-empty {
  color: var(--text-light);
  font-style: italic;
}

.news-import-ai-hint {
  margin-left: 0.75rem;
  font-size: 0.85rem;
}

.news-import-browser,
.news-import-progress {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.news-import-browser-header,
.news-import-progress-header,
.news-import-queue-main,
.news-import-browser-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.news-import-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  max-height: 28rem;
  overflow: auto;
}

.news-import-row {
  display: grid;
  grid-template-columns: auto 88px 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.news-import-thumb,
.news-import-thumb-placeholder {
  width: 88px;
  height: 66px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border);
}

.news-import-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-import-meta p {
  margin: 0.35rem 0 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.news-import-meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.news-import-theme-badges,
.news-theme-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.news-theme-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--primary-100);
  color: var(--primary-dark);
}

.news-theme-badge.theme-research {
  background: var(--primary);
  color: var(--text-white);
}

.news-theme-badge.theme-institute {
  background: var(--text);
  color: var(--text-white);
}

.news-theme-badge.theme-education {
  background: #e8f7ef;
  color: #1f6b45;
}

.news-theme-badge.theme-tech {
  background: var(--secondary);
  color: var(--text-white);
}

.news-theme-badge.theme-events {
  background: var(--secondary-100);
  color: var(--primary);
}

.news-import-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.news-import-status-stepper {
  margin: 0.85rem 0 0.5rem;
  overflow-x: auto;
}

.news-import-status-steps {
  --step-node-size: 1.75rem;
  --step-line-height: 0.28rem;
  --step-done: #2ecc71;
  --step-current: #3498db;
  --step-upcoming: #d5d8dc;
  --step-upcoming-text: #95a5a6;
  --step-failed: #c0392b;
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 28rem;
}

.news-import-status-step {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
  min-width: 0;
  z-index: 1;
}

/* Connector line between this node and the next one */
.news-import-status-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--step-node-size) / 2 - var(--step-line-height) / 2);
  left: calc(50% + var(--step-node-size) / 2);
  width: calc(100% - var(--step-node-size));
  height: var(--step-line-height);
  background: var(--step-upcoming);
  border-radius: 999px;
  z-index: 0;
}

.news-import-status-step.is-done:not(:last-child)::after {
  background: var(--step-done);
}

.news-import-status-stepper.is-succeeded
  .news-import-status-step:not(:last-child)::after {
  background: var(--step-done);
}

.news-import-status-node {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--step-node-size);
  height: var(--step-node-size);
  border-radius: 50%;
  background: var(--step-upcoming);
  color: #7f8c8d;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.news-import-status-label {
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--step-upcoming-text);
  word-break: break-word;
  max-width: 6.5rem;
}

.news-import-status-step.is-done .news-import-status-node {
  background: var(--step-done);
  color: #fff;
}

.news-import-status-step.is-done .news-import-status-label {
  color: var(--step-done);
  font-weight: 600;
}

.news-import-status-step.is-current .news-import-status-node {
  background: var(--step-current);
  color: #fff;
}

.news-import-status-step.is-current .news-import-status-label {
  color: var(--step-current);
  font-weight: 700;
}

.news-import-status-step.is-failed .news-import-status-node {
  background: var(--step-failed);
  color: #fff;
}

.news-import-status-step.is-failed .news-import-status-label {
  color: var(--step-failed);
  font-weight: 700;
}

.news-import-queue {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-import-queue-item {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.news-import-queue-item .news-import-status-steps {
  --step-node-size: 1.55rem;
  min-width: 26rem;
}

.news-import-queue-item .news-import-status-node {
  font-size: 0.7rem;
}

.news-import-feedback {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.newsletter-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 19, 28, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}
.newsletter-dialog {
  background: var(--bg);
  border-radius: var(--radius-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: min(1200px, 96vw);
  max-width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.newsletter-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.newsletter-dialog-header h2 {
  margin-bottom: 0.25rem;
  font-size: 1.2rem;
}
.newsletter-dialog-meta {
  font-size: 0.85rem;
  color: var(--text-light);
}
.newsletter-dialog-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.newsletter-dialog--sections .newsletter-dialog-body {
  max-height: calc(92vh - 180px);
  overflow: hidden;
}
.newsletter-editor-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 1rem;
  min-height: 520px;
}
.newsletter-sections-panel {
  overflow: auto;
  padding-right: 0.35rem;
}
.newsletter-preview-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-dark);
}
.newsletter-preview-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.newsletter-preview-hint {
  color: var(--text-light);
  font-size: 0.82rem;
}
.newsletter-preview-frame {
  flex: 1;
  width: 100%;
  min-height: 460px;
  border: 0;
  background: #eef2f7;
}
.newsletter-section-block {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.newsletter-section-block:last-child {
  border-bottom: 0;
}
.newsletter-section-header label {
  font-weight: 600;
}
.newsletter-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.newsletter-section-include {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
}
.newsletter-section-block--disabled {
  opacity: 0.65;
}
.newsletter-section-block--disabled .newsletter-section-field {
  pointer-events: none;
}
.newsletter-editor--disabled {
  opacity: 0.5;
}
.newsletter-dialog--readonly .newsletter-title-input,
.newsletter-dialog--readonly select,
.newsletter-dialog--readonly .newsletter-section-include {
  pointer-events: none;
  opacity: 0.85;
}
.newsletter-dialog--readonly .newsletter-section-block {
  opacity: 0.9;
}
.newsletter-dialog--readonly .newsletter-section-field {
  pointer-events: none;
}
.newsletter-section-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}
.newsletter-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
}
.newsletter-heading-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--bg);
  font: inherit;
}
.newsletter-title-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--bg);
  font: inherit;
}
.newsletter-editor .ql-toolbar,
.newsletter-editor .ql-container {
  border-color: var(--border);
}
.newsletter-editor .ql-container {
  background: var(--bg-light);
  min-height: 280px;
}
.newsletter-editor .ql-editor {
  min-height: 280px;
  font-size: 0.95rem;
  line-height: 1.6;
}
.newsletter-dialog-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.newsletter-dialog-message {
  min-height: 1.5rem;
}
.newsletter-regenerate summary {
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.newsletter-regenerate textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--bg);
  font: inherit;
  margin-bottom: 0.5rem;
  resize: vertical;
}
.newsletter-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.email-request-preview {
  max-width: min(56rem, 72vw);
  max-height: 18rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.email-workflow-recipients {
  margin-bottom: 1rem;
}

.email-workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem;
}

.email-workflow-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: var(--bg);
}

.email-workflow-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.email-workflow-panel p {
  margin: 0.35rem 0;
}

.workflow-default-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.workflow-default-editor label {
  grid-column: 1 / -1;
  color: var(--text-light);
  font-size: 0.82rem;
}

.workflow-default-editor input {
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
}

.email-workflow-candidates {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.email-workflow-candidates li {
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.email-workflow-blocked {
  color: var(--error);
}

.email-destination-editor {
  display: grid;
  grid-template-columns: auto minmax(12rem, 1fr);
  gap: 0.4rem 0.6rem;
  align-items: center;
  min-width: 18rem;
}

.email-destination-editor label {
  color: var(--text-light);
  font-size: 0.8rem;
}

.email-destination-editor input {
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--bg);
  font: inherit;
  font-size: 0.85rem;
}

.email-destination-editor button {
  grid-column: 2;
  justify-self: start;
}

@media (max-width: 768px) {
  .newsletter-form .form-row {
    grid-template-columns: 1fr;
  }

  .newsletter-editor-layout {
    grid-template-columns: 1fr;
  }

  .newsletter-preview-frame {
    min-height: 320px;
  }

  .newsletter-job-header {
    flex-direction: column;
  }

  .email-destination-editor {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .email-destination-editor button {
    grid-column: 1;
  }

  .email-workflow-grid {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------- Help center */
.help-page {
  max-width: 1040px;
  margin: 0 auto 3rem;
}

.help-hero {
  position: relative;
  overflow: hidden;
  margin: 1.5rem 0 2.75rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-panel);
  background:
    radial-gradient(
      circle at 92% 5%,
      color-mix(in srgb, var(--primary) 16%, transparent),
      transparent 30%
    ),
    linear-gradient(145deg, var(--bg) 0%, var(--primary-50) 100%);
}

.help-kicker {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.help-hero h1,
.help-article-page h1,
.help-unavailable h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.help-hero__lead,
.help-article__summary,
.help-unavailable p {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 42rem;
  margin-bottom: 1.25rem;
}

.help-search {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--primary-200);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.help-search [hidden] {
  display: none;
}

.help-search__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.help-search__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.help-search__input {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.78rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-button);
  font: inherit;
  background: var(--bg);
}

.help-search__input:focus,
.help-filter-row select:focus,
.help-page a:focus-visible,
.help-page button:focus-visible,
.help-page summary:focus-visible,
.help-article-page h1:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

.help-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.85rem;
}

.help-filter-row select {
  min-width: 12rem;
  padding: 0.45rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-button);
  font: inherit;
  background: var(--bg);
}

.help-result-count {
  margin-top: 0.75rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

.help-icon {
  display: block;
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
}

.help-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 1.1rem;
}

.help-section-heading--compact {
  margin-bottom: 1rem;
}

.help-section-heading h2 {
  color: var(--text);
  font-size: clamp(1.45rem, 3vw, 1.8rem);
  font-weight: 400;
  line-height: 1.25;
}

.help-section-heading > p {
  max-width: 26rem;
  color: var(--text-light);
  text-align: right;
}

.help-section-heading__eyebrow {
  margin-bottom: 0.25rem;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.help-journeys,
.help-categories,
.help-results,
.help-empty {
  margin-top: 2.75rem;
}

.help-journey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.1rem;
}

.help-journey {
  --help-journey-color: var(--primary);
  --help-journey-pale: var(--primary-pale);
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  border: 1px solid
    color-mix(in srgb, var(--help-journey-color) 25%, var(--border));
  border-top: 4px solid var(--help-journey-color);
  border-radius: var(--radius-media);
  background: linear-gradient(
    160deg,
    var(--bg) 45%,
    var(--help-journey-pale) 150%
  );
  box-shadow: var(--shadow);
}

.help-journey--teal {
  --help-journey-color: #138a82;
  --help-journey-pale: #e8f7f4;
}

.help-journey--violet {
  --help-journey-color: var(--secondary);
  --help-journey-pale: var(--secondary-100);
}

.help-journey--amber {
  --help-journey-color: #a7640d;
  --help-journey-pale: #fff5e5;
}

.help-journey__header {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.help-journey__icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  place-items: center;
  border-radius: var(--radius);
  background: var(--help-journey-pale);
  color: var(--help-journey-color);
}

.help-journey__icon .help-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.help-journey h3 {
  margin-bottom: 0.25rem;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.3;
}

.help-journey__header p {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.45;
}

.help-journey__steps {
  counter-reset: journey-step;
  margin: 1.15rem 0 0 1.35rem;
  padding: 0;
  list-style: none;
}

.help-journey__steps li {
  counter-increment: journey-step;
  position: relative;
  min-height: 2.25rem;
  padding: 0 0 0.8rem 1.8rem;
}

.help-journey__steps li::before {
  content: counter(journey-step);
  position: absolute;
  z-index: 1;
  top: 0.02rem;
  left: 0;
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border: 2px solid var(--help-journey-color);
  border-radius: 50%;
  background: var(--bg);
  color: var(--help-journey-color);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
}

.help-journey__steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.2rem;
  bottom: -0.05rem;
  left: 0.64rem;
  width: 2px;
  background: color-mix(in srgb, var(--help-journey-color) 30%, var(--border));
}

.help-journey__steps a {
  color: var(--primary-dark);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.help-journey__steps a:hover {
  color: var(--help-journey-color);
  text-decoration: underline;
}

.help-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.help-topic {
  align-self: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
}

.help-topic[open] {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-hover-blue);
}

.help-topic summary,
.help-all > summary {
  display: grid;
  cursor: pointer;
  list-style: none;
}

.help-topic summary {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  align-items: center;
  padding: 1rem;
}

.help-topic summary::-webkit-details-marker,
.help-all > summary::-webkit-details-marker {
  display: none;
}

.help-topic__icon {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: var(--radius-button);
  background: var(--primary-pale);
  color: var(--primary);
}

.help-topic__heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.help-topic__heading strong {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.3;
}

.help-topic__heading > span {
  overflow: hidden;
  color: var(--text-light);
  font-size: 0.8rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-topic__count,
.help-all__count {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--primary-50);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.help-topic__chevron {
  color: var(--text-light);
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.help-topic[open] .help-topic__chevron,
.help-all[open] > summary .help-topic__chevron {
  transform: rotate(180deg);
}

.help-topic__links {
  display: grid;
  gap: 0;
  margin: 0 1rem 1rem 3.2rem;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.help-topic__links li + li {
  border-top: 1px solid var(--bg-dark);
}

.help-topic__links a {
  display: block;
  padding: 0.65rem 0;
  color: var(--primary);
  font-size: 0.9rem;
  line-height: 1.35;
  text-decoration: none;
}

.help-topic__links a:hover {
  text-decoration: underline;
}

.help-all {
  margin-top: 2.25rem;
  border: 1px dashed var(--primary-200);
  border-radius: var(--radius);
  background: var(--primary-50);
}

.help-all > summary {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.25rem;
}

.help-all > summary > span:first-child {
  display: flex;
  flex-direction: column;
}

.help-all > summary strong {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
}

.help-all > summary > span:first-child > span {
  color: var(--text-light);
  font-size: 0.86rem;
}

.help-all .help-card-grid {
  padding: 0 1.2rem 1.2rem;
}

.help-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.help-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
}

.help-card:hover,
.help-card:focus-within {
  border-color: transparent;
  box-shadow: var(--shadow-hover-blue);
}

.help-card__topline {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.help-card__icon {
  color: var(--primary);
}

.help-card__icon .help-icon {
  width: 1rem;
  height: 1rem;
}

.help-card__meta {
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.help-card__title {
  font-size: 1.05rem;
  font-weight: 400;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

.help-card__title a,
.help-card__link,
.help-back a,
.help-breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
}

.help-card__title a:hover,
.help-card__link:hover,
.help-back a:hover,
.help-breadcrumbs a:hover {
  text-decoration: underline;
}

.help-card__summary {
  flex: 1;
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.help-card__link {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.help-card__link .help-icon {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.help-card__link:hover .help-icon {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .help-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
}

.help-subtitle,
.help-categories h2,
.help-results h2,
.help-empty h2 {
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.help-list {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.help-list li {
  margin-bottom: 0.45rem;
}

.help-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

.help-article-page {
  max-width: 860px;
  padding-top: 1.75rem;
}

.help-article-page > .help-kicker,
.help-article-page > h1,
.help-article-page > .help-article__summary {
  max-width: 48rem;
}

.help-screenshot {
  overflow: hidden;
  margin: 1.75rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-media);
  background: var(--bg-light);
  box-shadow: var(--shadow);
}

.help-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg);
}

.help-screenshot figcaption {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.88rem;
  line-height: 1.45;
}

.help-guide-steps {
  margin-top: 2rem;
}

.help-stepper {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.help-stepper > li {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0.9rem;
  padding-bottom: 0.8rem;
}

.help-stepper > li:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 2.45rem;
  bottom: -0.1rem;
  left: 1.32rem;
  width: 2px;
  background: linear-gradient(var(--primary-light), var(--primary-100));
}

.help-stepper__number {
  position: relative;
  z-index: 1;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 3px solid var(--primary-100);
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 0 0 4px var(--bg);
}

.help-stepper__body {
  min-height: 3.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(115deg, var(--bg) 65%, var(--primary-50) 100%);
  box-shadow: var(--shadow);
}

.help-stepper__body p {
  line-height: 1.5;
}

.help-prerequisites,
.help-notes {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--primary-200);
  border-radius: var(--radius);
  background: var(--primary-pale);
}

.help-prerequisites {
  margin-bottom: 1.75rem;
  border-color: var(--border);
  background: var(--bg-light);
}

.help-prerequisites__icon,
.help-notes__icon {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--primary);
}

.help-prerequisites .help-subtitle,
.help-notes .help-subtitle {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.help-prerequisites .help-list,
.help-notes .help-list {
  margin-top: 0.25rem;
}

.help-workflow {
  margin-top: 2rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--secondary-100);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--bg), var(--secondary-100));
}

.help-workflow figcaption {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.help-workflow__icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  place-items: center;
  border-radius: var(--radius);
  background: var(--secondary-100);
  color: var(--primary);
}

.help-workflow figcaption .help-subtitle {
  margin-bottom: 0.25rem;
}

.help-workflow figcaption p {
  max-width: 43rem;
  color: var(--text-light);
  font-size: 0.92rem;
}

.help-workflow__paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.2rem;
}

.help-workflow__path {
  padding: 1rem;
  border: 1px solid var(--primary-200);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.help-workflow__path h3 {
  min-height: 2.65rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.help-workflow__path ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-workflow__path li {
  position: relative;
  min-height: 2.1rem;
  padding: 0 0 0.65rem 1.65rem;
  color: var(--text-light);
  font-size: 0.82rem;
  line-height: 1.35;
}

.help-workflow__path li::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0.18rem;
  left: 0;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--bg);
}

.help-workflow__path li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0.85rem;
  bottom: -0.1rem;
  left: 0.34rem;
  width: 2px;
  background: var(--primary-200);
}

.help-workflow__path li:last-child::before {
  border-color: var(--success);
  background: var(--success);
  box-shadow: inset 0 0 0 2px var(--bg);
}

.help-next,
.help-ctas,
.help-related {
  margin-top: 2rem;
}

.help-next-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.help-next-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-light);
}

.help-next-card__icon {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary);
}

.help-next-card__icon .help-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.help-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-related-grid a {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 0.95rem 2.4rem 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--primary-dark);
  text-decoration: none;
}

.help-related-grid a:hover {
  border-color: transparent;
  box-shadow: var(--shadow-hover-blue);
}

.help-related-card__meta {
  margin-bottom: 0.25rem;
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.help-related-grid strong {
  font-size: 0.92rem;
  line-height: 1.4;
}

.help-related-card__arrow {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  color: var(--primary);
  transform: translateY(-50%);
}

.help-related-card__arrow .help-icon {
  width: 1rem;
  height: 1rem;
}

.help-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.help-back {
  margin-top: 2rem;
}

.help-unavailable {
  max-width: 40rem;
}

/* ----------------------------------------------------------------- Help core-flow diagrams */
.help-core-flow {
  --help-flow-color: var(--primary);
  --help-flow-pale: var(--primary-pale);
  --help-flow-ink: var(--primary-dark);
  --help-flow-soft: color-mix(in srgb, var(--help-flow-color) 14%, var(--bg));
  --help-flow-line: color-mix(
    in srgb,
    var(--help-flow-color) 55%,
    var(--border)
  );
  --help-flow-mark: color-mix(in srgb, var(--help-flow-color) 72%, var(--text));
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}

.help-core-flow__panel {
  min-width: 0;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid
    color-mix(in srgb, var(--help-flow-color) 22%, var(--border));
  border-radius: var(--radius-panel);
  background:
    radial-gradient(
      circle at 100% 0%,
      color-mix(in srgb, var(--help-flow-color) 12%, transparent),
      transparent 36%
    ),
    linear-gradient(160deg, var(--bg) 40%, var(--help-flow-pale) 160%);
  box-shadow: var(--shadow);
}

.help-flow-diagram {
  --help-flow-color: var(--primary);
  --help-flow-pale: var(--primary-pale);
  --help-flow-ink: var(--primary-dark);
  --help-flow-soft: color-mix(in srgb, var(--help-flow-color) 14%, var(--bg));
  --help-flow-line: color-mix(
    in srgb,
    var(--help-flow-color) 55%,
    var(--border)
  );
  --help-flow-mark: color-mix(in srgb, var(--help-flow-color) 72%, var(--text));
  color: var(--help-flow-ink);
}

.help-flow-diagram--tone-blue,
.help-core-flow--tone-blue {
  --help-flow-color: var(--primary);
  --help-flow-pale: var(--primary-pale);
}

.help-flow-diagram--tone-teal,
.help-core-flow--tone-teal {
  --help-flow-color: #138a82;
  --help-flow-pale: #e8f7f4;
}

.help-flow-diagram--tone-violet,
.help-core-flow--tone-violet {
  --help-flow-color: var(--secondary);
  --help-flow-pale: var(--secondary-100);
}

.help-flow-diagram--tone-amber,
.help-core-flow--tone-amber {
  --help-flow-color: #a7640d;
  --help-flow-pale: #fff5e5;
}

.help-flow-diagram__header {
  margin-bottom: 1rem;
}

.help-flow-diagram__eyebrow {
  margin-bottom: 0.3rem;
  color: var(--help-flow-color);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.help-flow-diagram__title {
  margin-bottom: 0.4rem;
  color: var(--help-flow-ink);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 400;
  line-height: 1.25;
}

.help-flow-diagram__description {
  max-width: 46rem;
  color: var(--text-light);
  font-size: 1rem;
}

.help-flow-diagram__canvas {
  position: relative;
  overflow: visible;
  width: 100%;
  min-height: 440px;
  padding: 1rem 0.35rem 0.5rem;
  isolation: isolate;
  border-radius: var(--radius-media);
  background: radial-gradient(
    circle at 0% 0%,
    var(--help-flow-canvas-accent, transparent),
    transparent 42%
  );
}

.help-flow-diagram__canvas[data-step-count="1"] {
  --help-step-count: 1;
}
.help-flow-diagram__canvas[data-step-count="2"] {
  --help-step-count: 2;
}
.help-flow-diagram__canvas[data-step-count="3"] {
  --help-step-count: 3;
}
.help-flow-diagram__canvas[data-step-count="4"] {
  --help-step-count: 4;
}
.help-flow-diagram__canvas[data-step-count="5"] {
  --help-step-count: 5;
}
.help-flow-diagram__canvas[data-step-count="6"] {
  --help-step-count: 6;
}
.help-flow-diagram__canvas[data-step-count="7"] {
  --help-step-count: 7;
}
.help-flow-diagram__canvas[data-step-count="8"] {
  --help-step-count: 8;
}

.help-flow-diagram__art {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: var(--help-flow-line);
  overflow: visible;
}

.help-flow-diagram__steps {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-flow-diagram__step {
  min-width: 0;
}

.help-flow-diagram__step-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  height: 100%;
  min-width: 0;
}

.help-flow-diagram__node {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 0.65rem 0.75rem;
  align-items: start;
  min-height: 5.5rem;
  padding: 0.85rem 0.95rem;
  border: 1.5px solid
    color-mix(in srgb, var(--help-flow-color) 28%, var(--border));
  border-radius: var(--radius-media);
  background: color-mix(in srgb, var(--bg) 88%, var(--help-flow-pale));
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 0
    color-mix(in srgb, var(--help-flow-color) 10%, transparent);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.help-flow-diagram__node:hover {
  border-color: var(--help-flow-color);
  background: var(--bg);
  box-shadow: var(--shadow-hover-blue);
  transform: none;
}

.help-flow-diagram__node:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

.help-flow-diagram__step[data-optional="true"] .help-flow-diagram__node {
  border-style: dashed;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      color-mix(in srgb, var(--help-flow-color) 6%, transparent) 8px,
      color-mix(in srgb, var(--help-flow-color) 6%, transparent) 16px
    ),
    color-mix(in srgb, var(--bg) 92%, var(--help-flow-pale));
}

.help-flow-diagram__step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--help-flow-color);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--help-flow-color);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
}

.help-flow-diagram__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: var(--radius-button);
  background: var(--help-flow-pale);
  color: var(--help-flow-mark);
}

.help-flow-diagram__icon-svg {
  width: 1.25rem;
  height: 1.25rem;
}

.help-flow-diagram__node-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  grid-column: 1 / -1;
}

.help-flow-diagram__node .help-flow-diagram__step-number,
.help-flow-diagram__node .help-flow-diagram__icon {
  grid-row: 1;
}

.help-flow-diagram__node .help-flow-diagram__node-copy {
  grid-column: 1 / -1;
}

.help-flow-diagram__phase,
.help-flow-diagram__actor,
.help-flow-diagram__status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.help-flow-diagram__phase {
  border: 1px solid
    color-mix(in srgb, var(--help-flow-color) 35%, var(--border));
  background: var(--help-flow-pale);
  color: var(--help-flow-mark);
}

.help-flow-diagram__actor {
  border: 1px solid var(--border);
  background: var(--bg-light);
  color: var(--text-light);
}

.help-flow-diagram__status--optional {
  border: 1px dashed color-mix(in srgb, var(--warning) 50%, var(--border));
  background: #fff8eb;
  color: var(--warning);
}

.help-flow-diagram__node-title {
  color: var(--help-flow-ink);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.help-flow-diagram__node-description {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.help-flow-diagram__guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.35rem 0.2rem;
  color: var(--help-flow-color);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  width: fit-content;
}

.help-flow-diagram__guide-link:hover {
  color: var(--help-flow-ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.help-flow-diagram__guide-link:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: 4px;
}

.help-flow-diagram__spine-line {
  opacity: 0.7;
}

.help-flow-diagram--action-spine {
  --help-flow-canvas-accent: color-mix(
    in srgb,
    var(--help-flow-color) 12%,
    transparent
  );
}

.help-flow-diagram__art--action-spine {
  opacity: 0.88;
}

.help-flow-diagram__step-body--spine {
  width: 100%;
}

.help-flow-diagram__canvas--action-spine {
  min-height: 560px;
  padding-inline: 0.5rem;
}

.help-flow-diagram__steps--action-spine {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.help-flow-diagram__step--spine {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.5rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
}

.help-flow-diagram__step--spine .help-flow-diagram__spine-node {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 1rem;
  height: 1rem;
  border: 3px solid var(--help-flow-color);
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 0 0 5px var(--help-flow-pale);
}

.help-flow-diagram__step--spine.help-flow-diagram__step--side-left
  .help-flow-diagram__step-body {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  width: min(100%, 24rem);
}

.help-flow-diagram__step--spine.help-flow-diagram__step--side-right
  .help-flow-diagram__step-body {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  width: min(100%, 24rem);
}

.help-flow-diagram__node--spine {
  border-radius: 16px;
}

.help-flow-diagram__step--spine.help-flow-diagram__step--side-left
  .help-flow-diagram__node--spine {
  border-right: 4px solid var(--help-flow-color);
}

.help-flow-diagram__step--spine.help-flow-diagram__step--side-right
  .help-flow-diagram__node--spine {
  border-left: 4px solid var(--help-flow-color);
}

@media (prefers-reduced-motion: reduce) {
  .help-flow-diagram__node {
    transition: none;
  }

  .help-flow-diagram__node:hover {
    transform: none;
  }
}

@media (max-width: 640px) {
  .help-hero {
    margin-top: 0.75rem;
    padding: 1.25rem;
    border-radius: var(--radius-media);
  }

  .help-search__row,
  .help-filter-row,
  .help-cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .help-filter-row select,
  .help-search__input {
    width: 100%;
  }

  .help-search__input {
    flex: 0 1 auto;
  }

  .help-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
  }

  .help-section-heading > p {
    text-align: left;
  }

  .help-topic-grid,
  .help-workflow__paths {
    grid-template-columns: 1fr;
  }

  .help-topic summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .help-topic__heading > span,
  .help-topic__count {
    display: none;
  }

  .help-topic__chevron {
    grid-column: 3;
  }

  .help-topic__links {
    margin-left: 1rem;
  }

  .help-all > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .help-all__count {
    display: none;
  }

  .help-stepper > li {
    grid-template-columns: 2.35rem minmax(0, 1fr);
    gap: 0.65rem;
  }

  .help-stepper__number {
    width: 2.35rem;
    height: 2.35rem;
  }

  .help-stepper > li:not(:last-child)::after {
    top: 2.1rem;
    left: 1.12rem;
  }

  .help-workflow__path h3 {
    min-height: 0;
  }

  .help-core-flow {
    margin-top: 1.75rem;
  }

  .help-core-flow__panel {
    padding: 0.95rem;
    border-radius: var(--radius-media);
  }

  .help-flow-diagram__canvas,
  .help-flow-diagram__canvas--action-spine {
    min-height: 0;
    padding: 0.35rem 0 0.15rem;
  }

  .help-flow-diagram__art {
    display: none;
  }

  .help-flow-diagram__steps--action-spine {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
    min-height: 0;
    position: relative;
  }

  .help-flow-diagram__step--spine {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    transform: none;
    display: block;
  }

  .help-flow-diagram__step--spine .help-flow-diagram__spine-node {
    display: none;
  }

  .help-flow-diagram__step--spine.help-flow-diagram__step--side-left
    .help-flow-diagram__step-body,
  .help-flow-diagram__step--spine.help-flow-diagram__step--side-right
    .help-flow-diagram__step-body {
    width: 100%;
    justify-self: stretch;
  }

  .help-flow-diagram__step--spine.help-flow-diagram__step--side-left
    .help-flow-diagram__node--spine,
  .help-flow-diagram__step--spine.help-flow-diagram__step--side-right
    .help-flow-diagram__node--spine {
    border-left: 4px solid var(--help-flow-color);
    border-right-width: 1.5px;
    border-radius: var(--radius-media);
  }

  .help-flow-diagram__steps > .help-flow-diagram__step:not(:last-child) {
    position: relative;
    padding-bottom: 0.85rem;
  }

  .help-flow-diagram__steps > .help-flow-diagram__step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 1.05rem;
    bottom: 0;
    width: 2px;
    height: 0.85rem;
    background: var(--help-flow-line);
    border-radius: 999px;
  }

  .help-flow-diagram__node {
    min-height: 44px;
    width: 100%;
    border-radius: var(--radius-media);
  }

  .help-flow-diagram__guide-link {
    min-height: 44px;
  }
}
