:root {
  --bg: #06080d;
  --panel: rgba(10, 15, 24, 0.96);
  --panel-2: rgba(16, 23, 36, 0.96);

  --line: #27354b;
  --line-bright: #385986;

  --blue: #2f5fff;
  --blue-bright: #6f8cff;
  --cyan: #4fe5ff;

  --green: #35e28a;
  --amber: #ffb84d;
  --red: #ff5d6f;

  --text: #f4f7fb;
  --muted: #7f8ba0;

  --shadow:
    0 18px 50px rgba(0, 0, 0, 0.45);
}


* {
  box-sizing: border-box;
}


html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}


body {
  background: var(--bg);
  color: var(--text);

  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}


button,
input,
textarea,
select {
  font: inherit;
}


button {
  color: inherit;
}

/* =========================================================
   DEMOCO WIRE · NEWS / FINANCIAL STANDING
   ========================================================= */

.news-terminal-ui {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px 18px 10px;
  background:
    linear-gradient(rgba(242, 169, 59, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 95, 255, 0.025) 1px, transparent 1px),
    #050a12;
  background-size: 28px 28px;
}

.portal-transit-overlay {
  position: fixed;
  inset: 0;
  z-index: 880;
  pointer-events: none;
  opacity: 0;
  transition: opacity 45ms linear;
}

.portal-transit-overlay.blue {
  background: radial-gradient(
    ellipse at center,
    transparent 20%,
    rgba(38, 101, 255, 0.3) 58%,
    rgba(5, 15, 52, 0.96) 100%
  );
}

.portal-transit-overlay.orange {
  background: radial-gradient(
    ellipse at center,
    transparent 20%,
    rgba(255, 155, 34, 0.28) 58%,
    rgba(55, 20, 3, 0.96) 100%
  );
}

