/* mesh74 — editorial field-guide aesthetic */

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

:root {
  --bg: #141210;
  --surface: #1c1916;
  --surface-2: #242019;
  --line: #3a342c;
  --line-soft: #2a2620;

  --text: #e8e4dc;
  --text-muted: #9a9288;
  --text-faint: #6b645c;

  --amber: #c4a574;
  --amber-dim: #8a7350;
  --sage: #6b8f71;
  --rust: #c45c3a;
  --ink: #0e0c0a;

  --font-display: Georgia, 'Palatino Linotype', 'Book Antiqua', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', Consolas, monospace;

  --space-page: clamp(1.25rem, 4vw, 3rem);
  --max: 72rem;
  --portal-map-h: clamp(20rem, 56vh, 42rem);
  --portal-nodes-h: 2.75rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: 1.25rem;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── atmosphere ── */

.topo {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 47px,
      rgba(196, 165, 116, 0.04) 47px,
      rgba(196, 165, 116, 0.04) 48px
    ),
    repeating-radial-gradient(
      ellipse 120% 80% at 70% 20%,
      transparent 0,
      transparent 38px,
      rgba(107, 143, 113, 0.03) 39px,
      transparent 40px
    );
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg 2deg,
    rgba(255, 255, 255, 0.015) 2deg 4deg
  );
}

/* ── shell ── */

main,
.footer {
  position: relative;
  z-index: 1;
}

/* ── header ── */

.header {
  position: relative;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.125rem var(--space-page);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(20, 18, 16, 0.92);
  backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: inherit;
}

.logo__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--amber);
  border: 1px solid var(--line);
  background: var(--surface);
}

.logo__mark svg {
  width: 1.375rem;
  height: 1.375rem;
}

.logo__word {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.logo__word strong {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--text);
}

.logo__word small {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.header__meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header__tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}

.header__freq {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--sage);
  letter-spacing: 0.02em;
}

/* ── hero ── */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: stretch;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) var(--space-page) clamp(2.5rem, 6vw, 4rem);
}

.hero__copy {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.hero__eyebrow {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 11ch;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--amber);
}

.hero__lead {
  max-width: 38ch;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 0;
  flex: 1;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.hero__viz {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.hero__viz .live-panel {
  flex: 1;
}

.region-alert {
  margin: -1.1rem -1.15rem 0.85rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid rgba(196, 58, 45, 0.22);
  background:
    linear-gradient(180deg, rgba(196, 58, 45, 0.11) 0%, rgba(196, 58, 45, 0.03) 55%, transparent 100%);
}

.region-alert__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1.05rem 0.35rem;
}

.region-alert__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f0a898;
}

.region-alert__badge-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #e85a45;
  box-shadow: 0 0 0 0 rgba(232, 90, 69, 0.55);
  animation: regionAlertPulse 2.4s ease infinite;
}

@keyframes regionAlertPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(232, 90, 69, 0.45);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(232, 90, 69, 0);
  }
}

.region-alert__count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: rgba(240, 168, 152, 0.85);
  white-space: nowrap;
}

.region-alert__viewport {
  position: relative;
  min-height: 4.25rem;
  padding: 0 1.05rem;
}

.region-alert__track {
  position: relative;
}

.region-alert__slide {
  display: none;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.2rem 0 0.55rem;
}

.region-alert__slide.is-active {
  display: grid;
  animation: regionAlertIn 0.42s ease;
}

@keyframes regionAlertIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.region-alert__emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  background: rgba(196, 58, 45, 0.16);
  border: 1px solid rgba(196, 58, 45, 0.32);
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.region-alert__slide--clear .region-alert__emoji {
  background: rgba(107, 143, 113, 0.14);
  border-color: rgba(107, 143, 113, 0.32);
}

.region-alert__slide--warn .region-alert__emoji {
  background: rgba(255, 159, 26, 0.12);
  border-color: rgba(255, 159, 26, 0.32);
}

.region-alert__slide--critical .region-alert__emoji {
  background: rgba(220, 70, 50, 0.2);
  border-color: rgba(220, 70, 50, 0.45);
}

.region-alert__content {
  min-width: 0;
}

.region-alert__label {
  margin: 0 0 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f5c4ba;
}

.region-alert__slide--clear .region-alert__label {
  color: #b8d4bc;
}

.region-alert__slide--warn .region-alert__label {
  color: #ffd099;
}

.region-alert__text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.48;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.region-alert__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.15rem 1.05rem 0.5rem;
}

.region-alert__btn {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.region-alert__btn:hover {
  border-color: rgba(240, 168, 152, 0.45);
  color: #f0d0c8;
  background: rgba(196, 58, 45, 0.12);
}

.region-alert__dots {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.region-alert__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.region-alert__dot.is-active {
  width: 1.1rem;
  background: #f0a898;
}

.region-alert__progress {
  height: 2px;
  margin: 0 -1.15rem;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.region-alert__progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(196, 58, 45, 0.35), #f0a898);
  animation: regionAlertProgress 7s linear forwards;
}

@keyframes regionAlertProgress {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.live-panel {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.12)), var(--surface);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  padding: 1.1rem 1.15rem 1rem;
  overflow: hidden;
}

.live-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.live-panel__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.live-panel__title-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.live-panel__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 10px rgba(107, 143, 113, 0.45);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.live-panel__fresh {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  color: var(--sage);
  white-space: nowrap;
}

.live-panel__fresh--stale {
  color: var(--amber);
}

.live-panel__link-desc {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.live-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  margin: 0;
  padding: 0.85rem 0 0;
  border-top: 1px solid var(--line-soft);
}

.live-panel__grid--regional {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.55rem;
}

.live-panel__stat {
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
}

.live-panel__stat--ok { border-top: 2px solid var(--sage); }
.live-panel__stat--warn { border-top: 2px solid var(--amber); }
.live-panel__stat--bad { border-top: 2px solid var(--rust); }
.live-panel__stat--info { border-top: 2px solid var(--line); }

.live-panel__stat dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.15rem;
}

