/* hymaps-layers.css — unified live-layer control (FAB + grouped toggle panel)
 * Lead-owned, paired with js/shared/hymaps-layers.js. Theme-aware: clean iOS
 * glass in light, neon cyberpunk accents in dark ([data-hymaptype="dark"]).
 */

/* ── floating action button ───────────────────────────────────────────────── */
.hml-fab{
  position:fixed; left:14px; bottom:104px; z-index:1400;
  width:46px; height:46px; border-radius:14px; border:1px solid var(--border,rgba(0,0,0,.12));
  background:var(--bg-card,rgba(255,255,255,.92)); color:var(--text,#1a2230);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  box-shadow:0 6px 20px rgba(0,0,0,.18); backdrop-filter:blur(14px) saturate(160%);
  -webkit-backdrop-filter:blur(14px) saturate(160%); font-size:22px; transition:transform .15s ease, box-shadow .15s ease;
}
.hml-fab:hover{ transform:translateY(-1px); }
.hml-fab:active{ transform:scale(.96); }
.hml-fab.is-open{ background:var(--accent,#2f6bff); color:#fff; border-color:transparent; }
.hml-fab-count{
  position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; padding:0 4px;
  border-radius:9px; background:var(--accent,#2f6bff); color:#fff; font-size:11px; font-weight:700;
  line-height:18px; text-align:center; box-shadow:0 2px 6px rgba(0,0,0,.3);
}

/* ── backdrop ─────────────────────────────────────────────────────────────── */
.hml-backdrop{
  position:fixed; inset:0; z-index:1399; background:rgba(6,10,18,.28);
  opacity:0; pointer-events:none; transition:opacity .18s ease;
}
.hml-backdrop.show{ opacity:1; pointer-events:auto; }

/* ── panel ────────────────────────────────────────────────────────────────── */
.hml-panel{
  position:fixed; left:14px; bottom:160px; z-index:1401; width:300px; max-width:calc(100vw - 28px);
  max-height:min(62vh,560px); display:flex; flex-direction:column;
  border-radius:18px; border:1px solid var(--border,rgba(0,0,0,.12));
  background:var(--bg-card,rgba(255,255,255,.96)); color:var(--text,#1a2230);
  box-shadow:0 18px 50px rgba(0,0,0,.28); backdrop-filter:blur(20px) saturate(170%);
  -webkit-backdrop-filter:blur(20px) saturate(170%);
  transform:translateY(10px) scale(.98); opacity:0; pointer-events:none;
  transform-origin:bottom left; transition:opacity .18s ease, transform .18s ease;
}
.hml-panel.show{ transform:translateY(0) scale(1); opacity:1; pointer-events:auto; }
.hml-hd{ display:flex; align-items:center; justify-content:space-between; padding:13px 14px 9px; }
.hml-hd-title{ display:flex; align-items:center; gap:8px; font-weight:700; font-size:15px; }
.hml-x{ border:0; background:transparent; color:var(--muted,#8a93a6); cursor:pointer; font-size:20px; padding:2px; border-radius:8px; }
.hml-x:hover{ color:var(--text,#1a2230); background:var(--bg-card-hover,rgba(0,0,0,.05)); }
.hml-body{ overflow-y:auto; padding:2px 8px 8px; -webkit-overflow-scrolling:touch; }
.hml-ft{ padding:8px 14px 12px; font-size:11px; color:var(--muted,#8a93a6); border-top:1px solid var(--border,rgba(0,0,0,.08)); }

/* ── groups + rows ────────────────────────────────────────────────────────── */
.hml-group{ margin:6px 0; }
.hml-group-hd{ display:flex; align-items:center; gap:7px; padding:6px 8px; font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:.04em; color:var(--muted,#8a93a6); }
.hml-group-list{ display:flex; flex-direction:column; gap:3px; }
.hml-row{
  display:flex; align-items:center; gap:11px; width:100%; text-align:left; cursor:pointer;
  padding:9px 10px; border-radius:12px; border:1px solid transparent; background:transparent;
  color:var(--text,#1a2230); font:inherit; transition:background .12s ease, border-color .12s ease;
}
.hml-row:hover{ background:var(--bg-card-hover,rgba(0,0,0,.04)); }
.hml-row.is-on{ background:var(--bg-card-hover,rgba(47,107,255,.08)); border-color:var(--accent,#2f6bff); }
.hml-row-ic{ flex:0 0 auto; width:30px; height:30px; border-radius:9px; display:flex; align-items:center; justify-content:center;
  font-size:18px; background:var(--bg-surface,rgba(0,0,0,.05)); color:var(--muted,#6b7280); }
.hml-row.is-on .hml-row-ic{ background:var(--accent,#2f6bff); color:#fff; }
.hml-row-tx{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; line-height:1.25; font-size:13.5px; font-weight:600; }
.hml-row-attr{ font-size:10.5px; font-weight:500; color:var(--muted,#8a93a6); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* iOS-style switch */
.hml-sw{ flex:0 0 auto; width:38px; height:22px; border-radius:11px; background:var(--border,rgba(0,0,0,.18)); position:relative; transition:background .16s ease; }
.hml-sw-knob{ position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); transition:left .16s ease; }
.hml-row.is-on .hml-sw{ background:var(--accent,#2f6bff); }
.hml-row.is-on .hml-sw-knob{ left:18px; }

/* ── dark / cyberpunk ─────────────────────────────────────────────────────── */
[data-hymaptype="dark"] .hml-fab,
[data-hymaptype="dark"] .hml-panel{
  background:rgba(8,14,26,.86); color:#dbe7ff; border-color:rgba(58,201,255,.35);
  box-shadow:0 0 0 1px rgba(58,201,255,.12), 0 16px 44px rgba(0,0,0,.6);
}
[data-hymaptype="dark"] .hml-fab.is-open{ background:rgba(0,255,163,.18); color:#c9fff0; border-color:rgba(0,255,163,.5); }
[data-hymaptype="dark"] .hml-fab-count,
[data-hymaptype="dark"] .hml-row.is-on .hml-sw{ background:#00ffa3; color:#04221a; box-shadow:0 0 8px rgba(0,255,163,.6); }
[data-hymaptype="dark"] .hml-row-ic{ background:rgba(58,201,255,.12); color:#8ee8ff; }
[data-hymaptype="dark"] .hml-row.is-on{ background:rgba(0,255,163,.10); border-color:rgba(0,255,163,.55); }
[data-hymaptype="dark"] .hml-row.is-on .hml-row-ic{ background:rgba(0,255,163,.22); color:#c9fff0; box-shadow:0 0 10px rgba(0,255,163,.35); }
[data-hymaptype="dark"] .hml-ft{ border-top-color:rgba(58,201,255,.18); }

/* ── mobile: dock the panel to the bottom sheet ───────────────────────────── */
@media (max-width:520px){
  .hml-fab{ bottom:90px; }
  .hml-panel{ left:8px; right:8px; bottom:8px; width:auto; max-width:none; max-height:72vh; transform-origin:bottom center; }
}
@media (prefers-reduced-motion: reduce){
  .hml-fab, .hml-panel, .hml-backdrop, .hml-sw, .hml-sw-knob{ transition:none; }
}
