:root {
  --bg: #160608;
  --panel: #27090d;
  --panel-2: #350d12;
  --panel-3: #431116;
  --line: #7d2b31;
  --line-soft: rgba(255, 214, 204, 0.16);
  --text: #fff5f0;
  --muted: #dcb9b1;
  --accent: #f4b46f;
  --accent-2: #ffcf99;
  --danger: #ff8a8a;
  --good: #79e2a3;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(75, 12, 17, 0.82), rgba(22, 6, 8, 0.94) 46%, rgba(50, 5, 11, 0.94)),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.title-block,
.lab-card,
.panel {
  border: 1px solid var(--line-soft);
  background: rgba(39, 9, 13, 0.88);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.title-block {
  padding: 26px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 900px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4.5vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 770px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.lab-card {
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(83, 18, 24, 0.92), rgba(39, 9, 13, 0.96));
}

.lab-card h2,
.panel h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.metric {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: baseline;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.metric:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.metric strong {
  color: var(--accent);
  font-size: 1.35rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.9rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(67, 17, 22, 0.68);
}

.panel-body {
  padding: 20px;
}

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

.field-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

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

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 38px 0 12px;
  color: var(--text);
  background: #21070a;
}

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

select:focus,
button:focus-visible {
  outline: 3px solid rgba(244, 180, 111, 0.35);
  outline-offset: 2px;
}

.solution-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.target-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(22, 6, 8, 0.34);
  cursor: pointer;
  text-align: left;
}

.target-button:hover {
  border-color: rgba(244, 180, 111, 0.42);
  background: rgba(244, 180, 111, 0.08);
}

.target-button.selected {
  border-color: rgba(244, 180, 111, 0.66);
  background: rgba(244, 180, 111, 0.12);
}

.target-button.complete {
  border-color: rgba(121, 226, 163, 0.44);
}

.target-button b {
  display: block;
  color: var(--text);
}

.target-check {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--good);
  background: rgba(121, 226, 163, 0.12);
}

.target-check svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recipe-readout {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(22, 6, 8, 0.52);
}

.recipe-readout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.recipe-readout strong {
  color: var(--text);
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.primary-btn,
.ghost-btn {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 800;
}

.primary-btn {
  color: #23070a;
  background: linear-gradient(180deg, #ffd6a2, #f1a456);
  box-shadow: 0 12px 26px rgba(244, 180, 111, 0.22);
}

.primary-btn:hover {
  filter: brightness(1.05);
}

.primary-btn:disabled:hover {
  filter: none;
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 245, 240, 0.08);
  border: 1px solid var(--line-soft);
}

.status {
  min-height: 52px;
  margin-top: 16px;
  padding: 12px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(22, 6, 8, 0.5);
  line-height: 1.45;
}

.status.good {
  color: #d9ffe5;
  border-color: rgba(121, 226, 163, 0.44);
  background: rgba(18, 75, 43, 0.32);
}

.status.bad {
  color: #ffe2e2;
  border-color: rgba(255, 138, 138, 0.5);
  background: rgba(96, 12, 20, 0.48);
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--accent-2);
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(22, 6, 8, 0.35);
}

td {
  color: var(--text);
  font-size: 0.94rem;
}

tr:last-child td {
  border-bottom: 0;
}

.subtle {
  color: var(--muted);
  font-size: 0.86rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--accent-2);
  border: 1px solid rgba(244, 180, 111, 0.35);
  background: rgba(244, 180, 111, 0.09);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.next-section {
  margin-top: 20px;
}

.next-panel {
  max-width: 460px;
  margin-left: auto;
}

.next-actions {
  display: flex;
  justify-content: flex-end;
}

.continue-btn {
  min-width: 220px;
}

.source-note {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(22, 6, 8, 0.46);
  font-size: 0.9rem;
  line-height: 1.5;
}

.source-note a {
  color: var(--accent-2);
  font-weight: 800;
  text-decoration: none;
}

.source-note a:hover {
  text-decoration: underline;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 138, 138, 0.38);
  border-radius: 6px;
  color: var(--danger);
  background: rgba(255, 138, 138, 0.08);
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255, 138, 138, 0.16);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-cell {
  text-align: center;
  white-space: nowrap;
  width: 1%;
}

.state {
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.complete .state {
  color: var(--good);
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .title-block,
  .panel-body,
  .panel-header,
  .lab-card {
    padding: 15px;
  }

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

  .ghost-btn {
    width: 100%;
  }

  .next-panel {
    max-width: none;
  }

  .next-actions {
    display: grid;
  }

  .continue-btn {
    width: 100%;
  }
}