.live-panel__stat > dd:first-of-type {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.live-panel__hint {
  margin-top: 0.12rem;
  font-size: 0.64rem;
  line-height: 1.35;
  color: var(--text-faint);
}

.live-panel__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.live-panel__grade {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--sage);
}

.live-panel__grade--warn {
  color: var(--amber);
}

.live-panel__grade--bad {
  color: var(--rust);
}

.live-panel__gateway {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-faint);
}

.live-panel__source {
  margin: 0.65rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-faint);
  line-height: 1.4;
}

/* ── network health (premium) ── */

.portal-health {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(107, 143, 113, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(196, 165, 116, 0.05), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.12)),
    var(--surface);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}

.health-kpi-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.health-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
}

.health-kpi {
  min-width: 0;
  padding: 0.65rem 0.75rem 0.6rem;
  border: 1px solid var(--line);
  border-top: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}

.health-kpi--ok { border-top-color: var(--sage); }
.health-kpi--warn { border-top-color: var(--amber); }
.health-kpi--bad { border-top-color: var(--rust); }
.health-kpi--info { border-top-color: var(--line); }

.health-kpi__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-kpi__value {
  margin: 0.25rem 0 0;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}

.health-coverage {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-faint);
}

.health-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--line-soft);
}

.health-tabs,
.health-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.health-tab,
.health-period {
  padding: 0.38rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.health-tab:hover,
.health-period:hover {
  border-color: rgba(196, 165, 116, 0.45);
  color: var(--amber);
}

.health-tab--active,
.health-period--active {
  border-color: rgba(107, 143, 113, 0.55);
  background: rgba(107, 143, 113, 0.12);
  color: #b8d4bc;
}

.health-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}

.health-metric {
  min-width: 0;
  padding: 0.75rem 0.85rem 0.65rem;
  border: 1px solid var(--line);
  border-top: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
}

.health-metric:hover {
  border-color: rgba(196, 165, 116, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.health-metric--active {
  border-color: rgba(107, 143, 113, 0.55);
  background: rgba(107, 143, 113, 0.08);
  box-shadow: inset 0 0 0 1px rgba(107, 143, 113, 0.15);
}

.health-metric--ok { border-top-color: var(--sage); }
.health-metric--warn { border-top-color: var(--amber); }
.health-metric--bad { border-top-color: var(--rust); }
.health-metric--info { border-top-color: var(--line); }

.health-metric__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.health-metric__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.health-metric__spark {
  flex-shrink: 0;
  width: 80px;
  height: 28px;
  opacity: 0.85;
}

.health-metric__value {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 600;
  line-height: 1.1;
}

.health-metric__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem 0.45rem;
  margin: 0.45rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-faint);
}

.health-metric__meta div {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
}

.health-metric__meta dd {
  margin: 0;
  color: var(--text-muted);
}

.health-chart-panel {
  min-width: 0;
  padding: 0.85rem 1rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.health-chart-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.5rem;
}

.health-chart-panel__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.health-chart-panel__sub {
  margin: 0.15rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
}

.health-chart-panel__hint {
  margin: 0;
  max-width: 22rem;
  font-size: 0.68rem;
  color: var(--text-faint);
  line-height: 1.4;
  text-align: right;
}

.health-chart-panel__canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 200px;
}

.health-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-faint);
  line-height: 1.45;
}

.health-quality {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.health-quality__item {
  margin: 0;
  padding: 0.4rem 0.55rem;
  border-left: 2px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.health-quality__item--warn {
  border-left-color: var(--amber);
  color: var(--amber);
}

.health-quality__item--info {
  border-left-color: var(--sage);
}

.health-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.portal-block--health .section-head--row > div {
  flex: 1 1 14rem;
  min-width: 0;
}

@media (max-width: 1100px) {
  .health-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .health-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .health-kpi-strip,
  .health-metrics {
    grid-template-columns: 1fr;
  }
  .health-chart-panel__hint {
    text-align: left;
    max-width: none;
  }
}

/* ── buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 1.375rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.btn--solid {
  color: var(--ink);
  background: var(--amber);
  border: 1px solid var(--amber);
}

.btn--solid:hover {
  background: #d4b88a;
  border-color: #d4b88a;
}

.btn--line {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

.btn--line:hover {
  border-color: var(--amber-dim);
  color: var(--amber);
}

.btn__arrow {
  font-size: 0.875rem;
  transition: transform 0.2s var(--ease);
}

.btn--line:hover .btn__arrow {
  transform: translate(2px, -2px);
}

/* ── section heads ── */

.section-head {
  margin-bottom: 2rem;
}

.section-head--row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.section-head__index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--amber-dim);
  letter-spacing: 0.05em;
  padding-top: 0.35rem;
  flex-shrink: 0;
}

.section-head__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}

.section-head__note {
  margin-top: 0.4rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 42ch;
}

/* ── features (asymmetric bento) ── */

.features {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-page) clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--line-soft);
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.features__layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.feature {
  background: var(--surface);
  padding: 1.5rem 1.625rem 1.75rem;
  transition: background 0.25s var(--ease);
}

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

.feature--lead {
  grid-row: span 2;
  padding: 2rem 1.75rem;
  border-right: 1px solid var(--line-soft);
}

.feature--wide {
  grid-column: span 2;
}

.feature__glyph {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  color: var(--amber-dim);
  margin-bottom: 1rem;
  line-height: 1;
}

.feature h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.feature p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.feature--lead p {
  font-size: 1rem;
  max-width: 28ch;
}

/* ── forum hub + account cabinet ── */

.forum-hub {
  width: 100%;
}

