/* Map, pins, bottom sheet, reservations and the pharmacist panel. */
.nd-map {
  flex: none; height: 42vh; min-height: 210px; margin: 8px 12px 4px; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: #dfe7e3; z-index: 0;
}
.nd .leaflet-container { font: 12px/1.3 inherit; background: #e3ebe7; }
.nd .leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, 0.82); }
.nd .leaflet-control-attribution a { color: #1d5fd1; }
.nd-pin { width: auto !important; height: auto !important; }
.nd-pin span {
  position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 6px)); display: block; white-space: nowrap;
  padding: 3px 7px; border-radius: 8px; background: #fff; color: #11231c; font: 700 11.5px/1.2 -apple-system, "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); border: 1.5px solid #9aa5a0; cursor: pointer;
}
.nd-pin span::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 5px solid transparent;
  border-top-color: inherit; border-bottom: 0;
}
.nd-pin.is-closed span { color: #7b8682; background: #f1f3f2; border-style: dashed; }
.nd-pin.is-nearest span { background: #2563eb; border-color: #2563eb; color: #fff; }
.nd-pin.is-cheapest span { background: #0f9f6e; border-color: #0f9f6e; color: #fff; }
.nd-pin.is-best span { background: #d97706; border-color: #d97706; color: #fff; font-size: 12.5px; padding: 4px 9px; }
.nd-pin.is-best.is-nearest span { box-shadow: 0 0 0 3px #2563eb, 0 2px 6px rgba(0, 0, 0, 0.3); }
.nd-pin.is-best.is-cheapest span { box-shadow: 0 0 0 3px #0f9f6e, 0 2px 6px rgba(0, 0, 0, 0.3); }
.nd-you { position: relative; }
.nd-you i {
  position: absolute; inset: 3px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.25);
  animation: nd-pulse 2s ease-out infinite;
}
@keyframes nd-pulse { 50% { box-shadow: 0 0 0 11px rgba(37, 99, 235, 0.08); } }

/* bottom sheet */
.nd-backdrop {
  position: absolute; inset: 0; z-index: 1500; display: flex; align-items: flex-end; background: rgba(10, 20, 16, 0.42);
  animation: nd-fade 0.16s ease both;
}
.nd-backdrop.out { opacity: 0; transition: opacity 0.16s; }
.nd-sheet {
  width: 100%; max-height: 88%; overflow: auto; background: var(--surface); border-radius: 18px 18px 0 0; padding: 12px 16px 22px;
  display: grid; gap: 12px; animation: nd-up 0.2s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.nd-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nd-sheet-head h3 { font-size: 17px; }
.nd-x { border: 0; background: var(--chip); width: 30px; height: 30px; border-radius: 50%; font-size: 18px; line-height: 1; flex: none; }
@keyframes nd-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes nd-fade { from { opacity: 0; } }
.nd-info { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 13.5px; }
.nd-info dt { color: var(--muted); }
.nd-info dd { margin: 0; }
.nd-rx-note { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bad) 10%, var(--surface)); font-size: 13.5px; }
.nd-qty { display: flex; align-items: center; gap: 10px; }
.nd-qty span { margin-right: auto; color: var(--muted); }
.nd-qty button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 18px; }
.nd-qty output { min-width: 22px; text-align: center; font-weight: 800; font-size: 17px; }
.nd-code { font: 800 34px/1.1 var(--mono); letter-spacing: 0.08em; text-align: center; color: var(--accent); }
.nd-code.small { font-size: 18px; letter-spacing: 0.05em; }

/* reservations */
.nd-res { display: grid; gap: 6px; padding: 11px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.nd-res.held { border-color: var(--accent); }
.nd-res .nd-btn { justify-self: start; }
.nd-res-code { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nd-status { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.nd-status.held { background: var(--accent); color: #fff; }
.nd-status.picked { color: var(--accent); }
.nd-alert-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; }

/* pharmacist */
.nd-ph-name { font-size: 18px; }
.nd-give { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.nd-give .nd-btn { width: auto; padding: 10px 18px; }
.nd-input.code { font: 700 20px/1 var(--mono); letter-spacing: 0.12em; text-align: center; }
.nd-held { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.nd-held .nd-muted { grid-column: 2; }
.nd-stock-head, .nd-stock { display: grid; grid-template-columns: minmax(0, 1fr) 76px 52px auto; gap: 6px; align-items: center; }
.nd-stock-head { font-size: 11.5px; color: var(--muted); }
.nd-stock { padding: 6px 0; border-bottom: 1px solid var(--line); }
.nd-stock.out .nd-stock-name b { color: var(--muted); }
.nd-stock-name { display: grid; min-width: 0; font-size: 13px; }
.nd-stock-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-input.num { padding: 7px 6px; text-align: right; font-size: 13px; }
.nd-stock .nd-btn.small { padding: 7px 8px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .nd-you i, .nd-backdrop { animation: none; } }