.news-command-bar,
.news-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.news-command-bar h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.news-command-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.news-command-actions button,
.strategic-radar button,
.terminal-empty-state button {
  min-height: 34px;
  border: 1px solid var(--blue-bright);
  background: rgba(20, 44, 88, 0.52);
  color: var(--text);
  padding: 8px 13px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.news-financial-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.news-financial-grid article {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #31527d;
  border-top: 2px solid var(--amber);
  background: linear-gradient(135deg, rgba(17, 30, 49, 0.92), rgba(6, 12, 21, 0.94));
}

.news-financial-grid span,
.news-financial-grid small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.news-financial-grid strong {
  display: block;
  margin: 5px 0 3px;
  color: #f4f7ff;
  font-size: 26px;
}

.news-columns {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 12px;
}

.news-panel {
  min-height: 0;
  overflow: hidden;
  border: 1px solid #2b476c;
  background: rgba(5, 11, 19, 0.92);
}

.news-panel header {
  min-height: 52px;
  padding: 10px 13px;
  border-bottom: 1px solid #2b476c;
  background: linear-gradient(90deg, rgba(20, 46, 86, 0.58), rgba(242, 169, 59, 0.05));
}

.news-panel header h4 {
  margin: 3px 0 0;
  font-size: 16px;
}

.news-panel header > span {
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.news-feed-panel,
.news-side-stack {
  min-height: 0;
}

.news-feed-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.news-feed {
  overflow: auto;
}

.news-story {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(50, 78, 115, 0.5);
  color: var(--text);
  text-decoration: none;
}

.news-story:hover {
  background: rgba(47, 95, 255, 0.12);
}

.news-story > b,
.news-story > em {
  color: var(--blue-bright);
  font-size: 11px;
  font-style: normal;
}

.news-story strong,
.news-story small {
  display: block;
}

.news-story strong {
  font-size: 12px;
  line-height: 1.35;
}

.news-story small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.news-side-stack {
  display: grid;
  grid-template-rows: minmax(0, 1.15fr) auto;
  gap: 12px;
}

.market-watch {
  overflow: auto;
}

.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 62px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(50, 78, 115, 0.45);
}

.market-row span strong,
.market-row span small {
  display: block;
}

.market-row span small {
  color: var(--muted);
  font-size: 11px;
}

.market-row > b,
.market-row > em {
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.market-row .up { color: #4ce6a1; }
.market-row .down { color: #ff6677; }

.strategic-radar {
  padding-bottom: 10px;
}

.strategic-radar button {
  width: calc(100% - 20px);
  margin: 9px 10px 0;
  text-align: left;
  border-color: #8a5f28;
  background: rgba(85, 53, 14, 0.18);
}

.news-disclaimer {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: center;
}

@media (max-width: 1050px) {
  .news-financial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-columns { grid-template-columns: 1fr; overflow: auto; }
  .news-feed-panel { min-height: 420px; }
  .news-side-stack { min-height: 480px; }
}

body.hud-cursor-active,
body.hud-cursor-active canvas {
  cursor: default !important;
}

body.hud-cursor-active .crosshair {
  opacity: 0.25;
}

.hud-cursor-vignette {
  position: fixed;
  inset: 0;
  z-index: 19;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(
      ellipse at center,
      rgba(3, 5, 9, 0.18) 0%,
      rgba(3, 5, 9, 0.38) 48%,
      rgba(3, 5, 9, 0.68) 100%
    );
  transition: opacity 0.16s ease-out;
}

body.hud-cursor-active .hud-cursor-vignette {
  opacity: 1;
}


.hidden {
  display: none !important;
}


/* =========================================================
   THREE.JS MOUNT
   ========================================================= */

#game-container {
  position: fixed;
  inset: 0;

  width: 100vw;
  height: 100vh;

  background:
    radial-gradient(
      circle at center,
      #0d1320,
      #05070b 70%
    );
}


#game-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}


/* =========================================================
   START SCREEN
   ========================================================= */

.overlay-screen {
  position: fixed;
  inset: 0;

  z-index: 100;

  display: grid;
  place-items: center;

  padding: 24px;

  background:
    radial-gradient(
      circle at center,
      rgba(22, 38, 70, 0.55),
      rgba(3, 5, 9, 0.96) 70%
    );

  backdrop-filter: blur(4px);

  opacity: 0;
  pointer-events: none;

  transition:
    opacity 0.25s ease;
}


.overlay-screen.visible {
  opacity: 1;
  pointer-events: auto;
}


.start-panel {
  width: min(640px, 92vw);

  padding: 42px 42px 34px;

  border:
    1px solid var(--line-bright);

  clip-path:
    polygon(
      18px 0,
      100% 0,
      100% calc(100% - 18px),
      calc(100% - 18px) 100%,
      0 100%,
      0 18px
    );

  background:
    linear-gradient(
      145deg,
      rgba(55, 89, 150, 0.12),
      transparent 34%
    ),
    rgba(7, 11, 18, 0.97);

  box-shadow:
    0 0 80px rgba(47, 95, 255, 0.14),
    var(--shadow);

  text-align: center;
}


.brand-emblem {
  width: 68px;
  height: 68px;

  margin: 0 auto 18px;

  display: grid;
  place-items: center;

  border:
    2px solid var(--blue);

  border-radius: 50%;

  color: var(--blue-bright);

  font-size: 32px;
  font-weight: 900;

  box-shadow:
    0 0 25px rgba(47, 95, 255, 0.3);
}


.start-kicker {
  margin-bottom: 5px;

  color: #a4b0c2;

  font-size: 11px;
  letter-spacing: 0.28em;
}


.start-panel h1 {
  margin: 0;

  font-size: clamp(34px, 6vw, 52px);
  line-height: 1;

  letter-spacing: 0.08em;
}


.start-divider {
  width: 55%;
  height: 1px;

  margin: 24px auto;

  background:
    linear-gradient(
      90deg,
      transparent,
      var(--blue),
      transparent
    );
}


.start-description {
  margin:
    0 0 25px;

  color: var(--muted);

  font-size: 14px;
  line-height: 1.6;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.primary-button,
.terminal-button,
.station-close-button {
  border:
    1px solid var(--line-bright);

  background:
    linear-gradient(
      180deg,
      rgba(67, 95, 148, 0.15),
      rgba(16, 23, 36, 0.6)
    );

  color: var(--text);

  cursor: pointer;

  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}


.primary-button {
  min-width: 250px;

  padding: 14px 20px;

  border-color: var(--blue);

  clip-path:
    polygon(
      8px 0,
      100% 0,
      100% calc(100% - 8px),
      calc(100% - 8px) 100%,
      0 100%,
      0 8px
    );

  background:
    linear-gradient(
      180deg,
      rgba(47, 95, 255, 0.3),
      rgba(47, 95, 255, 0.11)
    );

  color: #dce5ff;

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 0.13em;
}


.primary-button:hover {
  transform:
    translateY(-1px);

  background:
    linear-gradient(
      180deg,
      rgba(47, 95, 255, 0.46),
      rgba(47, 95, 255, 0.18)
    );

  box-shadow:
    0 0 20px rgba(47, 95, 255, 0.22);
}


.primary-button.compact {
  min-width: 0;

  padding:
    10px 13px;

  font-size: 10px;
}


.terminal-button,
.station-close-button {
  padding:
    8px 11px;

  border-radius: 4px;

  color: var(--muted);

  font-size: 9px;
  letter-spacing: 0.1em;
}


.terminal-button:hover,
.station-close-button:hover {
  border-color:
    var(--blue);

  color: var(--text);
}


/* =========================================================
   START CONTROLS
   ========================================================= */

.controls-grid {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 8px;

  margin-top: 28px;
}


.controls-grid > div {
  padding: 12px 5px;

  border:
    1px solid rgba(100, 121, 153, 0.22);

  background:
    rgba(255,255,255,0.015);
}


.controls-grid strong {
  display: block;

  margin-bottom: 4px;

  color: #d8e1ef;

  font-size: 12px;
}


.controls-grid span {
  color: #667389;

  font-size: 8px;
  letter-spacing: 0.11em;
}


.start-status {
  margin-top: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  color: var(--muted);

  font-size: 9px;
  letter-spacing: 0.14em;
}


/* =========================================================
   STATUS LIGHTS
   ========================================================= */

.status-light {
  width: 8px;
  height: 8px;

  display: inline-block;

  flex: 0 0 auto;

  border-radius: 50%;

  background: #5a6576;
}


.status-light.online {
  background: var(--green);

  box-shadow:
    0 0 11px rgba(53, 226, 138, 0.75);
}


.status-light.warning {
  background: var(--amber);

  box-shadow:
    0 0 11px rgba(255, 184, 77, 0.75);
}


.status-light.error {
  background: var(--red);

  box-shadow:
    0 0 11px rgba(255, 93, 111, 0.75);
}


/* =========================================================
   HUD
   ========================================================= */

.hud {
  position: fixed;
  inset: 0;

  z-index: 20;

  pointer-events: none;
}


.hud-brand {
  position: absolute;

  top: 24px;
  left: 28px;

  display: flex;
  align-items: center;

  gap: 11px;

  text-shadow:
    0 2px 8px rgba(0,0,0,0.8);
}


.hud-logo {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border:
    1px solid var(--blue);

  border-radius: 50%;

  color: var(--blue-bright);

  font-weight: 900;
}


.hud-company {
  color: #a2afc3;

  font-size: 8px;

  letter-spacing: 0.22em;
}


.hud-title {
  margin-top: 2px;

  font-size: 18px;
  font-weight: 800;

  letter-spacing: 0.07em;
}


.hud-system {
  position: absolute;

  top: 25px;
  right: 28px;

  min-width: 185px;

  padding: 10px 12px;

  border-left:
    2px solid var(--blue);

  background:
    linear-gradient(
      90deg,
      rgba(16, 24, 39, 0.65),
      rgba(16, 24, 39, 0.05)
    );

  font-size: 8px;

  letter-spacing: 0.1em;

  text-shadow:
    0 2px 8px rgba(0,0,0,0.9);
}


.hud-system-row {
  display: flex;
  align-items: center;

  gap: 6px;

  margin-bottom: 4px;
}


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


.muted {
  color: #8592a7;
}


/* =========================================================
   CROSSHAIR
   ========================================================= */

.crosshair {
  position: absolute;

  left: 50%;
  top: 50%;

  width: 18px;
  height: 18px;

  transform:
    translate(-50%, -50%);
}


.crosshair span {
  position: absolute;

  background:
    rgba(217, 231, 255, 0.82);

  box-shadow:
    0 0 6px rgba(102, 146, 255, 0.5);
}


.crosshair span:first-child {
  left: 8px;
  top: 2px;

  width: 1px;
  height: 14px;
}


.crosshair span:last-child {
  left: 2px;
  top: 8px;

  width: 14px;
  height: 1px;
}


/* =========================================================
   INTERACTION PROMPT
   ========================================================= */

.interaction-prompt {
  position: absolute;

  left: 50%;
  bottom: 105px;

  transform:
    translateX(-50%);

  display: flex;
  align-items: center;

  gap: 10px;

  min-width: 230px;

  padding:
    10px 13px;

  border:
    1px solid var(--line-bright);

  background:
    rgba(7, 11, 18, 0.86);

  box-shadow:
    0 12px 30px rgba(0,0,0,0.35);

  backdrop-filter: blur(8px);
}


.interaction-key {
  width: 29px;
  height: 29px;

  display: grid;
  place-items: center;

  border:
    1px solid var(--blue);

  background:
    rgba(47,95,255,0.18);

  color: white;

  font-size: 12px;
  font-weight: 800;
}


.interaction-title {
  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.09em;
}


.interaction-subtitle {
  margin-top: 2px;

  color: var(--muted);

  font-size: 8px;
  letter-spacing: 0.05em;
}


/* =========================================================
   HUD FOOTERS
   ========================================================= */

.hud-location {
  position: absolute;

  left: 28px;
  bottom: 25px;

  padding-left: 10px;

  border-left:
    2px solid var(--blue);
}


.hud-label {
  display: block;

  margin-bottom: 3px;

  color: #59677d;

  font-size: 7px;
  letter-spacing: 0.18em;
}


.hud-location strong {
  font-size: 10px;

  letter-spacing: 0.08em;
}


.hud-controls {
  position: absolute;

  right: 28px;
  bottom: 25px;

  display: flex;
  gap: 14px;

  color: #78869a;

  font-size: 8px;
}


.hud-controls span {
  display: flex;
  align-items: center;
  gap: 5px;
}


kbd {
  padding:
    3px 5px;

  border:
    1px solid #445268;

  border-radius: 3px;

  background:
    rgba(255,255,255,0.035);

  color: #cdd8e7;

  font-family: inherit;

  font-size: 8px;
}


/* =========================================================
   STATION INTERFACE
   ========================================================= */

.station-interface {
  position: fixed;
  inset: 0;

  z-index: 60;

  display: grid;
  place-items: center;

  padding:
    22px;

  background:
    rgba(3, 5, 8, 0.84);

  backdrop-filter:
    blur(10px);
}


.station-shell {
  width:
    min(1540px, 96vw);

  height:
    min(880px, 93vh);

  display: grid;

  grid-template-rows:
    auto auto 1fr;

  clip-path:
    polygon(
      18px 0,
      100% 0,
      100% calc(100% - 18px),
      calc(100% - 18px) 100%,
      0 100%,
      0 18px
    );

  border:
    1px solid var(--line-bright);

  background:
    radial-gradient(
      circle at 80% 0,
      rgba(47,95,255,0.12),
      transparent 32%
    ),
    var(--panel);

  box-shadow:
    0 0 80px rgba(47,95,255,0.09),
    var(--shadow);

  overflow: hidden;
}


.station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 20px;

  padding:
    17px 20px;

  border-bottom:
    1px solid var(--line);

  background:
    linear-gradient(
      90deg,
      rgba(21, 32, 52, 0.82),
      rgba(10, 15, 24, 0.55)
    );
}


.station-heading h2 {
  margin:
    3px 0 0;

  font-size: 22px;
}


.station-category,
.terminal-caption {
  color:
    var(--blue-bright);

  font-size:
    10px;

  font-weight:
    800;

  letter-spacing:
    0.16em;
}


.station-header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}


.station-link-status {
  display: flex;
  align-items: center;

  gap: 6px;

  color: var(--muted);

  font-size: 8px;
  letter-spacing: 0.09em;
}


.station-content {
  min-height: 0;
  overflow: hidden;
}

.planning-metric-link,
.news-financial-grid article[role="button"] {
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.planning-metric-link:hover,
.planning-metric-link:focus-visible,
.news-financial-grid article[role="button"]:hover,
.news-financial-grid article[role="button"]:focus-visible {
  border-color: #4ff3ff;
  background-color: rgba(79, 243, 255, 0.055);
  transform: translateY(-2px);
  outline: none;
}

.station-loading {
  width: 100%;
  height: 100%;

  display: grid;
  place-items: center;

  align-content: center;
  gap: 13px;

  color: var(--muted);

  font-size: 9px;
  letter-spacing: 0.15em;
}


.loading-bars {
  display: flex;
  gap: 5px;
}


.loading-bars span {
  width: 5px;
  height: 20px;

  background:
    var(--blue);

  animation:
    loadingPulse 1s infinite ease-in-out;
}


.loading-bars span:nth-child(2) {
  animation-delay: 0.1s;
}


.loading-bars span:nth-child(3) {
  animation-delay: 0.2s;
}


.loading-bars span:nth-child(4) {
  animation-delay: 0.3s;
}


@keyframes loadingPulse {
  0%,
  100% {
    opacity: 0.22;
    transform:
      scaleY(0.45);
  }

  50% {
    opacity: 1;
    transform:
      scaleY(1);
  }
}


/* =========================================================
   DATABASE TERMINAL
   ========================================================= */

.terminal-layout {
  height: 100%;

  display: grid;

  grid-template-columns:
    210px 1fr;
}


.terminal-sidebar {
  padding:
    15px 12px;

  border-right:
    1px solid var(--line);

  background:
    rgba(4, 7, 12, 0.5);
}


.terminal-nav-title {
  padding:
    8px 8px 14px;

  color: #74839a;

  font-size: 10px;
  letter-spacing: 0.18em;
}


.terminal-nav {
  width: 100%;

  margin-bottom: 5px;

  padding:
    10px 10px;

  border:
    1px solid transparent;

  background: transparent;

  color: #8190a6;

  text-align: left;

  cursor: pointer;

  font-size: 10px;
  letter-spacing: 0.07em;

  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}


.terminal-nav:hover {
  color: white;

  background:
    rgba(255,255,255,0.025);
}


.terminal-nav.active {
  border-color:
    rgba(47,95,255,0.52);

  background:
    rgba(47,95,255,0.11);

  color: #dce5ff;
}


.terminal-main {
  min-width: 0;
  min-height: 0;

  display: grid;

  grid-template-rows:
    auto auto 1fr;

  padding:
    18px;
}


.terminal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 12px;
}


.terminal-toolbar h3 {
  margin:
    4px 0 0;

  font-size: 19px;
}


.terminal-toolbar-actions {
  display: flex;
  gap: 7px;
  align-items: flex-end;
}

.database-search {
  display: grid;
  gap: 4px;
}

.database-search span {
  color: #74839a;
  font-size: 7px;
  letter-spacing: 0.1em;
}

.database-search input {
  width: 230px;
  padding: 8px 10px;
  border: 1px solid rgba(100, 150, 205, 0.34);
  outline: none;
  color: #dfeeff;
  background: rgba(4, 10, 18, 0.86);
  font: inherit;
  font-size: 9px;
}

.database-search input:focus {
  border-color: #4ff3ff;
  box-shadow: 0 0 0 2px rgba(79, 243, 255, 0.07);
}


.terminal-stats {
  display: grid;

  grid-template-columns:
    repeat(3, 180px);

  gap: 8px;

  margin:
    14px 0;
}


.terminal-stat {
  padding:
    10px 12px;

  border:
    1px solid var(--line);

  background:
    rgba(255,255,255,0.015);
}


.terminal-stat span {
  display: block;

  color: #7b899f;

  font-size: 9px;
  letter-spacing: 0.12em;
}


.terminal-stat strong {
  display: block;

  margin-top: 4px;

  font-size: 17px;
}


/* =========================================================
   DATABASE TABLE
   ========================================================= */

.table-frame {
  min-height: 0;

  overflow: auto;

  border:
    1px solid var(--line);

  background:
    rgba(3, 6, 11, 0.45);

  scrollbar-color:
    #334056 transparent;
}


.database-table {
  width: 100%;

  border-collapse:
    collapse;

  font-size: 10px;
}


.database-table th {
  position: sticky;

  top: 0;

  z-index: 2;

  padding:
    9px 10px;

  border-bottom:
    1px solid var(--line-bright);

  background:
    #101827;

  color: #8fa1b8;

  text-align: left;

  font-size: 9px;
  letter-spacing: 0.09em;

  white-space: nowrap;
}


.database-table td {
  padding:
    8px 10px;

  border-bottom:
    1px solid rgba(102, 124, 155, 0.11);

  color: #cbd5e4;

  white-space: nowrap;

  max-width: 280px;

  overflow: hidden;

  text-overflow: ellipsis;
}


.database-table tbody tr {
  cursor: pointer;

  transition:
    background 0.12s ease;
}


.database-table tbody tr:hover {
  background:
    rgba(47,95,255,0.08);
}


/* =========================================================
   NOTES
   ========================================================= */

.notes-interface {
  height: 100%;

  display: grid;

  grid-template-rows:
    auto 1fr;

  padding:
    18px;
}


.notes-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 12px;

  margin-bottom: 15px;
}


.notes-toolbar h3 {
  margin:
    4px 0 0;
}

.notes-toolbar-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.notes-search {
  display: grid;
  gap: 5px;
  min-width: min(280px, 42vw);
}

.notes-search span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.15em;
}

.notes-search input,
.notes-priority-filter {
  min-height: 34px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 18, 0.82);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 11px;
  outline: none;
}

.notes-search input:focus,
.notes-priority-filter:focus {
  border-color: rgba(79, 243, 255, 0.62);
  box-shadow: 0 0 0 2px rgba(79, 243, 255, 0.08);
}

.notes-filter-empty {
  grid-column: 1 / -1;
}


.notes-grid {
  min-height: 0;

  display: grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(220px, 1fr)
    );

  grid-auto-rows:
    minmax(170px, 220px);

  gap: 13px;

  overflow: auto;

  padding:
    3px;

  align-content: start;
}


.note-card {
  position: relative;

  padding:
    15px;

  color: #151515;

  background:
    linear-gradient(
      145deg,
      #eadf9d,
      #d5c575
    );

  box-shadow:
    0 8px 18px rgba(0,0,0,0.22);

  cursor: pointer;

  transform:
    rotate(-0.4deg);

  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
}


.note-card:nth-child(even) {
  transform:
    rotate(0.5deg);
}


.note-card:hover {
  transform:
    rotate(0deg)
    translateY(-3px)
    scale(1.01);

  box-shadow:
    0 14px 24px rgba(0,0,0,0.28);
}


