/* TODO: Organize CSS */

/* ROOT */
:root {
  --void-black: #05050f;
  --cold-navy: #0a1f2e;
  --dark-steel: #112233;
  --electric-cyan: #00f7ff;
  --muted-amber: #ffaa33;
  --text-main: #d8ebf5;
  --text-muted: #89a7bd;
  --panel: rgba(10, 31, 46, 0.68);
  --panel-border: rgba(0, 247, 255, 0.18);
  --danger: #f06a77;

  /* Semantic aliases used throughout the stylesheet */
  --accent: var(--electric-cyan);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --surface: var(--cold-navy);
  --border: rgba(0, 247, 255, 0.18);
  --warn: var(--muted-amber);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--void-black);
  color: var(--text-main);
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

/* --- Extractor Downtime/Inactive Styling --- */
.extractor-row.downtime {
  background: linear-gradient(90deg, #2a0a0a 0%, #5a1818 100%);
  border: 1.5px solid #f06a77;
  box-shadow: 0 0 12px 0 #f06a7740;
}
.building-status-badge.downtime {
  background: #f06a77;
  color: #fff;
  border: 1px solid #f06a77;
  text-shadow: 0 1px 2px #a22;
}
.building-status-badge.inactive {
  background: #a22;
  color: #fff;
  border: 1px solid #a22;
  text-shadow: 0 1px 2px #a22;
}
.extractor-progress-bar.downtime {
  background: linear-gradient(90deg, #f06a77 0%, #a22 100%);
  height: 8px;
  border-radius: 6px;
  box-shadow: 0 0 8px #f06a77a0;
}
#market {
  padding: 2em;
}

/* Galactic Exchange background for #market */
#market {
  background: url("/images/galactic_exchange.jpg") center center/cover no-repeat;
  background-attachment: local;
  border-radius: 18px;
  box-shadow: 0 0 40px 0 rgba(0,0,0,0.32);
  position: relative;
  overflow: hidden;
}
#market::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--void-black);
  opacity: 0.78;
  z-index: 1;
  pointer-events: none;
}
#market > * {
  position: relative;
  z-index: 2;
}
/* Direct background for Galactic Exchange tab/page */
#exchange-root {
  background: url("/images/galactic_exchange.jpg") center center/cover no-repeat;
  background-attachment: local;
  border-radius: 18px;
  box-shadow: 0 0 40px 0 rgba(0,0,0,0.32);
  position: relative;
  overflow: hidden;
}
#exchange-root::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--void-black);
  opacity: 0.78;
  z-index: 1;
  pointer-events: none;
}
#exchange-root > * {
  position: relative;
  z-index: 2;
}
/* Make Create Listing and Sell Orders the same height */
.exchange-layout {
  align-items: stretch;
}
.exchange-layout > .exchange-section {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.exchange-layout > .exchange-section .table-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
/* Galactic Exchange background */
#station-building-content.ge-bg {
  background: url("/images/galactic_exchange.jpg") center center/cover no-repeat;
  background-attachment: local;
  border-radius: 18px;
  box-shadow: 0 0 40px 0 rgba(0,0,0,0.32);
  position: relative;
  overflow: hidden;
}
#station-building-content.ge-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--void-black);
  opacity: 0.78;
  z-index: 1;
  pointer-events: none;
}
#station-building-content.ge-bg > * {
  position: relative;
  z-index: 2;
}

/* ISA Claims & Leases Division: Responsive .form-card width */
#station-building-content.icl-bg .form-card {
  width: 900px;
  max-width: 100%;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
}
#station-building-content.icl-bg .form-card .lease-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
#station-building-content.icl-bg .form-card .lease-card {
  flex: 1 1 300px;
  min-width: 280px;
  max-width: 420px;
}
@media (min-width: 901px) {
  #station-building-content.icl-bg .form-card.expand-width {
    width: auto;
    min-width: 900px;
    max-width: none;
  }
}
/* ISA Claims & Leases Division background */
#station-building-content.icl-bg {
  background: url("/images/isa_claims_leases_division.jpg") center center/cover no-repeat;
  background-attachment: local;
  border-radius: 18px;
  box-shadow: 0 0 40px 0 rgba(0,0,0,0.32);
  position: relative;
  overflow: hidden;
}
#station-building-content.icl-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--void-black);
  opacity: 0.78;
  z-index: 1;
  pointer-events: none;
}
#station-building-content.icl-bg > * {
  position: relative;
  z-index: 2;
}
/* Orbital Executive Suites background */
#station-building-content.oes-bg {
  background: url("/images/orbital_executive_suites.jpg") center center/cover no-repeat;
  background-attachment: local;
  border-radius: 18px;
  box-shadow: 0 0 40px 0 rgba(0,0,0,0.32);
  position: relative;
  overflow: hidden;
}

#station-building-content.oes-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--void-black);
  opacity: 0.78;
  z-index: 1;
  pointer-events: none;
}

#station-building-content.oes-bg > * {
  position: relative;
  z-index: 2;
}

#station-building-content {
  padding: 2em;
}

/* ─── Starfield canvas ─── */
#starfield-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: block;
}

/* ─── App background nebula layer ─── */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 15% 20%, rgba(0, 247, 255, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 12%, rgba(255, 170, 51, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 62% 80%, rgba(0, 100, 180, 0.1) 0%, transparent 55%),
    linear-gradient(160deg, #05050f 0%, #070d1a 40%, #0a1f2e 70%, #05050f 100%);
  animation: nebulaDrift 90s ease-in-out infinite alternate;
}

@keyframes nebulaDrift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 2% 3%; }
}

/* ─── Auth shell ─── */
.auth-shell {
  min-height: 100vh;
  width: 100%;
}

.auth-card {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  counter-reset: lore-section;
}

