:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #e8edf7;
  background:
    radial-gradient(
      circle at top left,
      rgba(83, 131, 255, 0.24),
      transparent 34%
    ),
    radial-gradient(
      circle at top right,
      rgba(118, 236, 198, 0.14),
      transparent 28%
    ),
    linear-gradient(180deg, #0c1120 0%, #121a2f 45%, #0f1728 100%);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 18px;
  padding: 18px;
}

.panel {
  height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border-radius: 28px;
}

.glass-panel,
.glass-card,
.hud span {
  background: rgba(19, 28, 49, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero-card {
  padding: 22px;
  margin-bottom: 16px;
  border-radius: 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #a8c4ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #f8fbff;
}

.hero-card p {
  margin: 12px 0 0;
  color: #bed0ed;
  line-height: 1.55;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #eef4ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.span-2 {
  grid-column: span 2;
}

.card {
  border-radius: 24px;
  padding: 18px;
  color: #ebf2ff;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.section-step {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9eb8ea;
  margin-bottom: 4px;
}

h2 {
  font-size: 18px;
  margin: 0;
  color: #f7fbff;
}

.badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge.neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #dbe9ff;
}
.badge.accent {
  background: rgba(96, 165, 250, 0.18);
  color: #badaff;
}
.badge.success {
  background: rgba(52, 211, 153, 0.14);
  color: #b2f2dc;
}

.muted {
  color: #bfd0ec;
  font-size: 13px;
  line-height: 1.55;
}

.microcopy {
  margin: 8px 0 12px;
  font-size: 12px;
  color: #9eb0cf;
}

code {
  background: rgba(116, 145, 255, 0.14);
  color: #e9f0ff;
  padding: 2px 6px;
  border-radius: 8px;
}

button,
.file {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f6f9ff;
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  min-height: 46px;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

button:hover,
.file:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

button.primary,
.file.primary {
  background: linear-gradient(
    135deg,
    rgba(92, 140, 255, 0.92),
    rgba(78, 99, 255, 0.88)
  );
  border-color: rgba(131, 171, 255, 0.55);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(50, 93, 207, 0.22);
}

button.primary:hover,
.file.primary:hover {
  background: linear-gradient(
    135deg,
    rgba(109, 154, 255, 0.96),
    rgba(89, 114, 255, 0.92)
  );
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.file input {
  display: none;
}

.button-stack {
  display: grid;
  gap: 10px;
}

.button-stack.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.position-grid {
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #d9e6fb;
}

.field-help {
  font-size: 11px;
  line-height: 1.35;
  color: #9fb2cf;
  font-weight: 500;
}

input[type="number"] {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  color: #f4f8ff;
  background: rgba(10, 16, 30, 0.36);
  outline: none;
}

input[type="number"]:focus {
  border-color: rgba(130, 176, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(102, 145, 255, 0.14);
}

.button-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.button-row.two-buttons {
  grid-template-columns: repeat(2, 1fr);
}

.simulation-actions {
  margin-top: 12px;
}

button.mode.active {
  background: rgba(82, 144, 255, 0.18);
  border-color: rgba(113, 168, 255, 0.64);
  color: #cfe4ff;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #dce9fd;
}

.compact-check {
  min-height: 62px;
  align-content: end;
  justify-content: flex-start;
}

.option-stack {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  margin-top: 12px;
}

.status,
.info {
  margin-top: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e7efff;
  font-size: 13px;
  line-height: 1.45;
}

.status {
  background: rgba(96, 165, 250, 0.1);
}

.warning {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.28);
  color: #ffddbe;
  font-size: 13px;
  line-height: 1.45;
}

.hidden {
  display: none;
}

.steps-list,
ul {
  margin: 8px 0 0 18px;
  padding: 0;
  color: #ccdaf0;
  line-height: 1.55;
}

.viewport-shell {
  position: relative;
  height: calc(100vh - 36px);
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(100, 167, 255, 0.16),
      transparent 24%
    ),
    radial-gradient(
      circle at 80% 15%,
      rgba(118, 236, 198, 0.12),
      transparent 18%
    ),
    linear-gradient(180deg, rgba(8, 13, 25, 0.9), rgba(14, 21, 39, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 48px rgba(0, 0, 0, 0.28);
}

.viewport-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    transparent 18%,
    transparent 82%,
    rgba(255, 255, 255, 0.03)
  );
}

canvas {
  display: block;
}

.hud {
  position: absolute;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  font-size: 12px;
  z-index: 3;
}

.hud-top {
  top: 14px;
}
.hud-bottom {
  bottom: 14px;
}

.hud span {
  border-radius: 999px;
  padding: 8px 12px;
  color: #edf4ff;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 420px 1fr;
  }
  .button-stack.three,
  .status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .panel,
  .viewport-shell {
    height: auto;
  }

  .panel {
    max-height: none;
  }

  .viewport-shell {
    min-height: 56vh;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 12px;
    gap: 12px;
  }
  .panel,
  .viewport-shell {
    border-radius: 22px;
  }
  .hero-card h1 {
    font-size: 24px;
  }
  .bento-grid,
  .grid.two,
  .button-row,
  .button-stack.three,
  .status-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: span 1;
  }
  .hud {
    flex-direction: column;
  }
}
