:root {
  --bg: #ece4d8;
  --bg-strong: #ddd0bd;
  --surface: rgba(245, 239, 229, 0.78);
  --surface-strong: rgba(253, 250, 245, 0.88);
  --line: rgba(70, 49, 24, 0.14);
  --text: #25160c;
  --muted: #6f5a43;
  --accent: #a14e2c;
  --accent-soft: rgba(161, 78, 44, 0.12);
  --success: #2d6a4f;
  --warning: #8d5524;
  --danger: #9f2a2a;
  --shadow: 0 24px 80px rgba(63, 41, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 248, 235, 0.95), transparent 36%),
    linear-gradient(180deg, #e7ddce 0%, #ece4d8 52%, #e0d1bc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 22, 12, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 22, 12, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
}

.page-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero,
.workspace,
.control-group,
.map-frame,
.inspector,
.table-shell {
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: end;
  min-height: calc(100svh - 64px);
  padding: clamp(24px, 4vw, 56px);
  border: 1px solid var(--line);
  border-radius: 32px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 250, 243, 0.88), rgba(229, 215, 191, 0.52)),
    url("https://images.unsplash.com/photo-1526779259212-939e64788e3c?auto=format&fit=crop&w=1600&q=80")
      center/cover;
  box-shadow: var(--shadow);
}

.hero__content {
  max-width: 620px;
  animation: fadeUp 750ms ease both;
}

.eyebrow,
.section-label,
.hero__panel-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1,
.results h2,
.control-group h2,
.inspector h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  line-height: 0.95;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(4.5rem, 10vw, 8.5rem);
  max-width: 6ch;
}

.hero__lede {
  max-width: 36rem;
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(37, 22, 12, 0.88);
}

.hero__panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.42), rgba(64, 38, 19, 0.78));
  color: #fff6ee;
  animation: fadeUp 950ms ease both;
}

.hero__panel ol {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 14px;
  line-height: 1.5;
}

.workspace {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
}

.control-rail {
  display: grid;
  gap: 18px;
}

.control-group,
.map-frame,
.inspector,
.table-shell {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-group {
  padding: 22px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2,
.results h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid rgba(70, 49, 24, 0.16);
  border-radius: 16px;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 252, 247, 0.7);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 252, 247, 0.92);
  transform: translateY(-1px);
}

.field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
}

.field--check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.hint,
.status-text,
.detail-grid dd,
.summary-strip,
td,
th {
  color: var(--muted);
}

.hint {
  margin: 0 0 18px;
  line-height: 1.6;
  font-size: 0.92rem;
}

.button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  color: #fff7ee;
  background: linear-gradient(135deg, #8f4527, #b5633f);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(143, 69, 39, 0.24);
}

.button:disabled {
  opacity: 0.5;
  cursor: progress;
}

.button--ghost {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 251, 246, 0.88), rgba(228, 211, 187, 0.72));
}

.status-panel {
  overflow: hidden;
}

.progress-bar {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(70, 49, 24, 0.08);
}

.progress-bar__fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #a14e2c, #d69a6d);
  transition: width 220ms ease;
}

.status-log {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.status-log__item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.6);
  font-size: 0.92rem;
  line-height: 1.45;
}

.results {
  display: grid;
  gap: 18px;
}

.results__topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.summary-strip span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.72);
  border: 1px solid var(--line);
}

.results__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 320px;
  gap: 18px;
}

.map-frame {
  overflow: hidden;
  min-height: 620px;
  position: relative;
}

#map {
  height: 100%;
  min-height: 620px;
}

.inspector {
  padding: 20px;
}

.inspector__header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.inspector h3 {
  font-size: 2rem;
  line-height: 1.05;
}

.detail-grid {
  margin: 16px 0 0;
  display: grid;
  gap: 14px;
}

.detail-grid div {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(70, 49, 24, 0.08);
}

.detail-grid dt {
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-grid dd {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
}

.table-shell {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(255, 252, 247, 0.76);
}

th,
td {
  text-align: left;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(70, 49, 24, 0.1);
  vertical-align: top;
}

tbody tr {
  cursor: pointer;
  transition: background 160ms ease;
}

tbody tr:hover,
tbody tr.is-selected {
  background: rgba(255, 250, 243, 0.86);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.status-pill--located {
  color: var(--success);
  background: rgba(45, 106, 79, 0.12);
}

.status-pill--inferred {
  color: var(--warning);
  background: rgba(141, 85, 36, 0.12);
}

.status-pill--missing {
  color: var(--danger);
  background: rgba(159, 42, 42, 0.12);
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .hero {
    min-height: auto;
  }

  .summary-strip {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 16px, 1440px);
    padding-top: 8px;
  }

  .hero,
  .control-group,
  .inspector {
    padding: 18px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 18vw, 5rem);
  }

  .results__topline {
    flex-direction: column;
    align-items: start;
  }

  th,
  td {
    padding: 12px;
    font-size: 0.9rem;
  }
}