/* ─── Landing hero ─── */
.landing-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: none;
  padding: clamp(3rem, 8vw, 7rem) clamp(1.25rem, 6vw, 5rem);
  position: relative;
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 247, 255, 0.06) 0%, transparent 65%),
    radial-gradient(ellipse 60% 30% at 20% 80%, rgba(255, 170, 51, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

/* Logo SVG */
.hero-logo {
  width: clamp(100px, 18vw, 160px);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  animation: logoFloat 8s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(0, 247, 255, 0.35));
}

.logo-svg {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* Overline */
.hero-overline {
  margin: 0 0 1.4rem;
  color: var(--muted-amber);
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: clamp(0.65rem, 1.4vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* Main title */
.hero-title {
  margin: 0 0 clamp(1.2rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  line-height: 1.0;
}

.hero-title-top,
.hero-title-bottom {
  display: block;
  font-family: "Orbitron", "Inter", sans-serif;
  font-weight: 700;
  color: #e8f8ff;
  text-shadow:
    0 0 30px rgba(0, 247, 255, 0.55),
    0 0 80px rgba(0, 247, 255, 0.18);
  letter-spacing: 0.04em;
}

.hero-title-top {
  font-size: clamp(1.4rem, 4.5vw, 3.8rem);
  opacity: 0.88;
}

.hero-title-bottom {
  font-size: clamp(1.8rem, 6vw, 5rem);
  color: #00f7ff;
  text-shadow:
    0 0 20px rgba(0, 247, 255, 0.9),
    0 0 60px rgba(0, 247, 255, 0.4),
    0 0 120px rgba(0, 247, 255, 0.15);
}

/* Divider */
.hero-divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: min(320px, 70%);
  margin: 0 auto clamp(1.2rem, 2.5vw, 1.8rem);
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 247, 255, 0.45), transparent);
}

.divider-diamond {
  width: 6px;
  height: 6px;
  background: var(--electric-cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(0, 247, 255, 0.8);
  flex-shrink: 0;
}

/* Tagline */
.hero-tagline {
  margin: 0 0 1.1rem;
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  font-weight: 600;
  font-style: italic;
  color: #bde0ee;
  letter-spacing: 0.01em;
  opacity: 0.95;
}

/* Description */
.hero-desc {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  font-size: clamp(0.88rem, 1.6vw, 1.05rem);
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 680px;
}

/* Hero action buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin: 0 0 1.2rem;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: clamp(0.72rem, 1.3vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 6px;
  padding: clamp(0.65rem, 1.5vw, 0.85rem) clamp(1.4rem, 3vw, 2.2rem);
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.btn-hero-outline {
  background: transparent;
  border: 1px solid rgba(0, 247, 255, 0.55);
  color: var(--electric-cyan);
  box-shadow: 0 0 14px rgba(0, 247, 255, 0.12), inset 0 0 14px rgba(0, 247, 255, 0.04);
}

.btn-hero-outline:hover {
  background: rgba(0, 247, 255, 0.08);
  border-color: rgba(0, 247, 255, 0.9);
  box-shadow: 0 0 24px rgba(0, 247, 255, 0.3), 0 0 6px rgba(0, 247, 255, 0.2);
  color: #fff;
}

.btn-hero-fill {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.22), rgba(0, 180, 220, 0.28));
  border: 1px solid rgba(0, 247, 255, 0.75);
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-hero-fill:hover {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.38), rgba(0, 200, 240, 0.42));
  box-shadow: 0 0 36px rgba(0, 247, 255, 0.45), 0 0 10px rgba(0, 247, 255, 0.25);
  transform: translateY(-1px);
}

/* Hero auth panels */
.auth-panel-hero {
  margin-top: 1.8rem;
  border: 1px solid rgba(0, 247, 255, 0.22);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  background: rgba(5, 16, 30, 0.82);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 520px;
  text-align: left;
}

.auth-panel-label {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.login-shell {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.login-card {
  width: min(760px, 100%);
  border: 1px solid rgba(0, 247, 255, 0.28);
  border-radius: 14px;
  background: rgba(5, 16, 30, 0.82);
  backdrop-filter: blur(10px);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(0, 247, 255, 0.08) inset,
    0 30px 60px rgba(0, 0, 0, 0.4);
}

.login-title {
  margin: 0 0 1rem;
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: clamp(1.5rem, 4.6vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #d6f5ff;
  text-shadow: 0 0 20px rgba(0, 247, 255, 0.28);
}

.login-copy {
  margin: 0 auto 2rem;
  max-width: 58ch;
  color: var(--text-muted);
  font-size: clamp(0.92rem, 1.8vw, 1.02rem);
  line-height: 1.7;
}

.login-form {
  width: min(560px, 100%);
  margin: 0 auto;
  text-align: left;
  display: grid;
  gap: 0.6rem;
}

.login-form label {
  font-family: "Rajdhani", "Inter", sans-serif;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #b2d4e5;
}

.login-form input {
  width: 100%;
  border: 1px solid rgba(0, 247, 255, 0.28);
  background: rgba(4, 12, 22, 0.9);
}

.login-form input:focus {
  outline: none;
  border-color: rgba(0, 247, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(0, 247, 255, 0.16);
}

.login-status {
  margin: 0.15rem 0 0.35rem;
  min-height: 1.35rem;
  color: #9ed4e7;
  font-size: 0.84rem;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.35rem;
}

.login-actions .btn-hero {
  width: 100%;
}

/* ─── Landing sections below hero ─── */
.landing-section {
  width: 100%;
  margin: 0;
  padding: 4.8rem clamp(1rem, 6vw, 6rem);
  border-top: 1px solid rgba(0, 247, 255, 0.08);
}

.auth-card > .landing-section:not(.landing-hero) {
  position: relative;
  overflow: hidden;
  counter-increment: lore-section;
}

.auth-card > .landing-section:not(.landing-hero)::before,
.auth-card > .landing-section:not(.landing-hero)::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-card > .landing-section:not(.landing-hero)::before {
  inset: 0;
  opacity: 0.35;
  background:
    linear-gradient(90deg, rgba(0, 247, 255, 0.06), transparent 24%),
    repeating-linear-gradient(
      to bottom,
      rgba(0, 247, 255, 0.03) 0,
      rgba(0, 247, 255, 0.03) 1px,
      transparent 1px,
      transparent 11px
    );
}

.auth-card > .landing-section:not(.landing-hero)::after {
  width: 460px;
  height: 460px;
  right: -190px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  opacity: 0.22;
  border: 1px solid rgba(0, 247, 255, 0.2);
  box-shadow:
    inset 0 0 0 28px rgba(0, 247, 255, 0.05),
    inset 0 0 0 72px rgba(0, 247, 255, 0.03);
}

.auth-card > .landing-section:not(.landing-hero):nth-of-type(even)::after {
  right: auto;
  left: -190px;
  border-color: rgba(255, 170, 51, 0.2);
  box-shadow:
    inset 0 0 0 28px rgba(255, 170, 51, 0.05),
    inset 0 0 0 72px rgba(255, 170, 51, 0.03);
}

.landing-section > h2,
.landing-section > p,
.landing-section > .landing-grid-3,
.landing-section > .landing-grid-2 {
  max-width: 1450px;
  margin-left: auto;
  margin-right: auto;
}

.landing-section > h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: fit-content;
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #c8e8f5;
  margin-bottom: 1.6rem;
  text-shadow: 0 0 20px rgba(0, 247, 255, 0.3);
}

.auth-card > .landing-section:not(.landing-hero) > h2::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0, 247, 255, 0.6);
  transform: rotate(45deg);
  box-shadow: 0 0 16px rgba(0, 247, 255, 0.25);
  background: rgba(0, 247, 255, 0.08);
}

.auth-card > .landing-section:not(.landing-hero) > h2::after {
  content: "SECTOR " counter(lore-section, decimal-leading-zero);
  margin-left: 0.35rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid rgba(0, 247, 255, 0.28);
  border-radius: 999px;
  color: rgba(180, 220, 242, 0.85);
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.landing-section:nth-of-type(2) {
  background: linear-gradient(180deg, rgba(8, 23, 37, 0.38) 0%, transparent 100%);
}
.landing-section:nth-of-type(3) {
  background: linear-gradient(180deg, rgba(9, 27, 43, 0.32) 0%, transparent 100%);
}
.landing-section:nth-of-type(4) {
  background: linear-gradient(180deg, rgba(12, 30, 47, 0.28) 0%, transparent 100%);
}
.landing-section:nth-of-type(5),
.landing-section:nth-of-type(6),
.landing-section:nth-of-type(7) {
  background: linear-gradient(180deg, rgba(10, 22, 35, 0.3) 0%, transparent 100%);
}

.cta-section {
  display: none;
}

.landing-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
  position: relative;
}

.landing-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.9rem;
  position: relative;
}

/* ─── Other shared landing components ─── */
.overline {
  margin: 0;
  color: var(--muted-amber);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  letter-spacing: 0.02em;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.muted {
  color: var(--text-muted);
}

.action-hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.lede {
  font-size: 0.98rem;
  line-height: 1.5;
}

.data-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 247, 255, 0.14);
  border-radius: 10px;
  background: rgba(12, 28, 44, 0.52);
  padding: 1.3rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.data-card::before,
.data-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.data-card::before {
  top: 0.5rem;
  right: 0.5rem;
  width: 34px;
  height: 34px;
  border-top: 1px solid rgba(0, 247, 255, 0.35);
  border-right: 1px solid rgba(0, 247, 255, 0.35);
}

.data-card::after {
  left: -20%;
  right: -20%;
  bottom: -18px;
  height: 36px;
  background: radial-gradient(circle at 50% 0%, rgba(0, 247, 255, 0.12), transparent 70%);
}

.data-card:hover {
  border-color: rgba(0, 247, 255, 0.3);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.07);
}

.data-card.requirement-done {
  border-color: rgba(0, 247, 255, 0.52);
  box-shadow: 0 0 24px rgba(0, 247, 255, 0.16);
}

.requirement-card {
  position: relative;
}

.requirement-card.requirement-clickable {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.requirement-card.requirement-clickable:hover {
  border-color: rgba(0, 247, 255, 0.4);
  background: rgba(0, 247, 255, 0.06);
}

.requirement-title {
  position: relative;
  display: inline-block;
  padding-right: 0.2rem;
}

.requirement-card.requirement-done .requirement-title {
  color: #9cd8c6;
}

.requirement-card.requirement-done .requirement-state {
  color: #9cd8c6;
}

@keyframes milestoneStrike {
  0% {
    width: 0%;
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    width: 100%;
    opacity: 1;
  }
}

.requirement-card.just-completed .requirement-title::after {
  content: "";
  position: absolute;
  left: 0;
  top: 53%;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, rgba(120, 255, 214, 0.15), rgba(120, 255, 214, 0.95), rgba(120, 255, 214, 0.15));
  box-shadow: 0 0 10px rgba(120, 255, 214, 0.5);
  animation: milestoneStrike 0.8s ease-out forwards;
}

.data-card h3 {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-family: "Rajdhani", "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #c0dff0;
}

.data-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.compact-card {
  min-height: 100%;
}

.feedback-panel {
  margin-top: 0.8rem;
}

.feedback-success {
  color: #b9ffe6;
}

.feedback-error {
  color: #ffb1bb;
}

.feedback-info {
  color: #b7d7e8;
}

/* ─── App header (game shell) ─── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(5, 5, 15, 0.86);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

#game-shell {
  height:100vh;
}

.header-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.header-actions .btn,
.header-actions .notification-dropdown .btn {
  height: 2.25rem;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
}

.notification-dropdown {
  position: relative;
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  padding: 0 0.38rem;
  font-size: 0.72rem;
  color: #fff;
  background: rgba(255, 170, 51, 0.75);
  border: 1px solid rgba(255, 170, 51, 0.9);
}

.notification-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(420px, 86vw);
  max-height: min(82vh, 612px);
  padding: 0.9rem;
  border: 1px solid rgba(0, 247, 255, 0.25);
  border-radius: 10px;
  background: rgba(6, 18, 30, 0.9);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 40;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

#notification-list {
  max-height: min(66vh, 452px);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.notification-item {
  border: 1px solid rgba(0, 247, 255, 0.16);
  border-radius: 8px;
  background: rgba(17, 34, 51, 0.55);
  padding: 0.55rem 0.65rem;
}

.notification-item.unread {
  border-color: rgba(255, 170, 51, 0.55);
  box-shadow: 0 0 16px rgba(255, 170, 51, 0.12);
}

.notification-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ─── UI buttons ─── */
.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.48rem 0.78rem;
  cursor: pointer;
  color: var(--text-main);
  background: rgba(17, 34, 51, 0.92);
}

.btn-outline {
  border-color: rgba(0, 247, 255, 0.28);
}

.btn-accent {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.24), rgba(0, 247, 255, 0.08));
  border-color: rgba(0, 247, 255, 0.5);
}

.btn:hover {
  box-shadow: 0 0 10px rgba(0, 247, 255, 0.16);
}

/* ─── Layout ─── */
.layout-grid {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.side-panel,
.main-panel {
  min-width: 0;
}

.panel-block,
.chart-card,
.form-card,
.tab-panel,
.side-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  backdrop-filter: blur(5px);
}

.side-panel {
  padding: 0.9rem;
  display: grid;
  gap: 0.8rem;
  align-content: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.panel-block {
  padding: 0.95rem 1rem;
}

.form-card,
.tab-panel {
  padding: 1.15rem 1.2rem;
}

.chart-card {
  padding: 1rem;
}

.tab-panel > h2,
.panel-block h2,
.form-card > h3,
.chart-card > h3,
.modal-card > h2 {
  margin-bottom: 0.95rem;
}

.tab-panel > .muted,
.form-card > .muted,
.chart-card > .muted {
  margin-bottom: 1rem;
}

.collapsible-block {
  padding-top: 0.7rem;
}

.section-toggle {
  width: 100%;
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-align: left;
  cursor: pointer;
}

.toggle-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  transition: transform 0.18s ease;
  color: var(--text-muted);
}

.section-toggle[aria-expanded="false"] .toggle-arrow {
  transform: rotate(-90deg);
}

.collapsible-content {
  margin-top: 0.9rem;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.tab-btn {
  border: 1px solid rgba(0, 247, 255, 0.24);
  background: rgba(17, 34, 51, 0.75);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.tab-btn.active,
.tab-btn:hover {
  border-color: rgba(0, 247, 255, 0.62);
  box-shadow: 0 0 12px rgba(0, 247, 255, 0.22);
}

.tab-panel {
  display: none;
  padding: 1rem;
}

.tab-panel.active {
  display: block;
}

.kv-list {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: auto 1fr;
  margin: 0;
}

.kv-list dt {
  color: var(--text-muted);
}

.kv-list dd {
  margin: 0;
  text-align: right;
}

.kv-list.kv-list--compact {
  grid-template-columns: auto auto;
  justify-content: start;
  column-gap: 1.25rem;
  row-gap: 0.35rem;
}

.kv-list.kv-list--compact dd {
  text-align: left;
}

.text-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.4rem;
}

.milestone-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.milestone-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(0, 247, 255, 0.12);
  border-radius: 8px;
  background: rgba(17, 34, 51, 0.48);
}