.note-card.high,
.note-card.critical {
  background:
    linear-gradient(
      145deg,
      #f0b9ad,
      #db8e80
    );
}


.note-card.low {
  background:
    linear-gradient(
      145deg,
      #b8d9c0,
      #91bd9b
    );
}


.note-card h4 {
  margin:
    0 0 8px;

  font-size:
    14px;
}


.note-card p {
  margin:
    0 0 8px;

  font-size:
    10px;

  line-height:
    1.45;
}


.note-meta {
  position:
    absolute;

  left: 15px;
  right: 15px;
  bottom: 12px;

  font-size:
    8px;

  opacity:
    0.64;
}


.terminal-empty-state {
  padding:
    16px;

  color: var(--muted);

  font-size: 10px;
}


/* =========================================================
   ACTION BOARD
   ========================================================= */

.action-interface {
  height: 100%;

  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap:
    12px;

  padding:
    18px;
}


.action-column {
  min-width: 0;

  padding:
    14px;

  border:
    1px solid var(--line);

  background:
    rgba(255,255,255,0.014);

  overflow:
    auto;
}


.action-column h3 {
  margin:
    5px 0 14px;

  font-size:
    18px;
}

.action-column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.action-count {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: #dbeaff;
  background: rgba(5, 11, 20, 0.76);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.action-column:nth-child(1) .action-count { color: #ff7b89; }
.action-column:nth-child(2) .action-count { color: #ffd170; }
.action-column:nth-child(3) .action-count { color: #9af574; }

@media (max-width: 760px) {
  .notes-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .notes-toolbar-actions,
  .notes-search {
    width: 100%;
  }

  .notes-toolbar-actions > * {
    flex: 1 1 150px;
  }
}


.action-record-list {
  display:
    grid;

  gap:
    7px;
}


.action-record {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding:
    10px;

  border:
    1px solid var(--line);

  background:
    rgba(6, 10, 16, 0.5);

  font-size:
    9px;

  line-height:
    1.45;
}


.action-record strong {
  display:
    block;

  margin-bottom:
    3px;
}


/* =========================================================
   TROPHY / STATS
   ========================================================= */

.trophy-interface {
  height:
    100%;

  display:
    grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap:
    13px;

  padding:
    18px;
}


.trophy-stat {
  min-height:
    165px;

  display:
    flex;
  flex-direction:
    column;
  justify-content:
    center;
  align-items:
    center;

  border:
    1px solid var(--line-bright);

  background:
    radial-gradient(
      circle at center,
      rgba(47,95,255,0.11),
      rgba(255,255,255,0.01)
    );

  text-align:
    center;
}


.trophy-stat span {
  color:
    #9aa7ba;

  font-size:
    11px;

  letter-spacing:
    0.12em;
}


.trophy-stat strong {
  margin-top:
    8px;

  font-size:
    30px;
}


.trophy-stat.locked {
  opacity:
    0.38;
}


.trophy-stat.locked strong {
  color:
    #5f6c7f;

  font-size:
    17px;
}

.action-record-command {
  display: block;
  margin-top: 8px;
  color: #65dff1;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.database-command-cell {
  min-width: 175px;
  white-space: nowrap;
}

.database-command {
  margin: 2px 4px 2px 0;
  padding: 6px 8px;
  border: 1px solid rgba(79, 243, 255, 0.35);
  color: #a9edff;
  background: rgba(8, 24, 40, 0.86);
  font: inherit;
  font-size: 8px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.database-command:hover,
.database-command:focus-visible {
  border-color: #4ff3ff;
  color: white;
  box-shadow: 0 0 15px rgba(79, 243, 255, 0.14);
}

.database-command.authorize,
.quest-actions .authorize {
  border-color: rgba(127, 229, 79, 0.48);
  color: #bfff9f;
}

.quest-dossier-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 5, 12, 0.86);
  backdrop-filter: blur(8px);
}

.quest-dossier {
  width: min(880px, 96%);
  max-height: 94%;
  overflow: auto;
  border: 1px solid rgba(79, 243, 255, 0.55);
  background:
    linear-gradient(rgba(5, 14, 27, 0.96), rgba(3, 8, 16, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(79, 243, 255, 0.035) 26px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68), inset 0 0 45px rgba(47, 95, 255, 0.07);
}

.quest-dossier-header,
.quest-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}

.quest-dossier-header {
  border-bottom: 1px solid var(--line-bright);
}

.quest-dossier-header h2 {
  margin: 5px 0 0;
  font-size: clamp(22px, 3vw, 38px);
  letter-spacing: 0.04em;
}

.quest-status-strip {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 10px;
  padding: 11px 20px;
  border-bottom: 1px solid rgba(100, 150, 205, 0.22);
  color: #8099b9;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.quest-status-strip strong { color: #dbeaff; }

.quest-dossier-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  padding: 20px;
}

.quest-dossier-grid section {
  padding: 16px;
  border: 1px solid rgba(100, 150, 205, 0.24);
  background: rgba(4, 12, 23, 0.72);
}

.quest-dossier-grid p {
  margin: 10px 0 0;
  color: #c7d7eb;
  font-size: 12px;
  line-height: 1.65;
}

.quest-email { color: #62e8ff; }
.quest-hold {
  display: block;
  margin-top: 11px;
  color: #ffcd6b;
  font-size: 8px;
  letter-spacing: 0.1em;
}
.quest-intel { grid-column: 1 / -1; }
.quest-objective { color: #efffdc !important; font-size: 15px !important; }

.quest-actions {
  justify-content: flex-start;
  border-top: 1px solid var(--line-bright);
  background: rgba(2, 8, 16, 0.76);
}

.quest-command-message {
  margin-left: auto;
  color: #8ca6c8;
  font-size: 9px;
  letter-spacing: 0.08em;
}

/* =========================================================
   STATION GUI ENHANCEMENT LAYER
   ========================================================= */

.station-shell {
  position: relative;
  isolation: isolate;
}

.station-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.13;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(79, 243, 255, 0.16) 48%,
    rgba(79, 243, 255, 0.36) 50%,
    transparent 53%
  );
  background-size: 100% 260px;
  animation: stationScan 8s linear infinite;
}

.station-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 70px rgba(47, 95, 255, 0.08);
}

@keyframes stationScan {
  from { background-position: 0 -260px; }
  to { background-position: 0 calc(100% + 260px); }
}

.station-header {
  position: relative;
  z-index: 5;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
}

.station-header::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, #4ff3ff, #2f5fff 45%, transparent 90%);
}

.station-heading h2 {
  text-shadow: 0 0 24px rgba(79, 243, 255, 0.18);
}

.station-link-status {
  padding: 7px 10px;
  border: 1px solid rgba(127, 229, 79, 0.2);
  background: rgba(127, 229, 79, 0.035);
}

.station-content {
  position: relative;
  z-index: 2;
  background-image:
    linear-gradient(rgba(66, 105, 155, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 105, 155, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

.terminal-nav {
  position: relative;
  overflow: hidden;
}

.terminal-nav::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: transparent;
}

.terminal-nav.active::before {
  background: #4ff3ff;
  box-shadow: 0 0 12px #4ff3ff;
}

.terminal-stat {
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.terminal-stat::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, #2f5fff, #4ff3ff);
  opacity: 0.7;
}

.terminal-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 243, 255, 0.45);
}

.database-table tbody tr:nth-child(even) {
  background: rgba(79, 243, 255, 0.012);
}

.database-table tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 #4ff3ff;
}

.terminal-empty-state {
  margin: 12px;
  border: 1px dashed rgba(100, 150, 205, 0.28);
  background: rgba(4, 10, 18, 0.58);
  text-align: center;
  letter-spacing: 0.08em;
}

.action-column {
  position: relative;
  box-shadow: inset 0 2px rgba(255, 255, 255, 0.025);
}

.action-column:nth-child(1) { border-top-color: #ff596b; }
.action-column:nth-child(2) { border-top-color: #ffbf47; }
.action-column:nth-child(3) { border-top-color: #7fe54f; }

.action-record {
  position: relative;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.action-record:hover {
  transform: translateX(3px);
  border-color: rgba(79, 243, 255, 0.42);
  background: rgba(15, 29, 49, 0.78);
}

.trophy-stat {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trophy-stat:not(.locked):hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(47, 95, 255, 0.16), inset 0 0 30px rgba(79, 243, 255, 0.04);
}

.trophy-stat:not(.locked)::after {
  content: "LIVE METRIC";
  position: absolute;
  bottom: 11px;
  color: rgba(127, 229, 79, 0.65);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.planning-readiness-group {
  box-shadow: inset 3px 0 rgba(79, 243, 255, 0.28);
}

.planning-readiness-row {
  transition: background 0.14s ease;
}

.planning-readiness-row:hover {
  background: rgba(79, 243, 255, 0.035);
}

.calendar-day {
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.calendar-day:hover {
  z-index: 2;
  transform: translateY(-2px);
  border-color: rgba(79, 243, 255, 0.48);
  background: rgba(13, 28, 48, 0.92);
}

@media (prefers-reduced-motion: reduce) {
  .station-shell::before { animation: none; display: none; }
  .terminal-stat,
  .action-record,
  .trophy-stat,
  .calendar-day { transition: none; }
}

/* =========================================================
   PAUSE / SETTINGS
   ========================================================= */

.pause-panel {
  width: min(860px, 94vw);
  max-height: 94vh;
  overflow: auto;
  padding: 30px;
  border: 1px solid var(--line-bright);
  background:
    linear-gradient(145deg, rgba(127, 229, 79, 0.07), transparent 36%),
    rgba(7, 11, 18, 0.98);
  box-shadow: 0 0 90px rgba(47, 95, 255, 0.18), var(--shadow);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

.pause-header,
.pause-layout {
  display: flex;
  justify-content: space-between;
  gap: 28px;
}

.pause-header {
  align-items: flex-end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-bright);
}

.pause-header h2 {
  margin: 3px 0 0;
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: 0.08em;
}

.pause-status {
  color: #7fe54f;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.pause-layout {
  align-items: stretch;
  margin-top: 24px;
}

.pause-actions,
.pause-settings {
  flex: 1;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pause-actions .primary-button {
  width: 100%;
}

.pause-menu-button {
  padding: 13px 18px;
  border: 1px solid rgba(100, 150, 205, 0.35);
  color: #9aa7ba;
  background: rgba(255, 255, 255, 0.02);
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.pause-menu-button:hover {
  color: #edf5ff;
  border-color: var(--blue);
}

.pause-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 17px;
  border: 1px solid rgba(100, 150, 205, 0.26);
  background: rgba(2, 8, 16, 0.62);
}

.pause-slider > span {
  display: flex;
  justify-content: space-between;
  color: #8da0ba;
  font-size: 9px;
  letter-spacing: 0.11em;
}

.pause-slider strong {
  color: #dcecff;
}

.pause-slider input {
  width: 100%;
  margin-top: 9px;
  accent-color: #7fe54f;
}

.station-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.station-brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 50%;
  color: var(--blue-bright);
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(47, 95, 255, 0.2);
}

.pause-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 11px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(100, 150, 205, 0.2);
  cursor: pointer;
}

.pause-toggle > span { display: grid; gap: 5px; }

.pause-toggle b,
.pause-toggle > strong {
  color: #dcecff;
  font-size: 9px;
  letter-spacing: 0.11em;
}

.pause-toggle small {
  max-width: 290px;
  color: #71829a;
  font-size: 8px;
  line-height: 1.45;
  letter-spacing: 0.04em;
}

.pause-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pause-toggle i {
  position: relative;
  width: 34px;
  height: 17px;
  border: 1px solid rgba(100, 150, 205, 0.65);
  background: rgba(0, 0, 0, 0.45);
  transition: 160ms ease;
}

.pause-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 9px;
  background: #71829a;
  box-shadow: 0 0 7px rgba(113, 130, 154, 0.5);
  transition: 160ms ease;
}

.pause-toggle input:checked + i {
  border-color: #7fe54f;
  background: rgba(127, 229, 79, 0.1);
}

.pause-toggle input:checked + i::after {
  left: 20px;
  background: #7fe54f;
  box-shadow: 0 0 9px rgba(127, 229, 79, 0.8);
}

.pause-toggle:focus-within i {
  outline: 1px solid #4ff3ff;
  outline-offset: 3px;
}

.pause-toggle > strong {
  min-width: 46px;
  color: #7fe54f;
  text-align: right;
}

.since-visit-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) 2fr;
  gap: 20px;
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(79, 243, 255, 0.28);
  background: rgba(4, 12, 23, 0.72);
}

.since-visit-panel > div:first-child strong {
  display: block;
  margin-top: 7px;
  color: #91a4bd;
  font-size: 9px;
  line-height: 1.45;
}

.since-visit-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(85px, 1fr));
  gap: 5px 12px;
  align-items: center;
}

