:root {
  color-scheme: dark;
  --bg: #090d12;
  --panel: #11171e;
  --panel-2: #171f28;
  --line: #29313a;
  --text: #f5f7f8;
  --muted: #8e9aa6;
  --accent: #ff5a3d;
  --accent-soft: rgba(255,90,61,.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, label { font: inherit; }
button, .import-button { color: inherit; }
button { border: 0; }
.topbar { height: 64px; display: flex; align-items: center; gap: 28px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(10,14,19,.96); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; letter-spacing: .06em; }
.brand-logo { width: 38px; height: 38px; margin: -5px -3px -5px -6px; object-fit: contain; filter: drop-shadow(0 2px 4px #000); }
.brand strong { font-size: .9rem; }
.brand-sub { font: 600 .64rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); padding-left: 9px; border-left: 1px solid var(--line); }
.sync-status { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: #a8b2bc; font: 700 .66rem/1 ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.sync-status i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,.65); }
.sync-status.syncing i { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.65); animation: sync-pulse 1s infinite alternate; }
.sync-status.offline i { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,.65); }
@keyframes sync-pulse { to { opacity: .35; } }
.toolbar { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tool, .fit-button, .icon-button, .mobile-list { background: transparent; cursor: pointer; border-radius: 7px; min-height: 38px; }
.tool { padding: 0 13px; color: var(--muted); font-size: .87rem; font-weight: 650; }
.tool.active { color: white; background: var(--panel-2); box-shadow: inset 0 0 0 1px #303946; }
.tool-icon { color: var(--accent); font-size: 1.15rem; margin-right: 5px; }
.divider { width: 1px; height: 24px; background: var(--line); margin: 0 8px; }
.icon-button { width: 38px; font-size: 1.35rem; color: var(--muted); }
.icon-button:hover, .fit-button:hover { background: var(--panel-2); color: white; }
#zoomLabel { width: 55px; text-align: center; font: 600 .72rem/1 ui-monospace, Consolas, monospace; color: var(--muted); }
.fit-button { color: var(--muted); padding: 0 10px; font-size: .8rem; }
.mobile-list { display: none; margin-left: auto; padding: 0 11px; background: var(--panel-2); }
.mobile-list span { background: var(--accent); border-radius: 10px; padding: 1px 6px; margin-left: 4px; }
.workspace { height: calc(100% - 64px); display: grid; grid-template-columns: minmax(0, 1fr) 350px; }
.map-viewport { position: relative; overflow: hidden; background: #080b0e; touch-action: none; user-select: none; }
.map-viewport::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5; box-shadow: inset 0 0 80px rgba(0,0,0,.55); }
.map-viewport.adding { cursor: crosshair; }
.map-viewport.panning { cursor: grab; }
.map-viewport.dragging { cursor: grabbing; }
.map-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
#mapImage { display: block; width: 6144px; height: 9216px; max-width: none; pointer-events: none; }
#markers { position: absolute; inset: 0; pointer-events: none; }
.marker { --pin: var(--accent); position: absolute; width: 32px; height: 42px; padding: 0; background: transparent; transform: translate(-50%, -100%) scale(var(--marker-scale, 1)); transform-origin: 50% 100%; pointer-events: auto; cursor: grab; filter: drop-shadow(0 3px 4px rgba(0,0,0,.65)); }
.marker::before { content: ""; position: absolute; width: 25px; height: 25px; left: 3px; top: 2px; border-radius: 50% 50% 50% 0; background: var(--pin); transform: rotate(-45deg); border: 3px solid #fff; }
.marker::after { content: ""; position: absolute; width: 7px; height: 7px; left: 12px; top: 11px; background: white; border-radius: 50%; }
.marker.tsa-logo-marker::before, .marker.tsa-logo-marker::after { display: none; }
.marker-logo { position: absolute; width: 54px; height: 54px; left: -11px; bottom: 0; object-fit: contain; pointer-events: none; filter: drop-shadow(0 3px 5px #000); }
.marker.tsa-logo-marker .marker-label { left: 50px; }
.marker.selected { z-index: 4; filter: drop-shadow(0 0 8px var(--pin)) drop-shadow(0 4px 5px #000); }
.marker:focus-visible { outline: 3px solid white; outline-offset: 4px; border-radius: 50%; }
.marker-label { position: absolute; left: 38px; top: 2px; padding: 6px 9px; border-radius: 5px; background: rgba(8,11,15,.9); border: 1px solid color-mix(in srgb, var(--pin) 75%, white); color: white; font: 800 13px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .02em; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.45); }
.crosshair { opacity: 0; position: absolute; width: 28px; height: 28px; pointer-events: none; z-index: 7; transform: translate(-50%,-50%); transition: opacity .12s; }
.adding .crosshair { opacity: .8; }
.crosshair i, .crosshair b { position: absolute; background: white; box-shadow: 0 0 2px #000; }
.crosshair i { width: 28px; height: 1px; top: 14px; }
.crosshair b { width: 1px; height: 28px; left: 14px; }
.map-hint, .coord-readout { position: absolute; bottom: 16px; z-index: 8; background: rgba(10,14,19,.86); border: 1px solid #313a44; backdrop-filter: blur(12px); color: var(--muted); }
.map-hint { left: 16px; border-radius: 8px; padding: 8px 10px; font-size: .75rem; }
.map-hint span { margin: 0 6px; opacity: .45; }
kbd { color: white; font: 600 .7rem/1 ui-monospace, Consolas, monospace; }
.coord-readout { right: 16px; border-radius: 6px; padding: 8px 10px; font: 600 .72rem/1 ui-monospace, Consolas, monospace; }
.panel { height: 100%; min-height: 0; overflow: hidden; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; z-index: 15; }
.panel-head { flex: 0 0 auto; padding: 22px 20px 17px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.eyebrow { color: var(--accent); font: 700 .67rem/1 ui-monospace, Consolas, monospace; letter-spacing: .16em; margin: 0 0 8px; }
h1 { font-size: 1.15rem; line-height: 1.1; margin: 0; }
h1 span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.close-panel { display: none; background: none; font-size: 1.5rem; color: var(--muted); }
.group-picker { flex: 0 0 auto; padding: 15px 16px; border-bottom: 1px solid var(--line); background: #0d1319; }
.group-picker > p, .group-section-title { margin: 0 0 10px; color: var(--muted); font: 700 .66rem/1 ui-monospace, Consolas, monospace; letter-spacing: .12em; }
#groupButtons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.group-chip { --group: var(--accent); min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 7px; border: 1px solid #303945; background: var(--panel-2); color: #c8d0d7; cursor: pointer; font-size: .82rem; font-weight: 750; text-align: left; }
.group-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--group); box-shadow: 0 0 0 1px rgba(255,255,255,.34), 0 0 8px color-mix(in srgb, var(--group) 70%, transparent); }
.group-chip .group-logo { width: 24px; height: 24px; margin: -2px -3px -2px -5px; object-fit: contain; filter: drop-shadow(0 1px 2px #000); }
.group-chip:hover { color: white; border-color: #4b5865; }
.group-chip.active { color: white; border-color: var(--group); background: color-mix(in srgb, var(--group) 17%, #111820); box-shadow: inset 3px 0 0 var(--group); }
.new-ping-card { margin: 20px; padding: 32px 20px; text-align: center; border: 1px dashed #34404c; border-radius: 10px; background: rgba(255,255,255,.015); }
.new-ping-card.hidden { display: none; }
.new-ping-card p { color: var(--muted); font-size: .82rem; line-height: 1.5; margin: 8px auto 0; max-width: 220px; }
.pulse-dot { width: 13px; height: 13px; margin: 0 auto 18px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 8px var(--accent-soft), 0 0 24px var(--accent); }
.ping-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 10px; }
.group-section { margin-bottom: 16px; }
.group-section-title { display: flex; align-items: center; gap: 7px; margin: 7px 8px; }
.group-section-title i { width: 8px; height: 8px; border-radius: 50%; background: var(--group); }
.group-section-title .section-logo { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 1px 2px #000); }
.group-section-title span { margin-left: auto; color: #d9dfe4; }
.ping-row { display: grid; grid-template-columns: 26px minmax(0,1fr) 28px; gap: 10px; padding: 11px 9px; border: 1px solid transparent; border-radius: 8px; margin-bottom: 5px; cursor: pointer; }
.ping-row:hover { background: var(--panel-2); }
.ping-row.selected { background: var(--accent-soft); border-color: rgba(255,90,61,.38); }
.color-dot { width: 13px; height: 13px; margin: 7px 0 0 3px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot) 18%, transparent); }
.row-logo { width: 25px; height: 25px; margin-top: 1px; object-fit: contain; filter: drop-shadow(0 1px 2px #000); }
.ping-main { min-width: 0; }
.group-change { display: block; }
.group-change > span { display: block; margin: 0 0 5px 2px; color: var(--muted); font: 700 .62rem/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.ping-group-select { width: 100%; min-height: 40px; padding: 7px 32px 7px 10px; background: #17212b; color: white; border: 1px solid #3b4855; border-radius: 7px; font-size: .88rem; font-weight: 750; cursor: pointer; }
.ping-group-select:hover { border-color: #647383; background: #1d2934; }
.ping-group-select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, white); outline-offset: 2px; border-color: var(--accent); background: #0d1218; }
.ping-group-select option { background: #11171e; color: white; }
.ping-coords { margin: 4px 4px 0; color: var(--muted); font: 500 .7rem/1.3 ui-monospace, Consolas, monospace; }
.delete-ping { align-self: center; width: 28px; height: 28px; background: transparent; color: #6f7b87; border-radius: 5px; cursor: pointer; font-size: 1rem; }
.delete-ping:hover { color: white; background: #4a2220; }
.panel-footer { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 12px; border-top: 1px solid var(--line); background: var(--panel); }
.panel-footer button, .import-button { min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--panel-2); color: #c2cad1; cursor: pointer; font-size: .78rem; font-weight: 650; }
.panel-footer button:hover, .import-button:hover { color: white; background: #222c36; }
.panel-footer .primary-export { grid-column: 1 / -1; min-height: 54px; flex-direction: column; gap: 4px; color: white; background: var(--accent); box-shadow: 0 8px 20px rgba(255,90,61,.18); }
.panel-footer .primary-export:hover { background: #ff6b51; }
.panel-footer .primary-export:disabled { cursor: wait; opacity: .66; }
.primary-export strong { font-size: .84rem; }
.primary-export span { font: 600 .66rem/1 ui-monospace, Consolas, monospace; opacity: .8; }
.panel-footer .danger { grid-column: 1 / -1; color: #e89085; background: transparent; border: 1px solid #3a2a2a; }
.import-button input { display: none; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 40; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 14px; border-radius: 7px; background: #f2f4f5; color: #10151a; font-size: .8rem; font-weight: 700; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 820px) {
  .topbar { height: 58px; padding: 0 12px; }
  .brand-sub, .tool span + span, .divider, .fit-button { display: none; }
  .sync-status span { display: none; }
  .toolbar { justify-content: flex-end; gap: 1px; }
  .tool { width: 39px; padding: 0; font-size: 0; }
  .tool-icon { font-size: 1.2rem; margin: 0; }
  #zoomLabel { width: 48px; }
  .mobile-list { display: block; font-size: .75rem; }
  .workspace { height: calc(100% - 58px); display: block; }
  .map-viewport { width: 100%; height: 100%; }
  .panel { position: fixed; inset: 58px 0 0 15%; transform: translateX(105%); transition: transform .2s ease; box-shadow: -12px 0 40px #000; }
  .panel.open { transform: translateX(0); }
  .close-panel { display: block; }
  .map-hint { max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .coord-readout { top: 12px; bottom: auto; right: 12px; }
}
@media (max-width: 470px) {
  .brand strong { font-size: .78rem; }
  .sync-status { display: none; }
  .icon-button { width: 32px; }
  .panel { left: 4%; }
  .map-hint span, .map-hint kbd:nth-of-type(n+2) { display: none; }
}
