/* The pin panel drawn from the kit (design overhaul, Map pass). Only under ?ui=2, where the panel opens in the one sheet (js/nm-pinsheet.js).
   The markup is built in _livePopupContent (js/nightmap-coots.js) and keeps the class names the old binders look for. Reads css/nm-tokens.css only (npm run lint:ui). */
@layer ui.page {
  .nm-pin { display: grid; gap: var(--ui-space-4); color: var(--ui-text-2); font: 400 var(--ui-size-body) / var(--ui-lh-body) var(--ui-font-sans); min-width: 0; }
  .nm-pin > * { margin: 0; min-width: 0; }

  .nm-pin .nm-title-row { display: flex; align-items: center; gap: var(--ui-space-2); position: static; margin: 0; padding: 0; background: transparent; }
  .nm-pin .nm-loc-title { flex: 1; min-width: 0; font: 700 var(--ui-size-title) / var(--ui-lh-title) var(--ui-font-serif); color: var(--ui-text); margin: 0; padding: 0; }
  .nm-pin .nm-tick-btn { flex: none; width: var(--ui-target); height: var(--ui-target); margin: 0; padding: 0; display: grid; place-items: center; border: 1px solid var(--ui-line-strong); border-radius: var(--ui-radius-pill); background: transparent; color: var(--ui-muted); cursor: pointer; }
  .nm-pin .nm-tick-btn svg { width: 22px; height: 22px; }
  .nm-pin .nm-tick-btn.is-on { color: var(--ui-good); border-color: var(--ui-good); }

  .nm-pin__photos { margin-top: 0; }
  .nm-pin__photos img { display: block; max-width: 100%; }

  .nm-pin__kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--ui-space-2) var(--ui-space-4); margin: 0; }
  .nm-pin__kv dt { font: 500 var(--ui-size-label) / var(--ui-lh-body) var(--ui-font-mono); letter-spacing: var(--ui-track-label); color: var(--ui-muted); }
  .nm-pin__kv dd { margin: 0; font-size: var(--ui-size-small); line-height: var(--ui-lh-body); color: var(--ui-text-2); }

  .nm-pin .nm-loc-notes { margin: 0; color: var(--ui-text-2); }
  .nm-pin .nm-contrib-row { display: flex; align-items: center; gap: var(--ui-space-2); color: var(--ui-muted); }
  .nm-pin .nm-contrib-row b { font-weight: 500; color: var(--ui-muted); }
  .nm-pin .nm-contrib-container { display: inline-flex; align-items: center; gap: var(--ui-space-2); }
  .nm-pin .nm-contrib-row a { color: var(--ui-accent); }

  .nm-pin .nm-loc-coords { display: grid; gap: var(--ui-space-1); }
  .nm-pin .nm-loc-coords__edit { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); align-items: center; }
  .nm-pin .nm-loc-coords__edit .ui-input { width: 120px; }

  .nm-pin__actions { margin: 0 calc(-1 * var(--ui-gutter)); }
  .nm-pin__actions .ui-row { border-radius: 0; justify-content: flex-start; font: inherit; color: var(--ui-text); }
  .nm-pin__actions .nm-list-actions { border-top: 1px solid var(--ui-line); }
  .nm-pin__actions .nm-list-actions .ui-row { border-top: 0; }
  .nm-pin__kv dd sup { font-size: 0.7em; }
  .nm-pin__actions .nm-list-actions { display: grid; }

  .nm-pin__lens { display: grid; gap: var(--ui-space-2); }
  .nm-pin .ui-chip { text-decoration: none; }

  .nm-pin .nm-admin-loc { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); align-items: center; }
  .nm-pin [data-loc-action="delete"] { color: var(--ui-problem); }
  .nm-pin .nm-priv-reminder { font-size: var(--ui-size-small); color: var(--ui-caution); }


  /* photo carousel (old markup, drawn by _renderCarouselHtml): arrows and dots from the kit's values */
  .nm-pin .image-carousel { margin-bottom: 0; }
  .nm-pin .carousel-slide img { border-radius: var(--ui-radius-card); }
  .nm-pin .carousel-prev, .nm-pin .carousel-next { position: absolute; top: 50%; transform: translateY(-50%); width: var(--ui-target); height: var(--ui-target); display: grid; place-items: center; border-radius: var(--ui-radius-pill); background: var(--ui-scrim); color: var(--ui-text); font-size: var(--ui-size-heading); cursor: pointer; text-decoration: none; margin: 0; padding: 0; line-height: 1; }
  .nm-pin .carousel-prev { left: var(--ui-space-2); }
  .nm-pin .carousel-next { right: var(--ui-space-2); }
  .nm-pin .carousel-indicators { display: flex; justify-content: center; gap: var(--ui-space-2); margin-top: var(--ui-space-2); }
  .nm-pin .carousel-dot { width: 8px; height: 8px; margin: 0; background: var(--ui-line-strong); }
  .nm-pin .carousel-dot.active { background: var(--ui-accent); }
  .nm-pin .nm-img-meta { color: var(--ui-muted); font-size: var(--ui-size-small); line-height: var(--ui-lh-small); margin-top: var(--ui-space-1); }

  /* eclipse, meteor and ISS blocks (old builders; the last two are appended to the sheet after it opens, outside .nm-pin): the same quiet card, kit type */
  .nm-pinhost .nm-eclipse-block, .nm-pinhost .nm-meteor-block, .nm-pinhost .nm-iss-pass { margin: var(--ui-space-4) 0 0; padding: var(--ui-space-3); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); background: transparent; font-size: var(--ui-size-small); line-height: var(--ui-lh-small); color: var(--ui-text-2); }
  .nm-pinhost .nm-meteor-block > div:first-child, .nm-pinhost .nm-iss-pass > div:first-child { color: var(--ui-text); font-weight: 600; }
  .nm-pinhost .nm-meteor-item { margin-top: var(--ui-space-2); }
  .nm-pinhost .nm-meteor-item strong { color: var(--ui-text); font-weight: 600; }
  .nm-pinhost .nm-iss-pass th { font: 500 var(--ui-size-label) / var(--ui-lh-body) var(--ui-font-mono); letter-spacing: var(--ui-track-label); color: var(--ui-muted); }
  .nm-pinhost .nm-iss-pass td { font-family: var(--ui-font-mono); }

  /* sections still built by older helpers (Sky transits, My home, eclipse): the same quiet headings */
  .nm-pin .nm-loc-section { display: grid; gap: var(--ui-space-2); margin: 0; padding: 0; border: 0; background: transparent; }
  .nm-pin .nm-loc-section__title { font: 500 var(--ui-size-label) / var(--ui-lh-label) var(--ui-font-mono); letter-spacing: var(--ui-track-label); color: var(--ui-muted); margin: 0; }
  .nm-pin .nm-loc-section[hidden] { display: none; }
}

