* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(160deg, #f6f9f4 0%, #eef5ff 100%);
  color: #1e293b;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.hero {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: #4f772d;
}

h1 {
  margin: 6px 0 8px;
  font-size: 2rem;
}

h2 {
  margin-top: 0;
}

.sub {
  margin: 0;
  color: #334155;
}

.card {
  background: #ffffff;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
}

.multi-select {
  min-height: 150px;
}

.feedstock-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
}

.feedstock-table th,
.feedstock-table td {
  border: 1px solid #dbe4ee;
  padding: 8px;
  text-align: left;
}

.feedstock-table th {
  background: #f8fafc;
}

.feedstock-qty-input {
  width: 100%;
  max-width: 180px;
  margin: 0;
}

input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
  resize: vertical;
}

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

.registry-meta {
  margin: 10px 0 0;
  font-size: 14px;
  color: #475569;
}

.summary {
  min-height: 24px;
  color: #1f2937;
}

.summary-card {
  position: sticky;
  top: 10px;
  z-index: 10;
}

.small {
  margin-top: 0;
  color: #475569;
}

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

.nav-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.btn-row-split {
  justify-content: space-between;
}

.btn-row .next-btn {
  margin-left: auto;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.btn {
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.btn-secondary {
  border-color: #334155;
  background: #334155;
}

.btn-danger {
  border-color: #b42318;
  background: #b42318;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.progress-card {
  position: sticky;
  top: 10px;
  z-index: 9;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  margin-bottom: 10px;
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0f766e, #4f772d);
  transition: width 0.2s ease;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.progress-step {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.preview-box {
  border: 1px solid #dbe4ee;
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px;
  white-space: pre-wrap;
  max-height: 420px;
  overflow: auto;
}

.facility-map {
  width: 100%;
  height: 280px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  margin: 8px 0;
}

.step1-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.step1-map-panel {
  margin: 0;
  position: static;
}

.progress-step.done {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.progress-step.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

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

.questionnaire-card {
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
}

.questionnaire-card h4 {
  margin: 0 0 8px;
}

.hidden {
  display: none;
}

.sources {
  margin: 0;
  padding-left: 18px;
}

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

.guide-link {
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.guide-panel {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.guide-panel.fading-out {
  opacity: 0;
  transform: translateY(-6px);
}

#feedstockSharePieChart,
#feedstockContributionChart {
  max-height: 220px;
}

a {
  color: #1d4ed8;
}

@media (max-width: 720px) {
  .flow-grid,
  .grid {
    grid-template-columns: 1fr;
  }

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

  .step1-layout {
    grid-template-columns: 1fr;
  }

  .step1-map-panel {
    position: static;
  }

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

  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-row .next-btn {
    margin-left: 0;
  }
}
