:root {
  --bg: #f2eee8;
  --surface: rgba(250, 246, 240, 0.9);
  --surface-muted: #e8e0d5;
  --surface-elevated: rgba(255, 251, 245, 0.94);

  --text: #241f1b;
  --muted: #6f655b;

  --border: rgba(91, 76, 60, 0.18);
  --border-strong: rgba(91, 76, 60, 0.32);

  --accent: #55624b; /* deep olive */
  --accent-strong: #31392c;
  --accent-soft: rgba(85, 98, 75, 0.12);

  --oxblood: #5f2d2f;
  --gold: #b6935f;

  --danger: #8a3a32;

  --shadow:
    0 24px 60px rgba(36, 31, 27, 0.08),
    0 2px 10px rgba(36, 31, 27, 0.04);

  --radius: 28px;

  --hero-width: 860px;
  --content-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  color: var(--text);

  font-family:
    "Inter",
    "Helvetica Neue",
    ui-sans-serif,
    system-ui,
    sans-serif;

  line-height: 1.7;
  letter-spacing: 0.01em;

  background:
    radial-gradient(circle at top, rgba(182, 147, 95, 0.08), transparent 30%),
    linear-gradient(
      180deg,
      rgba(255,255,255,0.45),
      rgba(255,255,255,0)
    ),
    var(--bg);

  position: relative;
  overflow-x: hidden;
}

/* subtle plaster / marble texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;

  background-image:
    radial-gradient(circle at 20% 20%, rgba(0,0,0,0.04) 0, transparent 32%),
    radial-gradient(circle at 80% 30%, rgba(0,0,0,0.03) 0, transparent 28%),
    radial-gradient(circle at 40% 80%, rgba(0,0,0,0.03) 0, transparent 36%),
    repeating-linear-gradient(
      115deg,
      rgba(255,255,255,0.04) 0px,
      rgba(255,255,255,0.04) 2px,
      transparent 2px,
      transparent 10px
    );
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.app-shell {
  width: min(var(--content-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 120px;
}

/* =========================
   HERO
========================= */

.hero {
  position: relative;

  max-width: var(--hero-width);
  margin: 0 auto 72px;

  padding: 72px 48px;

  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;

  border:
    1px solid rgba(182, 147, 95, 0.22);

  border-radius:
    220px 220px 24px 24px;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.46),
      rgba(255,255,255,0.08)
    );

  backdrop-filter: blur(4px);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 18px;

  color: var(--gold);

  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

h1 {
  margin: 0 auto;

  max-width: 780px;

  font-family:
    "Cormorant Garamond",
    "Bodoni Moda",
    "Times New Roman",
    serif;

  font-size: clamp(3.6rem, 7vw, 6.8rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.subtitle {
  max-width: 620px;
  margin: 28px auto 0;

  color: var(--muted);

  font-size: 1.05rem;
}

/* =========================
   PANELS / CARDS
========================= */

.search-panel,
.result-card {
  position: relative;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow);

  overflow: hidden;
}

.search-panel::before,
.result-card::before {
  content: "";
  position: absolute;
  inset: 14px;

  border: 1px solid rgba(182, 147, 95, 0.16);
  border-radius: calc(var(--radius) - 10px);

  pointer-events: none;
}

.search-panel {
  padding: 34px;
  margin-bottom: 42px;
}

.keyword-form {
  position: relative;

  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
}

.input-wrap {
  position: relative;
}

label {
  display: block;
  margin-bottom: 10px;

  color: var(--muted);

  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

input {
  width: 100%;

  padding: 16px 18px;

  border:
    1px solid rgba(91, 76, 60, 0.2);

  border-radius: 18px;

  background:
    rgba(255,255,255,0.68);

  color: var(--text);

  outline: none;

  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input:focus {
  border-color: rgba(182, 147, 95, 0.7);

  background: rgba(255,255,255,0.92);

  box-shadow:
    0 0 0 4px rgba(182, 147, 95, 0.14);
}

/* =========================
   BUTTONS
========================= */

.primary-button,
.secondary-button,
.image-control,
.chip-remove {
  border: 0;

  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.image-control:hover,
.chip-remove:hover {
  transform: translateY(-1px);
}

.primary-button,
.secondary-button {
  min-height: 56px;
  padding: 14px 28px;

  border-radius: 999px;

  font-weight: 700;
  letter-spacing: 0.04em;
}

.primary-button {
  background:
    linear-gradient(
      180deg,
      var(--gold),
      #a5824d
    );

  color: #fff;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 10px 30px rgba(166, 130, 77, 0.28);
}

.primary-button:hover:not(:disabled) {
  background:
    linear-gradient(
      180deg,
      #c2a06b,
      #9f7c47
    );
}

.secondary-button {
  background: transparent;

  border: 1px solid rgba(91, 76, 60, 0.2);

  color: var(--accent-strong);
}

/* =========================
   AUTOCOMPLETE
========================= */

.autocomplete-list {
  position: absolute;
  z-index: 20;

  top: calc(100% + 12px);
  left: 0;
  right: 0;

  max-height: 320px;

  margin: 0;
  padding: 10px;

  overflow-y: auto;
  list-style: none;

  background: var(--surface-elevated);

  border: 1px solid var(--border);

  border-radius: 22px;

  box-shadow:
    0 24px 60px rgba(36, 31, 27, 0.12);
}

.autocomplete-item {
  padding: 12px 14px;

  border-radius: 14px;

  color: #2f2923;

  outline: none;
  user-select: none;
}

.autocomplete-item:hover,
.autocomplete-item:focus,
.autocomplete-item.is-active {
  background: rgba(85, 98, 75, 0.1);

  color: var(--accent-strong);
}

/* =========================
   CHIPS
========================= */

.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  min-height: 36px;
  margin-top: 24px;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  max-width: 100%;

  padding: 7px 10px 7px 14px;

  border:
    1px solid rgba(182, 147, 95, 0.28);

  border-radius: 999px;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.82),
      rgba(232,224,213,0.7)
    );

  color: var(--accent-strong);

  font-size: 0.88rem;
  font-weight: 700;
}

.chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-remove {
  width: 24px;
  height: 24px;
  padding: 0;

  border-radius: 50%;

  background: rgba(255,255,255,0.8);

  color: var(--accent-strong);

  line-height: 1;
}

/* =========================
   STATUS / ACTIONS
========================= */

.actions-row {
  display: flex;
  align-items: center;
  gap: 16px;

  margin-top: 24px;
}

.status-message {
  margin: 0;

  color: var(--muted);
}

.status-message.error {
  color: var(--oxblood);
  font-weight: 700;
}

/* =========================
   RESULTS
========================= */

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

.result-card {
  overflow: hidden;
}

/* =========================
   IMAGE VIEWER
========================= */

.image-viewer {
  position: relative;

  background:
    linear-gradient(
      180deg,
      #2c2925,
      #171513
    );

  border-bottom:
    1px solid rgba(255,255,255,0.06);
}

.image-stage {
  position: relative;

  display: grid;
  place-items: center;

  height: clamp(320px, 50vw, 680px);

  overflow: hidden;

  touch-action: none;
}

.image-stage::after {
  content: "";
  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at center,
      transparent 35%,
      rgba(0,0,0,0.38) 100%
    );

  pointer-events: none;
}

