/* Shared portal chrome — sticky top bar + social auth affordances
   Used by boarding + Mission so navigation stays stationary site-wide. */

:root {
  --portal-topbar-h: 56px;
  --portal-max: 1600px;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--portal-topbar-h);
  border-bottom: 1px solid var(--glass-border, rgba(0, 255, 159, 0.12));
  background: linear-gradient(
    180deg,
    var(--glass-bg-top, rgba(18, 18, 18, 0.96)),
    var(--glass-bg-bot, rgba(5, 5, 5, 0.98))
  );
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 var(--glass-highlight, rgba(255, 255, 255, 0.04));
}
.portal-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--topbar-edge, rgba(0, 255, 159, 0.45)) 50%,
    transparent 100%
  );
  pointer-events: none;
  opacity: 0.9;
}

.portal-topbar-inner {
  max-width: var(--portal-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Mission: brand+nav | centered telemetry | actions */
.portal-topbar-inner.portal-topbar-mission {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}
.portal-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  justify-self: start;
}
.portal-topbar-left .portal-nav {
  flex: 0 1 auto;
  margin-left: 0.15rem;
}
.portal-topbar-center {
  justify-self: center;
  min-width: 0;
  max-width: 100%;
}
.portal-topbar-mission .portal-actions {
  margin-left: 0;
  justify-self: end;
}
.portal-telemetry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  flex-wrap: nowrap;
  /* Wide enough for mark + F&G + BTC.D + Mode without clipping */
  max-width: min(640px, 52vw);
  min-width: min(420px, 40vw);
  overflow-x: auto;
  scrollbar-width: none;
}
.portal-telemetry::-webkit-scrollbar { display: none; }
.portal-telemetry .seg {
  flex: 1 1 0;
  flex-shrink: 1;
  min-width: 4.6rem;
}
/* —— Mobile / tablet only (desktop grid above unchanged) —— */
@media (max-width: 900px) {
  .portal-topbar-inner.portal-topbar-mission {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.45rem;
    padding: 0.4rem 0.55rem 0.35rem;
    align-items: center;
  }
  .portal-topbar-center {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0 0 0.15rem;
  }
  body.has-portal-topbar .portal-topbar:has(.portal-topbar-mission) {
    height: auto;
    min-height: var(--portal-topbar-h);
  }
  /* Rails: full-page scroll on mobile rather than sticky under tall topbar */
  body.has-portal-topbar:has(.portal-topbar-mission) .rail {
    top: 0;
    max-height: none;
    position: relative;
  }
  .portal-telemetry {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    justify-content: stretch;
    gap: 0.2rem;
    overflow-x: visible;
  }
  .portal-telemetry .seg {
    flex: 1 1 0;
    min-width: 0 !important;
    max-width: none;
  }
  .portal-actions {
    gap: 0.25rem;
  }
  .portal-actions .btn.sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
  }
  .portal-burger {
    width: 2.25rem;
    height: 2.25rem;
  }
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text, #e4e4e7);
  flex-shrink: 0;
  text-decoration: none;
}
.portal-brand:hover { color: var(--text, #e4e4e7); }

/* Default mark; brand.css + logo-mark-*.png for official art (height-driven) */
.portal-mark {
  height: 1.75rem; /* 28px — fits 56px topbar with padding */
  width: auto;
  aspect-ratio: 1.32 / 1;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: none;
  flex-shrink: 0;
  line-height: 0;
}
.portal-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.portal-name {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.portal-name em {
  font-style: normal;
  color: var(--green, #00ff9f);
  font-weight: 800;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.portal-nav::-webkit-scrollbar { display: none; }

.portal-link {
  color: var(--muted, #8b9aab);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.36rem 0.58rem;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
}
.portal-link:hover {
  color: #e8eef4;
  background: rgba(0, 0, 0, 0.28);
  border-color: color-mix(in srgb, var(--blue-soft) 28%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.portal-link.is-on {
  color: #f0fdf8;
  background: rgba(0, 255, 159, 0.1);
  border-color: rgba(0, 255, 159, 0.32);
  box-shadow:
    0 0 12px rgba(0, 255, 159, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
}
.portal-actions .btn {
  border-radius: 8px;
  border: 1px solid var(--glass-border-soft, var(--line));
  background: var(--fill-deep, rgba(0, 0, 0, 0.32));
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--glass-inset, inset 0 1px 0 rgba(255, 255, 255, 0.04));
}
.portal-actions .btn:hover {
  border-color: var(--glass-border, var(--line));
  background: var(--hover-fill, rgba(255, 255, 255, 0.06));
  color: var(--text);
}
.portal-actions .btn.primary {
  background: linear-gradient(180deg, var(--green-dim), color-mix(in srgb, var(--green) 55%, #000));
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  color: var(--text-on-accent, #041018);
  box-shadow:
    0 0 12px var(--green-glow),
    var(--glass-inset, inset 0 1px 0 rgba(255, 255, 255, 0.08));
}
.portal-actions .btn.primary:hover {
  filter: brightness(1.06);
  border-color: var(--green, #00ff9f);
}
.portal-actions .btn.ghost {
  color: var(--muted, #8b9aab);
  border-color: var(--glass-border-soft, var(--line));
  background: transparent;
}

.portal-icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--blue-soft) 22%, transparent);
  background: rgba(0, 0, 0, 0.32);
  color: var(--muted, #8b9aab);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.portal-icon-btn:hover {
  color: #e8eef4;
  border-color: rgba(0, 255, 159, 0.4);
  background: rgba(0, 255, 159, 0.08);
}

.portal-burger {
  display: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--blue-soft) 22%, transparent);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text, #e8eef4);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.portal-burger:hover {
  border-color: rgba(0, 255, 159, 0.4);
  background: rgba(0, 255, 159, 0.08);
}

.portal-mobile-nav {
  border-bottom: 1px solid rgba(0, 255, 159, 0.12);
  background:
    linear-gradient(180deg, rgba(8, 20, 34, 0.98), rgba(3, 8, 14, 0.99));
  padding: 0.5rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.portal-mobile-nav[hidden] { display: none !important; }
.portal-mobile-nav a,
.portal-mobile-nav button {
  color: var(--text, #e4e4e7);
  padding: 0.55rem 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 8px;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.portal-mobile-nav a:hover,
.portal-mobile-nav button:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Social login grid (UI-first; providers wired later) */
.social-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--line, #1c1c1f);
  background: var(--fill-deep, var(--bg-elev));
  color: var(--text, #e4e4e7);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
  font-family: inherit;
}
.social-btn:hover {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, transparent);
}
.social-btn:disabled,
.social-btn.is-soon {
  opacity: 0.92;
}
.social-btn .s-ico {
  width: 1.05rem;
  height: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 4px;
  flex-shrink: 0;
}
.social-btn[data-provider="google"] .s-ico { background: #fff; color: #ea4335; font-size: 0.7rem; }
.social-btn[data-provider="apple"] .s-ico { background: #111; color: #fff; border: 1px solid #333; }
.social-btn[data-provider="telegram"] .s-ico { background: #229ed9; color: #fff; font-size: 0.65rem; }
.social-btn[data-provider="x"] .s-ico { background: #000; color: #fff; border: 1px solid #333; }
.social-soon {
  margin: 0.45rem 0 0;
  font-size: 0.65rem;
  color: var(--dim, #52525b);
  text-align: center;
}

body.has-portal-topbar {
  /* Mission shell sits under sticky bar */
}

body.has-portal-topbar .shell {
  min-height: calc(100vh - var(--portal-topbar-h));
}

body.has-portal-topbar .rail {
  max-height: calc(100vh - var(--portal-topbar-h));
  top: var(--portal-topbar-h);
}

@media (max-width: 980px) {
  .portal-nav { display: none; }
  .portal-burger { display: inline-flex; }
}
@media (max-width: 640px) {
  /* Keep official mark; hide text wordmark to save space */
  .portal-name { display: none; }
  /* Slightly larger mark when wordmark is hidden (logo-only topbar) */
  .portal-mark.brand-mark,
  .portal-mark {
    height: 2rem; /* 32px */
    width: auto;
    aspect-ratio: 1.32 / 1;
  }
  .portal-actions .btn-hide-sm { display: none; }
  /* Log out / long labels live in burger menu — free top-row space */
  .portal-actions #btn-portal-logout {
    display: none;
  }
  .portal-actions #btn-portal-user {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .portal-topbar-inner.portal-topbar-mission {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }
  .portal-mobile-nav {
    padding: 0.45rem 0.65rem 0.65rem;
  }
  .portal-mobile-nav button {
    min-height: 2.6rem;
    padding: 0.65rem 0.5rem;
    font-size: 0.92rem;
  }
}

/* �� Shared site footer + legal pages �� */
.portal-footer {
  border-top: 1px solid var(--line, #1c1c1f);
  padding: 2rem 0 0;
  background: var(--bg-elev, var(--bg));
  color: var(--text);
  margin-top: auto;
}
.portal-footer .section-inner,
.portal-footer .footer-grid {
  max-width: var(--portal-max, 1600px);
  margin: 0 auto;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
}
.footer-brand { margin-bottom: 0.5rem; }
.footer-tag {
  margin: 0.4rem 0 0;
  color: var(--dim, #52525b);
  font-size: 0.82rem;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.footer-h {
  margin: 0 0 0.45rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim, #52525b);
}
.footer-cols a,
.footer-muted {
  display: block;
  color: var(--muted, #71717a);
  font-size: 0.82rem;
  margin-bottom: 0.3rem;
  text-decoration: none;
}
.footer-cols a:hover { color: var(--text, #e4e4e7); }
.footer-base {
  border-top: 1px solid var(--line-soft, #141418);
  max-width: var(--portal-max, 1600px);
  margin: 0 auto;
  padding: 0.85rem 1.1rem 1.15rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--dim, #52525b);
  font-size: 0.72rem;
}
.footer-base a {
  color: var(--muted, #71717a);
  text-decoration: none;
  margin-left: 0.75rem;
}
.footer-base a:hover { color: var(--text, #e4e4e7); }
.footer-base-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

/* Compact footer for Mission SPA */
.site-footer-slim {
  border-top: 1px solid var(--line, #1c1c1f);
  background: rgba(7, 7, 9, 0.95);
  padding: 0.55rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.72rem;
  color: var(--dim, #52525b);
  z-index: 50;
}
.site-footer-slim a {
  color: var(--muted, #71717a);
  text-decoration: none;
  margin-left: 0.85rem;
}
.site-footer-slim a:hover { color: var(--text, #e4e4e7); }
.site-footer-slim .foot-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

/* Legal document pages */
body.legal-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg, #050506);
  color: var(--text, #e4e4e7);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}
.legal-main {
  flex: 1 1 auto;
  max-width: 780px;
  margin: 0 auto;
  padding: 1.75rem 1.15rem 3rem;
  width: 100%;
  box-sizing: border-box;
}
.legal-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim, #52525b);
}
.legal-main h1 {
  margin: 0 0 0.5rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.legal-meta {
  margin: 0 0 1.5rem;
  font-size: 0.82rem;
  color: var(--muted, #71717a);
}
.legal-callout {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(252, 211, 77, 0.28);
  background: rgba(66, 48, 6, 0.25);
  color: #fde68a;
  font-size: 0.84rem;
  line-height: 1.5;
}
.legal-main h2 {
  margin: 1.75rem 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.legal-main h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: #d4d4d8;
}
.legal-main p,
.legal-main li {
  color: #d4d4d8;
  font-size: 0.92rem;
}
.legal-main p { margin: 0 0 0.75rem; }
.legal-main ul,
.legal-main ol {
  margin: 0 0 0.9rem;
  padding-left: 1.25rem;
}
.legal-main li { margin-bottom: 0.35rem; }
.legal-main a { color: #93c5fd; }
.legal-toc {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line, #1c1c1f);
  background: #0a0a0e;
}
.legal-toc p {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim, #52525b);
}
.legal-toc a {
  display: block;
  font-size: 0.84rem;
  color: var(--muted, #71717a);
  text-decoration: none;
  margin-bottom: 0.25rem;
}
.legal-toc a:hover { color: var(--text, #e4e4e7); }

/* What’s New — changelog / roadmap / fixes */
.whats-new-main .wn-lead {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--muted, #8b9aab);
  line-height: 1.55;
}
.wn-section {
  margin: 0 0 2rem;
}
.wn-section > h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text, #e8eef4);
}
.wn-section-lead {
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
  color: var(--muted, #8b9aab);
}
.wn-card {
  margin: 0 0 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line, #1a2d40);
  background: var(--bg-panel, #0c1824);
}
.wn-card--feature {
  border-color: rgba(0, 255, 159, 0.28);
  box-shadow: 0 0 0 1px rgba(0, 255, 159, 0.06), 0 12px 32px rgba(0, 0, 0, 0.25);
}
.wn-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
}
.wn-card-meta time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dim, #5c6b7a);
}
.wn-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 750;
  color: var(--text, #e8eef4);
}
.wn-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #c5d0db;
  line-height: 1.55;
}
.wn-card ul {
  margin: 0;
  padding-left: 1.15rem;
}
.wn-card li {
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: #c5d0db;
}
.wn-card code {
  font-size: 0.82em;
  padding: 0.08em 0.35em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: #9fd4ff;
}
.wn-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.wn-badge--shipped {
  color: #00ff9f;
  border-color: rgba(0, 255, 159, 0.35);
  background: rgba(0, 255, 159, 0.08);
}
.wn-badge--now {
  color: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue-soft) 40%, transparent);
  background: rgba(10, 92, 173, 0.2);
}
.wn-badge--next {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}
.wn-badge--later {
  color: #8b9aab;
  border-color: rgba(139, 154, 171, 0.35);
  background: rgba(139, 154, 171, 0.08);
}
.wn-badge--fix {
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.4);
  background: rgba(255, 77, 0, 0.08);
}
.wn-roadmap {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 720px) {
  .wn-roadmap {
    grid-template-columns: repeat(3, 1fr);
  }
  .wn-roadmap .wn-card {
    height: 100%;
  }
}
.wn-card--cta .wn-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.75rem;
}
.wn-footnote {
  margin: 0.5rem 0 0 !important;
  font-size: 0.78rem !important;
  color: var(--dim, #5c6b7a) !important;
}
.wn-toc a {
  color: var(--muted, #8b9aab);
}

.legal-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line, #1c1c1f);
  font-size: 0.85rem;
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

/* UC in-app inbox */
.uc-inbox-badge {
  display: inline-flex;
  min-width: 1rem;
  padding: 0.05rem 0.35rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--green, #00ff9f);
  color: #04140c;
  vertical-align: middle;
}
.uc-inbox-list {
  max-height: 14rem;
  overflow: auto;
  margin-top: 0.4rem;
}
.uc-inbox-msg {
  border: 1px solid var(--line, #2a2a2a);
  border-radius: 8px;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.4rem;
  background: var(--bg-elev, #0c0c0c);
}
.uc-inbox-msg.is-unread {
  border-color: color-mix(in srgb, var(--green, #00ff9f) 40%, transparent);
}
.uc-inbox-msg-top {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: baseline;
}
.uc-inbox-body {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: pre-wrap;
  color: var(--text, #f2f2f2);
}
.uc-inbox-compose summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.82rem;
  color: var(--muted, #9a9a9a);
}

/* Portal messages envelope (next to User) */
.portal-msg-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.35rem 0.45rem !important;
}
.portal-msg-icon {
  display: block;
  flex-shrink: 0;
}
.portal-msg-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.2rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1rem;
  text-align: center;
  background: var(--green, #00ff9f);
  color: #04140c;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
/* —— Pilot Messages center · full-screen modal (not docked to Mission bottom) —— */
.msg-pop[hidden] { display: none !important; }
.msg-pop {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: auto;
}
body.msg-pop-open {
  overflow: hidden;
}
.msg-pop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: auto;
}
.msg-pop-panel {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: min(560px, 100%);
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,255,159,0.28);
  border-radius: 14px;
  background: #0a0a0a;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
.msg-pop-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.msg-pop-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a7a7a;
}
.msg-pop-title {
  margin: 0;
  font-size: 1.05rem;
  color: #f0f0f0;
}
.msg-pop-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}
.msg-pop-tabs {
  display: flex;
  gap: 0.1rem;
  padding: 0.25rem 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.msg-pop-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #8a8a8a;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.4rem 0.5rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.msg-pop-tab.is-active {
  color: #00ff9f;
  border-bottom-color: #00ff9f;
}
.msg-pop-tab-n {
  margin-left: 0.2rem;
  font-size: 0.6rem;
  padding: 0.05rem 0.28rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}
.msg-pop-tab-n.has-unread {
  background: #00ff9f;
  color: #04140c;
}
.msg-pop-hint {
  margin: 0;
  padding: 0.3rem 0.75rem;
  font-size: 0.65rem;
  color: #6a6a6a;
}
.msg-pop-list {
  flex: 1;
  overflow: auto;
  padding: 0.45rem 0.55rem;
  min-height: 8rem;
}
.msg-pop-empty {
  margin: 0.5rem;
  font-size: 0.78rem;
  color: #888;
}
.msg-full-modal[hidden] { display: none !important; }
.msg-full-modal {
  position: fixed;
  inset: 0;
  z-index: 13100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.msg-full-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
}
.msg-full-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(80vh, 680px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,255,159,0.3);
  border-radius: 12px;
  background: #0a0a0a;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.msg-full-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.msg-full-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  flex-shrink: 0;
}
.msg-full-actions .btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.msg-full-meta {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7a7a7a;
}
.msg-full-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #f2f2f2;
}
.msg-full-body {
  padding: 1rem;
  overflow: auto;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #d4d4d4;
  white-space: pre-wrap;
}
.msg-compose-body .field-label {
  display: block;
  margin: 0.4rem 0 0.2rem;
  font-size: 0.68rem;
  color: #8a8a8a;
  text-transform: uppercase;
}
.msg-compose-body .field-input {
  width: 100%;
}
.msg-pop-compose-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.msg-pop-status {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: #9a9a9a;
}
.msg-pop-status.ok { color: #00ff9f; }
.msg-pop-status.err { color: #f87171; }
/* reuse admin pill look if not on page */
.inbox-pill-wrap { display: flex; flex-direction: column; gap: 0.35rem; }
.msg-pop .inbox-pill {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 0.4rem minmax(3.5rem, 5.5rem) minmax(0, 1fr) 4.5rem;
  gap: 0.35rem;
  align-items: center;
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: #080808;
  color: #c8c8c8;
  font: inherit;
  font-size: 0.74rem;
  padding: 0.38rem 0.65rem 0.38rem 0.45rem;
}
.msg-pop .inbox-pill.is-unread {
  border-color: rgba(0,255,159,0.45);
  font-weight: 700;
  color: #f2f2f2;
}
.msg-pop .inbox-pill-dot {
  width: 0.35rem; height: 0.35rem; border-radius: 50%;
}
.msg-pop .inbox-pill.is-unread .inbox-pill-dot { background: #00ff9f; }
.msg-pop .inbox-pill-from, .msg-pop .inbox-pill-subj {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-pop .inbox-pill-when { text-align: right; font-size: 0.62rem; color: #666; }