.milestone-item.done {
  border-color: rgba(0, 247, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 247, 255, 0.08);
}

.milestone-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.7rem;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 170, 51, 0.12);
  color: var(--muted-amber);
  border: 1px solid rgba(255, 170, 51, 0.3);
}

.milestone-item.done .milestone-state {
  background: rgba(0, 247, 255, 0.12);
  color: var(--electric-cyan);
  border-color: rgba(0, 247, 255, 0.35);
}

.text-list li {
  line-height: 1.4;
}

.action-stack {
  display: grid;
  gap: 0.4rem;
}

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

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.7rem;
}

.chart-card {
  padding: 0.7rem;
  min-height: 280px;
  height: 280px;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: 210px !important;
  max-height: 210px !important;
}

/* ─── Financial Control Board (CORP-FIN-1) ───────────────────────────────── */

.finance-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(0, 247, 255, 0.18);
}

.finance-header h2 {
  margin: 0 0 0.15rem;
}

.finance-header__doc {
  margin: 0;
  font-family: "Share Tech Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: rgba(0, 247, 255, 0.78);
  text-transform: uppercase;
}

.finance-header__meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.finance-meta__label {
  font-family: "Share Tech Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.finance-meta__value {
  font-family: "Share Tech Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  color: var(--text-main);
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.95rem;
}

.kpi-tile {
  position: relative;
  padding: 0.85rem 0.95rem 0.9rem;
  background: linear-gradient(155deg, rgba(10, 31, 46, 0.92) 0%, rgba(5, 12, 24, 0.92) 100%);
  border: 1px solid rgba(0, 247, 255, 0.18);
  border-left: 3px solid rgba(0, 247, 255, 0.55);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.kpi-tile::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  background: radial-gradient(circle at top right, rgba(0, 247, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.kpi-tile--primary {
  border-left-color: rgba(255, 170, 51, 0.85);
  background: linear-gradient(155deg, rgba(28, 24, 14, 0.92) 0%, rgba(10, 12, 24, 0.92) 100%);
}

.kpi-tile--primary::before {
  background: radial-gradient(circle at top right, rgba(255, 170, 51, 0.22), transparent 70%);
}

.kpi-tile__label {
  font-family: "Share Tech Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-tile__value {
  font-family: "Share Tech Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 1.45rem;
  line-height: 1.1;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.kpi-tile--primary .kpi-tile__value {
  color: #ffd591;
  text-shadow: 0 0 14px rgba(255, 170, 51, 0.35);
}

.kpi-tile__sub,
.kpi-tile__trend {
  font-family: "Share Tech Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-tile__trend--up { color: #6cf0c2; }
.kpi-tile__trend--down { color: #f06a77; }
.kpi-tile__trend--flat { color: var(--text-muted); }

.kpi-tile__value--positive { color: #6cf0c2; }
.kpi-tile__value--negative { color: #f06a77; }

.finance-chart-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.finance-chart-grid .chart-card {
  grid-column: span 2;
}

.finance-chart-grid .chart-card--wide {
  grid-column: span 3;
}

@media (max-width: 1100px) {
  .finance-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .finance-chart-grid .chart-card,
  .finance-chart-grid .chart-card--wide {
    grid-column: span 1;
  }
}

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

.chart-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(0, 247, 255, 0.12);
}

.chart-card__head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.chart-card__sub {
  font-family: "Share Tech Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.chart-duration-picker {
  margin-left: auto;
  background: rgba(0, 247, 255, 0.05);
  border: 1px solid rgba(0, 247, 255, 0.25);
  color: var(--color-text, #d8ebf5);
  font-family: "Share Tech Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
}

.chart-duration-picker:hover,
.chart-duration-picker:focus {
  border-color: rgba(0, 247, 255, 0.6);
  outline: none;
}

.chart-duration-picker option {
  background: #05050f;
  color: var(--color-text, #d8ebf5);
}

.finance-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.7rem;
  margin-top: 0.95rem;
}

.finance-table-card {
  padding: 0.85rem 0.95rem;
  background: rgba(10, 31, 46, 0.68);
  border: 1px solid rgba(0, 247, 255, 0.14);
  border-radius: 6px;
}

.finance-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Share Tech Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.finance-table th,
.finance-table td {
  padding: 0.42rem 0.55rem;
  text-align: left;
  border-bottom: 1px dashed rgba(137, 167, 189, 0.18);
}

.finance-table th {
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.finance-table td.num,
.finance-table th.num {
  text-align: right;
}

.finance-table tfoot td {
  border-top: 1px solid rgba(0, 247, 255, 0.35);
  border-bottom: none;
  color: var(--text-main);
  font-size: 0.92rem;
  padding-top: 0.55rem;
}

.finance-table tbody tr:hover {
  background: rgba(0, 247, 255, 0.05);
}

.finance-table .num--positive { color: #6cf0c2; }
.finance-table .num--negative { color: #f06a77; }

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  align-items: end;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

input,
select,
textarea {
  background: rgba(4, 10, 20, 0.86);
  border: 1px solid rgba(0, 247, 255, 0.22);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.queue-list {
  display: grid;
  gap: 0.6rem;
}

.queue-item {
  border: 1px solid rgba(0, 247, 255, 0.2);
  border-radius: 8px;
  background: rgba(17, 34, 51, 0.56);
  padding: 0.85rem 0.9rem;
}

.queue-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
}

.progress-wrap {
  background: rgba(5, 5, 15, 0.8);
  border-radius: 999px;
  overflow: hidden;
  height: 8px;
  margin-top: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 247, 255, 0.88), rgba(255, 170, 51, 0.7));
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  border-radius: 999px;
  border: 1px solid rgba(0, 247, 255, 0.24);
  padding: 0.25rem 0.55rem;
  font-size: 0.82rem;
  color: var(--text-main);
  background: rgba(17, 34, 51, 0.6);
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.7rem;
}

.action-surface {
  background:
    radial-gradient(circle at top right, rgba(0, 247, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(17, 34, 51, 0.6), rgba(8, 22, 36, 0.74));
  box-shadow: inset 0 0 0 1px rgba(0, 247, 255, 0.05), 0 12px 32px rgba(0, 0, 0, 0.12);
}

.compact-action-form {
  max-width: 420px;
}

.research-panel {
  border-color: rgba(0, 247, 255, 0.3);
}

/* ── Corporate R&D Unified Panel ────────────────────────────── */

.rnd-panel {
  display: flex;
  flex-direction: column;
  max-width: min(820px, 100%);
  border: 1px solid rgba(0, 247, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(0, 247, 255, 0.06), transparent 30%),
    linear-gradient(180deg, rgba(17, 34, 51, 0.62), rgba(8, 22, 36, 0.78));
}

.rnd-panel #rnd-queue {
  max-width: 100%;
}

.rnd-panel__section {
  padding: 1.1rem 1.3rem;
}

.rnd-panel__section + .rnd-panel__section {
  border-top: 1px solid rgba(0, 247, 255, 0.1);
}

.rnd-panel__section--queue {
  background: rgba(0, 247, 255, 0.02);
}

.rnd-panel__label {
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(0, 247, 255, 0.5);
  margin: 0 0 0.75rem;
}

/* Ghost form — logic only, not visible */
.rnd-form-ghost {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Tech node rows */
.rnd-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 247, 255, 0.12);
  background: rgba(17, 34, 51, 0.4);
  margin-bottom: 0.4rem;
  transition: border-color 0.15s, background 0.15s;
}

.rnd-row:last-child {
  margin-bottom: 0;
}

.rnd-row--available:hover {
  border-color: rgba(0, 247, 255, 0.3);
  background: rgba(17, 34, 51, 0.58);
}

.rnd-row--queued {
  border-color: rgba(255, 170, 51, 0.22);
  background: rgba(255, 170, 51, 0.03);
}

.rnd-row--locked {
  opacity: 0.45;
  border-style: dashed;
  border-color: rgba(185, 214, 228, 0.1);
}

.rnd-row--done {
  opacity: 0.28;
  border-color: rgba(185, 214, 228, 0.08);
}

.rnd-row__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.rnd-row__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main, #e0f4ff);
}

.rnd-row__effect {
  font-size: 0.81rem;
  color: rgba(224, 244, 255, 0.6);
}

.rnd-row__meta {
  font-size: 0.73rem;
  color: rgba(185, 214, 228, 0.4);
}

.rnd-row__badge {
  flex-shrink: 0;
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.rnd-row__badge--done {
  color: rgba(0, 247, 255, 0.45);
  border: 1px solid rgba(0, 247, 255, 0.15);
  background: rgba(0, 247, 255, 0.03);
}

.rnd-row__badge--queued {
  color: rgba(255, 170, 51, 0.75);
  border: 1px solid rgba(255, 170, 51, 0.28);
  background: rgba(255, 170, 51, 0.06);
}

.rnd-row__badge--locked {
  color: rgba(185, 214, 228, 0.35);
  border: 1px solid rgba(185, 214, 228, 0.12);
}

.rnd-tier-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 0.35em;
  background: rgba(0, 247, 255, 0.1);
  color: rgba(0, 247, 255, 0.7);
  border: 1px solid rgba(0, 247, 255, 0.2);
}

.rnd-status-note:not(:empty) {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: rgba(0, 247, 255, 0.75);
}

/* Queue section refinements inside panel */
.rnd-panel .queue-list {
  gap: 0.5rem;
}

.rnd-panel .queue-item {
  border-color: rgba(0, 247, 255, 0.15);
}

#rnd-queue,
#ceo-queue {
  max-width: min(750px, 100%);
}

@media (min-width: 601px) and (max-width: 900px) {
  #rnd-queue,
  #ceo-queue {
    max-width: 500px;
  }
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.data-table th,
.data-table td {
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid rgba(0, 247, 255, 0.12);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b9d6e4;
}

.data-table tbody tr:hover {
  background: rgba(0, 247, 255, 0.04);
}

.sell-input {
  width: 100%;
  min-width: 88px;
}

.exchange-layout,
.forums-layout {
  align-items: start;
}

.forum-thread-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(0, 247, 255, 0.14);
  border-left: 3px solid rgba(0, 247, 255, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(12, 28, 44, 0.72), rgba(8, 18, 30, 0.55));
  color: inherit;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  display: grid;
  gap: 0.55rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.forum-thread-card:hover,
.forum-thread-card.active {
  border-color: rgba(0, 247, 255, 0.55);
  border-left-color: var(--color-accent);
  box-shadow: 0 6px 22px rgba(0, 247, 255, 0.14);
  transform: translateY(-1px);
}

.forum-thread-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.forum-thread-card__category {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 247, 255, 0.12);
  color: var(--color-accent);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.forum-thread-card__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--color-text);
}

.forum-thread-card__excerpt {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.forum-thread-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.55rem;
  margin-top: 0.25rem;
}

.forum-thread-card__meta strong {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
}

.forum-thread-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.forum-thread-detail {
  position: sticky;
  top: 5.8rem;
}

.thread-reply-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.thread-reply {
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(0, 247, 255, 0.12);
  border-radius: 8px;
  background: rgba(17, 34, 51, 0.42);
}

#chat {
  max-width:50vw;
}

.chat-log {
  height: min(400px, 56vh);
  margin: 0.6rem 0;
  max-height: min(400px, 56vh);
  min-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(0, 247, 255, 0.18);
  border-radius: 8px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
  list-style: none;
}

.chat-msg {
  flex: 0 0 auto;
  display: block;
  border-top: 1px solid rgba(0, 247, 255, 0.14);
  border-left: 1px solid rgba(0, 247, 255, 0.14);
  border-right: 1px solid rgba(0, 247, 255, 0.14);
  border-bottom: 2px solid rgba(0, 247, 255, 0.32);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  background: rgba(17, 34, 51, 0.48);
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.chat-msg:last-child {
  border-bottom: none;
}

.chat-meta {
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--text-muted);
}

.chat-channel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chat-channel-tab {
  border: 1px solid rgba(0, 247, 255, 0.28);
  background: rgba(17, 34, 51, 0.72);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.82rem;
}

.chat-channel-tab.active,
.chat-channel-tab:hover {
  border-color: rgba(0, 247, 255, 0.62);
  box-shadow: 0 0 12px rgba(0, 247, 255, 0.22);
}

.toolbar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

#starmap-canvas {
  width: 100%;
  height: min(62vh, 560px);
  max-width: 100%;
  border: 1px solid rgba(0, 247, 255, 0.3);
  border-radius: 10px;
  background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.06), transparent 25%), #040813;
  cursor: pointer;
  touch-action: none;
}