.result-image {
  max-width: 100%;
  max-height: 100%;

  user-select: none;

  transform-origin: center center;
  will-change: transform;
}

.image-placeholder {
  padding: 24px;

  color: rgba(255,255,255,0.68);

  text-align: center;
}

.image-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  padding: 14px;

  background:
    rgba(20,18,16,0.92);

  border-top:
    1px solid rgba(255,255,255,0.06);
}

.image-control {
  min-width: 44px;
  min-height: 38px;
  padding: 8px 12px;

  border-radius: 999px;

  background:
    rgba(255,255,255,0.08);

  color: #fff;
}

/* =========================
   CARD BODY
========================= */

.card-body {
  padding: 34px;
}

.center-location {
  margin: 0 0 26px;

  color: var(--gold);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}

.data-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 24px;
}

.data-section {
  position: relative;

  min-width: 0;

  padding: 24px;

  border:
    1px solid rgba(91, 76, 60, 0.16);

  border-radius: 24px;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.6),
      rgba(232,224,213,0.42)
    );
}

.data-section::before {
  content: "";
  position: absolute;
  inset: 10px;

  border:
    1px solid rgba(182,147,95,0.12);

  border-radius: 18px;

  pointer-events: none;
}

.data-section h3 {
  margin: 0 0 16px;

  font-family:
    "Cormorant Garamond",
    serif;

  font-size: 1.45rem;
  font-weight: 600;
}

.field-group + .field-group {
  margin-top: 18px;
}

.field-label {
  margin: 0 0 8px;

  color: var(--muted);

  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* =========================
   PILLS
========================= */

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.pill,
.pill-emph {
  padding: 6px 10px;

  border-radius: 999px;

  border:
    1px solid rgba(91, 76, 60, 0.16);

  background:
    rgba(255,255,255,0.68);

  color: #3b342d;

  font-size: 0.82rem;
}

.pill-emph {
  font-weight: 800;
}

/* =========================
   SIGNALS
========================= */

.signal-list {
  display: grid;
  gap: 10px;

  margin: 0;
}

.signal-row {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;

  gap: 12px;
  align-items: baseline;

  padding-bottom: 10px;

  border-bottom:
    1px dashed rgba(91, 76, 60, 0.18);
}

.signal-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.signal-key,
.signal-key-emph {
  color: #443b34;

  overflow-wrap: anywhere;
}

.signal-key-emph {
  font-weight: 800;
}

.signal-value {
  color: var(--text);

  font-weight: 800;

  overflow-wrap: anywhere;
}

/* =========================
   EMPTY STATE
========================= */

.empty-state {
  position: relative;

  padding: 54px 30px;

  text-align: center;

  color: var(--muted);

  background:
    rgba(255,255,255,0.5);

  border:
    1px dashed rgba(182,147,95,0.32);

  border-radius: var(--radius);
}

/* =========================
   ACCESSIBILITY
========================= */

.sr-only {
  position: absolute;

  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;

  clip: rect(0, 0, 0, 0);

  white-space: nowrap;

  border: 0;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding: 32px 0 72px;
  }

  .hero {
    padding: 54px 24px;
    margin-bottom: 42px;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 4.8rem);
  }

  .search-panel,
  .card-body {
    padding: 20px;
  }

  .keyword-form,
  .data-grid {
    grid-template-columns: 1fr;
  }

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

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

.map-section {
/*   padding: 18px; */
}

#map {
  height: 600px;
  width: 100%;
/*   border-radius: 18px; */
  overflow: hidden;
}
