:root {
  --background: #f7f3ed;
  --foreground: #241f1b;
  --ink-soft: #5c5148;
  --paper: #fffaf3;
  --paper-strong: #ffffff;
  --line: #ddd0c1;
  --ember: #c6422b;
  --ember-dark: #8d2f22;
  --gold: #d8a236;
  --sage: #607d67;
  --teal: #27666b;
  --shadow: 0 18px 50px rgba(61, 43, 28, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(216, 162, 54, 0.18), transparent 32rem),
    linear-gradient(180deg, #fbf7f0 0%, var(--background) 46%, #efe7dc 100%);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.hero-band {
  align-items: end;
  background:
    linear-gradient(135deg, rgba(36, 31, 27, 0.93), rgba(83, 57, 43, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 34px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fff8ed;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr auto;
  min-height: 260px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 56px);
  position: relative;
}

.hero-band::after {
  background: linear-gradient(180deg, #f2bb4c, #d7492e 50%, rgba(215, 73, 46, 0));
  border-radius: 999px;
  bottom: -80px;
  content: "";
  height: 230px;
  opacity: 0.72;
  position: absolute;
  right: 8%;
  width: 38px;
}

.hero-copy {
  max-width: 820px;
  position: relative;
  z-index: 1;
}

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

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

h1 {
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.88;
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  margin-bottom: 10px;
}

h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.hero-copy p:last-child {
  color: #eadccd;
  font-size: clamp(1rem, 2vw, 1.24rem);
  line-height: 1.55;
  margin-bottom: 0;
  max-width: 760px;
}

.source-pill {
  align-items: flex-start;
  align-self: start;
  background: rgba(255, 250, 243, 0.12);
  border: 1px solid rgba(255, 250, 243, 0.22);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.source-pill span,
.source-pill strong {
  display: block;
}

.source-pill span {
  color: #d8c8b8;
  font-size: 0.82rem;
}

.safety-strip {
  background: #fff4df;
  border: 1px solid #e8c074;
  border-radius: 8px;
  color: #503510;
  line-height: 1.45;
  margin: 18px 0;
  padding: 14px 16px;
}

.workspace-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 390px) 1fr;
}

.search-panel,
.detail-panel {
  background: rgba(255, 250, 243, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 34px rgba(61, 43, 28, 0.08);
}

.search-panel {
  padding: 18px;
  position: sticky;
  top: 18px;
}

.search-panel label {
  display: block;
  font-weight: 800;
  margin-bottom: 10px;
}

.search-box {
  align-items: center;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 38px;
  overflow: hidden;
}

.search-box:focus-within {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(198, 66, 43, 0.16);
}

.search-box input {
  background: transparent;
  border: 0;
  min-width: 0;
  outline: 0;
  padding: 14px;
}

.search-box button {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 1.5rem;
  height: 42px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.chips button {
  background: #f3e8d8;
  border: 1px solid #dfcdb9;
  border-radius: 999px;
  color: #3d3027;
  padding: 8px 11px;
}

.chips button:hover,
.result-item:hover,
.point-card:hover {
  border-color: var(--ember);
}

.result-heading,
.section-title,
.detail-header {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.result-heading {
  margin-bottom: 10px;
}

.result-heading span,
.section-title h3 {
  font-weight: 800;
}

.result-heading small,
.result-item small,
.point-card small,
.detail-header p {
  color: var(--ink-soft);
}

.result-list {
  display: grid;
  gap: 9px;
}

.result-item {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 5px;
  padding: 13px;
  text-align: left;
  width: 100%;
}

.result-item.active {
  background: #2f2924;
  border-color: #2f2924;
  color: #fff8ed;
}

.result-item.active span,
.result-item.active small {
  color: #dccdc0;
}

.detail-panel {
  min-height: 690px;
  padding: clamp(18px, 3vw, 28px);
}

.detail-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.status {
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 11px;
}

.status.good {
  background: rgba(96, 125, 103, 0.15);
  color: #314f39;
}

.status.muted {
  background: #eee4d7;
  color: #6c5f52;
}

.protocol {
  background: #fffdfa;
  border-left: 4px solid var(--ember);
  border-radius: 6px;
  line-height: 1.55;
  margin-bottom: 18px;
  padding: 16px;
}

.protocol p {
  color: #3f352e;
  margin-bottom: 0;
}

.locator-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(250px, 360px) 1fr;
}

.body-map {
  background: linear-gradient(180deg, #fcf7ef, #f0e2d0);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 540px;
  padding: 18px;
}

.body-map p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 16px 0 0;
}

.body-figure {
  height: 460px;
  margin: 0 auto;
  max-width: 290px;
  position: relative;
}

.head,
.neck,
.torso,
.arm,
.leg {
  background: rgba(39, 102, 107, 0.2);
  border: 2px solid rgba(39, 102, 107, 0.55);
  position: absolute;
}

.head {
  border-radius: 50%;
  height: 72px;
  left: calc(50% - 36px);
  top: 6px;
  width: 72px;
}

.neck {
  border-radius: 16px 16px 6px 6px;
  height: 42px;
  left: calc(50% - 18px);
  top: 74px;
  width: 36px;
}

.torso {
  border-radius: 44px 44px 30px 30px;
  height: 190px;
  left: calc(50% - 70px);
  top: 108px;
  width: 140px;
}

.arm {
  border-radius: 28px;
  height: 190px;
  top: 126px;
  width: 34px;
}

.arm.left {
  left: 36px;
  transform: rotate(10deg);
}

.arm.right {
  right: 36px;
  transform: rotate(-10deg);
}

.leg {
  border-radius: 24px;
  height: 170px;
  top: 292px;
  width: 42px;
}

.leg.left {
  left: 94px;
}

.leg.right {
  right: 94px;
}

.hotspot {
  background: var(--ember);
  border: 3px solid #fff9f0;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(198, 66, 43, 0.16), 0 6px 16px rgba(70, 36, 22, 0.25);
  height: 18px;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  z-index: 3;
}

.hotspot.active {
  background: var(--gold);
  box-shadow: 0 0 0 8px rgba(216, 162, 54, 0.24), 0 6px 16px rgba(70, 36, 22, 0.25);
}

.points-panel {
  min-width: 0;
}

.section-title {
  margin-bottom: 12px;
}

.section-title span {
  background: #2f2924;
  border-radius: 999px;
  color: #fff8ed;
  font-size: 0.82rem;
  font-weight: 800;
  min-width: 34px;
  padding: 5px 10px;
  text-align: center;
}

.point-list {
  display: grid;
  gap: 10px;
  max-height: 500px;
  overflow: auto;
  padding-right: 4px;
}

.point-card {
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 7px;
  padding: 14px;
  text-align: left;
}

.point-card.selected {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(198, 66, 43, 0.14);
}

.point-code {
  color: var(--ember-dark);
  font-weight: 900;
}

.empty-state,
.loading {
  color: var(--ink-soft);
  line-height: 1.5;
}

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

  .search-panel {
    position: static;
  }

  .source-pill {
    max-width: 320px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 12px;
  }

  .hero-band {
    min-height: 240px;
    padding: 24px;
  }

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

  .body-map {
    min-height: auto;
  }
}
