  html, body { height: 100%; margin: 0; }
  body { display: flex; flex-direction: column; font: 14px/1.4 system-ui, sans-serif; }
  #topbar {
    flex: none; position: relative; background: #1b2430; color: #fff;
    padding: 16px 20px; font-size: 20px; font-weight: 500;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
  }
  #about-btn {
    flex: none; width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid #4a5568; background: none; color: #cfd8e3;
    font: 600 15px/1 system-ui, sans-serif; cursor: pointer;
  }
  #about-btn:hover, #about-btn[aria-expanded="true"] { background: #2c3846; color: #fff; }
  #about {
    display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 1200;
    width: 370px; max-width: calc(100vw - 40px); /* 40px = the header's own side padding */
    background: #1e1e1e; color: #ddd; border-radius: 8px; padding: 4px 16px 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
    font: 13px/1.5 system-ui, sans-serif; font-weight: 400;
    max-height: 70vh; overflow-y: auto;
  }
  #about.open { display: block; }
  #about h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #8fa3b8; margin: 14px 0 4px; }
  #about p { margin: 0 0 6px; }
  #about ul { margin: 0; padding-left: 18px; }
  #about a { color: #6db3f2; }
  #infobar {
    flex: none; background: #2196f3; color: #fff; padding: 10px 20px;
  }
  #stage { position: relative; flex: 1; min-height: 0; }
  #map { height: 100%; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  #panel {
    position: absolute; top: 12px; left: 12px; z-index: 1000;
    background: #1e1e1e; color: #eee; border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.4);
    min-width: 270px; max-width: 330px;
    font: 14px/1.4 system-ui, sans-serif;
  }
  #panel-header { padding: 10px 14px; font-weight: 600; border-bottom: 1px solid #333; }
  #points { max-height: 65vh; overflow-y: auto; }
  #points:empty::after {
    content: "Long-press the map to add a point";
    display: block; padding: 12px 14px; color: #888; font-size: 13px;
  }
  #toasts {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    z-index: 1100; display: flex; flex-direction: column; gap: 8px; align-items: center;
  }
  .toast { background: #333; color: #fff; padding: 8px 14px; border-radius: 6px; font: 13px system-ui, sans-serif; opacity: .95; }
  .toast.warn { background: #8a6d00; }
  .toast.error { background: #8a1f1f; }
  .row { padding: 8px 12px; border-bottom: 1px solid #2a2a2a; }
  .row:last-child { border-bottom: none; }
  .row-main { display: flex; align-items: center; gap: 8px; }
  .row-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .coords { color: #9ab; font-size: 12px; }
  .rename { cursor: text; }
  .rename:hover { text-decoration: underline dotted; text-underline-offset: 2px; }
  .rename-input {
    width: 100%; box-sizing: border-box; margin-bottom: 2px;
    background: #2a2a2a; border: 1px solid #4da3ff; color: #fff;
    border-radius: 4px; padding: 2px 6px; font: 600 14px system-ui, sans-serif;
  }
  .pt-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: #2196f3; color: #fff; font-weight: 700; font-size: 12px; flex: none;
  }
  .pt-badge.off { background: #777; }
  .btn {
    background: none; border: none; color: #bbb; cursor: pointer;
    font-size: 15px; padding: 2px 6px; border-radius: 4px;
  }
  .btn:hover { background: #333; color: #fff; }
  .settings { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
  .field { display: flex; flex-direction: column; font-size: 11px; color: #aaa; gap: 2px; }
  .field input {
    width: 72px; background: #2a2a2a; border: 1px solid #444; color: #eee;
    border-radius: 4px; padding: 3px 6px; font-size: 13px;
  }
  .pt-icon { background: none; border: none; }
  .pt-icon .pt-badge { width: 26px; height: 26px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); box-sizing: border-box; }
  .rep-icon { background: none; border: none; }
  /* shared by the map marker and the panel row, so the two always match */
  .antenna svg { width: 15px; height: 15px; display: block; }
  .antenna svg path, .antenna svg circle { stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; }
  .antenna svg circle.dot { fill: #fff; stroke: none; }
  .rep-badge {
    width: 26px; height: 26px; border-radius: 50%; box-sizing: border-box;
    background: #5b7d8f; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
  }
  .rep-badge.on { background: #4caf50; }
  .pt-badge.rep { background: #5b7d8f; }
  .pt-badge.rep.on { background: #4caf50; }
  .pt-badge.antenna svg { width: 14px; height: 14px; }
  .popup-controls { font: 13px/1.5 system-ui, sans-serif; min-width: 190px; }
  .popup-controls .settings { margin: 8px 0; }
  .popup-controls .btn.danger { color: #d33; }
  .spinner {
    display: none; width: 14px; height: 14px; flex: none;
    border: 2px solid #555; border-top-color: #4da3ff; border-radius: 50%;
  }
  .spinner.on { display: inline-block; animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  /* Leaflet ships the layers toggle wider than the zoom buttons (36 vs 26,
     44 vs 30 on touch); match them so the stack lines up. */
  .leaflet-control-layers-toggle { width: 26px; height: 26px; background-size: 18px 18px; }
  .leaflet-touch .leaflet-control-layers-toggle { width: 30px; height: 30px; background-size: 20px 20px; }
  .leaflet-bar a svg { width: 16px; height: 16px; fill: currentColor; vertical-align: middle; }