#starmap-canvas.dragging {
  cursor: pointer;
}

.starmap-fallback {
  border: 1px dashed rgba(0, 247, 255, 0.26);
  border-radius: 10px;
  padding: 0.8rem;
}

.alert {
  color: var(--danger);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 8, 16, 0.78);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-card {
  width: min(760px, 96vw);
  border: 1px solid rgba(0, 247, 255, 0.3);
  border-radius: 12px;
  background: rgba(8, 24, 38, 0.96);
  padding: 1rem;
}

.walkthrough-focus {
  position: relative;
  z-index: 61;
  outline: 2px solid var(--muted-amber);
  box-shadow: 0 0 18px rgba(255, 170, 51, 0.35);
  border-radius: 8px;
}

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

/* ─── Auth panel ─── */
.auth-panel {
  margin-top: 1.1rem;
  border: 1px solid rgba(0, 247, 255, 0.2);
  border-radius: 10px;
  padding: 1rem;
  background: rgba(7, 22, 36, 0.72);
}

/* ─── Responsive ─── */
@media (max-width: 960px) {
  .landing-section {
    padding: 2.5rem 1.25rem;
  }

  .auth-card > .landing-section:not(.landing-hero)::after {
    width: 320px;
    height: 320px;
    left: 50%;
    right: auto;
    top: auto;
    bottom: -210px;
    transform: translateX(-50%);
  }

  .auth-card > .landing-section:not(.landing-hero):nth-of-type(even)::after {
    left: 50%;
  }

  .auth-card > .landing-section:not(.landing-hero) > h2 {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .auth-card > .landing-section:not(.landing-hero) > h2::after {
    margin-left: 0;
  }

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

  .side-panel {
    max-height: none;
  }
}

@media (max-width: 600px) {
  .hero-title-top {
    font-size: clamp(1.1rem, 7vw, 1.6rem);
  }
  .hero-title-bottom {
    font-size: clamp(1.4rem, 9vw, 2.4rem);
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-metrics {
    justify-content: flex-start;
  }
  .btn-hero {
    text-align: center;
  }
}

/* ─── Inbox ────────────────────────────────────────────────────────────────── */

#inbox {
  max-width: 33vw;
}

.inbox-folder-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 247, 255, 0.12);
  padding-bottom: 0.5rem;
}

.inbox-folder-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.3rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.inbox-folder-btn:hover {
  color: var(--accent);
  border-color: rgba(0, 247, 255, 0.2);
}

.inbox-folder-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 247, 255, 0.06);
}

.inbox-compose-btn {
  margin-left: auto;
  font-size: 0.82rem;
  padding: 0.28rem 0.85rem;
}

.inbox-subtab-nav {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.inbox-subtab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  font-size: 0.82rem;
  transition: color 0.15s, border-color 0.15s;
}

.inbox-subtab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.inbox-message-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.inbox-msg-item {
  padding: 0.55rem 0.75rem;
  border-radius: 5px;
  border: 1px solid rgba(0, 247, 255, 0.08);
  background: rgba(0, 247, 255, 0.02);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.inbox-msg-item:hover {
  background: rgba(0, 247, 255, 0.06);
  border-color: rgba(0, 247, 255, 0.2);
}

.inbox-msg-item.unread {
  border-left: 2px solid var(--accent);
  background: rgba(0, 247, 255, 0.04);
}

.inbox-msg-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.15rem;
}

.inbox-msg-from,
.inbox-msg-to {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-msg-date {
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.inbox-msg-subject {
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.inbox-unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Detail view */
.inbox-back-btn {
  margin-bottom: 0.75rem;
}

.inbox-detail-card {
  padding: 1.25rem;
}

.inbox-detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.inbox-detail-from,
.inbox-detail-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.inbox-detail-subject {
  margin: 0.35rem 0 0.75rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.inbox-detail-body {
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 1rem;
  border-top: 1px solid rgba(0, 247, 255, 0.1);
  padding-top: 0.75rem;
}

.inbox-detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Compose form */
.inbox-compose-form {
  max-width: 680px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.inbox-compose-form h3 {
  margin: 0 0 0.25rem;
}

.compose-body-area {
  resize: vertical;
  min-height: 220px;
}

.inbox-compose-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.inbox-compose-status {
  font-size: 0.82rem;
  color: var(--accent);
}

/* ─── Vertical rhythm: tab panel ─────────────────────────── */
.tab-panel > .card-grid,
.tab-panel > .chart-grid,
.tab-panel > .queue-list,
.tab-panel > .pill-grid {
  margin-top: 1rem;
}

.tab-panel > .form-card,
.tab-panel > .split-grid {
  margin-top: 1.6rem;
}

.tab-panel > .lede {
  margin-bottom: 0.9rem;
}

/* ─── Travel banner ──────────────────────────────────────── */
.travel-banner {
  margin-bottom: 1.5rem;
}

.travel-banner-inner {
  background: rgba(0, 30, 50, 0.85);
  border: 1px solid rgba(0, 247, 255, 0.25);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  text-align: center;
}

.travel-banner-inner h2 {
  font-family: "Orbitron", sans-serif;
  color: rgba(0, 247, 255, 0.95);
  margin-bottom: 0.5rem;
}

.travel-progress-bar {
  width: 100%;
  max-width: 480px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin: 1rem auto 0.5rem;
  overflow: hidden;
}

.travel-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(0, 247, 255, 0.7), rgba(0, 180, 220, 0.95));
  border-radius: 4px;
  transition: width 1s linear;
}

.travel-eta {
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
  color: rgba(0, 247, 255, 0.85);
  letter-spacing: 0.06em;
}

.travel-dest-card {
  border: 1px solid rgba(0, 247, 255, 0.12);
  border-radius: 6px;
  background: rgba(0, 20, 40, 0.5);
}

/* ─── Locked tabs during travel ──────────────────────────── */
.tab-btn--locked {
  opacity: 0.3;
  pointer-events: none;
  cursor: not-allowed;
}

/* ─── Full Travel page ───────────────────────────────────── */
.travel-page-outer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.travel-page-card {
  background: rgba(0, 30, 50, 0.85);
  border: 1px solid rgba(0, 247, 255, 0.25);
  border-radius: 10px;
  padding: 2.5rem 3rem;
  text-align: center;
  max-width: 560px;
  width: 100%;
}

.travel-page-overline {
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: rgba(0, 247, 255, 0.5);
  margin-bottom: 0.25rem;
}

.travel-page-heading {
  font-family: "Orbitron", sans-serif;
  font-size: 1.6rem;
  color: rgba(0, 247, 255, 0.95);
  margin-bottom: 1.5rem;
}

.travel-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.travel-route-node {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.travel-route-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.35);
}

.travel-route-station {
  font-family: "Orbitron", sans-serif;
  font-size: 0.92rem;
  color: rgba(216, 235, 245, 0.95);
}

.travel-route-body {
  font-size: 0.78rem;
  color: rgba(216, 235, 245, 0.5);
}

.travel-route-arrow {
  font-size: 1.4rem;
  color: rgba(0, 247, 255, 0.6);
}

.travel-progress-bar--large {
  max-width: 420px;
  height: 12px;
  border-radius: 6px;
}

.travel-progress-bar--large .travel-progress-fill {
  border-radius: 6px;
}

/* Interstellar travel variant */
.travel-page-card--interstellar {
  border-color: rgba(180, 120, 255, 0.35);
  background: rgba(20, 10, 50, 0.9);
}
.travel-page-card--interstellar .travel-page-overline,
.travel-page-card--interstellar .travel-page-heading {
  color: rgba(180, 140, 255, 0.95);
}
.travel-page-card--interstellar .travel-route-arrow {
  color: rgba(180, 140, 255, 0.7);
}
.travel-page-card--interstellar .travel-progress-fill {
  background: linear-gradient(90deg, rgba(120, 80, 220, 0.8), rgba(180, 140, 255, 0.95));
}

/* In-space system label */
.travel-system-label {
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
  color: rgba(0, 247, 255, 0.7);
  margin-bottom: 0.5rem;
}

/* Dock options grid */
.travel-dock-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.travel-dock-btn {
  min-width: 180px;
  padding: 0.7rem 1rem;
  text-align: center;
  line-height: 1.4;
}

/* ─── Starmap station tooltip ────────────────────────────── */
.starmap-tooltip {
  position: fixed;
  z-index: 9999;
  padding: 4px 10px;
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  color: rgba(216, 235, 245, 0.95);
  background: rgba(6, 18, 30, 0.92);
  border: 1px solid rgba(0, 247, 255, 0.3);
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

#map-details {
  max-width: 25vw;
}

/* ─── Starmap station modal ──────────────────────────────── */
.starmap-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 8, 16, 0.75);
  backdrop-filter: blur(4px);
}

