:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #e2e8f0;
  --dark: #111827;
  --radius: 28px;
  --shadow: 0 22px 50px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { text-decoration: none; }
.oni-map-app { max-width: 1400px; margin: 0 auto; padding: 24px; }
.hero, .controls, .map-panel, .list-panel, .note { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; margin-bottom: 18px; }
.badge { display: inline-flex; background: var(--dark); color: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 800; letter-spacing: .02em; }
h1 { margin: 14px 0 8px; font-size: clamp(30px, 4vw, 56px); line-height: 1; letter-spacing: -0.05em; }
.hero p { margin: 0; color: var(--muted); max-width: 760px; font-size: 17px; line-height: 1.55; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(86px, 1fr)); gap: 12px; min-width: 320px; }
.stats div { background: #f8fafc; border-radius: 20px; padding: 16px; text-align: center; }
.stats strong { display: block; font-size: 28px; }
.stats span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.controls { display: grid; grid-template-columns: 1fr 240px; gap: 14px; padding: 16px; margin-bottom: 18px; }
.field { border: 1px solid var(--soft); border-radius: 20px; display: flex; gap: 10px; align-items: center; padding: 0 16px; min-height: 56px; background: #fff; }
.field input, .field select { width: 100%; border: 0; outline: 0; font: inherit; background: transparent; color: var(--ink); }
.layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 18px; }
.map-panel { overflow: hidden; }
.map-heading, .list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-bottom: 1px solid var(--soft); }
h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.map-heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.map-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 16px; padding: 11px 15px; font-weight: 800; font-size: 14px; transition: transform .2s ease, opacity .2s ease; }
.btn:hover { transform: translateY(-1px); opacity: .92; }
.btn.dark { background: var(--dark); color: #fff; }
.btn.light { background: #f1f5f9; color: var(--ink); }
#mapFrame { display: block; width: 100%; height: 680px; border: 0; }
.list-panel { padding-bottom: 14px; }
#resultBadge { background: #f1f5f9; color: var(--muted); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.cards { max-height: 680px; overflow: auto; padding: 14px; display: grid; gap: 12px; }
.card { width: 100%; border: 1px solid var(--soft); border-radius: 24px; background: #fff; color: var(--ink); padding: 16px; text-align: left; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 16px 28px rgba(15, 23, 42, .12); }
.card.active { background: var(--dark); color: #fff; border-color: var(--dark); box-shadow: 0 18px 40px rgba(15, 23, 42, .24); }
.card-title { display: flex; gap: 12px; align-items: flex-start; }
.marker { width: 36px; height: 36px; border-radius: 14px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; font-weight: 900; color: var(--ink); }
.card.active .marker { background: #fff; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.2; }
.card .city { margin-top: 5px; color: var(--muted); font-size: 14px; }
.card.active .city { color: #cbd5e1; }
.address { margin-top: 12px; background: #f8fafc; border-radius: 18px; padding: 12px; color: #475569; font-size: 14px; line-height: 1.45; }
.card.active .address { background: rgba(255,255,255,.1); color: #f8fafc; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pill { display: inline-flex; border-radius: 999px; padding: 8px 11px; font-size: 12px; font-weight: 900; }
.pill.dark { background: var(--dark); color: #fff; }
.pill.light { background: #f1f5f9; color: #334155; }
.card.active .pill.dark { background: #fff; color: var(--ink); }
.card.active .pill.light { background: rgba(255,255,255,.14); color: #fff; }
.empty { color: var(--muted); padding: 20px; text-align: center; }
.note { margin-top: 18px; padding: 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }

@media (max-width: 1050px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .stats { width: 100%; min-width: 0; }
  .layout { grid-template-columns: 1fr; }
  .cards { max-height: none; }
}
@media (max-width: 700px) {
  .oni-map-app { padding: 12px; }
  .hero, .controls, .map-heading, .list-heading { border-radius: 22px; }
  .controls { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .map-heading { align-items: flex-start; flex-direction: column; }
  .map-actions { width: 100%; }
  .btn { flex: 1; }
  #mapFrame { height: 520px; }
}
