/* NautPlot navigation basics (js/plot-basics.js): own-boat marker, the data strip, off-course alert, measure strip, map buttons. */

/* own boat: a chevron turned to the course while moving (the dot while stopped, css/app.css .map-me) */
.map-me.nb-moving { width: 30px; height: 30px; border: 0; border-radius: 0; background: none; box-shadow: none; display: grid; place-items: center; }
.map-me.nb-moving::before { display: none; }
.map-me.nb-moving svg { filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.5)); }
.map-me.nb-stale { opacity: 0.45; }

/* the data strip (under the toolbar): SOG · COG · position; folds to one pill */
.nb-strip { display: flex; align-items: stretch; gap: 0; min-height: 52px; border-radius: 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 2px 10px rgb(0 0 0 / 0.18); overflow: hidden; }
.nb-strip[hidden] { display: none; }
.dir-drop:not([hidden]) ~ .nb-strip, .dir-drop:not([hidden]) ~ .nb-alert, .dir-drop:not([hidden]) ~ .nb-ms { display: none; }
body.pp-mob-on .nb-strip { display: none; }
.nb-cell { display: grid; align-content: center; gap: 0; min-width: 0; padding: 4px 9px; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: transparent;
  color: var(--text); font: inherit; text-align: left; min-height: 48px; }
