:root {
  --ink: #f4f2eb;
  --muted: #9096a7;
  --faint: #535b6d;
  --bg: #0a0d16;
  --sidebar: #0d111d;
  --panel: #111725;
  --panel-deep: #0f1421;
  --line: rgba(203, 215, 239, 0.14);
  --line-bright: rgba(203, 215, 239, 0.25);
  --lime: #c6f263;
  --cyan: #64d4d0;
  --violet: #a998ff;
  --coral: #ff756f;
  --amber: #efba72;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 73% 10%, rgba(86, 92, 172, 0.11), transparent 30rem),
    linear-gradient(135deg, #0a0d16 0%, #0c101c 56%, #0b0e18 100%);
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 34px 24px 26px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.025), transparent 34%),
    var(--sidebar);
  border-right: 1px solid var(--line);
}

.sidebar::after {
  position: absolute;
  right: -76px;
  bottom: 90px;
  width: 185px;
  height: 185px;
  border: 1px solid rgba(198, 242, 99, 0.15);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 18px rgba(198, 242, 99, 0.025), 0 0 0 37px rgba(198, 242, 99, 0.018);
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
}

.brand-mark,
.overlay-mark {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  gap: 3px;
  align-items: end;
  width: 27px;
  height: 30px;
}

.brand-mark span,
.overlay-mark span {
  display: block;
  background: var(--lime);
  box-shadow: 0 0 14px rgba(198, 242, 99, 0.3);
}

.brand-mark span:nth-child(1),
.overlay-mark span:nth-child(1) {
  height: 12px;
}

.brand-mark span:nth-child(2),
.overlay-mark span:nth-child(2) {
  height: 23px;
}