.forum-hub__grid {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.forum-hub__topics-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.account-cabinet {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  padding: 1.1rem 1.15rem;
  min-height: 100%;
}

.account-cabinet__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-dim);
}

.account-cabinet__loading {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.account-cabinet__loading[hidden],
.account-cabinet__guest[hidden],
.account-cabinet__panel[hidden] {
  display: none !important;
}

.account-cabinet__lead {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.account-cabinet__hint {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.account-cabinet__head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.account-cabinet__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.account-cabinet__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.account-cabinet__meta {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.account-cabinet__meta a {
  color: var(--amber-dim);
  text-decoration: none;
}

.account-cabinet__meta a:hover {
  color: var(--amber);
}

.account-cabinet__logout {
  color: var(--rust) !important;
}

.account-cabinet__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.account-cabinet__stats strong {
  color: var(--amber);
  font-weight: 600;
}

.account-cabinet__block + .account-cabinet__block {
  margin-top: 0.85rem;
}

.account-cabinet__block-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.account-cabinet__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.account-cabinet__empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.account-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
}

.account-item:first-child {
  border-top: none;
}

.account-item--unread .account-item__title {
  color: var(--amber);
}

.account-item__title {
  flex: 1 1 10rem;
  font-size: 0.875rem;
  line-height: 1.35;
}

.account-item__meta {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.header__login,
.header__account {
  font-family: inherit;
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--amber-dim);
  border: 1px solid var(--line-soft);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.header__account {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 12rem;
}

.header__account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__account-avatar {
  flex-shrink: 0;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-soft);
}

.header__account-avatar[hidden] {
  display: none !important;
}

.header__account-caret {
  font-size: 0.625rem;
  opacity: 0.7;
  line-height: 1;
}

.header__login:hover,
.header__account:hover,
.header__account--open {
  color: var(--amber);
  border-color: var(--line);
}

.header__account-wrap {
  position: relative;
}

.header__account-wrap[hidden],
.header__login[hidden] {
  display: none !important;
}

body.account-popup-open {
  overflow: hidden;
}

.account-popup {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(4.5rem, 12vh, 6rem) var(--space-page) 1.5rem;
  background: rgba(8, 7, 6, 0.62);
  backdrop-filter: blur(4px);
}

.account-popup[hidden] {
  display: none !important;
}

.account-popup__dialog {
  width: min(26rem, 100%);
  max-height: calc(100vh - 6rem);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(196, 165, 116, 0.1), transparent 55%),
    linear-gradient(165deg, var(--surface-2) 0%, var(--surface) 48%, #181512 100%);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.account-popup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}

.account-popup__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.account-popup__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 0.4rem;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.account-popup__close:hover {
  color: var(--text);
  border-color: var(--line);
}

.account-cabinet--popup {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.15rem 0.5rem;
  border: none;
  background: transparent;
}

.account-cabinet--popup .account-cabinet__list {
  max-height: 7.5rem;
  overflow-y: auto;
}

.account-cabinet--popup .account-cabinet__block + .account-cabinet__block {
  margin-top: 0.85rem;
}

.account-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.85rem 1.15rem 1.15rem;
  border-top: 1px solid var(--line-soft);
}

.account-popup__actions .btn {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 8.5rem;
}

.account-popup__logout {
  color: var(--rust);
  border-color: rgba(196, 58, 45, 0.35);
}

.account-popup__logout:hover {
  color: #e8a8a0;
  border-color: rgba(196, 58, 45, 0.55);
}

.forum-page,
.cabinet-page {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) var(--space-page) clamp(4rem, 8vw, 6rem);
}

.forum-hub--solo .forum-preview__panel {
  min-height: 0;
}

.account-cabinet--page {
  max-width: 42rem;
}

.forum-preview {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-page) clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--line-soft);
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.forum-hub .forum-preview__panel {
  min-height: 100%;
}

.forum-preview .section-head--row > div {
  flex: 1;
}

.forum-preview__cta {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}

.forum-preview__panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  padding: 1.25rem 1.5rem 1rem;
}

.forum-preview--loading .forum-preview__list {
  opacity: 0.45;
}

.forum-preview__status {
  font-size: 0.9375rem;
  color: var(--text-muted);
  padding: 0.5rem 0 1rem;
}

.forum-preview__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: opacity 0.25s var(--ease);
}

.forum-topic {
  border-top: 1px solid var(--line-soft);
}

.forum-topic:first-child {
  border-top: none;
}

.forum-topic__link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.875rem 0;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s var(--ease);
}

.forum-topic__link:hover .forum-topic__title {
  color: var(--amber);
}

.forum-topic__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1 1 12rem;
}

.forum-topic__meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.forum-preview__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.8125rem;
}

.forum-preview__foot a {
  color: var(--amber-dim);
  text-decoration: none;
}

.forum-preview__foot a:hover {
  color: var(--amber);
}

.forum-preview__foot span {
  color: var(--text-faint);
}

@media (max-width: 720px) {
  .forum-hub__grid {
    grid-template-columns: 1fr;
  }

  .forum-preview .section-head--row,
  .forum-hub .section-head--row {
    flex-wrap: wrap;
  }

  .forum-preview__cta {
    margin-left: 0;
    width: 100%;
  }
}

/* ── about ── */

.about {
  max-width: var(--max);
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  padding: clamp(2.5rem, 6vw, 4rem) var(--space-page);
  border-top: 1px solid var(--line);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(220px, 0.9fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}

.about__col-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.125rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line-soft);
}

.about__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.about__list li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.about__list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--amber-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.about__aside {
  padding: 1.375rem 1.25rem;
  border-left: 2px solid var(--rust);
  background: rgba(196, 92, 58, 0.06);
  align-self: stretch;
}

.about__aside-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 0.75rem;
}

.about__aside-text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.about__aside code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--amber);
}

