:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --surface: #fffaf1;
  --surface-strong: #ffffff;
  --ink: #1e2528;
  --muted: #657074;
  --line: #ded5c4;
  --accent: #0f766e;
  --accent-strong: #134e4a;
  --accent-soft: #d6f3ee;
  --sun: #d6932d;
  --terra: #b7523a;
  --shadow: 0 18px 45px rgba(47, 42, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.86), rgba(244, 240, 232, 0.94)),
    repeating-linear-gradient(90deg, rgba(15, 118, 110, 0.05) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(0deg, rgba(183, 82, 58, 0.05) 0 1px, transparent 1px 84px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 24px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.icon-button {
  border: 1px solid var(--accent-strong);
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 1.35rem;
}

.primary-button:disabled,
.icon-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.side-panel,
.map-stage,
.place-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.92);
  box-shadow: var(--shadow);
}

.side-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.status-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.status-block p:last-child {
  margin: 2px 0 0;
  font-weight: 800;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 6px rgba(214, 147, 45, 0.16);
}

.status-dot.is-loading {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(15, 118, 110, 0.16);
}

.status-dot.is-error {
  background: var(--terra);
  box-shadow: 0 0 0 6px rgba(183, 82, 58, 0.16);
}

.focus-place {
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.focus-image {
  min-height: 180px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.72), rgba(214, 147, 45, 0.58)),
    linear-gradient(45deg, transparent 0 40%, rgba(255, 255, 255, 0.32) 40% 42%, transparent 42% 100%);
  background-size: cover;
  background-position: center;
}

.focus-place > div:last-child {
  padding: 14px;
}

.focus-place h2 {
  margin: 6px 0;
  font-size: 1.45rem;
  line-height: 1.12;
}

.focus-place p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.focus-description {
  margin: 10px 0 0;
  color: var(--ink);
  line-height: 1.45;
}

.detail-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.detail-stack > div {
  display: grid;
  gap: 6px;
}

.detail-stack strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.detail-stack ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.35;
}

.map-stage {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255, 250, 241, 0.68), rgba(214, 243, 238, 0.86)),
    repeating-linear-gradient(30deg, rgba(15, 118, 110, 0.12) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(120deg, rgba(183, 82, 58, 0.11) 0 1px, transparent 1px 52px);
}

.radar {
  position: absolute;
  inset: 24px;
  border-radius: 8px;
}

.radar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.radar-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ring-one {
  width: 28%;
  aspect-ratio: 1;
}

.ring-two {
  width: 52%;
  aspect-ratio: 1;
}

.ring-three {
  width: 76%;
  aspect-ratio: 1;
}

.origin-marker,
.place-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.origin-marker {
  width: 18px;
  height: 18px;
  background: var(--terra);
  box-shadow: 0 0 0 10px rgba(183, 82, 58, 0.16), 0 0 0 20px rgba(183, 82, 58, 0.08);
}

.place-marker {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid #ffffff;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(15, 76, 72, 0.22);
}

.place-marker.is-active {
  width: 44px;
  height: 44px;
  background: var(--sun);
  box-shadow: 0 0 0 8px rgba(214, 147, 45, 0.2), 0 14px 28px rgba(109, 74, 23, 0.26);
  z-index: 2;
}

.radar-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.radar-caption span {
  color: var(--muted);
  font-weight: 800;
}

.places-section {
  padding-top: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

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

.place-card {
  overflow: hidden;
  background: var(--surface-strong);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.place-card.is-active {
  border-color: var(--sun);
  box-shadow: 0 0 0 3px rgba(214, 147, 45, 0.18), var(--shadow);
  transform: translateY(-2px);
}

.place-photo {
  min-height: 150px;
  background:
    linear-gradient(135deg, rgba(19, 78, 74, 0.86), rgba(214, 147, 45, 0.62)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 14px);
  background-size: cover;
  background-position: center;
}

.place-content {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.place-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.place-title-row h3 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.rating-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.vicinity {
  min-height: 38px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.place-summary {
  display: -webkit-box;
  min-height: 68px;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.place-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.open-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #f4f0e8;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.open-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.open-state.is-open {
  border-color: rgba(15, 118, 110, 0.24);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.open-state.is-closed {
  border-color: rgba(183, 82, 58, 0.22);
  background: rgba(183, 82, 58, 0.1);
  color: var(--terra);
}

.is-empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 250, 241, 0.7);
}

@media (max-width: 980px) {
  .workspace,
  .place-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-panel {
    grid-column: 1 / -1;
  }

  .map-stage {
    grid-column: 1 / -1;
    min-height: 460px;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .primary-button {
    flex: 1;
  }

  .workspace,
  .place-grid {
    grid-template-columns: 1fr;
  }

  .map-stage {
    min-height: 390px;
  }

  .radar {
    inset: 14px;
  }

  .radar-caption {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}