.starmap-modal-card {
  position: relative;
  background: rgba(8, 24, 42, 0.96);
  border: 1px solid rgba(0, 247, 255, 0.25);
  border-radius: 10px;
  padding: 2rem 2.5rem;
  max-width: 460px;
  width: 90%;
  text-align: center;
}

.starmap-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: rgba(216, 235, 245, 0.6);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.starmap-modal-close:hover {
  color: rgba(216, 235, 245, 0.95);
}

.starmap-modal-overline {
  font-family: "Orbitron", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: rgba(0, 247, 255, 0.45);
  margin-bottom: 0.2rem;
}

.starmap-modal-title {
  font-family: "Orbitron", sans-serif;
  font-size: 1.35rem;
  color: rgba(0, 247, 255, 0.95);
  margin-bottom: 0.3rem;
}

.starmap-modal-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
}

.starmap-modal-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.starmap-modal-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
}

.starmap-modal-stat-value {
  font-family: "Orbitron", sans-serif;
  font-size: 0.88rem;
  color: rgba(216, 235, 245, 0.92);
}

.starmap-modal-actions {
  margin-top: 1.5rem;
}

/* ─── Station district ───────────────────────────────────── */
.station-district {
  margin-top: 2rem;
}

.station-district h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.station-district > .muted {
  margin-bottom: 0.9rem;
}

.building-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
}

/* ── Prominent Facility Cards (Assembly, Refinery) ── */
#station-facility-buildings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.facility-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.2rem 1.4rem;
  min-height: 160px;
  border: 1px solid rgba(0, 247, 255, 0.18);
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.04) 0%, rgba(0, 0, 0, 0) 60%);
  border-radius: 4px;
  transition: border-color 0.2s;
}

.facility-card:hover {
  border-color: rgba(0, 247, 255, 0.4);
}

.facility-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.facility-card-header h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin: 0;
  flex: 1;
}

.facility-desc {
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0;
}

.facility-tier {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "Orbitron", sans-serif;
  margin: 0;
}

