:root {
  --accent: #0E7C86;
  --accent-ink: #ffffff;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #18212b;
  --muted: #5d6b78;
  --line: #e3e8ed;
  --ok: #128a4b;
  --warn: #b26a00;
  --info: #3d5afe;
  --radius: 12px;
  --panel-w: 400px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; }

#app { display: flex; height: 100%; min-height: 480px; }
#panel {
  width: var(--panel-w); flex: 0 0 var(--panel-w);
  background: var(--bg); overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  border-right: 1px solid var(--line);
}
#map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #dfe6ea; }

#brand { display: flex; gap: 12px; align-items: center; padding: 4px 2px; }
#brand-logo { height: 40px; width: auto; }
#brand-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
#brand-subtitle { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
body.embed-compact #brand { display: none; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-s { gap: 6px; }
.fineprint { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0 8px; }

/* Google Places autocomplete element */
gmp-place-autocomplete, #search-slot input {
  width: 100%; display: block;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; color-scheme: light;
}
#search-slot input { padding: 11px 12px; }
#search-slot input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Layer list */
#layer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
#layer-list li label {
  display: grid; grid-template-columns: 18px 14px 1fr auto; gap: 10px; align-items: center;
  padding: 7px 4px; border-radius: 8px; cursor: pointer;
}
#layer-list li label:hover { background: var(--bg); }
#layer-list input { margin: 0; accent-color: var(--accent); width: 16px; height: 16px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); }
.swatch.line { height: 4px; border-radius: 2px; border: 0; }
.tech { font-size: 12px; color: var(--muted); }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--ink); }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* Results */
#results:empty { display: none; }
#results { display: flex; flex-direction: column; gap: 10px; }
.result-head { display: flex; gap: 10px; align-items: flex-start; }
.result-head .icon { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; }
.result-head .icon.ok { background: var(--ok); }
.result-head .icon.no { background: #8794a0; }
.result-head h2 { font-size: 16px; }
.result-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; word-break: break-word; }

.provider { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.provider > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-left: 5px solid var(--pc, var(--accent)); }
.provider > header h3 { font-size: 15px; flex: 1; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.live { background: #e3f5ea; color: var(--ok); }
.badge.build { background: #fff3e0; color: var(--warn); }
.badge.planned { background: #eef0ff; color: var(--info); }
.badge.near { background: #eef0ff; color: var(--info); }
.badge.promo { background: var(--accent); color: var(--accent-ink); }
.provider .note { margin: 0; padding: 0 14px 10px 19px; font-size: 13px; color: var(--muted); }
.products { list-style: none; margin: 0; padding: 0 10px 10px; display: grid; gap: 8px; }
.product {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfd;
}
.product .pname { font-weight: 600; font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.product .speed { font-size: 13px; color: var(--muted); }
.product .price { text-align: right; font-weight: 700; font-size: 17px; white-space: nowrap; }
.product .price small { font-weight: 500; font-size: 12px; color: var(--muted); }
.product .meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.product .btn { grid-column: 1 / -1; }

.btn { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

.segment { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 12px; padding: 4px; background: var(--bg); border-radius: 10px; }
.segment button { border: 0; background: transparent; padding: 8px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.segment button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.product[hidden] { display: none; }

/* Lead form */
.lead { display: grid; gap: 10px; }
.lead-title { font-size: 16px; }
.lead-summary { margin: -4px 0 2px; color: var(--muted); font-size: 13.5px; }
.lead label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.lead input, .lead textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); width: 100%; }
.lead input:focus, .lead textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.lead .consent { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--muted); }
.lead .consent input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { color: #c62828; margin: 0; font-size: 13px; }
.success { text-align: center; padding: 22px 14px; }
.success .icon { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 22px; }

#map-status {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(24,33,43,.88); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 13px; z-index: 5;
  pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
#map-status.error { background: #c62828; pointer-events: auto; }
body.pin-mode #map { cursor: crosshair; }

.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.iw { font: 13px/1.4 Inter, system-ui, sans-serif; color: var(--ink); max-width: 240px; }
.iw b { display: block; font-size: 14px; }

/* Narrow iframes / phones: map on top, results below */
@media (max-width: 760px) {
  #app { flex-direction: column-reverse; }
  #panel { width: auto; flex: 1 1 auto; border-right: 0; border-top: 1px solid var(--line); padding: 12px 16px; }
  #map-wrap { flex: 0 0 42%; min-height: 240px; }
  .grid2 { grid-template-columns: 1fr; }
  #brand-title { font-size: 17px; }
}