/* ── join steps ── */

.join {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--space-page) clamp(4rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
}

.portal-workspace .portal-block--join.join {
  max-width: none;
  padding: 0;
  border-top: none;
}

.join__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 22rem);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: stretch;
}

.join__grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
  height: 100%;
  min-height: 100%;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.join__qr {
  display: flex;
  justify-content: center;
  align-items: stretch;
  height: 100%;
  min-height: 100%;
}

.join__step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  min-height: 0;
  padding: 1.5rem 1.75rem 1.625rem;
  background: var(--surface);
  transition: background 0.25s var(--ease);
}

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

.join__step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.08em;
  color: var(--amber);
  line-height: 1;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--line-soft);
}

.join__step-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.625rem;
  color: var(--text);
}

.join__step-body p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.join__qr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.875rem;
  width: 100%;
  max-width: 22rem;
  height: 100%;
  margin: 0;
  padding: clamp(1.5rem, 3vw, 2rem) clamp(1.25rem, 2.5vw, 1.75rem) 1.75rem;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(196, 165, 116, 0.14), transparent 55%),
    linear-gradient(165deg, var(--surface-2) 0%, var(--surface) 48%, #181512 100%);
  border: 1px solid var(--line);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 48px rgba(0, 0, 0, 0.28);
}

.join__qr-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-dim);
}

.join__qr-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.join__qr-lead {
  max-width: 18rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.join__qr-frame {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.25rem auto 0.5rem;
  padding: 0.875rem;
  background: #f8f6f1;
  border-radius: 0.75rem;
  box-shadow:
    0 0 0 1px rgba(196, 165, 116, 0.35),
    0 12px 32px rgba(0, 0, 0, 0.22);
}

.join__qr-image {
  display: block;
  width: min(220px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: 0.35rem;
}

.join__qr-corner {
  position: absolute;
  width: 1.125rem;
  height: 1.125rem;
  border-color: var(--amber);
  border-style: solid;
  opacity: 0.85;
  pointer-events: none;
}

.join__qr-corner--tl {
  top: 0.5rem;
  left: 0.5rem;
  border-width: 2px 0 0 2px;
}

.join__qr-corner--tr {
  top: 0.5rem;
  right: 0.5rem;
  border-width: 2px 2px 0 0;
}

.join__qr-corner--bl {
  bottom: 0.5rem;
  left: 0.5rem;
  border-width: 0 0 2px 2px;
}

.join__qr-corner--br {
  bottom: 0.5rem;
  right: 0.5rem;
  border-width: 0 2px 2px 0;
}

.join__qr-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

/* ── footer ── */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.75rem var(--space-page) 2.25rem;
  border-top: 1px solid var(--line);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer__brand strong {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
}

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

.footer__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.footer__links a {
  color: var(--amber-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer__links a:hover {
  color: var(--amber);
  border-bottom-color: var(--amber-dim);
}

.footer__links a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.footer__links a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.footer__legal a {
  color: var(--text-faint);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer__legal a:hover {
  color: var(--amber);
  border-bottom-color: var(--amber-dim);
}

.footer__links--legal {
  flex-wrap: wrap;
}

/* ── legal pages & cookie banner ── */

.legal-page .header--legal {
  margin-bottom: 0;
}

.legal-shell {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem var(--space-page) 3rem;
}

.legal-doc h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.75rem;
}

.legal-doc h2 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.65rem;
  color: var(--amber);
}

.legal-doc p,
.legal-doc li {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 0.9375rem;
}

.legal-doc ul,
.legal-doc ol {
  padding-left: 1.25rem;
  margin: 0.65rem 0 1rem;
}

.legal-doc a {
  color: var(--amber-dim);
}

.legal-doc a:hover {
  color: var(--amber);
}

.legal-doc__lead {
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.legal-doc__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}

.legal-doc__note {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 1.25rem;
}

.legal-doc__nav {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  gap: 0.65rem;
}

.legal-doc__nav a {
  font-weight: 600;
}

.legal-dl {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0 1rem;
}

.legal-dl > div {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 0.65rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.legal-dl dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.legal-dl dd {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

.legal-table th,
.legal-table td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  font-family: var(--font-mono);
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.02);
}

.legal-consent-box {
  padding: 1rem 1.15rem;
  border: 1px solid rgba(196, 165, 116, 0.25);
  border-radius: 12px;
  background: rgba(196, 165, 116, 0.04);
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  padding: 0.85rem var(--space-page) calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: rgba(14, 12, 10, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.cookie-banner__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  gap: 0.75rem;
}

.cookie-banner__text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.cookie-banner__text a {
  color: var(--amber-dim);
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.cookie-banner__btn {
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  border: 1px solid var(--line);
}

.cookie-banner__btn--primary {
  background: var(--amber);
  color: #141210;
  border-color: var(--amber);
  font-weight: 600;
}

.cookie-banner__btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.cookie-banner__btn:hover {
  filter: brightness(1.05);
}

.cookie-banner__link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-decoration: none;
}

.cookie-banner__link:hover {
  color: var(--amber);
}

.cookie-banner__note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-faint);
}

.cookie-banner__note a {
  color: var(--amber-dim);
}

@media (max-width: 640px) {
  .legal-dl > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .footer__legal {
    width: 100%;
  }
}

/* ── responsive ── */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero__copy {
    min-height: 0;
  }

  .hero__lead {
    flex: none;
    margin-bottom: 2rem;
  }

  .hero__actions {
    margin-top: 0;
    padding-top: 0;
  }

  .hero__viz {
    min-height: 0;
    max-width: none;
  }

  .hero__viz .live-panel {
    flex: none;
  }

  .live-panel__grid--regional {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero__title {
    max-width: none;
  }

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

  .feature--lead {
    grid-row: span 1;
    grid-column: span 2;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }

  .feature--wide {
    grid-column: span 2;
  }

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

  .about__aside {
    border-left: none;
    border-top: 2px solid var(--rust);
  }

  .join__layout {
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 4vw, 2rem);
  }

  .join__grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .join__qr {
    height: auto;
    min-height: 0;
  }

  .join__qr-card {
    max-width: 24rem;
    height: auto;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .header__tag {
    display: none;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

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

  .feature--lead,
  .feature--wide {
    grid-column: span 1;
  }

  .section-head--row {
    flex-direction: column;
    gap: 0.5rem;
  }

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

  .join__step {
    padding: 1.625rem 1.5rem 1.875rem;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .live-panel__dot {
    animation: none;
  }

  .btn,
  .btn__arrow,
  .feature,
  .join__step,
  .footer__links a {
    transition: none;
  }
}

/* ── live portal ── */

.header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-right: auto;
  margin-left: clamp(0.5rem, 2vw, 2rem);
}

.header__nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.header__nav a:hover {
  color: var(--amber);
}

.live-pill--ok { color: var(--sage); }
.live-pill--warn { color: var(--amber); }
.live-pill--bad { color: var(--rust); }

.live-panel__dot.live-pill--ok { background: var(--sage); box-shadow: 0 0 12px rgba(107, 143, 113, 0.55); }
.live-panel__dot.live-pill--warn { background: var(--amber); box-shadow: 0 0 10px rgba(196, 165, 116, 0.35); }
.live-panel__dot.live-pill--bad { background: var(--rust); box-shadow: 0 0 10px rgba(196, 92, 58, 0.35); }

.live-region {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line-soft);
}

.live-region__head {
  margin-bottom: 0.5rem;
}

.live-region__title {
  margin: 0;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}

.live-region__summary {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.live-region__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem 0.55rem;
  margin: 0;
}

.live-region__stat {
  margin: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
}

.live-region__stat dt {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 0.15rem;
}

.live-region__value {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.1;
  color: var(--text);
}

.live-region__sub {
  margin-top: 0.1rem;
  font-size: 0.62rem;
  color: var(--text-faint);
  line-height: 1.25;
}

.live-region__stat--ok { border-top: 2px solid var(--sage); }
.live-region__stat--warn { border-top: 2px solid var(--amber); }
.live-region__stat--bad { border-top: 2px solid var(--rust); }
.live-region__stat--info { border-top: 2px solid var(--line); }

.live-region__notes {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.live-region__note {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding-left: 0.55rem;
  border-left: 2px solid var(--line);
}

.live-region__note--warn { border-color: var(--amber); }
.live-region__note--bad { border-color: var(--rust); color: #e8b4a8; }

.live-region__feed {
  margin: 0.45rem 0 0;
  font-size: 0.65rem;
  color: var(--text-faint);
  line-height: 1.35;
}

.live-region__feed--ok { color: var(--sage); }
.live-region__feed--warn { color: var(--amber); }
.live-region__feed--bad { color: #e8b4a8; }

.live-region--warn .live-region__summary { color: var(--amber); }
.live-region--bad .live-region__summary { color: #e8b4a8; }

@media (max-width: 520px) {
  .live-region__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.live-alerts {
  list-style: none;
  margin-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.live-alert {
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  border-left: 2px solid var(--line);
  color: var(--text-muted);
}

.live-alert--bad { border-color: var(--rust); color: #e8b4a8; }
.live-alert--warn { border-color: var(--amber); }

.portal-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(196, 92, 58, 0.35);
  background: rgba(196, 92, 58, 0.08);
  color: #e8b4a8;
  font-size: 0.875rem;
}

.portal-map,
.portal-feed {
  position: relative;
  z-index: 1;
  padding: 0 var(--space-page) 4rem;
  max-width: var(--max);
  margin: 0 auto;
}

.portal-workspace {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-page) 4rem;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 3.75rem);
}

.portal-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
}

.portal-workspace .section-head {
  margin-bottom: 0;
}

.portal-workspace .section-head--row {
  min-height: 0;
}

.portal-map__error {
  flex-shrink: 0;
  margin: 0.55rem 0.75rem 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: rgba(196, 165, 116, 0.08);
  color: var(--amber);
  font-size: 0.875rem;
  border-radius: 10px;
}

.portal-map__error[hidden] {
  display: none !important;
}

.portal-map__loading {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: rgba(20, 18, 16, 0.88);
  color: var(--amber);
  font-size: 0.8125rem;
  pointer-events: none;
  white-space: nowrap;
}

.portal-map__loading[hidden] {
  display: none !important;
}

.portal-map__frame {
  width: 100%;
  height: var(--portal-map-h);
  min-height: var(--portal-map-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.08)), var(--surface);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}

.portal-map__stage {
  position: relative;
  flex: 1 1 0%;
  min-height: 14rem;
  overflow: hidden;
}

.portal-map__canvas-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.portal-map__canvas-wrap:fullscreen,
.portal-map__canvas-wrap:-webkit-full-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  z-index: 2147483000;
  background: #100e0c;
}

.portal-map__canvas-wrap:fullscreen .portal-map__canvas,
.portal-map__canvas-wrap:-webkit-full-screen .portal-map__canvas {
  width: 100%;
  height: 100%;
}

.portal-map__canvas-wrap:fullscreen .portal-map__layers,
.portal-map__canvas-wrap:-webkit-full-screen .portal-map__layers {
  z-index: 10000;
}

.portal-map__canvas-wrap:fullscreen .portal-map__loading,
.portal-map__canvas-wrap:-webkit-full-screen .portal-map__loading {
  z-index: 10001;
}

.portal-map__layers {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 5000;
  max-width: calc(100% - 7.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  padding: 0.45rem 0.6rem;
  border-radius: 11px;
  border: 1px solid rgba(196, 165, 116, 0.42);
  background: rgba(16, 14, 12, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  max-width: calc(100% - 7.5rem);
}

.map-fullscreen-fab {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 6000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.65rem;
  border-radius: 11px;
  border: 1px solid rgba(255, 159, 26, 0.72);
  background: rgba(16, 14, 12, 0.94);
  color: var(--accent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-fullscreen-fab:hover {
  border-color: rgba(255, 159, 26, 0.85);
  background: rgba(255, 159, 26, 0.14);
  transform: translateY(-1px);
}

.map-fullscreen-fab[aria-pressed='true'] {
  border-color: rgba(255, 159, 26, 0.9);
  background: rgba(255, 159, 26, 0.22);
  color: #fff;
}

.map-fullscreen-fab__icon {
  flex-shrink: 0;
  display: block;
}

.map-fullscreen-fab__label {
  line-height: 1;
  white-space: nowrap;
}

.portal-map__canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #1a1814;
}

.portal-map__canvas-wrap:fullscreen .map-fullscreen-fab,
.portal-map__canvas-wrap:-webkit-full-screen .map-fullscreen-fab {
  z-index: 10002;
}

.portal-map__layers-label {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-right: 0.15rem;
}

.portal-map__layers-sep {
  width: 1px;
  height: 1.15rem;
  background: rgba(196, 165, 116, 0.28);
  margin: 0 0.1rem;
  flex-shrink: 0;
}

.map-layer-btn {
  appearance: none;
  border: 1px solid rgba(196, 165, 116, 0.45);
  background: rgba(255, 159, 26, 0.14);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, opacity 0.15s;
}

.map-layer-btn:hover {
  border-color: rgba(255, 159, 26, 0.75);
  background: rgba(255, 159, 26, 0.22);
}

.map-layer-btn--on {
  border-color: rgba(255, 159, 26, 0.8);
  box-shadow: 0 0 0 1px rgba(255, 159, 26, 0.18);
}

.map-layer-btn--off {
  opacity: 0.62;
  background: rgba(0, 0, 0, 0.28);
  border-color: var(--line-soft);
  color: var(--text-faint);
  text-decoration: line-through;
  box-shadow: none;
}

.map-layer-btn--off:hover {
  opacity: 0.9;
  color: var(--text);
}

.portal-map__legend {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  z-index: 4;
  max-width: min(11rem, calc(100% - 1.3rem));
  padding: 0.45rem 0.55rem 0.5rem;
  border-radius: 11px;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: rgba(16, 14, 12, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.portal-map__legend-title {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.portal-map__legend-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.22rem;
}

.portal-map__legend-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.64rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.map-legend-dot {
  flex-shrink: 0;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.map-legend-dot--gateway {
  background: #ff8c00;
}

.map-legend-dot--router {
  background: #e74c3c;
}

.map-legend-dot--repeater {
  background: #9b59b6;
}

.map-legend-dot--client {
  background: #27ae60;
}

.map-legend-dot--node {
  background: #8b7355;
}

.map-legend-dot--stale {
  background: #7a7570;
  opacity: 0.75;
}

.portal-map__toolbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.22);
}

.portal-map__toolbar-group {
  display: inline-flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.portal-map__search {
  position: relative;
  flex: 1 1 12rem;
  min-width: 0;
}

.portal-map__search-input {
  width: 100%;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.portal-map__search-input:focus {
  outline: none;
  border-color: rgba(196, 165, 116, 0.55);
}

.portal-map__mode-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.64rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  line-height: 1.35;
}

.portal-map__dock {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 5;
  width: min(17.5rem, calc(100% - 1.5rem));
  max-height: min(15rem, 42%);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(196, 165, 116, 0.28);
  background: rgba(20, 18, 16, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.portal-nodes-bar {
  width: 100%;
  height: var(--portal-nodes-h);
  min-height: var(--portal-nodes-h);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.portal-nodes-bar .nodes-chip {
  flex-shrink: 0;
  padding: 0.14rem 0.48rem;
  font-size: 0.68rem;
  background: rgba(0, 0, 0, 0.18);
}

.portal-map__dock:not([hidden]) {
  animation: portal-dock-in 0.22s var(--ease);
}

@keyframes portal-dock-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.map-tool-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.map-tool-btn:hover {
  border-color: rgba(196, 165, 116, 0.45);
  color: var(--text);
}

.map-tool-btn--active {
  border-color: rgba(196, 165, 116, 0.55);
  background: rgba(196, 165, 116, 0.12);
  color: var(--amber);
}

.map-tool-btn--mini {
  font-size: 0.62rem;
  padding: 0.28rem 0.55rem;
}

.map-dock__empty {
  color: var(--text-faint);
  font-size: 0.78rem;
  line-height: 1.45;
}

.map-dock__hint {
  color: var(--text-faint);
  font-size: 0.72rem;
  line-height: 1.4;
  margin-top: 0.35rem;
  opacity: 0.85;
}

.map-node-card__head {
  margin-bottom: 0.65rem;
}

.map-point-card .map-node-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.map-point-card .map-node-card__title {
  margin-bottom: 0;
}

.map-node-card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.45rem;
}

.map-node-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.map-node-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.map-node-pill--gw { border-color: rgba(196, 165, 116, 0.45); color: var(--amber); }
.map-node-pill--ok { border-color: rgba(107, 143, 113, 0.45); color: #b8d4bc; }
.map-node-pill--off { border-color: rgba(107, 100, 92, 0.45); color: var(--text-faint); }
.map-node-pill--mqtt { border-color: rgba(168, 85, 247, 0.35); color: #d4c4f7; }
.map-node-pill--hop { border-color: rgba(56, 189, 248, 0.28); color: #a8d4f0; }
.map-node-pill--rf { border-color: rgba(107, 143, 113, 0.35); color: #b8d4bc; }
.map-node-pill--bat { border-color: rgba(234, 179, 8, 0.35); color: #f0dfa0; }
.map-node-pill--warn { border-color: rgba(234, 179, 8, 0.35); color: #f0dfa0; }

.map-node-card__grid {
  display: grid;
  gap: 0.35rem;
  font-size: 0.72rem;
}

.map-node-card__grid div {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: 0.35rem;
  align-items: baseline;
}

.map-node-card__grid dt {
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.map-node-card__grid dd {
  color: var(--text);
  word-break: break-word;
}

.map-node-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.map-node-neighbors {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.map-node-neighbors--primary {
  margin-top: 0.65rem;
  padding-top: 0;
  border-top: none;
}

.map-node-neighbors--secondary {
  opacity: 0.88;
}

.map-node-neighbors__empty {
  margin-top: 0.15rem;
  font-size: 0.72rem;
}

.map-node-neighbors__title {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 0.45rem;
}

.map-node-neighbors ul {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  font-size: 0.72rem;
}

.map-neighbor-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  color: var(--amber);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.map-neighbor-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.5rem;
  align-items: baseline;
}

.map-neighbor-row__meta {
  color: var(--text-faint);
  font-size: 0.68rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-neighbor-row__tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.map-dock__loading {
  color: var(--text-faint);
  font-size: 0.72rem;
  margin: 0.5rem 0 0.75rem;
}

.map-route-picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.map-route-picker__slot {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  min-width: 0;
}

.map-route-picker__slot--filled {
  border-style: solid;
  border-color: rgba(196, 165, 116, 0.45);
  background: rgba(196, 165, 116, 0.06);
}

.map-route-picker__label {
  display: block;
  font-size: 0.58rem;
  font-family: var(--font-mono);
  color: var(--text-faint);
}

.map-route-picker__value {
  display: block;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-route-picker__arrow {
  color: var(--amber);
  font-size: 0.85rem;
}

.map-route-result__hero {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.map-route-result__hops {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--amber);
}

.map-route-result__unit {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.map-route-result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.map-route-path {
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.map-route-step {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
}

.map-route-step__num {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: rgba(196, 165, 116, 0.15);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.map-route-step__off {
  color: var(--text-faint);
  font-size: 0.62rem;
}

.map-search-results {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.map-search-hit {
  appearance: none;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  display: grid;
  gap: 0.1rem;
}

.map-search-hit:hover {
  background: rgba(196, 165, 116, 0.08);
}

.map-search-hit strong {
  font-size: 0.78rem;
  color: var(--amber);
}

.map-search-hit span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.map-search-results__empty {
  padding: 0.55rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-faint);
}

.nodes-chip--btn {
  cursor: pointer;
  appearance: none;
  font: inherit;
}

.nodes-chip--btn:hover {
  border-color: rgba(196, 165, 116, 0.45);
}

.portal-map__dock,
.portal-nodes-bar {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 165, 116, 0.42) rgba(20, 18, 16, 0.85);
}

.mesh74-scroll,
.portal-chat__list,
.portal-nodes-bar {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 165, 116, 0.42) rgba(20, 18, 16, 0.85);
}

.mesh74-scroll::-webkit-scrollbar,
.portal-chat__list::-webkit-scrollbar,
.portal-nodes-bar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.mesh74-scroll::-webkit-scrollbar-track,
.portal-chat__list::-webkit-scrollbar-track,
.portal-nodes-bar::-webkit-scrollbar-track {
  background: rgba(14, 12, 10, 0.65);
  border-radius: 999px;
}

.mesh74-scroll::-webkit-scrollbar-thumb,
.portal-chat__list::-webkit-scrollbar-thumb,
.portal-nodes-bar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(196, 165, 116, 0.45), rgba(138, 115, 80, 0.55));
  border: 2px solid rgba(14, 12, 10, 0.65);
  border-radius: 999px;
}

.mesh74-scroll::-webkit-scrollbar-thumb:hover,
.portal-chat__list::-webkit-scrollbar-thumb:hover,
.portal-nodes-bar::-webkit-scrollbar-thumb:hover {
  background: rgba(196, 165, 116, 0.62);
}

.nodes-strip__empty {
  color: var(--text-faint);
  font-size: 0.8125rem;
}

.nodes-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--surface);
}

.nodes-chip--online {
  border-color: rgba(107, 143, 113, 0.45);
  color: #b8d4bc;
}

.portal-block--chat .section-head--row {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
}

.portal-block--chat .section-head--row > div {
  flex: 1 1 14rem;
  min-width: 0;
}

.portal-block--health .section-head--row > div {
  flex: 1 1 14rem;
  min-width: 0;
}

.portal-chat__expand {
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.portal-chat__expand:hover {
  border-color: rgba(196, 165, 116, 0.45);
  color: var(--amber);
}

.portal-chat__expand[aria-expanded='true'] {
  border-color: rgba(196, 165, 116, 0.5);
  background: rgba(196, 165, 116, 0.1);
  color: var(--amber);
}

.portal-chat__expand-icon {
  display: inline-block;
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}

.portal-chat__expand[aria-expanded='true'] .portal-chat__expand-icon {
  transform: rotate(180deg);
}

.portal-chat {
  width: 100%;
  height: auto;
  min-height: 8rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.08)), var(--surface);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}

.portal-chat.portal-chat--animating .portal-chat__list {
  transition: max-height 0.35s var(--ease);
}

.portal-chat__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
}

.portal-chat__channel {
  color: var(--amber);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.portal-chat__ingest {
  flex: 1 1 auto;
  min-width: 8rem;
}

.portal-chat__updated {
  margin-left: auto;
  white-space: nowrap;
}

.portal-chat__filters {
  padding: 0.55rem 1rem 0.35rem;
  border-bottom: 1px solid var(--line-soft);
}

.chat-author-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-size: 0.72rem;
}

.chat-author-filter__label {
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.chat-author-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.4rem;
}

.chat-author-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: rgba(196, 165, 116, 0.08);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.chat-author-chip__remove {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 0.85rem;
}

.chat-author-chip__remove:hover {
  color: var(--amber);
}

.chat-author-add {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-author-select {
  min-width: 9rem;
  max-width: 14rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.chat-author-add-btn,
.chat-author-clear,
.chat-load-older-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
  padding: 0.2rem 0.55rem;
}

.chat-author-add-btn {
  min-width: 1.8rem;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--amber);
}

.chat-author-add-btn:hover,
.chat-author-clear:hover,
.chat-load-older-btn:hover {
  border-color: rgba(196, 165, 116, 0.45);
  color: var(--amber);
}

.chat-storage-note {
  margin: 0.35rem 0 0;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.chat-period-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
}

.chat-period-stats__label {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.chat-period-stats__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chat-period-stats--filtered .chat-period-stats__label::after {
  content: ' · фильтр';
  color: var(--amber);
}

.chat-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.chat-stat__label {
  color: var(--text-faint);
}

.chat-stat__value {
  color: var(--amber);
  font-weight: 600;
}

.chat-stat--total .chat-stat__value {
  color: #b8d4bc;
}

.portal-chat__load-older {
  padding: 0.45rem 1rem 0;
  text-align: center;
}

.chat-load-older-btn[disabled] {
  opacity: 0.55;
  cursor: wait;
}

.portal-chat__list {
  flex: 0 1 auto;
  max-height: var(--chat-list-visible-h, 14rem);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.portal-chat__empty {
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.portal-chat__foot {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.chat-msg {
  max-width: 95%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
}

.chat-msg--in {
  align-self: flex-start;
  border-left: 2px solid var(--sage);
}

.chat-msg--out {
  align-self: flex-end;
  border-right: 2px solid var(--amber);
  background: rgba(196, 165, 116, 0.08);
}

.chat-msg__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.chat-msg__author {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--amber);
}

.chat-msg__time {
  font-size: 0.68rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.chat-msg__text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Inbox cards (aligned with FOXDPI dashboard) */
.mesh-message-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex-shrink: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
}

.mesh-message-card--incoming {
  border-left: 3px solid rgba(107, 143, 113, 0.55);
}

.mesh-message-card--outgoing {
  border-left: 3px solid rgba(201, 162, 39, 0.55);
}

.mesh-message-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
}

.mesh-message-identity {
  min-width: 0;
  flex: 1 1 auto;
}

.mesh-message-direction {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.mesh-message-sender {
  color: var(--text);
  font-weight: 600;
}

.mesh-message-node-id {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #b8c9e8;
}

.mesh-message-time {
  flex-shrink: 0;
  font-size: 0.62rem;
  color: var(--text-faint);
  text-align: right;
  line-height: 1.4;
  white-space: nowrap;
}

.mesh-message-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mesh-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.mesh-badge--rf {
  color: #b8d4bc;
  border-color: rgba(107, 143, 113, 0.35);
  background: rgba(107, 143, 113, 0.12);
}

.mesh-badge--mqtt {
  color: #d4c4f7;
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.1);
}

.mesh-badge--local {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.08);
}

.mesh-badge--channel {
  color: #a8d4f0;
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.1);
}

.mesh-badge--hops-good {
  color: #b8d4bc;
  border-color: rgba(107, 143, 113, 0.3);
  background: rgba(107, 143, 113, 0.1);
}

.mesh-badge--hops-warn {
  color: #f0dfa0;
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.1);
}

.mesh-badge--hops-bad {
  color: #f0b0b0;
  border-color: rgba(200, 90, 90, 0.35);
  background: rgba(200, 90, 90, 0.1);
}

.mesh-message-text {
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mesh-message-text__line {
  display: block;
}

.mesh-message-text__meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}

.mesh-message-text__detail {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
  }

  .header__nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line-soft);
  }

  .portal-workspace {
    gap: 2rem;
  }

  :root {
    --portal-map-h: clamp(18rem, 52vh, 26rem);
  }

  .portal-block--chat .section-head--row {
    align-items: flex-start;
  }

  .portal-chat__expand {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .portal-map__legend {
    left: 0.45rem;
    bottom: 0.45rem;
    max-width: calc(100% - 0.9rem);
  }

  .portal-map__layers {
    top: 0.45rem;
    left: 0.45rem;
    right: 0.45rem;
    max-width: none;
  }

  .portal-map__layers-label {
    flex: 1 1 100%;
  }

  .portal-map__stage {
    min-height: 12rem;
  }

  .portal-map__mode-hint {
    display: none;
  }

  .portal-map__dock {
    right: 0.5rem;
    bottom: 0.5rem;
    width: calc(100% - 1rem);
    max-height: min(13rem, 38%);
  }
}

/* ── join teaser (main) ── */

.join-teaser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
}

.join-teaser__lead {
  flex: 1 1 16rem;
  max-width: 42rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.join-teaser__cta {
  flex-shrink: 0;
}

/* ── FAQ ── */

.faq {
  border-top: 1px solid var(--line);
}

.faq__list {
  display: grid;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.faq__item {
  background: var(--surface);
  transition: background 0.25s var(--ease);
}

.faq__item[open],
.faq__item:hover {
  background: var(--surface-2);
}

.faq__question {
  padding: 1.125rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "+";
  float: right;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--amber-dim);
}

.faq__item[open] .faq__question::after {
  content: "−";
}

.faq__answer {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.faq__answer a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ── join standalone page ── */

.join-page {
  position: relative;
  z-index: 1;
}

.join-page .join {
  padding-top: clamp(2rem, 5vw, 3rem);
}
