:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #111722;
  --panel-2: #182232;
  --text: #eef4ff;
  --muted: #91a1b8;
  --line: #263348;
  --accent: #00e0a4;
  --accent-2: #ffcc4d;
  --danger: #ff5f70;
  --warn: #ff9f43;
  --ink: #03100d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 76% 0%, rgba(0, 224, 164, 0.12), transparent 26%),
    radial-gradient(circle at 0% 20%, rgba(255, 204, 77, 0.08), transparent 28%),
    linear-gradient(180deg, #080b12 0%, #0c121e 48%, #070a10 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  min-height: 100vh;
  padding-bottom: 72px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  border-radius: 8px;
  font: inherit;
}

button {
  background: var(--accent);
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  min-height: 44px;
  padding: 0 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  background: #0b111b;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px;
  width: 100%;
}

.app-topbar {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(8, 11, 18, 0.84);
  border-bottom: 1px solid rgba(0, 224, 164, 0.16);
  display: flex;
  height: 64px;
  justify-content: space-between;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand,
.agent-chip {
  align-items: center;
  display: flex;
  gap: 10px;
}

.brand {
  font-weight: 900;
}

.brand-mark,
.agent-chip span {
  align-items: center;
  background: var(--accent);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  font-size: 12px;
  font-weight: 1000;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.agent-chip {
  background: rgba(17, 23, 34, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
}

.app-shell {
  margin: 0 auto;
  max-width: 1320px;
  padding: 22px 18px 36px;
}

.command-hero {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 330px;
  margin-bottom: 16px;
}

.command-hero > div,
.identity-card,
.panel,
.operation-stage,
.status-grid article {
  background: rgba(17, 23, 34, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.command-hero > div {
  min-height: 300px;
  padding: 34px;
  position: relative;
}

.command-hero > div::after {
  background: linear-gradient(90deg, var(--accent), transparent);
  bottom: 28px;
  content: "";
  height: 2px;
  left: 34px;
  position: absolute;
  width: 180px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  margin: 0 0 8px;
  text-transform: uppercase;
}

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

h1 {
  font-size: 48px;
  line-height: 1.05;
  margin-bottom: 14px;
  max-width: 820px;
}

h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.hero-copy,
.empty-state p,
.stage-head p,
.protocol-box p,
.asset-card p,
.seal-bar span,
.burn-list span,
.burn-list small {
  color: var(--muted);
  line-height: 1.6;
}

.identity-card {
  align-content: center;
  display: grid;
  gap: 12px;
  padding: 18px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 7px;
}

.status-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;
}

.status-grid article {
  padding: 15px;
}

.status-grid span,
.locked-brief span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.status-grid strong,
.locked-brief strong {
  color: var(--accent-2);
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.main-grid {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: 310px minmax(0, 1fr) 280px;
}

.panel,
.operation-stage {
  padding: 16px;
}

.section-title {
  align-items: start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.operation-list {
  display: grid;
  gap: 10px;
}

.operation-card {
  background: linear-gradient(180deg, #172031, #101722);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: grid;
  gap: 7px;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.operation-card.active,
.operation-card:hover {
  border-color: var(--accent);
}

.op-code {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.operation-card small {
  color: var(--muted);
  line-height: 1.45;
}

.meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 7px;
}

.meta span {
  background: #0b111b;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
}

.empty-state {
  min-height: 440px;
  padding: 34px;
}

.stage-head {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.timer-box {
  background: rgba(0, 224, 164, 0.1);
  border: 1px solid rgba(0, 224, 164, 0.28);
  border-radius: 8px;
  min-width: 116px;
  padding: 14px;
  text-align: center;
}

.timer-box small {
  color: var(--muted);
  display: block;
}

.timer-box strong {
  color: var(--accent);
  display: block;
  font-size: 24px;
  margin-top: 4px;
}

.timer-box.live strong {
  color: var(--accent-2);
}

.locked-brief,
.asset-grid,
.decision-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
}

.locked-brief article,
.asset-card,
.decision-panel,
.protocol-box,
.seal-bar,
.burn-list article {
  background: rgba(8, 11, 18, 0.55);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.protocol-box {
  margin-top: 14px;
}

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

.asset-card {
  display: grid;
  gap: 12px;
  grid-template-columns: 68px 1fr;
}

.asset-visual {
  align-items: center;
  aspect-ratio: 1;
  background:
    linear-gradient(135deg, rgba(0, 224, 164, 0.22), rgba(255, 204, 77, 0.08)),
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(255, 255, 255, 0.08) 9px 10px);
  border: 1px solid rgba(0, 224, 164, 0.28);
  border-radius: 8px;
  color: var(--accent);
  display: flex;
  font-weight: 1000;
  justify-content: center;
}

.asset-card strong {
  display: block;
  margin-bottom: 5px;
}

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

.choice-list {
  display: grid;
  gap: 8px;
}

.choice-button {
  background: #0b111b;
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 46px;
  text-align: left;
}

.choice-button.selected {
  background: rgba(0, 224, 164, 0.16);
  border-color: var(--accent);
  color: var(--accent);
}

.seal-bar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
}

.result {
  border-radius: 8px;
  margin-top: 12px;
  padding: 14px;
}

.result strong,
.result span {
  display: block;
}

.result span {
  margin-top: 5px;
}

.result.ok {
  background: rgba(0, 224, 164, 0.14);
  color: #adffe8;
}

.result.warn {
  background: rgba(255, 159, 67, 0.16);
  color: #ffd8ad;
}

.result.bad {
  background: rgba(255, 95, 112, 0.14);
  color: #ffd2d7;
}

.burn-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.burn-list strong,
.burn-list span,
.burn-list small {
  display: block;
}

.burn-list span {
  margin-top: 5px;
}

.burn-list small {
  color: var(--accent-2);
  margin-top: 3px;
}

.secondary {
  background: var(--panel-2);
  color: var(--text);
}

.wide {
  width: 100%;
}

.bottom-nav {
  align-items: center;
  background: rgba(8, 11, 18, 0.92);
  border-top: 1px solid var(--line);
  bottom: 0;
  display: none;
  gap: 6px;
  grid-template-columns: repeat(3, 1fr);
  left: 0;
  padding: 8px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  position: fixed;
  right: 0;
  z-index: 12;
}

.bottom-nav a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 10px;
  text-align: center;
}

@media (max-width: 980px) {
  .command-hero,
  .main-grid,
  .locked-brief,
  .asset-grid,
  .decision-grid {
    grid-template-columns: 1fr;
  }

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

  .bottom-nav {
    display: grid;
  }

  h1 {
    font-size: 34px;
  }

  .command-hero > div {
    min-height: 260px;
    padding: 24px;
  }

  .stage-head,
  .seal-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .timer-box {
    width: 100%;
  }
}
