:root {
  --bg: #05070a;
  --panel: rgba(20, 24, 31, 0.9);
  --soft: #1d2430;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6faff;
  --muted: #95a3b8;
  --blue: #24d7ff;
  --green: #6cff8d;
  --danger: #ff5a66;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  background: rgba(5, 7, 10, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
nav strong { color: var(--blue); font-size: 22px; }
.brand-block { display: grid; gap: 3px; }
.developer-link { display: grid; gap: 1px; width: fit-content; }
.developer-link span { color: var(--muted); font-size: 12px; font-weight: 850; }
.developer-link small { color: var(--green); font-size: 11px; font-weight: 850; }
.developer-link:hover span,
.developer-link:hover small { color: var(--blue); }
nav div { display: flex; flex-wrap: wrap; gap: 10px; }
nav a { padding: 9px 12px; border-radius: 12px; background: var(--soft); font-weight: 800; }

main { display: grid; gap: 22px; padding: 22px; }
.hero {
  min-height: 72vh;
  display: grid;
  align-items: end;
  border-radius: 22px;
  padding: 26px;
  background:
    linear-gradient(rgba(5, 7, 10, 0.08), rgba(5, 7, 10, 0.96)),
    url("https://images.unsplash.com/photo-1558981403-c5f9899a28bc?w=1800&auto=format&fit=crop");
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}
.hero > div { max-width: 760px; }
h1 { margin: 0; font-size: clamp(48px, 10vw, 108px); line-height: 0.95; letter-spacing: 0; }
h2 { margin: 6px 0 8px; font-size: 28px; }
p { color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--green); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 900; font-size: 12px; }
.summer-line {
  width: fit-content;
  margin: 16px 0 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(36, 215, 255, 0.16);
  border: 1px solid rgba(36, 215, 255, 0.38);
  color: var(--text);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 950;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.button {
  border: 0;
  min-height: 48px;
  border-radius: 14px;
  padding: 0 18px;
  background: var(--blue);
  color: #001116;
  font-weight: 950;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.secondary { background: var(--soft); color: var(--text); border: 1px solid var(--line); }
.hidden { display: none !important; }

.workspace, .split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr); gap: 18px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  backdrop-filter: blur(18px);
}
.map {
  min-height: 680px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--soft);
}
#googleMap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1;
  filter: saturate(0.95) contrast(1.05);
  touch-action: pan-x pan-y;
}
.map-label {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 3;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(12px);
}
.map-label span { font-weight: 950; color: var(--text); }
.map-label small { color: var(--muted); }
.map-help {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  max-width: min(520px, calc(100% - 32px));
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(5, 7, 10, 0.72);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
#preview img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; background: var(--soft); }
.search-panel { display: grid; gap: 16px; }
.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.search-field { color: var(--muted); font-weight: 850; }
.state-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}
.state-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
}
.state-button.active {
  background: var(--blue);
  color: #001116;
  border-color: var(--blue);
}
.state-button mark {
  display: block;
  color: inherit;
  background: transparent;
  font-size: 10px;
  opacity: 0.74;
  margin-top: 2px;
}
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 15px; }
.card strong { display: block; margin-top: 10px; font-size: 18px; }
.card small { color: var(--muted); }
.empty {
  grid-column: 1 / -1;
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
}
form { display: grid; gap: 12px; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 800; }
input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  padding: 0 12px;
}
.check { display: flex; align-items: center; gap: 10px; color: var(--text); }
.check input { min-height: auto; }
.fine { font-size: 13px; }
.success-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(108, 255, 141, 0.12);
  border: 1px solid rgba(108, 255, 141, 0.34);
  color: var(--text);
  font-weight: 850;
}
.success-note.warning {
  background: rgba(255, 176, 32, 0.14);
  border-color: rgba(255, 176, 32, 0.38);
}
.photo-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.photo-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--soft);
}
.stat, .report { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.stat strong { color: var(--blue); font-size: 22px; }
.report button { border: 1px solid var(--line); border-radius: 12px; background: var(--soft); color: var(--text); padding: 9px 12px; font-weight: 850; }
.ai-agent {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  justify-items: end;
  gap: 10px;
}
.ai-toggle {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #001708;
  font-weight: 950;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.ai-panel {
  width: min(380px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 110px));
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(20, 24, 31, 0.96);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
}
.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ai-header div { display: grid; gap: 3px; }
.ai-header strong { color: var(--text); }
.ai-header span { color: var(--muted); font-size: 12px; font-weight: 800; }
.ai-header button,
.ai-prompts button,
.ai-input-row button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
  padding: 9px 10px;
  font-weight: 850;
  cursor: pointer;
}
.ai-messages {
  display: grid;
  align-content: start;
  gap: 9px;
  overflow: auto;
  padding-right: 4px;
}
.agent-message,
.user-message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.45;
}
.agent-message {
  background: rgba(36, 215, 255, 0.13);
  border: 1px solid rgba(36, 215, 255, 0.28);
  color: var(--text);
}
.user-message {
  justify-self: end;
  max-width: 88%;
  background: rgba(108, 255, 141, 0.13);
  border: 1px solid rgba(108, 255, 141, 0.28);
  color: var(--text);
}
.ai-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-prompts button { font-size: 12px; }
.ai-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.ai-input-row input {
  min-height: 44px;
}

@media (max-width: 900px) {
  nav { align-items: flex-start; flex-direction: column; }
  main { padding: 14px; }
  .workspace, .split, .cards { grid-template-columns: 1fr; }
  .search-row { grid-template-columns: 1fr; }
  .state-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .photo-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map { min-height: 560px; }
  .ai-agent { right: 12px; bottom: 12px; }
}

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