.facility-card-footer {
  margin-top: auto;
  padding-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.building-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.building-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.building-card-header h3 {
  font-size: 0.85rem;
  line-height: 1.3;
  margin: 0;
  flex: 1;
}

.faction-code-badge {
  display: inline-block;
  font-family: "Orbitron", sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.18em 0.5em;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.faction-code-badge.corp-badge {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.building-description {
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 0;
}

.building-flavor {
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
  flex: 1;
}

.building-card-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.building-status-badge {
  font-family: "Orbitron", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.2em 0.55em;
  border-radius: 2px;
}

.building-status-badge.operational {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Station building detail sub-view ───────────────────── */
.building-detail-nav {
  margin-bottom: 1.5rem;
}

.building-detail-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.building-detail-header h2 {
  margin: 0;
}

.station-location-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  margin-bottom: 0.75rem;
  background: color-mix(in srgb, var(--accent, #0ff) 8%, var(--surface, #1a1a2e));
  border: 1px solid color-mix(in srgb, var(--accent, #0ff) 25%, transparent);
  border-radius: 4px;
  font-size: 0.82rem;
  width: fit-content;
}

.station-location-icon {
  color: var(--accent, #0ff);
  font-size: 0.7rem;
}

.station-location-text {
  color: var(--muted, #aab);
}

.station-location-text strong {
  color: var(--fg, #eef);
}

/* ─── Logistics ─────────────────────────────────────────────────────────── */
#logistics-content {
  margin-top: 1rem;
}

.logistics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.logistics-summary-tile {
  background: var(--surface, #1a1a2e);
  border: 1px solid var(--border, #333);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.logistics-summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #aab);
}

.logistics-summary-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg, #eef);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

.logistics-station-card {
  background: var(--surface, #1a1a2e);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.logistics-station-card--current {
  border-color: var(--accent, #0ff);
  background: color-mix(in srgb, var(--accent, #0ff) 6%, var(--surface, #1a1a2e));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #0ff) 25%, transparent);
}

.logistics-station-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-bottom: 1px solid var(--border, #333);
  padding-bottom: 0.55rem;
}

.logistics-station-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.logistics-station-title h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--fg, #eef);
  word-break: break-word;
}

.logistics-station-sub {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logistics-current-badge {
  font-size: 0.6rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--accent, #0ff);
  color: var(--bg, #0a0a1a);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.logistics-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted, #aab);
  font-style: italic;
}

.logistics-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.logistics-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  background: color-mix(in srgb, var(--bg, #0a0a1a) 60%, var(--surface, #1a1a2e));
  border: 1px solid color-mix(in srgb, var(--border, #333) 70%, transparent);
  border-radius: 5px;
  min-width: 0;
}

.logistics-item-row--transfer {
  flex-wrap: wrap;
}

.logistics-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 130px;
}

.logistics-item-name {
  font-size: 0.88rem;
  color: var(--fg, #eef);
  word-break: break-word;
}

.logistics-item-qty {
  font-size: 0.72rem;
}

.logistics-transfer-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 0 1 auto;
  min-width: 0;
}

.logistics-qty-input {
  width: 78px;
  max-width: 100%;
  padding: 0.28rem 0.4rem;
  font-size: 0.8rem;
  background: var(--bg, #0a0a1a);
  border: 1px solid var(--border, #333);
  border-radius: 4px;
  color: var(--fg, #eef);
}

.logistics-transfer-btn {
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .logistics-item-row--transfer {
    flex-direction: column;
    align-items: stretch;
  }
  .logistics-transfer-controls {
    justify-content: flex-end;
  }
}

/* ─── Assets ────────────────────────────────────────────────────────────── */

/* Summary stats bar */
.assets-summary-bar {
  display: flex;
  gap: 1px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel-border);
}

.assets-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  background: var(--panel);
}

.assets-stat-value {
  font-family: "Orbitron", "Rajdhani", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.assets-stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Sub-tab nav */
.assets-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 1rem;
}

.assets-tab-btn {
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.assets-tab-btn:hover {
  color: var(--text-main);
}

.assets-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Panel visibility */
.assets-panel {
  display: none;
}

.assets-panel.active {
  display: block;
}

/* Consolidated asset table */
.assets-table {
  width: 100%;
  border-collapse: collapse;
}

.assets-table thead th {
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(0, 247, 255, 0.2);
  text-align: left;
}

.assets-table thead th.num {
  text-align: right;
}

.assets-table tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(0, 247, 255, 0.06);
  font-size: 0.85rem;
  color: var(--text-main);
  vertical-align: middle;
}

.assets-table tbody td.num {
  text-align: right;
  font-family: "Rajdhani", monospace;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.assets-table tbody td.assets-resource-name {
  font-weight: 600;
  color: var(--accent);
  border-right: 1px solid rgba(0, 247, 255, 0.08);
}

.assets-table tbody tr:hover {
  background: rgba(0, 247, 255, 0.04);
}

.assets-table tfoot td {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid rgba(0, 247, 255, 0.18);
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.assets-table tfoot td.num {
  text-align: right;
  color: var(--accent);
  font-family: "Orbitron", monospace;
  font-size: 0.85rem;
}

.assets-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem !important;
  font-size: 0.85rem;
}

/* Badge in table — ensure idle state */
.building-status-badge.idle {
  color: var(--text-muted);
  border-color: var(--text-muted);
}

@media (max-width: 600px) {
  .assets-summary-bar {
    flex-wrap: wrap;
  }
  .assets-stat {
    min-width: 33%;
  }
  .assets-table {
    font-size: 0.8rem;
  }
}

.action-surface {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.compact-action-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 0.8rem 0 0.5rem;
  flex-wrap: wrap;
}

.compact-action-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.compact-action-form input[type="number"] {
  width: 5rem;
  padding: 0.4rem 0.5rem;
}

.action-hint {
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

#lease-suite-box {
  width: 750px;
}

/* ─── Office Interior View ───────────────────────────────────────────────── */

.office-interior {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 820px;
  
}

/* Header */
.office-header {
  padding: 1.4rem 1.6rem 1.2rem;
  background: linear-gradient(160deg, rgba(17, 34, 51, 0.95) 0%, rgba(5, 5, 15, 0.98) 100%);
  border: 1px solid rgba(0, 247, 255, 0.22);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.office-header__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.office-ref-code {
  font-family: "Orbitron", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.office-header__title {
  font-size: 1.45rem;
  margin: 0 0 0.3rem;
  color: var(--text-main);
}

.office-header__location {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0;
}

/* Lease grid: two columns side by side */
.office-lease-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 580px) {
  .office-lease-grid { grid-template-columns: 1fr; }
}

/* Generic office panel card */
.office-panel {
  background: rgba(10, 31, 46, 0.72);
  border: 1px solid rgba(0, 247, 255, 0.14);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
}

.office-panel--wide {
  grid-column: 1 / -1;
}

.office-panel__label {
  font-family: "Orbitron", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
  opacity: 0.9;
}

/* Countdown timer panel */
.office-panel--timer {
  display: flex;
  flex-direction: column;
}

.lease-countdown {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  color: var(--accent);
}

.lease-countdown--warning { color: #ffaa33; }
.lease-countdown--expired { color: #f06a77; }

.lease-countdown__days {
  font-family: "Orbitron", monospace;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 18px currentColor;
}

.lease-countdown__unit {
  font-family: "Orbitron", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.lease-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 0.6rem 0 0.4rem;
}

.lease-progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0, 247, 255, 0.5);
  transition: width 0.4s ease;
}

.lease-progress__bar--warning {
  background: #ffaa33;
  box-shadow: 0 0 6px rgba(255, 170, 51, 0.5);
}

.lease-progress__bar--expired {
  background: #f06a77;
  box-shadow: none;
}

.office-muted {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Workforce stat row */
.office-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

@media (max-width: 520px) {
  .office-stat-row { grid-template-columns: repeat(2, 1fr); }
}

.office-stat-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 0.25rem 1rem 0.25rem 0;
  border-right: 1px solid rgba(0, 247, 255, 0.1);
}

.office-stat-cell:last-child { border-right: none; }

.office-stat-cell__value {
  font-family: "Orbitron", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  white-space: nowrap;
  padding-left: 0.5em;
}

.office-stat-cell__unit {
  font-size: 0.65rem;
  opacity: 0.65;
  font-weight: 400;
}

.office-stat-cell__label {
  padding-left: 1em;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.office-stat-divider {
  height: 1px;
  background: rgba(0, 247, 255, 0.1);
  margin: 1rem 0;
}

/* Hire form */
.office-hire-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.office-hire-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.office-hire-label input[type="number"] {
  width: 5.5rem;
}

/* Quick nav */
.office-quicknav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.office-nav-btn {
  font-family: "Orbitron", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0, 247, 255, 0.04);
  border: 1px solid rgba(0, 247, 255, 0.18);
  border-radius: 3px;
  padding: 0.45em 0.9em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.office-nav-btn:hover {
  color: var(--accent);
  border-color: rgba(0, 247, 255, 0.5);
  background: rgba(0, 247, 255, 0.08);
}

/* Status badge variants */
.building-status-badge.warning {
  color: #ffaa33;
  border-color: #ffaa33;
}

.building-status-badge.expired {
  color: #f06a77;
  border-color: #f06a77;
}

#station-location-header .overline {
  margin-bottom: 0.2rem;
}

#station-location-header h2 {
  margin: 0.1rem 0 0.4rem;
}

/* ─── ISA Claims & Leases — lease cards ─────────────────────────────────── */
.lease-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.lease-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
}

.lease-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.lease-body-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.lease-type-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.lease-purchase-block {
  max-width: 640px;
}

/* ─── Extractor rows within lease management ─────────────────────────────── */
.extractor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.extractor-row {
  padding: 0.85rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.extractor-row.active {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.extractor-row-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.extractor-cycle-status {
  font-size: 0.82rem;
  color: var(--accent);
  display: block;
  margin: 0.2rem 0;
}

.extractor-cycle-status.idle {
  color: var(--muted);
}

/* ─── Mining cycle progress bar ──────────────────────────────────────────── */
.extractor-progress-wrap {
  margin: 0.6rem 0 0.2rem;
}

.extractor-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
}

.extractor-progress-pct {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.extractor-progress-time {
  font-size: 0.75rem;
  color: var(--muted);
}

.extractor-progress-track {
  height: 7px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 99px;
  overflow: hidden;
}

.extractor-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 1s linear;
  min-width: 3px;
}

.extractor-progress-fill.downtime {
  background: linear-gradient(90deg, #f06a77 0%, #a22 100%);
  box-shadow: 0 0 8px #f06a77a0;
  animation: downtime-pulse 2s ease-in-out infinite;
}

@keyframes downtime-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.extractor-stat-row {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}

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

.extractor-stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.extractor-stat-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

/* ─── Lease management card responsive width ─────────────────────────────── */
.lease-management-card {
  max-width: min(750px, 100%);
}

@media (max-width: 600px) {
  .lease-management-card {
    max-width: 100%;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .lease-management-card {
    max-width: 500px;
  }
}

/* ─── Vertical rhythm: within form-card ─────────────────── */
.form-card > .card-grid,
.form-card > .split-grid,
.form-card > .choice-row,
.form-card > .inline-form,
.form-card > .data-card,
.form-card > .queue-list {
  margin-top: 1.1rem;
}

.form-card > p:not(:first-child),
.form-card > .muted:not(:first-child) {
  margin-top: 0.65rem;
}

/* ─── Button — ripple + command variants ─────────────────── */
.btn {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.14s ease;
}

.btn-command {
  padding: 0.68rem 1.4rem;
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@keyframes btn-ripple-anim {
  from { transform: scale(1); opacity: 0.45; }
  to   { transform: scale(14); opacity: 0; }
}

.btn-ripple-effect {
  position: absolute;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  margin-left: -9px;
  background: rgba(0, 247, 255, 0.55);
  animation: btn-ripple-anim 0.55s ease-out forwards;
  pointer-events: none;
  z-index: 0;
}

@keyframes btn-pulse-success {
  0%   { box-shadow: 0 0 0 0 rgba(0, 247, 255, 0); }
  40%  { box-shadow: 0 0 0 8px rgba(0, 247, 255, 0.35), 0 0 28px rgba(0, 247, 255, 0.28); }
  100% { box-shadow: 0 0 0 0 rgba(0, 247, 255, 0); }
}

.btn.btn-pulse-success {
  animation: btn-pulse-success 0.75s ease-out forwards;
}

/* ─── Forum redesign ─────────────────────────────────────── */
#forum-overview-view {
  max-width: 50vw;
}

.forums-nav {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.forum-category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1;
}

.forum-category-btn {
  border: 1px solid rgba(0, 247, 255, 0.24);
  border-radius: 999px;
  background: rgba(17, 34, 51, 0.6);
  color: var(--text-main);
  padding: 0.32rem 0.72rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.forum-category-btn.active,
.forum-category-btn:hover {
  border-color: rgba(0, 247, 255, 0.7);
  box-shadow: 0 0 14px rgba(0, 247, 255, 0.18);
  color: var(--electric-cyan);
}

.forum-thread-list {
  display: grid;
  gap: 0.6rem;
}

.forum-thread-header {
  margin-bottom: 1.1rem;
}

.forum-thread-full {
  max-width: 860px;
}

.forum-thread-full .form-card {
  margin-top: 0;
}

.forum-thread-full .form-card {
  border-color: rgba(0, 247, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(8, 26, 40, 0.92), rgba(7, 20, 33, 0.92));
  box-shadow:
    0 20px 36px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(0, 247, 255, 0.08);
}

.forum-thread-full .form-card h2 {
  margin-bottom: 0.8rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 247, 255, 0.24);
}

.forum-thread-full .thread-reply-list {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(0, 247, 255, 0.2);
}

.forum-thread-full .thread-reply {
  border-color: rgba(0, 247, 255, 0.25);
  background: rgba(12, 32, 48, 0.72);
}

.thread-op-block {
  margin-top: 0.9rem;
  padding: 0.8rem 0.9rem;
  border-radius: 9px;
  border: 1px solid rgba(0, 247, 255, 0.2);
  background: rgba(7, 24, 37, 0.7);
}

/* ─── Premium Thread Detail View ────────────────────────────────────────── */
.forum-thread-full {
  max-width: 920px;
}

.thread-detail {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  color: var(--fg, #eef);
}

.thread-detail__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.thread-back-btn {
  background: transparent;
  border: 1px solid rgba(0, 247, 255, 0.35);
  color: rgba(0, 247, 255, 0.95);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.thread-back-btn:hover {
  background: rgba(0, 247, 255, 0.12);
  border-color: rgba(0, 247, 255, 0.7);
  transform: translateX(-2px);
}

.thread-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
}

.thread-badge--category {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.18), rgba(0, 180, 220, 0.08));
  border-color: rgba(0, 247, 255, 0.45);
  color: rgba(180, 245, 255, 0.95);
  box-shadow: 0 0 12px rgba(0, 247, 255, 0.18);
}

.thread-badge--op {
  background: rgba(0, 247, 255, 0.18);
  border-color: rgba(0, 247, 255, 0.55);
  color: rgba(190, 248, 255, 0.95);
}

.thread-badge--reply {
  background: rgba(120, 130, 150, 0.12);
  border-color: rgba(160, 170, 190, 0.35);
  color: rgba(200, 210, 225, 0.85);
}

.thread-detail__header {
  padding: 0.4rem 0 0.6rem;
}

.thread-detail__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f1fbff;
  text-shadow: 0 0 24px rgba(0, 247, 255, 0.16);
}

.thread-detail__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: rgba(180, 200, 220, 0.75);
}

.thread-meta-dot {
  color: rgba(0, 247, 255, 0.55);
}

.thread-card {
  position: relative;
  border-radius: 14px;
  padding: 1.1rem 1.25rem 0.9rem;
  background: linear-gradient(180deg, rgba(10, 28, 42, 0.92), rgba(6, 18, 30, 0.92));
  border: 1px solid rgba(0, 247, 255, 0.18);
  box-shadow:
    0 20px 38px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(0, 247, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.thread-card--op {
  border-color: rgba(0, 247, 255, 0.45);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(0, 247, 255, 0.18),
    0 0 32px rgba(0, 247, 255, 0.18);
  padding-top: 1.55rem;
}

.thread-card__op-tag {
  position: absolute;
  top: -0.7rem;
  left: 1.1rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #04111c;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #00f7ff, #00b8d4);
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.4);
}

.thread-card--reply {
  background: linear-gradient(180deg, rgba(8, 22, 34, 0.85), rgba(5, 14, 24, 0.85));
}

.thread-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.thread-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: #04111c;
  background: linear-gradient(135deg,
    hsl(var(--avatar-hue, 190), 90%, 70%),
    hsl(calc(var(--avatar-hue, 190) + 30), 80%, 50%));
  box-shadow: 0 0 14px hsla(var(--avatar-hue, 190), 90%, 60%, 0.35);
  flex-shrink: 0;
}

.thread-avatar--op {
  width: 50px;
  height: 50px;
  font-size: 1.05rem;
  border: 2px solid rgba(0, 247, 255, 0.55);
}

.thread-card__head-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1 1 auto;
  min-width: 0;
}

.thread-card__author {
  font-weight: 600;
  color: #eaf7ff;
  font-size: 0.95rem;
}

.thread-card__timestamp {
  font-size: 0.72rem;
  color: rgba(170, 195, 215, 0.7);
}

.thread-card__body {
  font-size: 0.92rem;
  line-height: 1.62;
  color: rgba(220, 232, 244, 0.92);
  word-wrap: break-word;
}

.thread-card__body p {
  margin: 0 0 0.7rem;
}

.thread-card__body p:last-child {
  margin-bottom: 0;
}

.thread-card__body--op {
  font-size: 0.97rem;
  color: rgba(232, 244, 252, 0.95);
}

.thread-card__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(0, 247, 255, 0.12);
}

.thread-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid rgba(140, 160, 180, 0.25);
  color: rgba(200, 215, 230, 0.85);
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.thread-action-btn:hover {
  background: rgba(0, 247, 255, 0.08);
  border-color: rgba(0, 247, 255, 0.45);
  color: #eaf7ff;
}

.thread-action-btn--primary {
  border-color: rgba(0, 247, 255, 0.55);
  background: rgba(0, 247, 255, 0.12);
  color: #d6f7ff;
}

.thread-action-btn--primary:hover {
  background: rgba(0, 247, 255, 0.22);
}

.thread-action-btn--like .thread-action-count {
  font-weight: 700;
  color: rgba(0, 247, 255, 0.9);
}

.thread-action-btn--like.is-liked {
  background: rgba(0, 247, 255, 0.18);
  border-color: rgba(0, 247, 255, 0.55);
  color: rgba(0, 247, 255, 1);
}

.thread-action-btn--like.is-liked .thread-action-count {
  color: #fff;
}

/* Replies section */
.thread-replies {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
}

.thread-replies__heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 247, 255, 0.85);
  margin: 0.5rem 0 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 247, 255, 0.18);
}

.thread-reply-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.thread-reply-list::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(180deg,
    rgba(0, 247, 255, 0.5),
    rgba(0, 247, 255, 0.05));
}

.thread-reply {
  position: relative;
  display: block;
}

.thread-reply__connector {
  position: absolute;
  left: -1.2rem;
  top: 1.55rem;
  width: 1rem;
  height: 1px;
  background: rgba(0, 247, 255, 0.45);
}

.thread-reply--empty {
  padding: 0.6rem 0.9rem;
}

@media (max-width: 600px) {
  .thread-card { padding: 0.95rem 0.95rem 0.8rem; }
  .thread-card--op { padding-top: 1.5rem; }
  .thread-reply-list { padding-left: 1.1rem; }
  .thread-reply__connector { left: -0.9rem; }
  .thread-detail__title { font-size: 1.4rem; }
}

/* ─── Mission detail modal ───────────────────────────────── */
.mission-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 8, 16, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mission-modal-card {
  position: relative;
  width: min(640px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(0, 247, 255, 0.25);
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(0, 247, 255, 0.04), transparent 60%),
    rgba(8, 24, 38, 0.97);
  padding: 0;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.55), 0 0 1px rgba(0, 247, 255, 0.2);
  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mission-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 2;
  background: rgba(8, 24, 38, 0.7);
  border: 1px solid rgba(0, 247, 255, 0.18);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.mission-modal-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.mission-modal-header {
  display: flex;
  gap: 1.4rem;
  padding: 1.4rem 1.6rem 0;
  align-items: flex-start;
}

.mission-modal-img-placeholder {
  flex-shrink: 0;
  width: 120px;
  aspect-ratio: 1;
  border: 1px solid rgba(0, 247, 255, 0.22);
  border-radius: 12px;
  background:
    radial-gradient(circle at 32% 40%, rgba(0, 247, 255, 0.1), transparent 52%),
    radial-gradient(circle at 70% 72%, rgba(255, 170, 51, 0.07), transparent 42%),
    linear-gradient(135deg, rgba(8, 22, 36, 0.94), rgba(14, 34, 54, 0.86));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  color: rgba(0, 247, 255, 0.32);
  text-transform: uppercase;
  line-height: 1.8;
}

.mission-modal-meta {
  flex: 1;
  min-width: 0;
}

.mission-modal-meta .overline {
  margin-bottom: 0.3rem;
}

.mission-modal-meta h2 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.mission-modal-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.mission-modal-reward-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted-amber);
  padding: 0.15rem 0.6rem;
  border: 1px solid rgba(255, 170, 51, 0.25);
  border-radius: 6px;
  background: rgba(255, 170, 51, 0.08);
  letter-spacing: 0.04em;
}

.mission-modal-body {
  padding: 1.2rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mission-modal-section h4 {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
  opacity: 0.7;
}

.mission-modal-section p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
}

.mission-modal-section .muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.mission-modal-actions {
  padding: 0 1.6rem 1.4rem;
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
}

/* ─── Mission quota bar ──────────────────────────────────── */
.mission-quota-info {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mission-quota-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(0, 247, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0, 247, 255, 0.12);
}

.mission-quota-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
  opacity: 0.7;
}

.mission-quota-bar.quota-fulfilled {
  background: var(--success, #22c55e);
  opacity: 1;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.mission-quota-text {
  font-size: 0.82rem;
  color: var(--muted);
}

.mission-quota-text strong {
  color: var(--text);
}

/* ─── Mission location tags ──────────────────────────────── */
.mission-location-tag {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.5rem;
  border-radius: 5px;
  white-space: nowrap;
}

.mission-location-local {
  color: var(--success, #22c55e);
  border: 1px solid rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.08);
}

.mission-location-remote {
  color: var(--muted-amber);
  border: 1px solid rgba(255, 170, 51, 0.25);
  background: rgba(255, 170, 51, 0.08);
}

.mission-location-warning {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted-amber);
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(255, 170, 51, 0.2);
  border-radius: 8px;
  background: rgba(255, 170, 51, 0.05);
}

.mission-location-warning strong {
  color: var(--text);
}

#active-missions-section {
  margin-top: 1.6rem;
}

/* ─── Agent card (bureau hub) ────────────────────────────── */
.agent-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 30em;
}

.agent-card:hover,
.agent-card:focus-visible {
  border-color: rgba(0, 247, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 247, 255, 0.08);
}

.agent-card-inner {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.agent-card-thumb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 247, 255, 0.25);
  flex-shrink: 0;
}

.agent-card-info .overline {
  margin-bottom: 0.15rem;
}

.agent-card-info h3 {
  margin-bottom: 0.2rem;
}

/* ─── Agent office view ──────────────────────────────────── */
#agent-office-view {
  max-width: 50vw;
}

#agent-back-btn {
  margin-bottom: 1.2rem;
}

.agent-office-layout {
  display: grid;
  grid-template-columns: min(300px, 36%) 1fr;
  gap: 2rem;
  align-items: start;
}

.agent-portrait-section {
  text-align: center;
}

.agent-portrait {
  width: 100%;
  max-width: 280px;
  border-radius: 14px;
  border: 1px solid rgba(0, 247, 255, 0.22);
  object-fit: cover;
  aspect-ratio: 3 / 4;
  background:
    radial-gradient(circle at 32% 40%, rgba(0, 247, 255, 0.1), transparent 52%),
    linear-gradient(135deg, rgba(8, 22, 36, 0.94), rgba(14, 34, 54, 0.86));
}

.agent-nameplate {
  margin-top: 1rem;
}

.agent-nameplate .overline {
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
}

.agent-nameplate h2 {
  margin: 0;
  font-size: 1.35rem;
}

.agent-info-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.agent-bio h3 {
  margin-bottom: 0.7rem;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #00f7ff);
}

.agent-bio p {
  color: var(--foreground, #d0d8e0);
  line-height: 1.7;
  font-size: 0.88rem;
}

.agent-bio p + p {
  margin-top: 0.7rem;
}

/* ─── Agent dialogue bubble ──────────────────────────────── */
.agent-dialogue {
  position: relative;
}

.agent-dialogue-bubble {
  padding: 0.2rem 0;
}

.agent-dialogue-speaker {
  display: block;
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #00f7ff);
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.agent-dialogue-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--foreground, #d0d8e0);
  font-style: italic;
  border-left: 3px solid rgba(0, 247, 255, 0.3);
  padding-left: 1rem;
  margin: 0;
}

/* ─── Agent missions section ─────────────────────────────── */
.agent-missions-section {
  margin-top: 0.4rem;
}

.agent-missions-section h3 {
  margin-bottom: 0.6rem;
}

.contract-refresh-timer {
  margin-top: 0.7rem;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.contract-refresh-timer::before {
  content: "⏱";
  font-size: 0.82rem;
  opacity: 0.65;
}

/* ─── Agent reputation display ───────────────────────────── */
.agent-reputation-section {
  margin-top: 1.2rem;
  padding: 0.8rem 0.9rem;
  background: rgba(10, 31, 46, 0.45);
  border: 1px solid rgba(0, 247, 255, 0.1);
  border-radius: 10px;
  text-align: center;
}

.agent-reputation-section h3,
.agent-completed-section h3 {
  margin-bottom: 0.7rem;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.agent-reputation-section h3 {
  font-size: 0.68rem;
  margin-bottom: 0.45rem;
  opacity: 0.6;
}

.agent-rep-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin-bottom: 0.45rem;
}

.agent-rep-title {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}

.agent-rep-level {
  font-size: 0.66rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.agent-rep-stars {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.rep-star {
  font-size: 0.9rem;
  color: rgba(0, 247, 255, 0.15);
  transition: color 0.3s;
}

.rep-star--filled {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 247, 255, 0.4);
}

.agent-rep-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(0, 247, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(0, 247, 255, 0.08);
  margin-bottom: 0.35rem;
}

.agent-rep-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), rgba(0, 247, 255, 0.6));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.agent-rep-detail {
  font-size: 0.68rem;
  line-height: 1.4;
}

.agent-card-standing {
  font-size: 0.72rem;
  margin-top: 0.15rem;
  color: var(--accent);
  opacity: 0.7;
}

/* ─── Mission Log section ────────────────────────────────── */
.mission-log-section {
  margin-top: 1.2rem;
}

#missions-board-view {
  max-width:25vw;
}

.mission-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.mission-log-header h3 {
  margin: 0;
}

.mission-log-count {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mission-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 19rem;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.mission-log-list::-webkit-scrollbar {
  width: 8px;
}

.mission-log-list::-webkit-scrollbar-thumb {
  background: rgba(0, 247, 255, 0.18);
  border-radius: 999px;
}

/* ─── Completed mission entries ──────────────────────────── */
.completed-mission-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 0.7rem;
  row-gap: 0.1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  background: rgba(10, 31, 46, 0.35);
  border: 1px solid rgba(0, 247, 255, 0.05);
  transition: background 0.2s, border-color 0.2s;
}

.completed-mission-entry:hover {
  background: rgba(10, 31, 46, 0.55);
  border-color: rgba(0, 247, 255, 0.12);
}

.completed-mission-icon {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 247, 255, 0.08);
  color: var(--accent);
  font-size: 0.78rem;
  align-self: center;
  flex-shrink: 0;
}

.completed-mission-title {
  grid-column: 2;
  font-size: 0.84rem;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.completed-mission-reward {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-amber);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.completed-mission-meta {
  grid-column: 2;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.completed-mission-type {
  display: inline-block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1em 0.45em;
  border-radius: 3px;
  background: rgba(0, 247, 255, 0.08);
  color: var(--accent);
  margin-right: 0.4em;
  vertical-align: middle;
  font-weight: 600;
}

#completed-missions-section {
  margin-top: 1.2rem;
}

/* ─── Mission complete celebration overlay ───────────────── */
.mission-complete-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(3, 8, 16, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: modalFadeIn 0.25s ease;
}

.mission-complete-overlay--exit {
  animation: modalFadeOut 0.3s ease forwards;
}

@keyframes modalFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.mission-complete-card {
  position: relative;
  text-align: center;
  max-width: 440px;
  width: 94vw;
  padding: 2.4rem 2rem 2rem;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(34, 197, 94, 0.08), transparent 60%),
    rgba(8, 24, 38, 0.97);
  box-shadow:
    0 0 60px rgba(34, 197, 94, 0.12),
    0 8px 40px rgba(0, 0, 0, 0.5);
  animation: completePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes completePop {
  0%   { opacity: 0; transform: scale(0.7) translateY(20px); }
  60%  { opacity: 1; transform: scale(1.04) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.mission-complete-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.12);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: #22c55e;
  animation: checkPulse 0.6s ease 0.3s both;
}

@keyframes checkPulse {
  0%   { transform: scale(0); opacity: 0; }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}

.mission-complete-heading {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #22c55e;
  margin-bottom: 0.4rem;
}

.mission-complete-title {
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 1.4rem;
  line-height: 1.4;
}

.mission-complete-reward,
.mission-complete-rep {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(0, 247, 255, 0.08);
}

.mission-complete-reward-label,
.mission-complete-rep-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mission-complete-reward-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted-amber);
}

.mission-complete-rep-value {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
}

.mission-complete-levelup {
  margin-top: 0.8rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 8px;
  background: rgba(255, 215, 0, 0.06);
  font-size: 0.84rem;
  color: #ffd700;
  animation: levelGlow 1.2s ease infinite alternate;
}

@keyframes levelGlow {
  from { box-shadow: 0 0 8px rgba(255, 215, 0, 0.1); }
  to   { box-shadow: 0 0 20px rgba(255, 215, 0, 0.25); }
}

.mission-complete-dismiss {
  margin-top: 1.4rem;
}

/* Celebration particles */
.mission-complete-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--hue, 180), 85%, 60%);
  top: 50%;
  left: 50%;
  pointer-events: none;
  animation: particleBurst 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) var(--delay, 0s) forwards;
  opacity: 0;
}