.since-visit-summary div {
  display: grid;
  gap: 5px;
}

.since-visit-summary span {
  color: #8092aa;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.since-visit-summary b {
  color: #7fe54f;
  font-size: 17px;
}

.business-alert-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) 2fr;
  gap: 20px;
  margin-top: 10px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 191, 71, 0.34);
  background: rgba(26, 15, 3, 0.52);
}

.business-alert-panel > div:first-child strong {
  display: block;
  margin-top: 7px;
  color: #ffbf47;
  font-size: 9px;
}

.business-alert-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.business-alert-summary span {
  padding: 7px 9px;
  border: 1px solid rgba(255, 191, 71, 0.24);
  color: #d9c9ab;
  background: rgba(255, 191, 71, 0.05);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.business-alert-summary .clear {
  border-color: rgba(127, 229, 79, 0.3);
  color: #7fe54f;
}

.pause-controls {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-top: 24px;
}

.pause-controls > div {
  padding: 10px 4px;
  border: 1px solid rgba(100, 121, 153, 0.22);
  text-align: center;
}

.pause-controls strong,
.pause-controls span {
  display: block;
}

/* =========================================================
   F2 BASE EDITOR
   ========================================================= */

.build-mode-interface {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  color: #edf5ff;
  background: linear-gradient(rgba(3, 8, 16, 0.08), rgba(3, 8, 16, 0.18));
}

.build-mode-header {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 15px;
  border: 1px solid rgba(79, 243, 255, 0.5);
  background: rgba(5, 12, 23, 0.94);
  pointer-events: auto;
}

.build-mode-header strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: 0.14em;
}

.build-mode-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.terminal-button.danger {
  border-color: rgba(255, 89, 107, 0.55);
  color: #ff8996;
}

.build-mode-sidebar {
  position: absolute;
  top: 98px;
  left: 16px;
  width: 248px;
  padding: 16px;
  border: 1px solid rgba(79, 243, 255, 0.45);
  background: rgba(5, 12, 23, 0.94);
  pointer-events: auto;
}

.build-mode-sidebar h3 {
  min-height: 22px;
  margin: 8px 0 14px;
  color: #7fe54f;
  font-size: 15px;
}

.build-coordinate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.build-coordinate-grid label {
  color: #8da0ba;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.build-coordinate-grid input {
  width: 100%;
  margin-top: 5px;
  padding: 7px;
  border: 1px solid rgba(100, 150, 205, 0.35);
  color: #e6f1ff;
  background: #050b14;
  font-size: 10px;
}

.build-snap-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  color: #8da0ba;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.build-snap-control input {
  accent-color: #4ff3ff;
}

.build-object-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 11px;
}

.build-object-actions .danger {
  grid-column: 1 / -1;
}

.build-object-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.build-catalog,
.build-finishes {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(100, 150, 205, 0.24);
}