/* The old popup rules mark these buttons !important; only a rule in the force layer can beat them */
@layer force {
  html.ui2 .nm-pinhost [style*="9eb0d3"], html.ui2 .nm-pinhost [style*="cdd7f5"], html.ui2 .nm-pinhost .nm-eclipse-block { color: var(--ui-muted) !important; }
  html.ui2 .nm-pinhost .nm-iss-pass td { color: var(--ui-text-2) !important; }
  html.ui2 .nm-pinhost [style*="7ef1ff"], html.ui2 .nm-pinhost .nm-eclipse-block a, html.ui2 .nm-pinhost .nm-meteor-block a { color: var(--ui-accent) !important; }
  html.ui2 .nm-pinhost .nm-iss-pass > div:first-child, html.ui2 .nm-pinhost .nm-meteor-block > div:first-child { color: var(--ui-text) !important; }
  html.ui2 .nm-pinhost .nm-meteor-block, html.ui2 .nm-pinhost .nm-iss-pass { border: 1px solid var(--ui-line) !important; background: transparent !important; border-radius: var(--ui-radius-card) !important; padding: var(--ui-space-3) !important; margin: var(--ui-space-4) 0 0 !important; }
  html.ui2 .nm-pin .nm-fov-btn, html.ui2 .nm-pin .nm-print-popup { border: 0 !important; border-top: 1px solid var(--ui-line) !important; border-radius: 0 !important; background: transparent !important; padding-top: var(--ui-space-2) !important; padding-bottom: var(--ui-space-2) !important; font-size: var(--ui-size-body) !important; }
}