@keyframes particleBurst {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* ─── Mission cards ──────────────────────────────────────── */
.mission-card {
  position: relative;
  border: 1px solid rgba(0, 247, 255, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(168deg, rgba(10, 26, 42, 0.85) 0%, rgba(8, 20, 34, 0.92) 100%);
  padding: 1.2rem 1.4rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.18s ease;
  overflow: hidden;
  max-width:25vw;
}

.mission-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(0, 247, 255, 0.04) 0%, transparent 40%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mission-card:hover,
.mission-card:focus-visible {
  border-color: rgba(0, 247, 255, 0.38);
  box-shadow:
    0 0 18px rgba(0, 247, 255, 0.08),
    0 4px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.mission-card:hover::before,
.mission-card:focus-visible::before {
  opacity: 1;
}

.mission-card:focus-visible {
  outline: 2px solid var(--accent, #00f7ff);
  outline-offset: 2px;
}

/* Header row: type badge + risk badge */
.mission-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.mission-card-type {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #00f7ff);
  opacity: 0.72;
}

.mission-card-risk {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.mission-card-risk.risk-low {
  color: #5cffab;
  background: rgba(92, 255, 171, 0.1);
  border: 1px solid rgba(92, 255, 171, 0.22);
}

.mission-card-risk.risk-med {
  color: #ffd866;
  background: rgba(255, 216, 102, 0.1);
  border: 1px solid rgba(255, 216, 102, 0.22);
}

.mission-card-risk.risk-high {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.22);
}

/* Title */
.mission-card-title {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground, #e0e8f0);
  margin: 0 0 0.55rem;
  line-height: 1.35;
}

/* Description text */
.mission-card-text {
  color: var(--text-muted, #8a9bb0);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer row: reward + CTA */
.mission-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(0, 247, 255, 0.08);
}

.mission-card-reward {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5cffab;
  letter-spacing: 0.03em;
}

.mission-card-cta {
  font-size: 0.78rem;
  color: var(--accent, #00f7ff);
  letter-spacing: 0.04em;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.mission-card:hover .mission-card-cta {
  opacity: 1;
}

/* Active contract variant */
.mission-card--active {
  border-color: rgba(92, 255, 171, 0.18);
  background:
    linear-gradient(168deg, rgba(12, 32, 24, 0.7) 0%, rgba(8, 20, 34, 0.92) 100%);
}

.mission-card--active:hover {
  border-color: rgba(92, 255, 171, 0.35);
  box-shadow:
    0 0 18px rgba(92, 255, 171, 0.06),
    0 4px 24px rgba(0, 0, 0, 0.25);
}

.mission-card--active .mission-card-type {
  color: #5cffab;
}

@media (max-width: 700px) {
  .agent-office-layout {
    grid-template-columns: 1fr;
  }

  .agent-portrait {
    max-width: 180px;
  }

  .agent-card-thumb {
    width: 56px;
    height: 56px;
  }
}

/* ─── Exchange buy button ─────────────────────────────────── */
.exchange-buy-btn {
  white-space: nowrap;
  font-size: 0.82rem;
  padding: 0.34rem 0.7rem;
}

/* ─── Exchange resource filter bar ───────────────────────── */
.exchange-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.exchange-filter-pill {
  border: 1px solid rgba(0, 247, 255, 0.24);
  border-radius: 999px;
  background: rgba(17, 34, 51, 0.6);
  color: var(--text-muted);
  padding: 0.28rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.exchange-filter-pill:hover {
  border-color: rgba(0, 247, 255, 0.55);
  color: var(--text-main);
}

.exchange-filter-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 247, 255, 0.08);
  box-shadow: 0 0 10px rgba(0, 247, 255, 0.16);
}

/* ─── NPC standing buy orders ────────────────────────────── */
.npc-order-remaining {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.npc-order-of-total {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
}

.npc-order-track {
  height: 5px;
  background: rgba(0, 247, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
  min-width: 80px;
}

.npc-order-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}

tr.npc-order-exhausted {
  opacity: 0.45;
}

/* ─── Trade history ──────────────────────────────────────── */
.trade-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.trade-type-listed {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.trade-type-sold {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.trade-type-bought {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
}

.trade-tax-note {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.8;
}

/* ─── Trade Confirmation Modal ─── */
.trade-confirm-card {
  width: min(480px, 94vw);
}

.trade-confirm-body {
  margin: 1rem 0;
}

.trade-confirm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.trade-confirm-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.trade-confirm-table td:first-child {
  color: var(--muted);
  white-space: nowrap;
}

.trade-confirm-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.trade-confirm-highlight td {
  border-top: 1px solid rgba(0, 247, 255, 0.25);
  border-bottom: none;
  font-weight: 700;
  padding-top: 0.55rem;
}

.trade-confirm-highlight td:first-child {
  color: var(--foreground);
}

.trade-confirm-highlight .trade-confirm-value {
  color: var(--accent);
  font-size: 1rem;
}

.trade-confirm-muted td {
  color: var(--muted);
  opacity: 0.8;
}

.trade-confirm-muted .trade-confirm-value {
  color: var(--warn);
}

.trade-time,
.trade-counterparty {
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 700px) {
  .mission-modal-header {
    flex-direction: column;
    gap: 0.8rem;
  }

  .mission-modal-img-placeholder {
    width: 80px;
  }
}

/* ─── Asteroid Belt Mining / Expeditions ─────────────────── */
.expedition-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.expedition-card {
  background: rgba(10, 31, 46, 0.5);
  border: 1px solid rgba(0, 247, 255, 0.12);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
}

.expedition-card.completed {
  opacity: 0.7;
  border-color: rgba(0, 247, 255, 0.06);
}

.expedition-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.expedition-belt-label {
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.expedition-bar {
  background: linear-gradient(90deg, rgba(0, 247, 255, 0.7), rgba(255, 170, 51, 0.65));
  transition: width 0.5s ease;
}

.expedition-yields {
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

.starmap-expedition-card {
  background: rgba(10, 31, 46, 0.5);
  border: 1px solid rgba(0, 247, 255, 0.1);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.4rem;
}

.starmap-exp-select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.35rem 0.5rem;
  background: rgba(5, 5, 15, 0.8);
  border: 1px solid rgba(0, 247, 255, 0.2);
  border-radius: 5px;
  color: var(--foreground);
  font-size: 0.84rem;
}

.starmap-mining-panel h4 {
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}

/* ─── Assembly Facility ──────────────────────────────────── */
.assembly-probe-status {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  margin-top: 1rem;
}

.assembly-probe-img {
  width: 120px;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(0, 247, 255, 0.18);
  background: rgba(5, 5, 15, 0.6);
}

.assembly-probe-status p {
  margin-bottom: 0.5rem;
}
