:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #607068;
  --line: #d9e1dc;
  --surface: #ffffff;
  --band: #f5f7f4;
  --accent: #16745b;
  --accent-strong: #0e5944;
  --amber: #b46a16;
  --danger: #b33838;
  --shadow: 0 14px 34px rgba(23, 32, 27, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--band);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

.locked .topbar,
.locked .app-shell {
  display: none;
}

.intake-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #18382f;
}

.intake-form {
  width: min(680px, 100%);
  display: grid;
  gap: 14px;
  padding: clamp(18px, 4vw, 32px);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.intake-form h1 {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
  color: #18382f;
}

.intake-form p {
  margin: 8px 0 0;
  color: var(--muted);
}

.topbar {
  min-height: 112px;
  padding: 24px clamp(18px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #18382f;
  color: white;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.topbar p {
  margin: 8px 0 0;
  color: #c9ded6;
  font-size: 1rem;
}

.status-pill {
  min-width: 92px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
}

.app-shell {
  width: min(1420px, calc(100vw - 28px));
  margin: 18px auto 40px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 0 0 10px;
  overflow-x: auto;
}

.tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(14px, 2vw, 22px);
}

.panel.active {
  display: block;
}

.toolbar,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.table-actions {
  justify-content: space-between;
  margin-top: 16px;
}

.blast-progress {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(21, 94, 117, 0.18);
  border-radius: 8px;
  background: #edf7f5;
}

.blast-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.blast-progress-label span:last-child {
  color: var(--muted);
  font-weight: 600;
}

.blast-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(21, 94, 117, 0.16);
}

.blast-progress-bar {
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #2563eb, #14b8a6);
  animation: blast-progress-slide 1.1s ease-in-out infinite;
}

@keyframes blast-progress-slide {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(250%);
  }
}

button,
.file-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

button:hover,
.file-button:hover {
  border-color: var(--accent);
}

button.primary:hover {
  background: var(--accent-strong);
}

.file-button input {
  display: none;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.1fr) minmax(310px, 0.9fr);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #fbfcfb;
  font-weight: 400;
}

select {
  min-height: 41px;
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.35;
}

.controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.controls.vertical {
  grid-template-columns: 1fr;
  align-content: start;
  margin-top: 0;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.terms {
  color: var(--ink);
  font-weight: 700;
}

.terms-copy {
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  background: #eef3ef;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.viz-wrap {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101a18;
  padding: 10px;
}

canvas {
  display: block;
  width: 100%;
  height: 220px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 420px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.final-table table {
  min-width: 1280px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3ef;
  color: #394840;
  font-size: 0.82rem;
}

td.sequence {
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.ok {
  color: var(--accent-strong);
  font-weight: 700;
}

.warn {
  color: var(--amber);
  font-weight: 700;
}

.bad {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.two,
  .controls {
    grid-template-columns: 1fr;
  }
}