.nb-cell:first-child { border-left: 0; }
button.nb-cell { cursor: pointer; }
button.nb-cell:hover { background: var(--bg); }
.nb-cell small { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-cell strong { font-size: 1.25rem; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* a narrow bar never runs one value into the next (UI check 2026-10-06) */
.nb-cell strong i { font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--muted); margin-left: 3px; }
.nb-sog { flex: 0 0 auto; }
.nb-cog, .nb-hdg { flex: 0 0 auto; }
.nb-pos { flex: 1 1 auto; }
.nb-cell:not(.nb-pos) { flex-shrink: 0; }   /* a tight bar shortens the position (it ends in …), never a number (UI check 2026-10-06) */
@media (max-width: 430px) { .nb-cell { padding: 4px 7px; } .nb-cell strong { font-size: 1.14rem; } }   /* phones: four fields fit 370 px with the position readable */
.nb-strip.nb-tight .nb-cell { padding: 4px 7px; } .nb-strip.nb-tight .nb-cell:not(.nb-pos) strong { font-size: 1.14rem; }   /* the same for any bar that narrow (the computer's 380 px side column; nb-tight set in js/plot-basics.js) */
.nb-pos strong { display: grid; font-size: 0.83rem; line-height: 1.2; font-weight: 700; overflow: hidden; }
.nb-pos strong span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-fold { flex: none; width: 44px; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--muted); font-size: 1.1rem; min-height: 48px; padding: 0; }
.nb-fold:hover { background: var(--bg); }
.nb-bad { color: #b91c1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nb-bad { color: #ff8a80; } }
.nb-stale { border-color: #d97706; }
.nb-stale .nb-sog strong, .nb-stale .nb-cog strong, .nb-stale .nb-pos strong { color: var(--muted); }   /* greyed but readable (was opacity 0.5: 2:1) */
.nb-weak .nb-pos small { color: #b45309; }
.nb-pos small { text-transform: none; letter-spacing: 0; font-size: 0.72rem; }
.nb-strip.nb-min { justify-self: start; min-height: 44px; }
.nb-pill { min-height: 44px; padding: 0 14px; border: 0; border-radius: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.95rem; white-space: nowrap; cursor: pointer; }
.nb-pill b { font-variant-numeric: tabular-nums; }
.nb-find { padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; color: var(--muted); }
@media (max-width: 380px) { .nb-cell { padding: 4px 6px; } .nb-cell strong { font-size: 1.1rem; } .nb-pos strong { font-size: 0.76rem; } }

/* off course alert (with Silence) */
.nb-alert { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 6px 4px 14px; border-radius: 14px; background: #b3261e; color: #fff;
  border: 2px solid #fff; box-shadow: 0 4px 16px rgb(0 0 0 / 0.35); font-size: 0.95rem; }
.nb-alert[hidden] { display: none; }
.nb-alert.quiet { background: var(--surface); color: var(--text); border: 2px solid #b3261e; }
.nb-alert-txt { flex: 1 1 auto; min-width: 0; }
.nb-alert button { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; background: #fff; color: #b3261e; border: 0; font-weight: 800; }

/* measure strip */
.nb-ms { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--surface); color: var(--text);
  border: 2px solid #111827; box-shadow: 0 2px 10px rgb(0 0 0 / 0.2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nb-ms { border-color: #e5edf7; } }
.nb-ms[hidden] { display: none; }
.nb-ms-main { flex: 1 1 140px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 0.92rem; }
.nb-ms-main strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.nb-ms-main small { color: var(--muted); width: 100%; }
.nb-ms-btns { display: flex; gap: 6px; flex: 1 1 auto; justify-content: flex-end; }
.nb-ms-btns button { min-height: 44px; padding: 0 12px; border-radius: 999px; background: transparent; color: var(--text); border: 1px solid var(--border); font-weight: 700; font-size: 0.88rem; }
.nb-ms-btns button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text, #fff); border-color: var(--accent); }
.nb-ms-btns button[data-done] { background: #111827; color: #fff; border-color: #111827; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nb-ms-btns button[data-done] { background: #e5edf7; color: #0b1829; border-color: #e5edf7; } }
.nb-ms-btns button:disabled { opacity: 0.4; }
.nb-ms-pt { width: 44px; height: 44px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.nb-ms-pt span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #111827; color: #fff; border: 2.5px solid #fff;
  font-size: 12px; font-weight: 800; box-shadow: 0 1px 5px rgb(0 0 0 / 0.5); }
.nb-ms-label { padding: 3px 9px; border-radius: 999px; background: #111827; color: #fff; border: 2px solid #fff; font-size: 12px; font-weight: 800; white-space: nowrap;
  pointer-events: none; box-shadow: 0 1px 5px rgb(0 0 0 / 0.4); }
body.nb-measuring .maplibregl-canvas { cursor: crosshair; }

/* "where I am" doubles as the orientation button: icon + a small caption (North / Course / Free) while the GPS is on */
.plot-page .maplibregl-ctrl-group button.pp-me.nb-has-cap { grid-template-rows: 22px 12px; align-content: center; gap: 0; padding: 2px 0 0; }
.plot-page .pp-me .nb-ic { display: grid; place-items: center; height: 22px; }
.plot-page .pp-me small { font-size: 9px; font-weight: 800; line-height: 1; text-transform: uppercase; letter-spacing: 0.02em; color: #fff; }
.plot-page .maplibregl-ctrl-group button.pp-me[data-mode="course"] { box-shadow: inset 0 0 0 3px #ffd54a; }
.plot-page #measure-btn[aria-pressed="true"] { background: #111827; color: #fff; border-color: #111827; }
.plot-page #measure-btn[aria-pressed="true"] svg { color: #fff; }
@media (max-width: 420px) { .pp-chips { gap: 4px; } }   /* seven chips fit a 360 px phone */
.plot-page .nb-clear { display: flex; align-items: end; }
.plot-page .nb-clear button { min-height: 44px; }

/* Recenter: a floating pill at the bottom of the chart (js/plot-basics.js places it above the open panel) */
.nb-recenter { position: absolute; z-index: 5; transform: translateX(-50%); }
.nb-recenter[hidden] { display: none; }
.nb-recenter button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--accent); color: var(--accent-text, #fff);
  border: 2px solid #fff; font-weight: 800; font-size: 0.95rem; box-shadow: 0 3px 12px rgb(0 0 0 / 0.35); white-space: nowrap; }
body.pp-mob-on .nb-recenter { display: none; }

/* phones: the panel never reaches up under the data strip / banners (it was capped at 62%; a tall top leaves less) */
@media (max-width: 899px) { .pp-sheet { max-height: min(62%, calc(100% - var(--pp-top, 118px) + 6px)); } }

/* chart alerts (js/plot-ahead.js): shallow water / a hazard ahead. Danger = the red off-course look; caution = amber; silenced = quiet */
.nb-alert-txt small { display: block; margin-top: 1px; font-size: 0.74rem; line-height: 1.25; opacity: 0.92; }
.nb-alert.warn { background: #b45309; }
.nb-alert.warn button { color: #b45309; }
.nb-alert.quiet.warn { background: var(--surface); border-color: #b45309; }
.nb-alert.quiet small { opacity: 0.8; }
/* GPX blocks (js/plot-gpx.js) */
.pp-gpx-actions > button { flex: 1 1 140px; }
.pp-gpx-names { display: block; margin-top: 1px; overflow-wrap: anywhere; }
.pp-gpx-sub { margin-left: 26px; }
.pp-gpx-notes { margin: 8px 0 0; padding-left: 18px; }
.pp-gpx-list { max-height: 38vh; overflow-y: auto; }
.nb-depth { flex: 0 0 auto; }
.nb-depth strong { font-size: 1.1rem; }
/* the strip is a 380 px column on a computer too, so these apply at every width */
.nb-strip:has(.nb-depth) .nb-cell { padding: 4px 7px; }
.nb-strip:has(.nb-depth) .nb-cell strong { font-size: 1.12rem; }
.nb-strip:has(.nb-depth) .nb-pos strong { font-size: 0.7rem; }
.nb-strip:has(.nb-depth) .nb-pos small { font-size: 0.66rem; }


.nb-strip:has(.nb-row) { flex-direction: column; }
.nb-row { display: flex; align-items: stretch; min-width: 0; flex: 1 1 auto; }
.nb-sunrow { flex: none; margin: 0; padding: 1px 10px 2px; border-top: 1px solid var(--border); font-size: 0.74rem; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }
