/* 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, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 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;
}

/* ── gateway node status (top of site) ── */

.node-status-bar {
  position: relative;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.4rem var(--space-page);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(28, 24, 20, 0.96);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.node-status-bar--ok {
  background: rgba(28, 36, 30, 0.96);
  color: #c5d8c8;
}

.node-status-bar--warn {
  background: rgba(40, 32, 20, 0.96);
  color: #e2d0a8;
}

.node-status-bar--bad {
  background: rgba(42, 24, 20, 0.96);
  color: #e8b4a8;
}

.node-status-bar__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--amber);
}

.node-status-bar__dot.live-pill--ok {
  background: var(--sage);
  box-shadow: 0 0 8px rgba(107, 143, 113, 0.55);
}

.node-status-bar__dot.live-pill--warn {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(196, 165, 116, 0.4);
}

.node-status-bar__dot.live-pill--bad {
  background: var(--rust);
  box-shadow: 0 0 8px rgba(196, 92, 58, 0.4);
}

.node-status-bar__label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
}

.node-status-bar__text {
  color: inherit;
}

.header__node {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  opacity: 0.95;
}

/* ── 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%);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.region-alert--pulse {
  animation: regionAlertBgPulse 1.6s ease-in-out infinite;
}

.region-alert--pulse .region-alert__badge-dot {
  animation: regionAlertPulse 1.15s ease infinite;
}

@keyframes regionAlertBgPulse {
  0%,
  100% {
    background:
      linear-gradient(180deg, rgba(196, 58, 45, 0.12) 0%, rgba(196, 58, 45, 0.04) 55%, transparent 100%);
    border-bottom-color: rgba(196, 58, 45, 0.24);
    box-shadow: inset 0 0 0 rgba(196, 58, 45, 0);
  }
  50% {
    background:
      linear-gradient(180deg, rgba(196, 58, 45, 0.34) 0%, rgba(196, 58, 45, 0.16) 55%, rgba(196, 58, 45, 0.05) 100%);
    border-bottom-color: rgba(232, 90, 69, 0.65);
    box-shadow: inset 0 0 32px rgba(196, 58, 45, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .region-alert--pulse {
    animation: none;
  }
}

.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-weather {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.live-weather__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.live-weather__title {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}

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

.live-weather__cities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.55rem;
}

.live-weather__city {
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line-soft);
}

.live-weather__city-name {
  display: block;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.live-weather__city-val {
  display: block;
  margin-top: 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.live-weather__air {
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line-soft);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.live-weather__air-hint {
  font-weight: 400;
  font-size: 0.62rem;
  color: var(--text-faint);
}

.live-weather__air--excellent,
.live-weather__air--good {
  color: var(--sage);
}

.live-weather__air--fair {
  color: var(--text);
}

.live-weather__air--poor,
.live-weather__air--bad {
  color: var(--amber);
}

.live-weather__mesh {
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.live-weather__rain {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.live-weather__rain-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.live-weather__rain-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), #6ea8fe);
  transition: width 0.35s var(--ease);
}

.live-weather__rain-bar--warn span {
  background: linear-gradient(90deg, var(--amber), #6ea8fe);
}

.live-weather__rain-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.live-weather__loading {
  margin: 0;
  font-size: 0.68rem;
  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[hidden] {
  display: none !important;
}

.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 .portal-map__dock {
  z-index: 10002;
}

.portal-map__layers-toggle {
  display: none;
}

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

html.map-immersive-open,
html.map-immersive-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.portal-map__canvas-wrap:fullscreen .portal-map__canvas,
.portal-map__canvas-wrap:-webkit-full-screen .portal-map__canvas,
.portal-map__canvas-wrap--immersive .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,
.portal-map__canvas-wrap--immersive .portal-map__layers {
  z-index: 10000;
}

.portal-map__canvas-wrap:fullscreen .portal-map__loading,
.portal-map__canvas-wrap:-webkit-full-screen .portal-map__loading,
.portal-map__canvas-wrap--immersive .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.7rem;
  border-radius: 11px;
  border: 1px solid rgba(255, 159, 26, 0.85);
  background: #1a1612;
  color: #fff;
  -webkit-text-fill-color: #fff;
  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.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-fullscreen-fab:hover {
  border-color: #ff9f1a;
  background: #241c14;
  color: #fff;
  -webkit-text-fill-color: #fff;
  transform: translateY(-1px);
}

.map-fullscreen-fab[aria-pressed='true'] {
  border-color: #ff9f1a;
  background: #2a1e12;
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.map-fullscreen-fab__icon {
  flex-shrink: 0;
  display: block;
  color: #fff;
  fill: #fff;
}

.map-fullscreen-fab__label {
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  -webkit-text-fill-color: #fff;
}

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

.portal-map__canvas-wrap:fullscreen .portal-map__dock,
.portal-map__canvas-wrap:-webkit-full-screen .portal-map__dock,
.portal-map__canvas-wrap--immersive .portal-map__dock {
  max-height: min(22rem, 48%);
  width: min(20rem, calc(100% - 1.5rem));
  z-index: 10003;
}

.portal-map__canvas-wrap:fullscreen .map-fullscreen-fab,
.portal-map__canvas-wrap:-webkit-full-screen .map-fullscreen-fab,
.portal-map__canvas-wrap--immersive .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;
}

.map-airtime-card {
  max-width: min(14.5rem, calc(100% - 1.3rem));
}

.map-legend-swatch {
  flex-shrink: 0;
  width: 0.9rem;
  height: 0.55rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.map-legend-swatch--g {
  background: #6b8f71;
}

.map-legend-swatch--y {
  background: #d4a017;
}

.map-legend-swatch--r {
  background: #c45c3a;
}

.map-airtime-card__note {
  display: block;
  margin-top: 0.12rem;
  padding-top: 0.28rem;
  border-top: 1px solid rgba(196, 165, 116, 0.18);
  color: var(--text-faint);
  font-size: 0.58rem;
}

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

.map-airtime-legend {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.64rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  line-height: 1.35;
}

.map-airtime-legend__g,
.map-airtime-legend__y,
.map-airtime-legend__r {
  display: inline-block;
  margin: 0 0.15rem;
  padding: 0 0.28rem;
  border-radius: 4px;
  font-weight: 600;
}

.map-airtime-legend__g {
  color: #8fbf96;
  background: rgba(107, 143, 113, 0.18);
}

.map-airtime-legend__y {
  color: #e6c25a;
  background: rgba(212, 160, 23, 0.18);
}

.map-airtime-legend__r {
  color: #e08a72;
  background: rgba(196, 92, 58, 0.2);
}

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

.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(22rem, 56%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  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-node-telem-slot {
  margin-top: 0.75rem;
}

.map-node-telem__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.map-node-telem__head h4 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
}

.map-node-telem__head span {
  font-size: 0.68rem;
  color: var(--text-faint);
}

.map-node-telem__kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.65rem;
  margin: 0 0 0.75rem;
}

.map-node-telem__kpi dt {
  font-size: 0.62rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.map-node-telem__kpi dd {
  margin: 0.12rem 0 0;
  font-size: 0.82rem;
  color: var(--text1);
}

.map-node-telem__charts {
  display: grid;
  gap: 0.55rem;
}

.map-node-telem__metric {
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.map-node-telem__metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  color: var(--text2);
}

.map-node-telem__metric-head strong {
  font-size: 0.78rem;
  color: var(--text1);
}

.map-node-telem__spark {
  display: block;
  width: 100%;
  height: 56px;
}

.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 {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  flex: 1 1 auto;
}

/* ── Node card overlay (chat / mobile) ── */
.chat-node-overlay {
  position: fixed;
  inset: 0;
  z-index: 10004;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chat-node-overlay[hidden] {
  display: none !important;
}

.chat-node-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 6, 0.62);
  backdrop-filter: blur(2px);
}

.chat-node-overlay__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(26rem, 100%);
  max-height: min(82dvh, 42rem);
  margin: 0 0.5rem 0.5rem;
  padding: 0.85rem 0.95rem;
  background: rgba(24, 21, 18, 0.98);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.chat-node-overlay__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

@media (min-width: 720px) {
  .chat-node-overlay {
    align-items: center;
  }

  .chat-node-overlay__panel {
    margin: 0;
  }
}

.map-node-card__head {
  flex-shrink: 0;
  margin: 0 0 0.45rem;
  padding-bottom: 0.35rem;
  background: rgba(20, 18, 16, 0.96);
  z-index: 2;
}

.map-node-card__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.1rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

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

.map-node-card__head-row .map-node-card__title {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.map-node-card__close {
  flex-shrink: 0;
  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), background 0.2s var(--ease);
}

.map-node-card__close:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

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

.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,
.portal-chat__filters,
.superchat-online__list,
.superchat-main {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 165, 116, 0.38) #141210;
}

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

.mesh74-scroll::-webkit-scrollbar-track,
.portal-chat__list::-webkit-scrollbar-track,
.portal-nodes-bar::-webkit-scrollbar-track,
.portal-chat__filters::-webkit-scrollbar-track,
.superchat-online__list::-webkit-scrollbar-track,
.superchat-main::-webkit-scrollbar-track {
  background: #141210;
  border-radius: 999px;
}

.mesh74-scroll::-webkit-scrollbar-thumb,
.portal-chat__list::-webkit-scrollbar-thumb,
.portal-nodes-bar::-webkit-scrollbar-thumb,
.portal-chat__filters::-webkit-scrollbar-thumb,
.superchat-online__list::-webkit-scrollbar-thumb,
.superchat-main::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(196, 165, 116, 0.45), rgba(138, 115, 80, 0.55));
  border: 2px solid #141210;
  border-radius: 999px;
}

.mesh74-scroll::-webkit-scrollbar-thumb:hover,
.portal-chat__list::-webkit-scrollbar-thumb:hover,
.portal-nodes-bar::-webkit-scrollbar-thumb:hover,
.portal-chat__filters::-webkit-scrollbar-thumb:hover,
.superchat-online__list::-webkit-scrollbar-thumb:hover,
.superchat-main::-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__head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-left: auto;
  flex-shrink: 0;
}

.portal-chat__popout {
  flex-shrink: 0;
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(196, 165, 116, 0.5);
  border-radius: 999px;
  background: rgba(196, 165, 116, 0.12);
  color: var(--amber);
  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__popout:hover {
  border-color: rgba(196, 165, 116, 0.75);
  background: rgba(196, 165, 116, 0.2);
  color: #e8d4b0;
}

.portal-chat__popout-icon {
  font-size: 0.85rem;
  line-height: 1;
}

@media (min-width: 861px) {
  .portal-chat__popout:not([hidden]) {
    display: inline-flex;
  }
}

.portal-chat__expand {
  flex-shrink: 0;
  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__channel-mix {
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

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

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

.portal-chat__tabs {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0.15rem 0 0;
  padding: 0.35rem 0 0.1rem;
  border-top: 1px solid var(--line-soft);
  overflow-x: auto;
  scrollbar-width: thin;
}

.portal-chat__dm-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.portal-chat__tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 12rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
}

.portal-chat__tab:hover {
  border-color: var(--amber);
  color: var(--text);
}

.portal-chat__tab.is-active {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(232, 145, 48, 0.14);
}

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

.portal-chat__tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  margin-right: -0.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
}

.portal-chat__tab-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.portal-chat__filters {
  padding: 0.55rem 1rem 0.35rem;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

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

.chat-channel-select {
  min-width: 11rem;
  max-width: 18rem;
  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-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, min(32vh, 22rem));
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.portal-chat--expanded .portal-chat__list {
  max-height: var(--chat-list-visible-h, min(70vh, 48rem));
}

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

/* ---- Multi-pane chat (columns) ---- */
.chat-panes {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.chat-pane {
  display: none;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.chat-pane.is-active {
  display: flex;
}

.chat-pane__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}

.chat-pane__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.chat-pane__unread {
  flex: 0 0 auto;
  min-width: 1.15rem;
  padding: 0.05rem 0.32rem;
  border-radius: 999px;
  background: var(--amber);
  color: #1a140c;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.chat-pane__close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
  border-radius: 6px;
}

.chat-pane__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.chat-pane__clear {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.15rem 0.3rem;
  cursor: pointer;
  border-radius: 6px;
}

.chat-pane__clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.chat-pane__clear--server {
  display: none;
}

body.mesh74-admin .chat-pane__clear--server {
  display: inline-block;
}

.chat-pane__clear.is-armed {
  color: #1a140c;
  background: var(--amber);
  font-weight: 600;
}

.chat-pane__clear.is-ok {
  color: #7ee2a8;
}

.chat-pane__clear.is-err {
  color: #ff9a8a;
}

.portal-chat__tab-badge {
  display: inline-block;
  min-width: 1.05rem;
  margin-left: 0.3rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--amber);
  color: #1a140c;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  vertical-align: 1px;
}

.portal-chat__tab-add {
  flex: 0 0 auto;
  align-self: center;
  appearance: none;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text-faint);
  border-radius: 8px;
  padding: 0.18rem 0.4rem;
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 7.5rem;
}

.portal-chat__tab-add:hover,
.portal-chat__tab-add:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
  outline: none;
}

.portal-chat__tab-add option {
  background: var(--surface);
  color: var(--text);
}

.chat-pane__resizer {
  display: none;
  position: absolute;
  top: 0;
  right: -4px;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  z-index: 7;
  touch-action: none;
}

.chat-pane__resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: transparent;
  transition: background 0.15s;
}

.chat-pane__resizer:hover::after,
.chat-pane__resizer.is-drag::after {
  background: var(--amber);
  box-shadow: 0 0 6px rgba(255, 170, 60, 0.45);
}

html.mesh74-embed .chat-pane__resizer,
html.mesh74-chat-popout .chat-pane__resizer,
body.m74-app .chat-pane__resizer {
  display: block;
}

.chat-panes--resizing {
  scroll-snap-type: none !important;
  user-select: none;
}

/* Column mode: app embed, chat popout, m74 app shell */
html.mesh74-embed .chat-panes,
html.mesh74-chat-popout .chat-panes,
body.m74-app .chat-panes {
  flex: 1 1 0;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
}

html.mesh74-embed .chat-pane,
html.mesh74-chat-popout .chat-pane,
body.m74-app .chat-pane {
  display: flex;
  flex: 1 1 0;
  min-width: min(17rem, 88vw);
  scroll-snap-align: start;
  border-right: 1px solid var(--line-soft);
}

html.mesh74-embed .chat-pane:last-child,
html.mesh74-chat-popout .chat-pane:last-child,
body.m74-app .chat-pane:last-child {
  border-right: 0;
}

/* Active (focused) column highlight in multi-column mode. */
html.mesh74-embed .chat-pane.is-active,
html.mesh74-chat-popout .chat-pane.is-active,
body.m74-app .chat-pane.is-active {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 2px 0 var(--amber);
}

html.mesh74-embed .chat-pane.is-active .chat-pane__title,
html.mesh74-chat-popout .chat-pane.is-active .chat-pane__title,
body.m74-app .chat-pane.is-active .chat-pane__title {
  color: var(--amber);
  font-weight: 600;
}

.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-bots-help {
  margin: 0;
  padding: 0.55rem 1rem 0.15rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.chat-bots-help code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
}

.chat-compose {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.03);
  display: grid;
  gap: 0.65rem;
}

.chat-compose__title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.chat-compose__mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.85rem;
}

.chat-compose__mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--text);
}

.chat-compose__select {
  appearance: auto;
  cursor: pointer;
}

.chat-compose__to {
  position: relative;
}

.chat-compose__to-results {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  max-height: 14rem;
  overflow: auto;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  z-index: 5;
}

.chat-compose__to-results[hidden] {
  display: none;
}

.chat-compose__to-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

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

.chat-compose__to-item:hover,
.chat-compose__to-item:focus {
  background: rgba(0, 0, 0, 0.06);
  outline: none;
}

.chat-compose__to-item__meta {
  display: block;
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}

.chat-compose__to-picked {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--sage);
}

.chat-compose__to-empty {
  padding: 0.55rem 0.65rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.chat-compose__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.chat-compose__captcha-block {
  display: grid;
  gap: 0.55rem;
}

.chat-compose__captcha-img-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 96px;
}

.chat-compose__captcha-img {
  display: block;
  max-width: 100%;
  width: 320px;
  height: auto;
  border: 1px solid var(--line-soft);
  background: #eee;
  user-select: none;
  -webkit-user-drag: none;
}

.chat-compose__captcha-fallback {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.chat-compose__row--captcha {
  align-items: flex-end;
}

.chat-compose__field--captcha {
  flex: 1 1 10rem;
  min-width: 10rem;
}

.chat-compose__field {
  display: grid;
  gap: 0.25rem;
  min-width: 7rem;
}

.chat-compose__name-field[hidden],
.chat-compose__captcha-block[hidden],
.chat-compose__row[hidden],
.chat-compose__row:has(.chat-compose__name-field[hidden]),
#chat-compose-to-row[hidden],
#chat-compose-refresh[hidden] {
  display: none !important;
}

.chat-compose__field--grow {
  flex: 1 1 12rem;
  min-width: 12rem;
}

.chat-compose__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-compose__input {
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  color: var(--text);
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.9rem;
  min-height: 2.25rem;
  width: 100%;
}

.chat-compose__textbar {
  position: relative;
  display: block;
  flex: 0 0 auto;
  min-height: 3rem;
}

.chat-compose__input--area {
  display: block;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
  min-height: 3rem;
  max-height: 9.5rem;
  padding: 0.7rem 7.1rem 0.7rem 0.85rem;
  line-height: 1.35;
  border-radius: 1.15rem;
}

.chat-compose__photo {
  position: absolute;
  right: 4.6rem;
  bottom: 0.3rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.chat-compose__photo:hover,
.chat-compose__photo[aria-pressed='true'] {
  background: var(--surface-2);
}

.chat-compose__photo-preview {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.chat-compose__photo-preview[hidden] {
  display: none;
}

.chat-compose__photo-thumb {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: cover;
  border-radius: 0.45rem;
  border: 1px solid var(--line-soft);
}

.chat-compose__photo-clear {
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  line-height: 1;
}

.chat-compose__emoji {
  position: absolute;
  right: 2.45rem;
  bottom: 0.3rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.chat-compose__emoji:hover,
.chat-compose__emoji[aria-expanded='true'] {
  background: var(--surface-2);
}

.chat-emoji-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.4rem);
  z-index: 80;
  width: min(20rem, calc(100vw - 2rem));
  max-height: 12.5rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.12rem;
  padding: 0.45rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.85rem;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.chat-emoji-panel[hidden] {
  display: none;
}

.chat-emoji-panel__item {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.3rem;
  line-height: 1.45;
  padding: 0.12rem;
  border-radius: 0.4rem;
  cursor: pointer;
}

.chat-emoji-panel__item:hover,
.chat-emoji-panel__item:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.chat-compose__send {
  position: absolute;
  right: 0.3rem;
  bottom: 0.3rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--sage);
  color: #111;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-compose__send svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.chat-compose__send:disabled {
  opacity: 0.55;
  cursor: wait;
}

.chat-compose__send:hover:not(:disabled) {
  filter: brightness(1.06);
}

.chat-compose__input--captcha {
  max-width: 14rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.chat-compose__input:focus {
  outline: 2px solid var(--sage);
  outline-offset: 1px;
}

.chat-compose__refresh,
.chat-compose__submit {
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  min-height: 2.25rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.chat-compose__submit {
  background: var(--sage);
  border-color: transparent;
  color: #111;
  font-weight: 600;
}

.chat-compose__submit:disabled,
.chat-compose__refresh:disabled {
  opacity: 0.55;
  cursor: wait;
}

.chat-compose__refresh:hover,
.chat-compose__submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

.chat-compose__hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-faint);
}

.chat-compose__hint code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.chat-compose__status {
  margin: 0;
  font-size: 0.8rem;
}

.chat-compose__status--ok {
  color: var(--sage);
}

.chat-compose__status--err {
  color: #b45309;
}

.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-sender--btn,
.mesh-message-node-id--btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

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

.mesh-message-sender--btn:hover,
.mesh-message-sender--btn:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.mesh-message-node-id--btn:hover,
.mesh-message-node-id--btn:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.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--web {
  color: #f2c08a;
  border-color: rgba(232, 140, 48, 0.35);
  background: rgba(232, 140, 48, 0.12);
}

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

.mesh-badge--ch0 {
  color: #f2c08a;
  border-color: rgba(232, 140, 48, 0.35);
  background: rgba(232, 140, 48, 0.12);
}

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

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

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

.mesh-badge--ch4 {
  color: #f0b8d0;
  border-color: rgba(236, 72, 153, 0.3);
  background: rgba(236, 72, 153, 0.1);
}

.mesh-badge--ch5 {
  color: #f0dfa0;
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 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-photo {
  display: block;
  margin: 0.35rem 0 0.45rem;
  max-width: min(18rem, 100%);
}

.mesh-message-photo img {
  display: block;
  width: 100%;
  max-height: 16rem;
  object-fit: contain;
  border-radius: 0.55rem;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.2);
}

.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(34rem, 88dvh, 58rem);
  }

  .portal-block--map .section-head__note {
    font-size: 0.78rem;
  }

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

  .portal-chat__head-actions {
    margin-left: 0;
    width: 100%;
  }

  .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-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 159, 26, 0.55);
    background: rgba(255, 159, 26, 0.12);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .portal-map__layers-toggle::after {
    content: '▾';
    font-size: 0.65rem;
    opacity: 0.85;
  }

  .portal-map__layers--open .portal-map__layers-toggle::after {
    content: '▴';
  }

  .portal-map__layers {
    top: 0.45rem;
    left: 0.45rem;
    right: auto;
    max-width: calc(100% - 5.5rem);
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
  }

  /* Collapsed by default: only the «Слои» chip — map stays visible */
  .portal-map__layers:not(.portal-map__layers--open) .portal-map__layers-label,
  .portal-map__layers:not(.portal-map__layers--open) .portal-map__layers-sep,
  .portal-map__layers:not(.portal-map__layers--open) .map-layer-btn {
    display: none !important;
  }

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

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

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

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

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

  .map-fullscreen-fab {
    min-width: 3rem;
    height: 2.85rem;
    padding: 0 0.8rem;
    font-size: 0.82rem;
    color: #fff;
    -webkit-text-fill-color: #fff;
    background: #1a1612;
    border-color: #ff9f1a;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
  }

  .portal-map__canvas-wrap--immersive .portal-map__layers {
    max-width: calc(100% - 5.5rem);
  }

  .portal-map__canvas-wrap--immersive .portal-map__layers--open {
    max-width: none;
  }

  .portal-map__canvas-wrap--immersive .portal-map__dock {
    max-height: min(40vh, 18rem);
  }
}

/* ── 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);
}

/* App radio / logged-in — captcha block toggled via hidden attr; keep layout stable */
html.mesh74-radio-send .chat-compose__captcha-block[hidden],
html.mesh74-radio-send .chat-compose__name-field[hidden],
html.mesh74-account-send .chat-compose__captcha-block[hidden],
html.mesh74-account-send .chat-compose__name-field[hidden] {
  display: none !important;
}

.chat-compose__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.65rem;
}

html.mesh74-radio-send .chat-compose__actions,
html.mesh74-account-send .chat-compose__actions {
  margin-top: 0.4rem;
}

.chat-compose__linkbtn {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Embedded in app.mesh74.ru iframe — one section per screen, desktop portal unchanged */
html.mesh74-embed,
html.mesh74-embed body {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #141210;
}
html.mesh74-embed[data-m74-embed='forum'],
html.mesh74-embed[data-m74-embed='forum'] body {
  overflow: auto;
}
html.mesh74-embed body {
  padding: 0;
}
html.mesh74-embed .node-status-bar,
html.mesh74-embed .header,
html.mesh74-embed .footer,
html.mesh74-embed .hero,
html.mesh74-embed .portal-block--join-teaser,
html.mesh74-embed .portal-block--faq,
html.mesh74-embed .account-popup,
html.mesh74-embed .m74-tabbar {
  display: none !important;
}
html.mesh74-embed main,
html.mesh74-embed .portal-workspace {
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
html.mesh74-embed[data-m74-embed='forum'] main,
html.mesh74-embed[data-m74-embed='forum'] .portal-workspace {
  overflow: auto;
  height: auto;
  min-height: 100%;
}
html.mesh74-embed .section-head,
html.mesh74-embed .portal-chat__expand,
html.mesh74-embed .chat-bots-help,
html.mesh74-embed .portal-chat__foot {
  display: none !important;
}

html.mesh74-embed[data-m74-embed='map'] #chat,
html.mesh74-embed[data-m74-embed='map'] #forum,
html.mesh74-embed[data-m74-embed='map'] #network-util,
html.mesh74-embed[data-m74-embed='chat'] #map,
html.mesh74-embed[data-m74-embed='chat'] #forum,
html.mesh74-embed[data-m74-embed='chat'] #network-util,
html.mesh74-embed[data-m74-embed='chat'] #nodes-strip,
html.mesh74-embed[data-m74-embed='network'] #map,
html.mesh74-embed[data-m74-embed='network'] #chat,
html.mesh74-embed[data-m74-embed='network'] #forum,
html.mesh74-embed[data-m74-embed='forum'] #map,
html.mesh74-embed[data-m74-embed='forum'] #chat,
html.mesh74-embed[data-m74-embed='forum'] #network-util {
  display: none !important;
}

html.mesh74-embed[data-m74-embed='map'] #workspace,
html.mesh74-embed[data-m74-embed='map'] #map,
html.mesh74-embed[data-m74-embed='map'] .portal-map__frame,
html.mesh74-embed[data-m74-embed='map'] .portal-map__stage,
html.mesh74-embed[data-m74-embed='map'] .portal-map__canvas-wrap,
html.mesh74-embed[data-m74-embed='map'] .portal-map__canvas {
  height: 100%;
  min-height: 0;
  max-height: 100%;
}
html.mesh74-embed[data-m74-embed='map'] .portal-map__frame {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
html.mesh74-embed[data-m74-embed='map'] .portal-map__stage {
  min-height: 0;
}
html.mesh74-embed[data-m74-embed='map'] .portal-nodes-bar {
  display: none;
}

html.mesh74-embed[data-m74-embed='chat'] #workspace {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  gap: 0 !important;
}
html.mesh74-embed[data-m74-embed='chat'] #chat {
  position: absolute;
  inset: 0;
  height: auto !important;
  min-height: 0;
  max-height: none;
  gap: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html.mesh74-embed[data-m74-embed='chat'] .portal-chat {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}
html.mesh74-embed[data-m74-embed='chat'] .portal-chat__toolbar {
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
}
html.mesh74-embed[data-m74-embed='chat'] .portal-chat__tabs {
  flex: 1 1 100%;
  order: 20;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-author-filter,
html.mesh74-embed[data-m74-embed='chat'] .superchat-online,
html.mesh74-embed[data-m74-embed='chat'] .chat-period-stats,
html.mesh74-embed[data-m74-embed='chat'] .chat-storage-note,
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__title,
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__hint,
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__label,
html.mesh74-embed[data-m74-embed='chat'] .portal-chat__load-older {
  display: none !important;
}
html.mesh74-embed[data-m74-embed='chat'] .portal-chat__filters {
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
  gap: 0.3rem;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-channel-filter {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.78rem;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-channel-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
html.mesh74-embed[data-m74-embed='chat'] [data-node-onmap] {
  display: none !important;
}
html.mesh74-embed[data-m74-embed='chat'] .portal-chat__list,
html.mesh74-embed[data-m74-embed='chat'] .portal-chat__empty {
  flex: 1 1 0;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden;
  overflow-y: auto;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose {
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-top: 0;
  max-height: none;
  overflow: visible;
  padding: 0.3rem 0.5rem 0.55rem;
  gap: 0.25rem;
  display: flex;
  flex-direction: column;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__mode {
  gap: 0.65rem;
  font-size: 0.78rem;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__row {
  gap: 0.4rem;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__field,
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__field--grow,
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__field--captcha {
  min-width: 0;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__captcha-img-wrap {
  min-height: 0;
  gap: 0.4rem;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__captcha-img {
  width: 140px;
  max-height: 42px;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__input {
  min-height: 2.5rem;
  font-size: 16px;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__textbar {
  flex: 0 0 auto;
  min-height: 3.1rem;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__input--area {
  min-height: 3.1rem;
}
html.mesh74-embed[data-m74-embed='chat'] .chat-compose__actions {
  display: none;
}

html.mesh74-embed .portal-block--health {
  display: none !important;
}
html.mesh74-embed[data-m74-embed='network'],
html.mesh74-embed[data-m74-embed='network'] body {
  overflow: hidden;
}
html.mesh74-embed[data-m74-embed='network'] main,
html.mesh74-embed[data-m74-embed='network'] .portal-workspace {
  height: 100%;
  overflow: hidden;
}
html.mesh74-embed[data-m74-embed='network'] .portal-block--health {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding: 0.4rem 0.5rem 0.5rem;
  gap: 0.35rem;
}
html.mesh74-embed[data-m74-embed='network'] .portal-health {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 0.35rem;
  padding: 0 0 0.4rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
html.mesh74-embed[data-m74-embed='network'] .health-kpi-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
html.mesh74-embed[data-m74-embed='network'] .health-metrics {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.3rem;
  flex: 0 0 auto;
}
html.mesh74-embed[data-m74-embed='network'] .health-kpi {
  padding: 0.35rem 0.45rem 0.3rem;
}
html.mesh74-embed[data-m74-embed='network'] .health-kpi__value {
  font-size: 0.95rem;
}
html.mesh74-embed[data-m74-embed='network'] .health-metric {
  padding: 0.28rem 0.35rem 0.22rem;
}
html.mesh74-embed[data-m74-embed='network'] .health-metric__head {
  margin-bottom: 0.1rem;
}
html.mesh74-embed[data-m74-embed='network'] .health-metric__label {
  font-size: 0.52rem;
}
html.mesh74-embed[data-m74-embed='network'] .health-metric__value {
  font-size: 0.82rem;
  line-height: 1.15;
}
html.mesh74-embed[data-m74-embed='network'] .health-coverage,
html.mesh74-embed[data-m74-embed='network'] .health-quality,
html.mesh74-embed[data-m74-embed='network'] .health-metric__meta,
html.mesh74-embed[data-m74-embed='network'] .health-metric__spark,
html.mesh74-embed[data-m74-embed='network'] .health-chart-panel__hint {
  display: none !important;
}
html.mesh74-embed[data-m74-embed='network'] .health-toolbar {
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
html.mesh74-embed[data-m74-embed='network'] .health-tabs,
html.mesh74-embed[data-m74-embed='network'] .health-periods {
  flex-wrap: nowrap;
}
html.mesh74-embed[data-m74-embed='network'] .health-tab,
html.mesh74-embed[data-m74-embed='network'] .health-period {
  padding: 0.28rem 0.55rem;
  white-space: nowrap;
}
html.mesh74-embed[data-m74-embed='network'] .health-chart-panel {
  flex: 0 0 auto;
  min-height: 11.5rem;
  height: 12.5rem;
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0.5rem;
  overflow: hidden;
}
html.mesh74-embed[data-m74-embed='network'] .health-chart-panel__canvas {
  flex: 1 1 auto;
  height: auto;
  min-height: 8rem;
  max-height: none;
}
html.mesh74-embed[data-m74-embed='network'] .health-meta {
  font-size: 0.62rem;
  line-height: 1.35;
}

html.mesh74-embed[data-m74-embed='forum'] .portal-block--forum {
  min-height: 100%;
  padding: 0.75rem;
}

html.mesh74-embed #workspace,
html.mesh74-embed #chat {
  scroll-margin-top: 0;
}

.mesh-message-replyto {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mesh-message-actions {
  margin-top: 0.45rem;
}

.mesh-message-reply {
  appearance: none;
  border: 1px solid rgba(232, 140, 48, 0.35);
  background: rgba(232, 140, 48, 0.1);
  color: #f2c08a;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.mesh-message-reply:hover {
  background: rgba(232, 140, 48, 0.18);
}

body.chat-reply-open {
  overflow: hidden;
}

.chat-reply-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.chat-reply-modal[hidden] {
  display: none !important;
}

.chat-reply-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 6, 0.66);
  backdrop-filter: blur(4px);
}

.chat-reply-modal__dialog {
  position: relative;
  width: min(26rem, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  padding: 1rem 1.1rem 1.15rem;
  background: linear-gradient(165deg, var(--surface-2) 0%, var(--surface) 48%, #181512 100%);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.chat-reply-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.chat-reply-modal__title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.chat-reply-modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.chat-reply-modal__quote {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid #e88c30;
  background: rgba(232, 140, 48, 0.08);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.chat-reply-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.chat-reply-modal__field {
  position: relative;
  display: block;
}

.chat-reply-modal__label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-reply-modal__input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border-radius: 0.45rem;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.chat-reply-modal__input--area {
  resize: vertical;
  min-height: 4.5rem;
  padding-right: 4.8rem;
}

.chat-reply-modal__photo {
  position: absolute;
  right: 2.45rem;
  bottom: 0.35rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.chat-reply-modal__photo:hover,
.chat-reply-modal__photo[aria-pressed='true'] {
  background: var(--surface-2);
}

.chat-reply-modal__emoji {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.chat-reply-modal__emoji:hover,
.chat-reply-modal__emoji[aria-expanded='true'] {
  background: var(--surface-2);
}

.chat-emoji-panel--reply {
  left: 0;
  right: auto;
  bottom: auto;
  top: calc(100% + 0.3rem);
}

.chat-reply-modal__captcha-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.4rem;
}

.chat-reply-modal__captcha-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-top: 0.45rem;
}

.chat-reply-modal__refresh,
.chat-reply-modal__submit,
.chat-reply-modal__cancel {
  appearance: none;
  border-radius: 0.45rem;
  cursor: pointer;
  font: inherit;
}

.chat-reply-modal__refresh {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.45rem 0.65rem;
}

.chat-reply-modal__actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
}

.chat-reply-modal__submit {
  border: 0;
  background: #e88c30;
  color: #1a1208;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
}

.chat-reply-modal__cancel {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.5rem 0.85rem;
}

.chat-reply-modal__status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-reply-modal__status--ok {
  color: #b8d4bc;
}

.chat-reply-modal__status--err {
  color: #f0a8a0;
}

/* Desktop super-chat popout: full chat, no landing chrome */
html.mesh74-chat-popout,
html.mesh74-chat-popout body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  color-scheme: dark;
}

html.mesh74-chat-popout body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

html.mesh74-chat-popout .hero,
html.mesh74-chat-popout .portal-block--map,
html.mesh74-chat-popout #forum,
html.mesh74-chat-popout .portal-block--join-teaser,
html.mesh74-chat-popout .portal-block--health,
html.mesh74-chat-popout .portal-block--faq,
html.mesh74-chat-popout .footer,
html.mesh74-chat-popout .header__nav,
html.mesh74-chat-popout .portal-chat__expand,
html.mesh74-chat-popout .portal-chat__popout,
html.mesh74-chat-popout .portal-block--chat .section-head__index {
  display: none !important;
}

html.mesh74-chat-popout .node-status-bar,
html.mesh74-chat-popout .header {
  flex: 0 0 auto;
}

html.mesh74-chat-popout .header {
  padding: 0.65rem var(--space-page);
}

html.mesh74-chat-popout main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.mesh74-chat-popout .portal-workspace {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 0.9rem 0.7rem;
  gap: 0;
  display: flex;
  overflow: hidden;
}

html.mesh74-chat-popout .portal-block--chat {
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.4rem;
}

html.mesh74-chat-popout .portal-block--chat .section-head {
  flex: 0 0 auto;
  margin: 0.45rem 0 0;
}

html.mesh74-chat-popout .portal-block--chat .section-head__title {
  font-size: 1.15rem;
}

html.mesh74-chat-popout .portal-chat {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.mesh74-chat-popout .portal-chat__toolbar,
html.mesh74-chat-popout .portal-chat__tabs,
html.mesh74-chat-popout .portal-chat__filters,
html.mesh74-chat-popout .portal-chat__load-older,
html.mesh74-chat-popout .chat-compose,
html.mesh74-chat-popout .chat-bots-help,
html.mesh74-chat-popout .portal-chat__foot {
  flex: 0 0 auto;
}

html.mesh74-chat-popout .portal-chat__list,
html.mesh74-chat-popout .portal-chat__empty {
  flex: 1 1 0;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden;
  overflow-y: auto;
}

html.mesh74-chat-popout .chat-compose {
  margin-top: 0;
}

.superchat-only {
  display: none !important;
}

html.mesh74-chat-popout .node-status-bar,
html.mesh74-chat-popout .logo__word small,
html.mesh74-chat-popout .header__freq,
html.mesh74-chat-popout .header__tag,
html.mesh74-chat-popout .portal-block--chat .section-head,
html.mesh74-chat-popout .chat-compose__title,
html.mesh74-chat-popout .chat-compose__hint,
html.mesh74-chat-popout .chat-bots-help,
html.mesh74-chat-popout .portal-chat__foot {
  display: none !important;
}

html.mesh74-chat-popout.superchat-help-open .chat-bots-help,
html.mesh74-chat-popout.superchat-help-open .portal-chat__foot {
  display: block !important;
}

html.mesh74-chat-popout:not(.superchat-compose-open) .chat-compose__name-field,
html.mesh74-chat-popout:not(.superchat-compose-open) .chat-compose__captcha-block {
  display: none !important;
}

html.mesh74-chat-popout .portal-chat {
  display: grid;
  grid-template-columns: minmax(15.5rem, 18rem) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    'toolbar toolbar'
    'filters main'
    'compose compose'
    'help help';
  gap: 0;
  border-radius: 10px;
}

html.mesh74-chat-popout .portal-chat__toolbar {
  grid-area: toolbar;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  padding: 0.4rem 0.75rem;
}

html.mesh74-chat-popout .portal-chat__tabs {
  flex: 1 1 100%;
  order: 20;
  margin: 0.1rem -0.15rem 0;
  padding: 0.4rem 0.15rem 0.15rem;
}

html.mesh74-chat-popout .portal-chat__filters {
  grid-area: filters;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem 0.75rem 0.8rem;
  border-bottom: 0;
  border-right: 1px solid var(--line-soft);
}

html.mesh74-chat-popout .superchat-main {
  grid-area: main;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

html.mesh74-chat-popout .portal-chat__load-older {
  flex: 0 0 auto;
}

html.mesh74-chat-popout .portal-chat__list,
html.mesh74-chat-popout .portal-chat__empty {
  flex: 1 1 0;
  min-height: 0 !important;
  max-height: none !important;
}

html.mesh74-chat-popout .chat-compose {
  grid-area: compose;
  padding: 0.45rem 0.75rem 0.55rem;
  border-top: 1px solid var(--line-soft);
}

html.mesh74-chat-popout .chat-bots-help,
html.mesh74-chat-popout .portal-chat__foot {
  grid-area: help;
  margin: 0;
  padding: 0.4rem 0.75rem 0.55rem;
}

html.mesh74-chat-popout .superchat-tools.superchat-only {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  min-width: 0;
  flex: 1 1 14rem;
}

html.mesh74-chat-popout .superchat-search {
  flex: 1 1 10rem;
  min-width: 0;
}

html.mesh74-chat-popout .superchat-search input {
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
}

html.mesh74-chat-popout .superchat-toolbtn {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

html.mesh74-chat-popout .superchat-toolbtn--on,
html.mesh74-chat-popout .superchat-toolbtn[aria-pressed='true'] {
  border-color: rgba(196, 165, 116, 0.65);
  background: rgba(196, 165, 116, 0.16);
  color: var(--amber);
}

html.mesh74-chat-popout .superchat-jump.superchat-only:not([hidden]) {
  display: inline-flex !important;
  position: absolute;
  right: 0.85rem;
  bottom: 0.75rem;
  z-index: 3;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(196, 165, 116, 0.55);
  border-radius: 999px;
  background: rgba(20, 18, 16, 0.92);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
}

html.mesh74-chat-popout .superchat-new-sep {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0.2rem;
  color: var(--rust);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.mesh74-chat-popout .superchat-new-sep::before,
html.mesh74-chat-popout .superchat-new-sep::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: rgba(196, 92, 58, 0.45);
}

html.mesh74-chat-popout #portal-error {
  flex: 0 0 auto;
  margin: 0.45rem 0 0;
}

html.mesh74-chat-popout .chat-compose__mode {
  margin-bottom: 0.2rem;
}

html.mesh74-chat-popout .chat-compose__input--area {
  min-height: 3.1rem;
}

html.mesh74-chat-popout .portal-chat__filters {
  display: flex;
  flex-direction: column;
}

html.mesh74-chat-popout .superchat-online.superchat-only {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 7rem;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line-soft);
}

html.mesh74-chat-popout .superchat-online__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

html.mesh74-chat-popout .superchat-online__hops {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

html.mesh74-chat-popout .superchat-hop {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  cursor: pointer;
}

html.mesh74-chat-popout .superchat-hop--on {
  border-color: rgba(196, 165, 116, 0.6);
  background: rgba(196, 165, 116, 0.14);
  color: var(--amber);
}

html.mesh74-chat-popout .superchat-hop__n {
  color: var(--text-faint);
}

html.mesh74-chat-popout .superchat-hop--on .superchat-hop__n {
  color: var(--amber);
}

html.mesh74-chat-popout .superchat-online__count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--amber);
}

html.mesh74-chat-popout .superchat-online__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

html.mesh74-chat-popout .superchat-online__empty {
  margin: 0.35rem 0 0;
  color: var(--text-faint);
  font-size: 0.78rem;
}

html.mesh74-chat-popout .superchat-online__item {
  display: grid;
  grid-template-columns: 0.55rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.28rem 0.2rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

html.mesh74-chat-popout .superchat-online__item:hover {
  background: rgba(196, 165, 116, 0.1);
}

html.mesh74-chat-popout .superchat-online__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #6b8f71;
  box-shadow: 0 0 0 3px rgba(107, 143, 113, 0.18);
}

html.mesh74-chat-popout .superchat-online__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

html.mesh74-chat-popout .superchat-online__meta {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-faint);
  white-space: nowrap;
}

@media (max-width: 1099px) {
  html.mesh74-chat-popout .portal-chat {
    grid-template-columns: 1fr;
    grid-template-areas:
      'toolbar'
      'filters'
      'main'
      'compose'
      'help';
  }

  html.mesh74-chat-popout .portal-chat__filters {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    max-height: 38vh;
  }
}