.brand-mark span:nth-child(3),
.overlay-mark span:nth-child(3) {
  height: 17px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow.accent {
  color: var(--lime);
}

.brand-name {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-name span,
.overlay-card h2 span {
  color: var(--lime);
}

.brand-copy {
  margin: 51px 0 31px;
  color: #e1e5ee;
  font-size: 15px;
  line-height: 1.55;
}

.sidebar-rule {
  width: 100%;
  height: 1px;
  margin-bottom: 30px;
  background: var(--line);
}

.nav-label {
  margin: 0 0 12px;
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.room-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.room-button {
  display: grid;
  grid-template-columns: 27px 1fr 20px;
  align-items: center;
  width: 100%;
  min-height: 49px;
  padding: 0 9px 0 0;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.room-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.room-button.is-active {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(198, 242, 99, 0.14), transparent);
  border-left-color: var(--lime);
}

.room-index {
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.room-button.is-active .room-index,
.room-button.is-active .room-arrow {
  color: var(--lime);
}

.room-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.room-arrow {
  color: var(--faint);
  font-size: 14px;
  text-align: right;
}

.sidebar-bottom {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.signal-line {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--cyan);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.11em;
}

.signal-dot,
.live-pulse {
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--cyan);
}

.sidebar-footnote {
  max-width: 184px;
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.6;
}

.main-content {
  width: min(100%, 1490px);
  padding: 0 44px 38px;
}

.topbar {
  display: flex;
  min-height: 77px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.11em;
}

.breadcrumb span {
  padding: 0 10px;
  color: var(--line-bright);
}

.topbar-actions {
  display: flex;
  gap: 20px;
}

.text-button {
  padding: 7px 0;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.text-button:hover {
  color: var(--lime);
}

.intro-row {
  display: flex;
  gap: 30px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 48px 0 38px;
}

.intro-row h1 {
  max-width: 620px;
  margin: 9px 0 12px;
  font-size: clamp(35px, 4vw, 59px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.intro-copy {
  max-width: 550px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.live-chip {
  display: flex;
  gap: 9px;
  align-items: center;
  align-self: center;
  padding: 11px 12px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  background: rgba(100, 212, 208, 0.06);
  border: 1px solid rgba(100, 212, 208, 0.18);
}

.live-pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

.live-divider {
  width: 1px;
  height: 12px;
  background: rgba(100, 212, 208, 0.3);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(115px, 1fr)) minmax(205px, 1.42fr);
  gap: 10px;
}

.metric-card,
.objective-card,
.panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 46%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 133px;
  padding: 16px 17px 14px;
}

.metric-topline,
.objective-head,
.objective-footer,
.panel-heading,
.ledger-heading,
.commit-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-symbol {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-family: "DM Mono", monospace;
  font-size: 15px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.cash-card .metric-symbol {
  color: var(--lime);
}

.climate-card .metric-symbol {
  color: var(--violet);
}

.morale-card .metric-symbol {
  color: var(--amber);
}

.metric-delta {
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.metric-delta.is-positive {
  color: var(--lime);
}

.metric-delta.is-negative {
  color: var(--coral);
}

.metric-value {
  margin-top: 15px;
  font-family: "DM Mono", monospace;
  font-size: clamp(23px, 2.5vw, 32px);
  font-weight: 500;
  letter-spacing: -0.08em;
}

.metric-unit {
  margin-left: 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.metric-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.metric-bar,
.reach-bar {
  width: 100%;
  height: 3px;
  margin-top: 15px;
  overflow: hidden;
  background: #242b3a;
}

.metric-bar span,
.reach-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
  transition: width 350ms ease;
}

.cash-card .metric-bar span {
  background: var(--lime);
}

.climate-card .metric-bar span {
  background: var(--violet);
}

.morale-card .metric-bar span {
  background: var(--amber);
}

.objective-card {
  min-height: 133px;
  padding: 16px 18px 14px;
  background:
    linear-gradient(124deg, rgba(198, 242, 99, 0.16), rgba(198, 242, 99, 0.02) 55%, transparent),
    var(--panel);
  border-color: rgba(198, 242, 99, 0.28);
}

.objective-status {
  color: var(--lime);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.objective-status.is-failed {
  color: var(--coral);
}

.objective-card > p {
  min-height: 38px;
  margin: 15px 0 7px;
  color: #d7dbe5;
  font-size: 12px;
  line-height: 1.4;
}

.objective-footer {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.objective-footer strong {
  color: var(--lime);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.reach-bar {
  margin-top: 8px;
}

.reach-bar span {
  background: var(--lime);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(275px, 0.82fr);
  gap: 10px;
  margin-top: 31px;
}

.panel {
  min-width: 0;
}

.control-panel {
  padding: 24px 25px 27px;
}

.panel-heading {
  gap: 20px;
}

.panel-heading h2 {
  margin: 6px 0 0;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.panel-heading h2 span {
  color: var(--lime);
}

.move-count {
  padding: 7px 9px;
  color: var(--lime);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  background: rgba(198, 242, 99, 0.08);
  border: 1px solid rgba(198, 242, 99, 0.18);
}

.department-copy {
  max-width: 630px;
  margin: 16px 0 21px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.decision-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 17px;
  overflow: hidden;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.decision-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 2px;
  background: var(--cyan);
  content: "";
}

.decision-card:hover {
  background: #151c2c;
  border-color: var(--line-bright);
  transform: translateY(-2px);
}

.decision-card.is-selected {
  background:
    linear-gradient(135deg, rgba(198, 242, 99, 0.12), transparent 60%),
    var(--panel-deep);
  border-color: var(--lime);
  box-shadow: 0 0 0 1px rgba(198, 242, 99, 0.17), 0 10px 35px rgba(0, 0, 0, 0.18);
}

.decision-card.is-selected::before {
  width: 100%;
  background: var(--lime);
}

.decision-card.is-locked {
  cursor: not-allowed;
  opacity: 0.43;
}

.decision-card.is-locked:hover {
  background: var(--panel-deep);
  border-color: var(--line);
  transform: none;
}

.decision-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.decision-index {
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.decision-cost {
  color: var(--cyan);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.decision-card h3 {
  max-width: 240px;
  margin: 15px 0 7px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.decision-card p {
  max-width: 285px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.48;
}

.decision-effects {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 14px;
}

.effect-chip {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 6px;
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.effect-chip.positive {
  color: var(--lime);
}

.effect-chip.negative {
  color: var(--coral);
}

.effect-chip.neutral {
  color: var(--cyan);
}

.briefing-panel {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 24px 23px 19px;
}

.panel-heading.compact {
  align-items: flex-start;
}

.feed-badge {
  padding: 5px 6px;
  color: var(--coral);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 117, 111, 0.28);
}

.event-card {
  min-height: 155px;
  margin-top: 22px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(169, 152, 255, 0.13), transparent 65%),
    #12182a;
  border: 1px solid rgba(169, 152, 255, 0.21);
}

.event-tag {
  color: var(--violet);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.event-card h3 {
  margin: 12px 0 7px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.event-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.event-impact {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.event-impact strong {
  color: var(--violet);
  font-weight: 500;
}

.ledger-section {
  margin-top: 24px;
}

.ledger-heading {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.ledger-heading > span:last-child {
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 207px;
  overflow-y: auto;
}

.ledger-empty {
  padding: 19px 0;
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  line-height: 1.5;
}

.ledger-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(203, 215, 239, 0.08);
}

.ledger-quarter {
  color: var(--lime);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.ledger-item strong {
  display: block;
  overflow: hidden;
  color: #d7dbe5;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-item small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-impact {
  color: var(--cyan);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.commit-bar {
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  padding: 23px 2px 0;
}

.commit-status {
  justify-content: flex-start;
  gap: 13px;
}

.commit-line {
  display: block;
  width: 2px;
  height: 35px;
  background: var(--lime);
}

.commit-status strong {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.commit-button,
.overlay-button {
  display: inline-flex;
  gap: 35px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--lime);
  border: 0;
  cursor: pointer;
  transition: 180ms ease;
}

.commit-button:hover,
.overlay-button:hover {
  background: #ddff8d;
  box-shadow: 0 8px 30px rgba(198, 242, 99, 0.16);
  transform: translateY(-2px);
}

.commit-button:disabled {
  color: var(--faint);
  background: #29303f;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.button-arrow {
  font-size: 17px;
}

.overlay {
  position: fixed;
  z-index: 10;
  display: grid;
  inset: 0;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(6, 8, 14, 0.86);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  backdrop-filter: blur(12px);
}

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

.overlay-grid {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(198, 242, 99, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 242, 99, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.overlay-card {
  position: relative;
  width: min(100%, 610px);
  padding: 45px;
  background:
    radial-gradient(circle at 100% 0%, rgba(169, 152, 255, 0.16), transparent 28%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.055), transparent 45%),
    #111725;
  border: 1px solid rgba(198, 242, 99, 0.26);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.4);
}

.overlay-mark {
  margin-bottom: 34px;
}

.overlay-card h2 {
  margin: 11px 0 14px;
  font-size: clamp(47px, 9vw, 87px);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.overlay-lede {
  max-width: 420px;
  margin: 0;
  color: #ccd1df;
  font-size: 16px;
  line-height: 1.6;
}

.overlay-rule {
  width: 100%;
  height: 1px;
  margin: 32px 0 17px;
  background: var(--line);
}

.overlay-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.overlay-button {
  margin-top: 34px;
  padding: 16px 18px;
}

.overlay-button span {
  margin-left: 34px;
  font-size: 16px;
}

.overlay-note {
  max-width: 340px;
  margin: 17px 0 0;
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: 330px;
  padding: 13px 15px;
  color: var(--bg);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  line-height: 1.45;
  background: var(--lime);
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.72);
  }
}

@media (max-width: 1150px) {
  .metrics-grid {
    grid-template-columns: repeat(4, minmax(105px, 1fr));
  }

  .objective-card {
    grid-column: 1 / -1;
  }

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

  .briefing-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .briefing-panel .panel-heading,
  .briefing-panel .event-card,
  .briefing-panel .ledger-section {
    margin: 0;
  }

  .briefing-panel .panel-heading {
    grid-column: 1 / -1;
  }
}

@media (max-width: 810px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    padding: 20px 20px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-copy,
  .sidebar-rule,
  .nav-label,
  .sidebar-bottom {
    display: none;
  }

  .room-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 19px;
  }

  .room-button {
    display: block;
    min-height: auto;
    padding: 9px 7px;
    border-top: 2px solid transparent;
    border-left: 0;
  }

  .room-button.is-active {
    border-top-color: var(--lime);
    border-left: 0;
  }

  .room-index,
  .room-arrow {
    display: none;
  }

  .room-name {
    display: block;
    font-size: 10px;
    line-height: 1.35;
  }

  .main-content {
    padding: 0 20px 30px;
  }

  .topbar {
    min-height: 58px;
  }

  .intro-row {
    padding-top: 35px;
  }
}

@media (max-width: 590px) {
  .breadcrumb {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .intro-row {
    display: block;
  }

  .live-chip {
    width: fit-content;
    margin-top: 22px;
  }

  .metrics-grid,
  .decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 125px;
    padding: 13px;
  }

  .objective-card {
    grid-column: 1 / -1;
  }

  .control-panel,
  .briefing-panel {
    padding: 19px 16px;
  }

  .briefing-panel {
    display: block;
  }

  .briefing-panel .event-card {
    margin-top: 19px;
  }

  .briefing-panel .ledger-section {
    margin-top: 22px;
  }

  .decision-card {
    min-height: 192px;
    padding: 13px;
  }

  .decision-card h3 {
    font-size: 14px;
  }

  .commit-bar {
    display: block;
  }

  .commit-button {
    width: 100%;
    margin-top: 19px;
  }

  .overlay-card {
    padding: 31px 24px;
  }

  .overlay-card h2 {
    font-size: 54px;
  }
}
