:root {
  --bg: #f4efe6;
  --panel: #fffdf9;
  --ink: #1f2a2e;
  --muted: #637076;
  --accent: #a34f2d;
  --accent-soft: #f2d5bf;
  --border: #d9cfc1;
  --ok: #2f6b46;
  --warn: #8f6500;
  --bad: #8f2d2d;
  --shadow: 0 18px 40px rgba(47, 36, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(163, 79, 45, 0.12), transparent 30%),
    linear-gradient(180deg, #f8f4ed 0%, var(--bg) 100%);
}

a {
  color: var(--accent);
}

pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 14px;
  background: #f7f1e8;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.page-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
  display: grid;
  gap: 1.25rem;
}

.hero-card,
.panel {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 2rem;
}

.hero-card.compact {
  padding: 1.5rem 2rem;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.eyebrow {
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
}

.lede {
  max-width: 58rem;
  line-height: 1.6;
  color: var(--muted);
}

.helper-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.panel {
  padding: 1.5rem;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.upload-form,
.grid,
.meta-grid {
  display: grid;
  gap: 1rem;
}

.two-up {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: white;
  font: inherit;
}

select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: white;
  font: inherit;
}

button {
  width: fit-content;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, #aa552f 0%, #c8744f 100%);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ts-wrapper.single .ts-control,
.ts-control {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  background: white;
  box-shadow: none;
}

.ts-wrapper.single .ts-control input {
  font: inherit;
}

.ts-wrapper.focus .ts-control,
.ts-control.focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 79, 45, 0.12);
}

.ts-dropdown {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ts-dropdown .optgroup-header {
  padding: 0.75rem 0.9rem 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #fbf5ed;
}

.ts-dropdown .option,
.ts-dropdown .create {
  padding: 0.8rem 0.9rem;
}

.ts-dropdown .active {
  background: rgba(163, 79, 45, 0.09);
  color: var(--ink);
}

.no-results {
  padding: 0.8rem 0.9rem;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: capitalize;
}

.status-succeeded {
  background: rgba(47, 107, 70, 0.12);
  color: var(--ok);
}

.status-running,
.status-queued {
  background: rgba(143, 101, 0, 0.14);
  color: var(--warn);
}

.status-failed {
  background: rgba(143, 45, 45, 0.12);
  color: var(--bad);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.image-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
  justify-content: start;
}

.image-card {
  margin: 0;
  display: grid;
  gap: 0.5rem;
  justify-items: start;
}

.image-card a {
  display: block;
  width: 100%;
}

.image-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #f6f1ea;
}

figcaption {
  color: var(--muted);
  font-size: 0.9rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.origin-impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.origin-impact-card {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf3 0%, #f7efe4 100%);
  border: 1px solid rgba(163, 79, 45, 0.16);
}

.lca-preview-panel {
  display: grid;
  gap: 1.1rem;
  background:
    radial-gradient(circle at top right, rgba(163, 79, 45, 0.08), transparent 36%),
    linear-gradient(180deg, #fffdf9 0%, #f9f4eb 100%);
}

.lca-preview-panel .panel-heading {
  margin-bottom: 0;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid rgba(99, 112, 118, 0.14);
}

.lca-preview-heading {
  display: grid;
  gap: 0.4rem;
  max-width: 44rem;
}

.lca-preview-heading h2 {
  margin: 0;
}

.lca-preview-scroll {
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.lca-preview-grid {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  min-width: 760px;
  gap: 1.15rem;
  align-items: stretch;
}

.lca-preview-stats {
  width: 100%;
  display: grid;
  gap: 0.9rem;
}

.lca-preview-card {
  display: grid;
  gap: 0.6rem;
  padding: 1rem 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffaf3 0%, #f7efe4 100%);
  border: 1px solid rgba(163, 79, 45, 0.16);
  box-shadow: 0 10px 24px rgba(51, 36, 22, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  min-height: 0;
}

.lca-preview-card-score {
  background:
    radial-gradient(circle at top right, rgba(163, 79, 45, 0.18), transparent 42%),
    linear-gradient(180deg, #fff8f0 0%, #f7eadc 100%);
}

.lca-preview-radar {
  min-width: 0;
  display: grid;
  gap: 0.95rem;
  padding: 1rem 1rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(48, 93, 85, 0.08), transparent 34%),
    linear-gradient(180deg, #fdfaf4 0%, #f6efe6 100%);
  border: 1px solid rgba(99, 112, 118, 0.18);
  box-shadow: 0 12px 26px rgba(31, 42, 46, 0.07);
}

.lca-preview-radar-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.lca-preview-radar h3 {
  margin: 0;
}

.lca-preview-card .metric-value {
  font-size: clamp(2rem, 3.6vw, 2.8rem);
}

.lca-preview-card .metric-value-small {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.lca-preview-card .metric-text {
  font-size: 1.05rem;
}

.lca-preview-card .helper-copy,
.lca-preview-radar .helper-copy {
  font-size: 0.93rem;
}

.metric-label {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
}

.metric-value,
.metric-text {
  margin: 0;
}

.metric-value {
  font-size: clamp(2.3rem, 5vw, 3.3rem);
  line-height: 1;
  color: var(--accent);
}

.metric-value-small {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.metric-text {
  font-size: 1.15rem;
  line-height: 1.4;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.chart-panel,
.insight-panel {
  min-height: 100%;
}

.chart-wrap {
  position: relative;
  min-height: 320px;
  padding: 0.75rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(163, 79, 45, 0.08), transparent 45%),
    #fbf6ef;
  border: 1px solid rgba(99, 112, 118, 0.16);
}

.lca-preview-radar .chart-wrap {
  min-height: clamp(280px, 28vw, 340px);
  background:
    radial-gradient(circle at top, rgba(163, 79, 45, 0.1), transparent 46%),
    #faf4ea;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(163, 79, 45, 0.12);
  color: var(--accent);
  font-size: 0.88rem;
}

.insight-stack {
  display: grid;
  gap: 0.9rem;
}

.insight-card {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: #fcf8f2;
  border: 1px solid rgba(99, 112, 118, 0.16);
}

.insight-card p:last-child {
  margin-bottom: 0;
}

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

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.95rem 0.9rem;
  border-bottom: 1px solid rgba(99, 112, 118, 0.16);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.data-table tbody tr:hover {
  background: rgba(163, 79, 45, 0.04);
}

.metric-chip {
  display: inline-flex;
  min-width: 3rem;
  justify-content: center;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(47, 107, 70, 0.11);
  color: var(--ok);
  font-weight: 600;
}

.preview-note {
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .lca-preview-scroll {
    overflow: visible;
    padding-bottom: 0;
  }

  .lca-preview-grid {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    gap: 1rem;
  }

  .lca-preview-radar-topline {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .lca-preview-card,
  .lca-preview-radar {
    padding: 0.95rem;
  }

  .lca-preview-radar .chart-wrap {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 1100px);
    margin-top: 1rem;
  }

  .panel-heading,
  .hero-row {
    flex-direction: column;
  }

  .lca-preview-scroll {
    overflow: visible;
    padding-bottom: 0;
  }

  .lca-preview-grid {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

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

  .chart-wrap {
    min-height: 280px;
    padding: 0.75rem;
  }

  .data-table {
    min-width: 760px;
  }
}
