/* 06: map overlays + HALO panel. Uses tokens from app.css. */
#map-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map-canvas:active { cursor: grabbing; }

#turn-card, #route-card {
  position: absolute; z-index: 2; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); box-shadow: var(--shadow, none);
}
html[data-theme=light] #turn-card, html[data-theme=light] #route-card { box-shadow: 0 8px 30px rgba(0,0,0,.08); }
#turn-card { left: 16px; top: 16px; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; min-width: 190px; }
#turn-card[hidden], #route-card[hidden] { display: none; }
.mp-arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--halo); color: #fff; flex: none; }
.mp-turn-txt { display: flex; flex-direction: column; min-width: 0; }
.mp-dist { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mp-street { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
#route-card { left: 16px; top: 88px; padding: 10px 16px; display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.mp-eta { font-size: 20px; font-weight: 600; color: var(--ok); }
.mp-km, .mp-arr { font-size: 13px; color: var(--text-2); }

/* HALO panel */
.hp { display: flex; flex-direction: column; gap: 14px; color: var(--text); font-size: 13px; }
.hp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hp-brand { display: flex; align-items: baseline; gap: 10px; flex: 1 1 auto; min-width: 0; }
.hp-logo { font-size: 20px; font-weight: 700; letter-spacing: .28em; color: var(--halo); }
.hp-badge { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.hp-status { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text-2); }
.hp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.hp[data-status=ready] .hp-dot { background: var(--ok); }
.hp[data-status=active] .hp-dot { background: var(--halo); box-shadow: 0 0 0 0 var(--halo); animation: hp-pulse 1.8s infinite; }
.hp[data-status=nag] .hp-dot { background: var(--warn); }
.hp[data-status=disengaging] .hp-dot { background: var(--danger); }
.hp[data-status=active] .hp-status-txt { color: var(--halo); }
.hp-engage { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--halo); background: var(--halo); color: #fff; font: 600 15px/1 inherit; cursor: pointer; }
.hp[data-status=active] .hp-engage, .hp[data-status=nag] .hp-engage { background: transparent; color: var(--halo); }
.hp-engage:disabled { opacity: .4; cursor: default; }
.hp-tag { margin: -6px 0 0; color: var(--text-3); font-size: 13px; }

.hp-pipe { display: flex; align-items: stretch; gap: 0; }
.hp-card { flex: 1 1 0; min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.hp-plan { flex: 1.4 1 0; }
.hp-k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.hp-v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hp-decision { font-size: 15px; line-height: 1.3; min-height: 2.6em; }
.hp-s { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.hp-flow { flex: 0 0 22px; align-self: center; height: 2px; background: repeating-linear-gradient(90deg, var(--text-3) 0 4px, transparent 4px 8px); background-size: 8px 2px; opacity: .6; }
.hp[data-status=active] .hp-flow, .hp[data-status=nag] .hp-flow { background-image: repeating-linear-gradient(90deg, var(--halo) 0 4px, transparent 4px 8px); opacity: 1; animation: hp-flow .6s linear infinite; }

.hp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hp-tile { position: relative; margin: 0; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); aspect-ratio: 16 / 9; }
.hp-tile canvas { width: 100%; height: 100%; display: block; background: #000; }
.hp-tile figcaption { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); padding: 2px 7px; border-radius: 999px; letter-spacing: .02em; }
.hp-nofeed { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--text-2); background: var(--surface-2); }
.hp-nofeed[hidden] { display: none; }
.hp-occ canvas { background: var(--surface-2); object-fit: contain; }

.hp-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hp-ctl { flex: 1 1 200px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-height: 52px; }
.hp-toggle { width: 52px; height: 30px; border-radius: 999px; border: 0; background: var(--text-3); position: relative; cursor: pointer; padding: 0; transition: background .15s; }
.hp-toggle span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.hp-toggle.on { background: var(--accent); }
.hp-toggle.on span { transform: translateX(22px); }
.hp-toggle { height: 44px; border: solid transparent; border-width: 7px 0; background-clip: padding-box; } /* 44px tap target, same 52x30 look */
.hp-step { display: flex; align-items: center; gap: 4px; }
.hp-step button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 20px/1 inherit; cursor: pointer; }
.hp-step b { min-width: 24px; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.hp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hp-stats div { display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hp-stats b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hp-stats span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.hp button:focus-visible, #map-ui button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* trip chart + album art mount points */
#trip-chart { display: block; width: 100%; height: 140px; }
.album-art { display: block; border-radius: 10px; aspect-ratio: 1; background: var(--surface-2); }

@keyframes hp-pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes hp-flow { to { background-position: 8px 0; } }
@media (prefers-reduced-motion: reduce) {
  .hp-dot, .hp-flow { animation: none !important; }
  .hp-toggle, .hp-toggle span { transition: none; }
}
@media (max-width: 759px) {
  .hp-pipe { flex-wrap: wrap; gap: 8px; }
  .hp-flow { display: none; }
  .hp-card { flex: 1 1 45%; }
  .hp-plan { flex: 1 1 100%; }
  .hp-grid { grid-template-columns: repeat(2, 1fr); }
  .hp-stats { grid-template-columns: repeat(2, 1fr); }
  #turn-card { left: 8px; top: 8px; min-width: 0; }
  #route-card { left: 8px; top: 72px; }
}