.build-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.build-catalog-grid button {
  min-height: 34px;
  padding: 6px;
  border: 1px solid rgba(79, 243, 255, 0.25);
  color: #9fb6d0;
  background: rgba(79, 243, 255, 0.04);
  font-size: 7px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.build-catalog-grid button:hover {
  border-color: #4ff3ff;
  color: #eef8ff;
}

.build-finish-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.build-finish-grid button {
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.build-finish-grid button:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

.build-finish-grid button[data-build-finish="command-blue"] { background: #173c78; }
.build-finish-grid button[data-build-finish="mint-green"] { background: #7fe54f; }
.build-finish-grid button[data-build-finish="hazard-orange"] { background: #ff8b32; }
.build-finish-grid button[data-build-finish="industrial-gray"] { background: #596575; }

.build-mode-help {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid rgba(100, 150, 205, 0.24);
}

.build-mode-help p {
  margin: 7px 0;
  color: #788aa4;
  font-size: 8px;
}

.build-mode-help strong {
  color: #cbd8e9;
}

.build-mode-message {
  margin-top: 14px;
  color: #7fe54f;
  font-size: 8px;
  letter-spacing: 0.11em;
}

.build-mode-legend {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 18px;
  padding: 10px 13px;
  border: 1px solid rgba(79, 243, 255, 0.4);
  color: #8da0ba;
  background: rgba(5, 12, 23, 0.92);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.build-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
}

.build-dot.movable { background: #4ff3ff; }
.build-dot.selected { background: #7fe54f; }

body.build-mode-active canvas {
  cursor: crosshair;
}

body.build-mode-active.build-mode-panning canvas {
  cursor: grabbing;
}

.pause-controls strong {
  color: #d8e1ef;
  font-size: 10px;
}

.pause-controls span {
  margin-top: 4px;
  color: #667389;
  font-size: 7px;
  letter-spacing: 0.09em;
}

.planning-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 13px;
}

.planning-readiness-details {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.planning-readiness-group {
  margin-top: 12px;
  border: 1px solid var(--line-bright);
  background: rgba(3, 10, 20, 0.55);
}

.planning-readiness-heading,
.planning-readiness-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.planning-readiness-heading {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-bright);
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.planning-readiness-row {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(100, 150, 205, 0.18);
}

.planning-readiness-row:last-child {
  border-bottom: 0;
}

.planning-readiness-row > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.planning-readiness-row strong {
  font-size: 12px;
}

.planning-readiness-row span {
  color: #9aa7ba;
  font-size: 11px;
  line-height: 1.45;
}

.planning-readiness-status {
  min-width: 130px;
  text-align: right;
}

.calendar-interface {
  height: 100%;
  overflow: auto;
  padding: 18px;
}

.calendar-toolbar,
.calendar-lower,
.calendar-form-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.calendar-toolbar {
  align-items: center;
  margin-bottom: 14px;
}

.calendar-toolbar h3 {
  margin: 5px 0 0;
}

.calendar-access {
  max-width: 55%;
  color: #9aa7ba;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-align: right;
}

.calendar-access.online { color: #77f0a4; }
.calendar-access.warning { color: #ffc866; }
.calendar-access.error { color: #ff7a89; }

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
}

.calendar-weekdays span {
  padding: 8px;
  border: 1px solid var(--line-bright);
  color: #88a6ca;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-align: center;
}

.calendar-day {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 102px;
  padding: 7px;
  border: 1px solid rgba(100, 150, 205, 0.25);
  background: rgba(3, 10, 20, 0.55);
}

.calendar-day:focus-visible {
  outline: 1px solid #4ff3ff;
  outline-offset: -2px;
}

@media (max-width: 760px) {
  .quest-dossier-grid { grid-template-columns: 1fr; }
  .quest-intel { grid-column: auto; }
  .quest-status-strip { grid-template-columns: auto 1fr; }
  .quest-actions { flex-wrap: wrap; }
  .quest-command-message { width: 100%; margin-left: 0; }
}

.calendar-day.outside { opacity: 0.38; }
.calendar-day.today { box-shadow: inset 0 0 0 2px #7fe54f; }
.calendar-day > strong { font-size: 12px; }

.calendar-chip {
  margin-top: 5px;
  padding: 4px 5px;
  overflow: hidden;
  color: #dcecff;
  background: rgba(47, 95, 255, 0.28);
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-chip.note {
  color: #ecffd8;
  background: rgba(95, 170, 50, 0.34);
}

.calendar-more {
  display: block;
  margin-top: 5px;
  color: #9aa7ba;
  font-size: 8px;
}

.calendar-lower {
  align-items: flex-start;
  margin-top: 18px;
}

.calendar-lower > section,
.calendar-event-form {
  flex: 1;
}

.calendar-upcoming-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(100, 150, 205, 0.22);
  font-size: 10px;
}

.calendar-upcoming-row span,
.calendar-upcoming-row em {
  color: #8aa5c8;
  font-style: normal;
}

.calendar-event-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-bright);
  background: rgba(3, 10, 20, 0.58);
}

.calendar-event-form label {
  flex: 1;
  color: #8da0ba;
  font-size: 10px;
  letter-spacing: 0.09em;
}

.calendar-event-form input,
.calendar-event-form textarea,
.calendar-event-form select {
  width: 100%;
  margin-top: 6px;
  padding: 9px;
  border: 1px solid var(--line-bright);
  color: #e6f1ff;
  background: #050b14;
  font: inherit;
  letter-spacing: normal;
}

.calendar-form-row {
  align-items: flex-end;
}


/* =========================================================
   MODAL
   ========================================================= */

.modal-layer {
  position:
    fixed;

  inset:
    0;

  z-index:
    100;

  display:
    grid;

  place-items:
    center;

  padding:
    20px;

  background:
    rgba(2, 4, 7, 0.88);

  backdrop-filter:
    blur(10px);
}


.modal-panel {
  width:
    min(760px, 95vw);

  max-height:
    92vh;

  overflow:
    auto;

  padding:
    19px;

  border:
    1px solid var(--line-bright);

  background:
    var(--panel);

  box-shadow:
    var(--shadow);
}


.modal-header {
  display:
    flex;

  justify-content:
    space-between;

  align-items:
    flex-start;

  gap:
    12px;

  margin-bottom:
    18px;
}


.modal-header h2 {
  margin:
    3px 0 0;
}


#note-form {
  display:
    grid;

  gap:
    13px;
}


#note-form label {
  display:
    grid;

  gap:
    6px;

  color:
    #8290a5;

  font-size:
    11px;

  line-height:
    1.35;

  letter-spacing:
    0.1em;
}


#note-form input,
#note-form textarea,
#note-form select {
  width:
    100%;

  border:
    1px solid var(--line);

  background:
    #080d15;

  color:
    var(--text);

  outline:
    none;

  padding:
    10px 11px;

  font-size:
    13px;

  line-height:
    1.45;

  resize:
    vertical;
}


#note-form input:focus,
#note-form textarea:focus,
#note-form select:focus {
  border-color:
    var(--blue);
}


.form-grid {
  display:
    grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap:
    12px;
}


.modal-actions {
  display:
    flex;

  justify-content:
    space-between;

  align-items:
    center;

  gap:
    12px;

  margin-top:
    5px;
}


.save-message {
  min-height:
    16px;

  color:
    var(--muted);

  font-size:
    9px;
}


/* =========================================================
   TOAST
   ========================================================= */

.toast {
  position:
    fixed;

  z-index:
    150;

  left:
    50%;

  bottom:
    26px;

  transform:
    translateX(-50%);

  display:
    flex;

  align-items:
    center;

  gap:
    8px;

  min-width:
    260px;

  padding:
    10px 13px;

  border:
    1px solid var(--line-bright);

  background:
    rgba(7, 11, 18, 0.94);

  box-shadow:
    var(--shadow);

  color:
    #d6dfed;

  font-size:
    9px;

  letter-spacing:
    0.05em;
}


/* =========================================================
   SCANLINES / GAMEY POLISH
   ========================================================= */

body::after {
  content: "";

  position:
    fixed;

  inset:
    0;

  z-index:
    999;

  pointer-events:
    none;

  opacity:
    0.035;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.14) 0,
      rgba(255,255,255,0.14) 1px,
      transparent 1px,
      transparent 3px
    );
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

  .controls-grid {
    grid-template-columns:
      repeat(2, 1fr);
  }

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

  .terminal-stats {
    grid-template-columns:
      repeat(3, 1fr);
  }

  .action-interface,
  .trophy-interface {
    grid-template-columns:
      1fr;
  }

  .planning-metric-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .pause-controls {
    grid-template-columns: repeat(4, 1fr);
  }

  .since-visit-panel {
    grid-template-columns: 1fr;
  }

  .business-alert-panel {
    grid-template-columns: 1fr;
  }

  .since-visit-summary {
    grid-template-columns: repeat(2, minmax(85px, 1fr));
  }

  .calendar-lower {
    flex-direction: column;
  }

  .calendar-lower > section,
  .calendar-event-form {
    width: 100%;
  }

}


@media (max-width: 650px) {

  .start-panel {
    padding:
      30px 22px;
  }

  .pause-layout {
    flex-direction: column;
  }

  .hud-brand,
  .hud-system {
    transform:
      scale(0.86);

    transform-origin:
      top left;
  }

  .hud-system {
    transform-origin:
      top right;
  }

  .terminal-layout {
    display:
      block;
  }

  .terminal-sidebar {
    display:
      flex;

    overflow-x:
      auto;

    border-right:
      none;

    border-bottom:
      1px solid var(--line);
  }

  .terminal-nav-title {
    display:
      none;
  }

  .terminal-nav {
    width:
      auto;

    white-space:
      nowrap;
  }

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

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

}

.database-empty-command { display: grid; justify-items: start; gap: 9px; padding: 20px; }
.database-empty-command strong { color: #76e6f5; letter-spacing: .08em; }
.database-empty-command span { color: #8394aa; }

.crm-access {
  display: grid;
  gap: 7px;
  width: min(420px, 100%);
  margin: 0 auto 8px;
  text-align: left;
}

.crm-access span,
.crm-access-status {
  color: #77869d;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.crm-access input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #35557c;
  background: rgba(3, 8, 17, 0.82);
  color: #eaf3ff;
  font: inherit;
  outline: none;
}

.crm-access input:focus {
  border-color: #5ccfff;
  box-shadow: 0 0 14px rgba(54, 174, 255, 0.2);
}

.crm-access-status {
  min-height: 14px;
  margin-bottom: 10px;
  text-align: center;
}

.crm-access-status.authorized { color: #55df91; }
.crm-access-status.error { color: #ff7185; }

/* =========================================================
   WORLD-MAP HUD / AVA COMMAND LINK
   ========================================================= */

.crm-radar {
  position: fixed;
  top: 112px;
  right: 34px;
  width: 190px;
  height: 190px;
  z-index: 24;
  pointer-events: none;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .72));
}

.radar-bezel {
  position: absolute;
  inset: 12px;
  padding: 10px;
  border: 7px ridge #ae7f31;
  border-radius: 50%;
  background: radial-gradient(circle, #213947 0 58%, #30220e 60% 100%);
  box-shadow: inset 0 0 0 2px #f1cd70, inset 0 0 28px #02070c, 0 0 0 2px #211505;
}

.radar-compass {
  position: absolute;
  left: 50%; top: -18px;
  transform: translateX(-50%);
  color: #ffd979;
  font: 800 12px Georgia, serif;
  text-shadow: 0 1px #000;
}

.radar-field {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  border-radius: 50%;
  background:
    linear-gradient(rgba(113, 196, 229, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 196, 229, .09) 1px, transparent 1px),
    radial-gradient(circle at 44% 52%, #345a59, #122d39 65%, #08151f);
  background-size: 18px 18px, 18px 18px, auto;
}

.radar-dot, .radar-player {
  position: absolute;
  display: block;
  width: 8px; height: 8px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.radar-dot.station { background: #4fe5ff; box-shadow: 0 0 6px #4fe5ff; }
.radar-dot.critter { background: #7cff37; box-shadow: 0 0 6px #7cff37; width: 6px; height: 6px; }
.radar-dot.ava { background: #ff527d; box-shadow: 0 0 8px #ff527d; width: 10px; height: 10px; }
.radar-player {
  z-index: 4;
  width: 0; height: 0;
  border: 6px solid transparent;
  border-bottom: 12px solid #ffe596;
  border-radius: 0;
  transform-origin: center;
}

.radar-orbit-button {
  position: absolute;
  z-index: 5;
  width: 40px; height: 40px;
  border: 4px ridge #b98c3d;
  border-radius: 50%;
  background: radial-gradient(circle, #263c5d, #090e19);
  color: #ffe89e;
  font: 900 12px Georgia, serif;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 3px 10px #000;
}
.radar-orbit-button:hover { filter: brightness(1.35); transform: scale(1.06); }
.radar-orbit-button.ava { left: 0; top: 20px; color: #ffabc0; font-size: 20px; }
.radar-orbit-button.kpi { right: 0; bottom: 15px; font-size: 9px; }
.radar-orbit-button.quests { left: 22px; bottom: -5px; color: #ffe39a; font: 900 18px Georgia, serif; }
.radar-orbit-button.alerts { right: 0; top: 18px; color: #ffcf63; font-size: 20px; }
.notification-badge {
  position: absolute; right: -3px; top: 11px; z-index: 7;
  min-width: 19px; height: 19px; padding: 1px 5px;
  border: 2px solid #ffd986; border-radius: 10px;
  background: #a91f2e; color: white; font: 800 10px/14px sans-serif;
  text-align: center;
}

.ava-console {
  position: fixed; inset: 0; z-index: 180;
  display: grid; place-items: center;
  padding: 28px;
  background: rgba(2, 4, 10, .82);
  backdrop-filter: blur(5px);
}
.ava-console-panel {
  width: min(920px, 96vw); height: min(760px, 92vh);
  display: grid; grid-template-rows: auto 1fr auto auto;
  border: 1px solid #855069;
  background: linear-gradient(145deg, rgba(16,18,31,.98), rgba(5,8,16,.99));
  box-shadow: 0 25px 80px #000, inset 0 0 40px rgba(225,48,113,.06);
}
.ava-console-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 24px; border-bottom: 1px solid #473247;
  background: linear-gradient(90deg, rgba(99,20,56,.25), transparent);
}
.ava-console-header h2 { margin: 5px 0 0; color: #ffdce6; }
.ava-history { overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 13px; }
.ava-message { max-width: 78%; padding: 12px 15px; border: 1px solid #344c71; background: #091321; }
.ava-message.ava { align-self: flex-start; border-color: #743e5e; background: #1c0c18; }
.ava-message.you { align-self: flex-end; }
.ava-message > span { color: #ff78a9; font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.ava-message p { margin: 7px 0 0; line-height: 1.55; white-space: pre-wrap; }
.ava-message time { display: block; margin-top: 7px; color: #66758d; font-size: 9px; }
.ava-system-line { color: #8290a6; text-align: center; }
.ava-system-line.error { color: #ff7b88; }
.ava-meter-notice { padding: 10px 22px; border-top: 1px solid #2a3446; color: #99a8bd; font-size: 11px; }
.ava-meter-notice strong { color: #54e8b0; }
.ava-compose { padding: 16px 22px 20px; border-top: 1px solid #2a3446; }
.ava-compose textarea { width: 100%; resize: vertical; padding: 13px; color: white; background: #040912; border: 1px solid #344c71; }
.ava-compose-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 10px; }
.ava-status { display: block; min-height: 18px; margin-top: 9px; color: #7fc7db; font-size: 10px; letter-spacing: .08em; }

.hud-popover {
  position: fixed; z-index: 175; top: 305px; right: 28px;
  width: min(390px, calc(100vw - 30px));
  border: 2px ridge #9f7834; background: rgba(5,10,18,.98);
  box-shadow: 0 18px 50px #000;
}
.hud-popover header { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #74592b; color: #ffdd83; }
.hud-popover header button { border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 20px; }
.hud-popover-content, #hud-popover-content { padding: 13px; }
.hud-alert-item, .hud-clear-item, .hud-kpi-row { margin: 0 0 8px; padding: 10px; border: 1px solid #30445f; background: #091321; font-size: 11px; }
.hud-alert-item.actionable { display: grid; width: 100%; gap: 6px; color: #dce8f8; font: inherit; text-align: left; cursor: pointer; }
.hud-alert-item.actionable strong { color: #64dfef; font-size: 8px; letter-spacing: .1em; }
.hud-alert-item.actionable:hover { border-color: #4ff3ff; background: #0d1d30; }
.hud-quest-summary { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 10px; padding: 10px; border: 1px solid #5f4c26; background: #151108; }
.hud-quest-summary strong { color: #ffe095; font-size: 22px; }
.hud-quest-summary span { color: #a79570; font-size: 8px; letter-spacing: .1em; }
.hud-quest-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; padding: 9px; border-bottom: 1px solid #283b52; font-size: 9px; }
.hud-quest-row span { color: #5ddced; }
.hud-quest-row em { color: #83d260; font-style: normal; font-size: 7px; }
.hud-quest-actions { display: flex; gap: 7px; padding-top: 10px; }
.hud-quest-actions button { flex: 1; padding: 9px; border: 1px solid #3e7293; background: #0b1a2a; color: #bfefff; font: inherit; font-size: 8px; cursor: pointer; }
.quest-wallet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 9px; }
.quest-wallet span { display: grid; gap: 4px; padding: 9px; border: 1px solid #6b572c; color: #b99d63; font-size: 8px; text-align: center; }
.quest-wallet strong { color: #ffe49b; font-size: 18px; }
.quest-guide { display: grid; gap: 8px; max-height: min(58vh, 570px); overflow: auto; padding-right: 4px; }
.quest-guide section { padding: 11px; border-left: 2px solid #5edcea; background: rgba(7, 20, 35, .82); }
.quest-guide section strong { color: #74e9f5; font-size: 10px; letter-spacing: .12em; }
.quest-guide p, .quest-guide li { color: #bfccdc; font-size: 11px; line-height: 1.55; }
.quest-guide ol { margin: 8px 0 0; padding-left: 20px; }
.hud-clear-item { color: #58e5a1; }
.hud-kpi-row { display: flex; justify-content: space-between; gap: 15px; }
.hud-kpi-row strong { color: #5de6ff; }

.planning-readiness-heading { cursor: pointer; list-style: none; }
.planning-readiness-heading::-webkit-details-marker { display: none; }
.planning-readiness-heading::before { content: "▾"; color: #4fe5ff; margin-right: 8px; }
.planning-readiness-group:not([open]) .planning-readiness-heading::before { content: "▸"; }

/* Deep station quest dossiers */
.quest-tabs { display: flex; gap: 3px; padding: 10px 20px 0; border-bottom: 1px solid rgba(100, 150, 205, 0.22); }
.quest-tabs button { padding: 10px 14px; border: 1px solid transparent; border-bottom: 0; background: transparent; color: #758ba8; font: inherit; font-size: 9px; letter-spacing: 0.12em; cursor: pointer; }
.quest-tabs button.active { border-color: rgba(79, 243, 255, 0.4); background: rgba(12, 32, 52, 0.72); color: #7eeeff; }
.quest-tabs button span { color: #a7f47d; }
.quest-panel { display: none; }
.quest-panel.active { display: block; }
.quest-objective-list { display: grid; gap: 9px; padding: 20px; }
.quest-check { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: center; padding: 14px; border: 1px solid rgba(100, 150, 205, 0.25); background: rgba(4, 12, 23, 0.7); color: #c9d7e9; cursor: pointer; }
.quest-check input { accent-color: #7fe54f; }
.quest-check span { display: flex; gap: 12px; align-items: center; font-size: 11px; }
.quest-check strong { color: #59deef; font-size: 8px; letter-spacing: 0.12em; }
.quest-check.complete { opacity: 0.58; border-color: rgba(127, 229, 79, 0.4); }
.quest-check.complete span { text-decoration: line-through; }
.quest-comms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px; }
.quest-comms-grid section { padding: 16px; border: 1px solid rgba(100, 150, 205, 0.24); background: rgba(4, 12, 23, 0.72); }
.quest-comms-grid p { color: #c7d7eb; font-size: 12px; line-height: 1.65; }
.quest-inline-actions { display: flex; gap: 8px; padding: 0 20px 20px; }
.quest-reward-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 24px 20px 14px; }
.quest-reward-grid div { display: grid; place-items: center; min-height: 120px; border: 1px solid rgba(255, 203, 82, 0.38); background: radial-gradient(circle, rgba(255, 190, 47, 0.12), rgba(5, 12, 22, 0.75)); }
.quest-reward-grid span { color: #c9a95c; font-size: 9px; letter-spacing: 0.12em; }
.quest-reward-grid strong { color: #ffe49b; font-size: 34px; }
.quest-calibration-note { margin: 0 20px 22px; color: #7e8ca1; font-size: 9px; letter-spacing: 0.08em; text-align: center; }
.quest-reward-calibration { display: flex; justify-content: center; gap: 9px; padding: 0 20px 14px; }
.quest-reward-calibration button:disabled { opacity: .4; cursor: not-allowed; }
.quest-campaign-map { display: grid; gap: 6px; padding: 18px 20px 10px; }
.quest-campaign-map > div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 9px; border: 1px solid #263b53; opacity: .48; }
.quest-campaign-map > div > span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #496783; border-radius: 50%; color: #91a6ba; }
.quest-campaign-map section strong { color: #b9c9da; font-size: 10px; letter-spacing: .08em; }
.quest-campaign-map section p { margin: 4px 0 0; color: #8190a3; font-size: 10px; }
.quest-campaign-map > div.current { border-color: #62e8ff; background: rgba(22, 107, 137, .14); opacity: 1; box-shadow: inset 3px 0 #62e8ff; }
.quest-campaign-map > div.complete { border-color: #507444; opacity: .72; }
.quest-campaign-map > div.complete > span { color: #8eef6a; border-color: #68a452; }
.quest-dependency-brief { margin: 4px 20px 20px; padding: 14px; border: 1px solid #526632; background: rgba(24, 35, 12, .45); }
.quest-dependency-brief p { color: #cbd8ba; font-size: 11px; line-height: 1.55; }
.action-record-topline, .action-record-meta { display: flex; justify-content: space-between; gap: 8px; }
.action-record-topline em { color: #ffcd6b; font-size: 8px; font-style: normal; }
.action-record-objective { display: block; color: #aab8ca; }
.action-record-meta { margin-top: 8px; color: #74869f; font-size: 7px; letter-spacing: 0.08em; }
.planning-readiness-row { width: 100%; grid-template-columns: 1fr auto auto; border-top: 0; border-left: 0; border-right: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.planning-open-quest { color: #5bdceb !important; font-size: 8px !important; letter-spacing: 0.1em; white-space: nowrap; }

@media (max-width: 760px) {
  .quest-comms-grid, .quest-reward-grid { grid-template-columns: 1fr; }
  .quest-tabs { overflow-x: auto; }
  .planning-readiness-row { grid-template-columns: 1fr; }
}

.trophy-stat:has(#trophy-manufacturers),
.trophy-stat:has(#trophy-active),
.trophy-stat:has(#trophy-capital) { cursor: pointer; transition: transform .16s ease, border-color .16s ease; }
.trophy-stat:has(#trophy-manufacturers):hover,
.trophy-stat:has(#trophy-active):hover,
.trophy-stat:has(#trophy-capital):hover { transform: translateY(-3px); border-color: #4ff3ff; }

.trophy-interface { overflow: auto; align-content: start; }
.campaign-progression { grid-column: 1 / -1; padding: 18px; border: 1px solid var(--line-bright); background: rgba(3, 10, 20, .62); }
.campaign-progression header { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: end; margin-bottom: 16px; }
.campaign-progression header h3 { margin: 0; }
.campaign-progression header p { grid-column: 2; margin: 0; color: #7f91a9; font-size: 10px; }
.campaign-phase-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.campaign-phase { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; min-height: 112px; padding: 13px; border: 1px solid rgba(79, 243, 255, .3); background: linear-gradient(145deg, rgba(13, 39, 61, .8), rgba(5, 12, 22, .9)); color: #dcecff; font: inherit; text-align: left; cursor: pointer; }
.campaign-phase > span { grid-row: 1 / 4; color: #3f7896; font-size: 24px; font-weight: 900; }
.campaign-phase strong { font-size: 9px; letter-spacing: .08em; }
.campaign-phase em { color: #7fe54f; font-size: 8px; font-style: normal; letter-spacing: .12em; }
.campaign-phase small { color: #8395ac; line-height: 1.4; }
.campaign-phase.locked { opacity: .48; filter: saturate(.55); }
.campaign-phase:hover { border-color: #4ff3ff; filter: brightness(1.14); }

.calendar-upcoming-row { width: 100%; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.calendar-upcoming-row:hover { background: rgba(79, 243, 255, .06); }

@media (max-width: 900px) {
  .campaign-phase-track { grid-template-columns: 1fr 1fr; }
}
.planning-ava-quest { margin: 10px; padding: 8px 12px; border: 1px solid #824666; background: #190d18; color: #ff9abb; cursor: pointer; font-size: 10px; letter-spacing: .08em; }
.planning-ava-quest:hover { background: #301227; }

@media (max-width: 760px) {
  .crm-radar { width: 145px; height: 145px; right: 12px; top: 102px; }
  .ava-console { padding: 8px; }
  .ava-compose-actions { flex-wrap: wrap; }
}
.crm-login-form {
  display: contents;
}

.crm-login-username {
  position: fixed;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.operator-callsign { margin-bottom: 4px; }
.operator-callsign input { padding-block: 9px; }

.radar-dot.operator {
  width: 9px;
  height: 9px;
  background: #ffdd66;
  box-shadow: 0 0 8px currentColor;
}

.voice-control-panel,
.guest-pass-panel {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(93, 159, 211, 0.25);
  background: rgba(2, 8, 17, 0.55);
}

.voice-control-heading,
.voice-button-row,
.guest-pass-create,
.guest-pass-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-control-heading { justify-content: space-between; }
.voice-control-heading span,
.guest-pass-panel > div:first-child { display: grid; gap: 4px; }
.voice-control-panel small,
.guest-pass-panel small,
.voice-participants { color: #7f91aa; font-size: 10px; }
.voice-control-panel label { display: grid; gap: 5px; color: #8fa1ba; font-size: 10px; letter-spacing: .08em; }
.voice-control-panel select,
.guest-pass-panel input,
.guest-pass-panel select {
  min-width: 0;
  padding: 8px;
  border: 1px solid #35557c;
  background: #030a14;
  color: #dcecff;
}
.voice-button-row button { flex: 1; }
.voice-button-row button.active { color: #ff7a89; border-color: #ff5267; }
.voice-participants { padding: 8px; border-left: 2px solid #4ff3ff; }
.voice-peer-row { display: grid; grid-template-columns: minmax(120px, 1fr) 100px auto; align-items: center; gap: 8px; }
.voice-peer-name small { display: block; color: #65eaff; font-size: 9px; margin-top: 3px; }
.voice-end-tour { color: #ff8197; border-color: rgba(255, 90, 120, .55); }
.guest-pass-create input { flex: 1; }
.guest-pass-create { flex-wrap: wrap; }
.guest-pass-create input[type="email"] { flex-basis: 180px; }
.guest-invite-actions { display: flex; gap: 8px; margin-top: 8px; }
.radar-dot.operator.speaking {
  background: #ffffff;
  box-shadow: 0 0 5px #fff, 0 0 14px #65eaff;
  animation: voicePulse .55s ease-in-out infinite alternate;
}
@keyframes voicePulse { to { transform: translate(-50%, -50%) scale(1.55); } }
.operator-speaking-beacon { filter: drop-shadow(0 0 8px #65eaff); }
.guest-pass-result { color: #7fe54f; overflow-wrap: anywhere; }
.guest-pass-list { display: grid; gap: 5px; }
.guest-pass-row { justify-content: space-between; color: #a8b8cc; font-size: 10px; }
.guest-pass-row.expired { opacity: .5; }
.guest-readonly-banner { color: #ffdd66; }

body[data-access-role="guest"] :is(
  #ava-comm-button,
  #add-note-button,
  .calendar-event-form,
  [data-quest-note],
  [data-quest-calendar],
  [data-quest-authorize],
  [data-authorize-index],
  [data-news-ava],
  [data-quest-ava],
  [data-quest-draft],
  [data-ava-quest-category],
  #analyze-database,
  [data-action-calendar]
) { display: none !important; }

/* Menu readability floor
   Operational UI must remain readable at desktop play distance. These
   selectors intentionally exclude the compact in-world HUD/radar glyphs. */
.station-interface :is(
  button,
  input,
  select,
  textarea,
  label,
  th,
  td,
  small,
  .terminal-caption,
  .station-category,
  .station-link-status,
  .terminal-nav-title,
  .terminal-nav,
  .database-search span,
  .database-search input,
  .save-message,
  .quest-command-message
),
.modal-layer :is(
  button,
  input,
  select,
  textarea,
  label,
  small,
  .station-category,
  .save-message
),
.ava-console :is(
  button,
  input,
  textarea,
  label,
  small,
  .terminal-caption,
  .ava-status,
  .ava-message time
),
.pause-panel :is(
  button,
  input,
  label,
  small,
  .terminal-caption,
  .pause-status,
  .pause-slider > span,
  .pause-toggle b,
  .pause-toggle > strong
),
.build-mode-interface :is(
  button,
  input,
  select,
  label,
  small,
  p,
  .terminal-caption,
  .build-mode-message
) {
  font-size: 11px !important;
}

.station-interface :is(.database-table th, .database-table td) {
  line-height: 1.45;
}

.station-interface :is(input, select, textarea)::placeholder,
.modal-layer :is(input, textarea)::placeholder,
.ava-console :is(input, textarea)::placeholder {
  color: #7f8fa5;
  font-size: 11px;
  opacity: 1;
}


/* =========================================================
   INVITE STATION · FRIENDS / GUEST ACCESS
   ========================================================= */

.invite-terminal-ui {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px 18px 12px;
  background:
    linear-gradient(rgba(84, 214, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 214, 255, 0.025) 1px, transparent 1px),
    #050a12;
  background-size: 28px 28px;
}

.invite-command-bar,
.invite-panel > header,
.invite-modal-card > header,
.invite-modal-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invite-command-bar h3,
.invite-panel h4,
.invite-modal-card h4 { margin: 3px 0 0; }
.invite-command-bar h3 { font-size: 24px; }
.invite-command-bar small { color: var(--muted); }
.invite-command-actions { display: flex; gap: 8px; }

.invite-command-actions button,
.friend-actions button,
.invite-pass-row button,
.invite-modal-card button,
.invite-result button,
.invite-result a {
  min-height: 32px;
  border: 1px solid #397b9d;
  background: rgba(14, 52, 72, .54);
  color: var(--text);
  padding: 7px 11px;
  font: inherit;
  font-size: 10px;
  letter-spacing: .07em;
  text-decoration: none;
  cursor: pointer;
}

.invite-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .8fr);
  gap: 12px;
}

.invite-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #2d5772;
  background: rgba(5, 11, 19, .94);
}

.invite-panel > header {
  min-height: 58px;
  padding: 10px 13px;
  border-bottom: 1px solid #2d5772;
  background: linear-gradient(90deg, rgba(16, 66, 88, .58), rgba(84, 214, 255, .04));
}

.invite-panel > header input {
  width: min(290px, 44%);
  border: 1px solid #355b77;
  background: #07111d;
  color: var(--text);
  padding: 8px 10px;
}

.friend-list,
.invite-pass-list { min-height: 0; overflow: auto; }

.friend-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(53, 91, 119, .48);
}

.friend-identity strong,
.friend-identity span,
.friend-identity small { display: block; }
.friend-identity strong { font-size: 13px; }
.friend-identity span { margin-top: 2px; color: #7fe5ff; font-size: 10px; letter-spacing: .08em; }
.friend-identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.friend-status { color: var(--muted); font-size: 10px; letter-spacing: .07em; white-space: nowrap; }
.friend-status.active { color: #4ce6a1; }
.friend-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.friend-actions [data-friend-invite] { border-color: #4ca8ce; background: rgba(30, 106, 132, .34); }
.friend-actions [data-friend-remove] { border-color: #7f4851; background: rgba(90, 27, 38, .25); }

.invite-pass-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(53, 91, 119, .48);
}
.invite-pass-row strong,
.invite-pass-row small { display: block; }
.invite-pass-row small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.invite-pass-row > div:last-child { display: flex; gap: 6px; }
.invite-pass-row.inactive { opacity: .58; }

.invite-composer,
.friend-editor {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 7, 13, .82);
  backdrop-filter: blur(5px);
}

.invite-modal-card {
  width: min(620px, 92%);
  max-height: 92%;
  overflow: auto;
  display: grid;
  gap: 11px;
  padding: 16px;
  border: 1px solid #54d6ff;
  background: #08111d;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .45);
}
.invite-modal-card label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; letter-spacing: .07em; }
.invite-modal-card input,
.invite-modal-card select,
.invite-modal-card textarea {
  width: 100%;
  border: 1px solid #355b77;
  background: #050b13;
  color: var(--text);
  padding: 9px 10px;
}
.invite-modal-card textarea { min-height: 90px; resize: vertical; }
.invite-modal-card > header > button { min-width: 34px; font-size: 18px; padding: 3px 8px; }

.invite-result {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid #2d5772;
  background: rgba(11, 31, 45, .6);
  color: var(--muted);
  font-size: 11px;
}
.invite-result strong { color: #7fe54f; overflow-wrap: anywhere; }
.invite-result span { color: #a8b8cc; }
.invite-result > div { display: flex; gap: 7px; flex-wrap: wrap; }

.news-stale-banner,
.news-soft-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #8a642e;
  background: rgba(112, 72, 18, .18);
  color: #e8c580;
  font-size: 10px;
  letter-spacing: .05em;
}
.news-stale-banner strong { color: #ffd27a; white-space: nowrap; }
.news-soft-warning { border-color: #49647b; background: rgba(41, 72, 93, .18); color: #a8b8cc; }

@media (max-width: 1050px) {
  .invite-layout { grid-template-columns: 1fr; overflow: auto; }
  .invite-panel { min-height: 420px; }
  .friend-card { grid-template-columns: 1fr; }
  .friend-actions { justify-content: flex-start; }
}

/* =========================================================
   ARTHUR'S 1960s NEWSSTAND / ARTICLE READER
   ========================================================= */
.newsstand-ui {
  position: relative;
  background:
    radial-gradient(circle at 12% 10%, rgba(255,184,92,.055), transparent 28%),
    linear-gradient(rgba(232,210,168,.018) 1px, transparent 1px),
    #070a0d;
  background-size: auto, 100% 24px;
}
.newsstand-ui .news-command-bar {
  border-bottom-color: #7f633b;
  background: linear-gradient(90deg, rgba(85,55,25,.26), rgba(8,15,25,.86));
}
.newsstand-ui .news-command-bar small { display: block; margin-top: 4px; color: #bba984; font-size: 9px; letter-spacing: .08em; }
.news-story { width: 100%; text-align: left; font: inherit; color: inherit; border: 0; border-bottom: 1px solid rgba(141,116,72,.24); cursor: pointer; }
.news-story span i { display: block; margin-top: 4px; color: #8e9aa9; font-size: 9px; font-style: normal; line-height: 1.35; }
.news-story:hover { background: rgba(185,139,72,.08); }
.news-reader-layer { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 22px; background: rgba(2,4,7,.84); backdrop-filter: blur(6px); }
.news-reader-layer.hidden { display: none; }
.newspaper-reader { width: min(920px, 94%); max-height: 92%; overflow: auto; color: #29251f; background: #ded4ba; border: 5px double #514634; box-shadow: 0 24px 90px rgba(0,0,0,.68); font-family: Georgia, "Times New Roman", serif; }
.newspaper-reader > header { display: flex; justify-content: space-between; gap: 20px; align-items: start; padding: 13px 16px; border-bottom: 3px double #514634; background: #cabd9d; }
.newspaper-reader > header span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.newspaper-reader > header small { color: #655c4d; }
.newspaper-reader > header button, .newspaper-reader > footer button { border: 1px solid #514634; background: transparent; color: #29251f; cursor: pointer; padding: 6px 10px; }
.newspaper-reader article { padding: 18px 24px 22px; column-rule: 1px solid rgba(74,62,45,.3); }
.newspaper-reader article img { width: min(46%, 420px); max-height: 300px; object-fit: cover; float: right; margin: 0 0 14px 20px; border: 1px solid #6b604f; filter: saturate(.78) contrast(1.03); }
.newspaper-reader article h2 { margin: 0 0 9px; font-size: clamp(30px, 4vw, 52px); line-height: .98; text-transform: uppercase; }
.reader-byline { font-size: 11px; letter-spacing: .12em; font-weight: 700; }
.reader-dek { font-size: 16px; line-height: 1.6; }
.newspaper-reader video { width: 100%; max-height: 420px; margin-top: 14px; background: #111; }
.newspaper-reader > footer { clear: both; display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 3px double #514634; }
.newspaper-reader > footer a { color: #5b1818; font-weight: 800; text-decoration: none; }
.reader-loading { padding: 70px 24px; text-align: center; letter-spacing: .14em; }

/* =========================================================
   IN-ROOM EMAIL ACTION CONSOLE
   ========================================================= */
.in-room-email-layer { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 24px; background: rgba(1,5,10,.82); backdrop-filter: blur(8px); }
.in-room-email-layer.hidden { display: none; }
.in-room-email-card { width: min(860px, 96vw); max-height: 92dvh; overflow: auto; padding: 17px; border: 1px solid #3f6d96; background: #07111c; box-shadow: 0 26px 90px rgba(0,0,0,.62); }
.in-room-email-card > header { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.in-room-email-card > header span { color: #62a8ff; font-size: 9px; letter-spacing: .18em; }
.in-room-email-card > header h3 { margin: 4px 0 12px; }
.in-room-email-card > header button { border: 0; background: transparent; color: #8191a8; font-size: 24px; cursor: pointer; }
.mail-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.in-room-email-card label { display: grid; gap: 5px; color: #8493a8; font-size: 9px; letter-spacing: .11em; }
.in-room-email-card input, .in-room-email-card textarea { border: 1px solid #2f4e6b; background: #040b13; color: #eef6ff; padding: 10px; font: inherit; }
.in-room-email-card textarea { width: 100%; min-height: 330px; margin-top: 10px; resize: vertical; line-height: 1.55; }
.in-room-email-card > p { color: #8ea0b8; font-size: 10px; min-height: 18px; }
.in-room-email-card > footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.in-room-email-card > footer button { border: 1px solid #355e84; background: rgba(20,49,75,.6); color: #eef6ff; padding: 8px 12px; cursor: pointer; }
.in-room-email-card > footer button.primary { border-color: #3f6eff; background: rgba(41,69,255,.22); }
.action-record-wrap { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; align-items: stretch; }
.action-email-draft { min-width: 112px; border: 1px solid #365e83; background: rgba(25,63,94,.34); color: #a9d5ff; font-size: 9px; letter-spacing: .08em; cursor: pointer; }
.action-email-draft:hover { border-color: #5b9bd4; color: #e7f5ff; }

/* Embedded 2D view should always get a real viewport instead of a clipped sliver. */
.station-content:has(iframe[title="DemoCo 2D 3D CRM"]) { overflow: hidden; min-height: 0; }
.station-content iframe[title="DemoCo 2D 3D CRM"] { min-height: 620px; }

@media (max-width: 760px) {
  .mail-grid { grid-template-columns: 1fr; }
  .action-record-wrap { grid-template-columns: 1fr; }
  .newspaper-reader article img { width: 100%; float: none; margin: 0 0 14px; }
}


/* 2026-08-17 gameplay authority / quest-engine additions */
.respawn-overlay { position: fixed; inset: 0; z-index: 12000; display:grid; place-items:center; background:rgba(5,7,12,.48); pointer-events:none; }
.respawn-overlay.hidden { display:none; }
.respawn-overlay > div { min-width:320px; padding:28px 34px; border:2px solid #ff5f5f; background:#13090b; box-shadow:0 0 40px rgba(255,70,70,.28); text-align:center; }
.respawn-overlay span { display:block; color:#ff8c8c; font-size:11px; letter-spacing:.22em; margin-bottom:10px; }
.respawn-overlay strong { color:#fff1e8; font-size:30px; letter-spacing:.08em; }
.quest-engine-guide code { color:#ffe49b; white-space:normal; }
.quest-rule-editor { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; }
.quest-rule-editor > strong,.quest-rule-editor > button,.quest-rule-editor > small { grid-column:1/-1; }
.quest-rule-editor label { display:grid; grid-template-columns:1fr 82px; align-items:center; gap:8px; color:#b9c9d8; font-size:10px; }
.quest-rule-editor input { width:100%; box-sizing:border-box; padding:7px; border:1px solid #35536f; background:#061321; color:#dff7ff; }
.quest-check span em { margin-left:auto; color:#ffd36a; font-style:normal; font-size:9px; }

.identity-scanner-layer { position:fixed; inset:0; z-index:13000; display:grid; place-items:center; background:rgba(1,6,14,.88); }
.identity-scanner-card { width:min(680px,92vw); border:1px solid #4be3f4; background:#061321; color:#dff7ff; box-shadow:0 0 50px rgba(45,213,240,.2); }
.identity-scanner-card header,.identity-scanner-card footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; border-bottom:1px solid #24465e; }
.identity-scanner-card footer { border-top:1px solid #24465e; border-bottom:0; }
.identity-scanner-card header span { color:#64eaff; font-size:9px; letter-spacing:.18em; }
.identity-scanner-card h3 { margin:4px 0 0; font-size:18px; }
.identity-scanner-card header button { border:0; background:transparent; color:#dff7ff; font-size:26px; cursor:pointer; }
.identity-scanner-card video { display:block; width:min(520px,80vw); aspect-ratio:1; object-fit:cover; margin:18px auto 0; border:1px solid #2d617b; background:#000; transform:scaleX(-1); }
.scanner-instruction { display:grid; gap:6px; padding:16px 22px; text-align:center; }
.scanner-instruction strong { color:#ffe49b; letter-spacing:.1em; }
.scanner-instruction small { color:#93a9ba; line-height:1.5; }

/* 2026-08-17 refinement: Arthur market dossiers + expense ledger */
.news-side-stack > .news-panel:first-child {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  max-height: 48vh;
}
.market-watch {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
button.market-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(50, 78, 115, 0.45);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
button.market-row:hover,
button.market-row:focus-visible {
  background: rgba(47, 95, 255, 0.14);
  outline: 1px solid rgba(72, 158, 255, .45);
}
.stock-dossier { width: min(940px, 94vw); }
.stock-dossier-body { display:grid; gap:14px; overflow:auto; padding-bottom:8px; }
.stock-hero { display:flex; align-items:end; justify-content:space-between; gap:16px; padding:4px 0 0; }
.stock-hero > div { display:flex; align-items:baseline; gap:14px; }
.stock-hero strong { font-size:34px; }
.stock-hero em { font-style:normal; font-weight:700; }
.stock-hero .up { color:#4ce6a1; }
.stock-hero .down { color:#ff6677; }
.stock-chart { border:1px solid #2b476c; background:rgba(3,9,17,.72); padding:12px; }
.stock-chart svg { display:block; width:100%; height:190px; }
.stock-chart polyline { stroke:#65eaff; stroke-width:2.4; }
.stock-chart > div { display:flex; justify-content:space-between; color:var(--muted); font-size:10px; letter-spacing:.08em; }
.stock-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.stock-stats > div { border:1px solid #284568; background:rgba(11,21,36,.8); padding:10px; }
.stock-stats span,.stock-stats strong { display:block; }
.stock-stats span { color:var(--muted); font-size:9px; letter-spacing:.1em; }
.stock-stats strong { margin-top:4px; font-size:12px; }
.stock-company-news { display:grid; gap:6px; }
.stock-company-news h3 { margin:0 0 4px; font-size:14px; }
.stock-company-news a { display:block; padding:9px 10px; border:1px solid rgba(50,78,115,.45); color:var(--text); text-decoration:none; }
.stock-company-news a:hover { background:rgba(47,95,255,.12); }
.stock-company-news a strong,.stock-company-news a small { display:block; }
.stock-company-news a small { margin-top:3px; color:var(--muted); }

.expense-terminal-ui { height:100%; min-height:0; display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; gap:12px; }
.expense-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.expense-kpis article { border:1px solid #31527d; border-top:2px solid var(--amber); background:linear-gradient(135deg,rgba(17,30,49,.92),rgba(6,12,21,.94)); padding:13px 14px; }
.expense-kpis span,.expense-kpis strong { display:block; }
.expense-kpis span { color:var(--muted); font-size:9px; letter-spacing:.08em; }
.expense-kpis strong { margin-top:6px; font-size:24px; }
.expense-kpis .negative strong { color:#ff7987; }
.expense-ledger-table { min-height:0; overflow:auto; border:1px solid #2b476c; }
.expense-ledger-table > header,.expense-ledger-table > div { display:grid; grid-template-columns:minmax(180px,.9fr) minmax(120px,.45fr) minmax(260px,1.65fr); gap:12px; align-items:center; padding:9px 12px; }
.expense-ledger-table > header { position:sticky; top:0; z-index:2; background:#0d1d32; color:#8fc8ff; font-size:9px; letter-spacing:.1em; }
.expense-ledger-table > div { border-top:1px solid rgba(50,78,115,.4); }
.expense-ledger-table b { text-align:right; }
.expense-ledger-table small { color:var(--muted); }
.invite-command-actions a { min-height:34px; display:inline-flex; align-items:center; border:1px solid var(--blue-bright); background:rgba(20,44,88,.52); color:var(--text); padding:8px 13px; text-decoration:none; font-size:10px; letter-spacing:.08em; }
@media (max-width:900px) { .stock-stats,.expense-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* 2026-08-17 database row dossiers + stronger interaction affordance */
.database-table tbody tr[data-record-index] {
  cursor: pointer;
  transition: background-color .12s ease, box-shadow .12s ease;
}
.database-table tbody tr[data-record-index]:hover,
.database-table tbody tr[data-record-index]:focus-visible {
  background: rgba(44, 105, 255, .10);
  box-shadow: inset 3px 0 0 #4fdcff;
  outline: none;
}
.database-record-dossier { width: min(1040px, 95vw); }
.database-record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: min(62vh, 620px);
  overflow: auto;
  padding: 4px 2px 12px;
}
.database-record-grid section {
  min-width: 0;
  border: 1px solid rgba(48, 80, 120, .48);
  background: rgba(7, 15, 26, .82);
  padding: 10px 12px;
}
.database-record-grid p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.database-record-grid a { color: #6be6ff; }
@media (max-width: 760px) {
  .database-record-grid { grid-template-columns: 1fr; }
}

/* Financial Trading Post — internal company money operations */
.financial-command-ui,
.financial-detail-ui {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}
.financial-command-header,
.financial-detail-ui > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid #31527d;
  border-top: 2px solid #ffc557;
  background: linear-gradient(135deg, rgba(11,25,44,.96), rgba(5,11,20,.96));
}
.financial-command-header h3,
.financial-detail-ui h3 { margin: 3px 0 0; font-size: 25px; }
.financial-command-header small { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.financial-command-position { text-align: right; }
.financial-command-position span { display:block; color:var(--muted); font-size:9px; letter-spacing:.1em; }
.financial-command-position strong { display:block; margin-top:4px; font-size:26px; }
.financial-command-position .negative,
.financial-detail-ui .negative { color:#ff7987; }
.financial-command-position .positive { color:#63f0a5; }
.financial-command-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}
.financial-command-tile {
  min-height: 150px;
  text-align: left;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  padding: 15px;
  border: 1px solid #31527d;
  border-top: 2px solid #4ff3ff;
  background: linear-gradient(145deg, rgba(12,26,46,.95), rgba(4,10,18,.98));
  color: #e7f2ff;
  cursor: pointer;
  font: inherit;
}
.financial-command-tile:nth-child(even) { border-top-color:#ffc557; }
.financial-command-tile:hover { transform: translateY(-2px); box-shadow:0 8px 26px rgba(0,0,0,.28); border-color:#6398d6; }
.financial-command-tile span { color:#94bde8; font-size:10px; letter-spacing:.12em; text-transform:uppercase; }
.financial-command-tile strong { font-size:23px; }
.financial-command-tile small { align-self:end; color:var(--muted); line-height:1.45; }
.financial-detail-ui { grid-template-rows:auto auto minmax(0,1fr); }
.financial-detail-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.financial-detail-kpis article { border:1px solid #31527d; background:#081321; padding:14px; }
.financial-detail-kpis span { display:block; color:var(--muted); font-size:9px; letter-spacing:.08em; }
.financial-detail-kpis strong { display:block; margin-top:6px; font-size:22px; }
.financial-detail-note,
.financial-empty-system { border:1px solid #284567; background:#07111e; padding:18px; color:#a9b9ce; line-height:1.6; }
.financial-empty-system strong { display:block; color:#ffc557; letter-spacing:.1em; margin-bottom:8px; }
.financial-list { min-height:0; overflow:auto; border:1px solid #284567; }
.financial-list > div { display:grid; grid-template-columns:minmax(200px,1.1fr) minmax(120px,.5fr) minmax(220px,1.4fr); gap:12px; padding:10px 12px; border-bottom:1px solid rgba(49,82,125,.45); }
.financial-list span,.financial-list small { color:var(--muted); }
.financial-back-button { justify-self:start; border:1px solid #31527d; background:#081321; color:#cce2ff; padding:7px 11px; font:inherit; font-size:9px; letter-spacing:.1em; cursor:pointer; }
.financial-back-button:hover { border-color:#5b8bc5; }
@media (max-width: 1050px) {
  .financial-command-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .financial-detail-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* 2026-08-17 Financial command / progression pass */
.progression-hud{position:fixed;right:22px;top:285px;z-index:46;width:190px;padding:9px 11px;border:1px solid rgba(74,139,210,.38);background:rgba(3,9,18,.72);backdrop-filter:blur(5px);font:10px/1.25 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.08em;color:#d9e8fa;pointer-events:auto}.progression-hud>div,.progression-hud>button{display:grid;grid-template-columns:auto 1fr;gap:3px 8px;align-items:center;padding:5px 0;border:0;border-bottom:1px solid rgba(100,150,210,.13);background:none;color:inherit;text-align:left;width:100%}.progression-hud>button{cursor:pointer}.progression-hud small{font-size:8px;color:#8395aa;letter-spacing:.09em}.xp-track{height:4px;background:#172337;display:block;overflow:hidden}.xp-track i{height:100%;display:block;background:#2d83ef;box-shadow:0 0 7px #2d83ef}.expense-entry-layer{position:fixed;inset:0;z-index:1100;display:grid;place-items:center;background:rgba(0,4,10,.82);padding:24px}.expense-entry-card{width:min(900px,94vw);max-height:90vh;overflow:auto;background:#07111c;border:1px solid #356899;box-shadow:0 20px 80px #000;padding:18px;color:#dcecff}.expense-entry-card header,.expense-entry-card footer{display:flex;align-items:center;justify-content:space-between;gap:14px}.expense-entry-card header span{font:9px ui-monospace,monospace;letter-spacing:.18em;color:#5eb1ff}.expense-entry-card h3{margin:4px 0 14px;font-size:24px}.expense-entry-card button,.expense-entry-card input,.expense-entry-card select,.expense-entry-card textarea{font:inherit;color:#dcecff;background:#050b12;border:1px solid #31577c;padding:9px}.expense-entry-card button{cursor:pointer}.expense-entry-card button.primary{border-color:#176dff;background:#0b2d68}.expense-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.expense-form-grid label{display:grid;gap:5px;font:9px ui-monospace,monospace;letter-spacing:.09em;color:#8ea4bb}.expense-form-grid label.wide{grid-column:1/-1}.expense-form-grid textarea{min-height:72px;resize:vertical}.expense-entry-card footer{margin-top:16px;border-top:1px solid #1d3854;padding-top:14px}.expense-entry-card footer span{margin-right:auto;font:9px ui-monospace,monospace;color:#83a1be}@media(max-width:800px){.progression-hud{right:8px;top:250px;width:165px}.expense-form-grid{grid-template-columns:1fr}.expense-form-grid label.wide{grid-column:auto}}
