/* Compass glass: one instrument language for the dial and navigation pad. */
.pulse-compass,.compass-controls {
 --compass-ink:#d8f2e5; --compass-dim:#9bbcac; --compass-line:#b8e5cc45;
 box-sizing:border-box; min-width:0; color:var(--compass-ink);
 font-family:var(--mono,ui-monospace,SFMono-Regular,Consolas,monospace);
 background:linear-gradient(130deg,#081b13,#03100c 70%);
 container-type:inline-size; color-scheme:dark;
}
.pulse-compass *,.compass-controls * { box-sizing:border-box; }
.pulse-compass {
 display:flex; flex-direction:column; align-items:stretch; min-height:0;
 padding:clamp(9px,3cqw,16px); gap:0; overflow:hidden;
}
.compass-header,.compass-controls-header {
 display:flex; align-items:center; justify-content:space-between; gap:8px;
 flex:none; min-height:28px; padding:0 0 6px; border-bottom:1px solid var(--compass-line);
 font-size:clamp(11px,3.8cqw,16px); line-height:1.2; letter-spacing:.075em;
}
.compass-header strong,.compass-controls-header strong { font-weight:500; }
.compass-exit,.compass-controls button {
 -webkit-tap-highlight-color:transparent; touch-action:manipulation;
 font:inherit; color:inherit; cursor:pointer;
}
.compass-exit {
 display:flex; align-items:center; justify-content:center; gap:3px;
 min-height:32px; padding:3px 6px; border:1px solid #b8e5cc80; border-radius:5px;
 background:#03100c66; font-size:clamp(10px,3cqw,13px); letter-spacing:.07em;
}
.compass-icon { display:inline-flex; align-items:center; justify-content:center; flex:none; }
.compass-icon svg { display:block; width:22px; height:22px; }
.compass-exit .compass-icon svg { width:15px; height:15px; }
.compass-sensor-status {
 display:flex; align-items:center; gap:7px; flex:none; min-height:23px;
 color:var(--compass-dim); font-size:clamp(9px,2.7cqw,12px); letter-spacing:.055em;
}
.compass-sensor-status::before {
 content:''; flex:none; width:7px; height:7px; border-radius:50%; background:#547463;
}
.compass-sensor-status[data-state=active]::before { background:#b6eecb; box-shadow:0 0 7px #9be8bd44; }
.compass-sensor-status[data-state=error]::before { background:#e2ae79; }
.compass-instrument {
 position:relative; flex:1 1 0; min-height:0;
 display:flex; align-items:center; justify-content:center; isolation:isolate;
}
.compass-instrument > svg { position:absolute; width:100%; height:100%; overflow:visible; }
.compass-dial,.compass-target-arrow { transform-origin:120px 120px; }
.compass-dial { transition:transform .18s linear; }
.compass-dial circle { fill:none; stroke:#a9d7bd66; stroke-width:.6; }
.compass-dial .compass-tick { fill:none; stroke:#c4e9d5; stroke-width:.7; }
.compass-dial .compass-tick.major { stroke-width:1; }
.compass-dial .compass-tick.cardinal { stroke-width:1.5; }
.compass-dial text { fill:var(--compass-ink); text-anchor:middle; font:14px var(--mono,monospace); }
.compass-dial .compass-north,.compass-index { fill:#efba83; }
.compass-target-arrow { fill:#b6f5d1; stroke:#ddffec; stroke-width:.5; }
.compass-readout { position:relative; display:flex; align-items:center; flex-direction:column; gap:5px; pointer-events:none; }
.compass-degrees { font-size:clamp(24px,10cqw,44px); line-height:1; font-weight:400; font-variant-numeric:tabular-nums; }
.pulse-compass[data-heading=false] .compass-degrees::after { content:'°'; }
.compass-heading-label { font-size:clamp(10px,3.1cqw,14px); letter-spacing:.055em; }
.compass-mode { color:var(--compass-dim); font-size:clamp(9px,2.65cqw,12px); letter-spacing:.08em; }
.pulse-compass[data-heading=false] .compass-dial { opacity:.8; }
.compass-return {
 display:flex; align-items:center; gap:12px; flex:none;
 padding:8px 0 4px; border-top:1px solid var(--compass-line); min-width:0;
}
.compass-return > .compass-icon { padding-right:10px; border-right:1px solid var(--compass-line); }
.compass-return > .compass-icon svg { width:24px; height:24px; }
.compass-return-copy { display:flex; flex-direction:column; min-width:0; gap:3px; }
.compass-label { display:block; color:var(--compass-dim); font-size:clamp(9px,2.8cqw,12px); line-height:1.3; letter-spacing:.055em; }
.compass-destination { display:block; font-size:clamp(12px,3.7cqw,17px); line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.compass-metrics { display:block; font-size:clamp(10px,3cqw,13px); line-height:1.2; color:var(--compass-dim); overflow-wrap:anywhere; }
.compass-metrics[hidden] { display:none; }
.compass-status { flex:none; margin:4px 0 0; color:var(--compass-dim); font-size:clamp(9px,2.8cqw,12px); line-height:1.35; text-align:center; overflow-wrap:anywhere; }
.compass-controls { display:flex; flex-direction:column; gap:0; padding:clamp(8px,2.8cqw,14px); }
.compass-controls-header { min-height:22px; padding-bottom:6px; }
.compass-offline { flex:none; border:1px solid #b8e5cc88; border-radius:3px; padding:2px 5px; font-size:clamp(9px,2.8cqw,12px); line-height:1; letter-spacing:.055em; }
.compass-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); min-width:0; padding:4px 0; border-bottom:1px solid var(--compass-line); }
.compass-controls .compass-sensor-key {
 display:flex; align-items:center; gap:7px; min-width:0; min-height:44px;
 padding:4px 7px 4px 0; border:0; border-radius:0; background:none; text-align:left;
}
.compass-controls .compass-sensor-key + .compass-sensor-key { border-left:1px solid var(--compass-line); padding-left:10px; padding-right:0; }
.compass-sensor-key > .compass-icon svg { width:clamp(18px,6.3cqw,27px); height:clamp(18px,6.3cqw,27px); }
.compass-sensor-copy { display:flex; flex-direction:column; flex:1; min-width:0; gap:3px; }
.compass-sensor-title { font-size:clamp(9px,3cqw,13px); letter-spacing:.08em; line-height:1.1; }
.compass-sensor-state { color:var(--compass-dim); font-size:clamp(9px,2.7cqw,12px); line-height:1.1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.compass-switch { position:relative; width:34px; height:20px; flex:none; border:1px solid #afcdb574; border-radius:20px; background:linear-gradient(#29382f,#18251e); box-shadow:inset 0 1px 3px #0005; }
.compass-switch::after { content:''; position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#a4b2a7; box-shadow:0 1px 2px #0007; transition:transform .16s ease,background .16s ease; }
.compass-sensor-key[aria-checked=true] .compass-switch { border-color:#b0e9c6aa; background:#27543c; }
.compass-sensor-key[aria-checked=true] .compass-switch::after { transform:translateX(14px); background:#d0f4dc; }
.compass-point { padding:7px 0 6px; }
.compass-point-row { display:flex; align-items:center; gap:7px; min-width:0; margin-top:3px; }
.compass-point-row > .compass-icon svg { width:22px; height:22px; }
.compass-point-row input {
 appearance:none; flex:1; min-width:0; width:0; height:36px; padding:4px 0;
 border:0; border-bottom:1px solid #b8e5cc9c; border-radius:0;
 color:var(--compass-ink); background:transparent; font:16px/1.2 var(--font,system-ui);
}
.compass-point-row input::placeholder { color:var(--compass-dim); opacity:.85; }
.compass-controls .compass-save {
 display:flex; align-items:center; justify-content:center; gap:5px;
 min-height:36px; max-width:42%; padding:5px 8px; border:1px solid #b8e5cc7c;
 border-radius:5px; background:linear-gradient(#15302480,#0b1d1580);
 font-size:clamp(9px,2.85cqw,12px); letter-spacing:.025em; line-height:1.25;
}
.compass-save .compass-icon svg { width:18px; height:18px; }
.compass-controls button:disabled { opacity:.4; cursor:default; }
.compass-footer { margin-top:auto; padding-top:6px; border-top:1px solid var(--compass-line); }
.compass-privacy { display:flex; align-items:center; gap:5px; min-width:0; min-height:15px; font-size:clamp(9px,2.6cqw,11px); line-height:1.2; }
.compass-privacy > .compass-icon svg { width:12px; height:12px; }
.compass-privacy > span:not(.compass-icon) { min-width:0; }
.compass-controls .compass-clear { flex:none; margin-left:auto; padding:2px 0 2px 5px; min-height:24px; border:0; background:none; color:var(--compass-dim); font-size:clamp(9px,2.6cqw,11px); }
.compass-clear[hidden] { display:none; }
.compass-local { margin:3px 0 0; color:var(--compass-dim); font-size:clamp(9px,2.6cqw,11px); line-height:1.25; }
.compass-local span { display:block; }
.pulse-compass button:focus-visible,.compass-controls :is(button,input):focus-visible { outline:2px solid #b9f4d3; outline-offset:2px; }
.compass-controls .compass-sensor-key:active { background:#a8e5be0c; }
.radio[data-compass=true] :is(.lcd-upper,.contour-display)>:not(.pulse-compass),.radio[data-compass=true] :is(.lcd-lower,.contour-lower)>:not(.compass-controls) { visibility:hidden!important; pointer-events:none!important; }
.radio[data-compass=true] :is(.lcd-upper,.contour-display)>.pulse-compass { position:absolute; inset:0; z-index:19; }
.radio[data-compass=true] :is(.lcd-lower,.contour-lower)>.compass-controls { position:absolute; inset:2% 3%; z-index:19; overflow:auto; }
/* Contour's shallow lower monitor uses a single-line footer and keeps the
   input's accessible label while omitting its duplicate visible caption. */
.radio[data-compass=true] .contour-lower>.compass-controls { padding:6px 9px; }
.contour-lower .compass-controls-header { min-height:18px; padding-bottom:3px; font-size:11px; }
.contour-lower .compass-buttons { padding:0; }
.contour-lower .compass-point { padding:3px 0 4px; }
.contour-lower .compass-point > .compass-label { display:none; }
.contour-lower .compass-point-row { margin-top:0; }
.contour-lower .compass-footer { padding-top:3px; }
.contour-lower .compass-local { margin-top:2px; }
.contour-lower .compass-local span { display:inline; }
.contour-lower .compass-local span + span::before { content:' · '; }
.compass-sheet .pulse-compass { height:390px; }
.compass-sheet .compass-controls { min-height:200px; }
.compass-standalone { margin:0; background:#071510; color:#d2f5e8; font-family:system-ui; }
.compass-standalone main { display:flex; flex-direction:column; max-width:520px; margin:auto; min-height:100svh; padding:max(8px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom)); box-sizing:border-box; }
.compass-standalone .pulse-compass { flex:1; min-height:390px; }
.compass-standalone .compass-instrument { min-height:220px; }
.compass-standalone .compass-controls { min-height:210px; }
.compass-standalone .compass-exit,.compass-standalone .compass-save { min-height:44px; }
@media(prefers-reduced-motion:reduce) { .compass-dial,.compass-switch::after { transition:none; } }


/* Saved points share the glass; the pad scrolls inside the radio bezel. */
.compass-controls > * { flex-shrink:0; }
.compass-controls-meta { display:flex; align-items:center; gap:5px; min-width:0; }
.compass-controls .compass-points-key { min-height:24px; padding:3px 5px; border:1px solid var(--compass-line); border-radius:3px; background:none; font-size:10px; line-height:1; white-space:nowrap; }
.compass-waypoints { flex:none; min-width:0; padding:6px 0; border-top:1px solid var(--compass-line); }
.compass-waypoints-head { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.compass-controls .compass-show-all { flex:none; max-width:48%; min-height:30px; background:none; border:1px solid var(--compass-line); border-radius:4px; padding:4px 6px; font-size:10px; line-height:1.2; }
.compass-show-all[aria-pressed=true] { color:#b6f5d1; }
.compass-waypoints-list { display:flex; flex-direction:column; min-width:0; max-height:176px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.compass-waypoint-row { display:flex; flex-wrap:wrap; align-items:center; gap:5px; border-bottom:1px solid #b8e5cc22; min-height:44px; }
.compass-controls .compass-waypoint-select { display:flex; flex:1; min-width:0; gap:6px; align-items:center; min-height:44px; background:none; border:0; padding:4px 0; text-align:left; font-size:12px; line-height:1.2; }
.compass-waypoint-select[aria-pressed=true] { color:#b6f5d1; }
.compass-waypoint-number { flex:none; display:grid; place-items:center; min-width:20px; height:20px; padding:0 2px; border:1px solid var(--compass-line); border-radius:50%; font-size:10px; }
.compass-waypoint-copy { display:flex; flex-direction:column; gap:3px; min-width:0; }
.compass-waypoint-name { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.compass-waypoint-distance { color:var(--compass-dim); font-size:10px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.compass-waypoint-actions { display:flex; flex:none; gap:3px; }
.compass-controls .compass-waypoint-actions button { min-height:32px; background:none; border:1px solid #b8e5cc35; border-radius:3px; padding:4px; font-size:10px; }
.compass-waypoint-edit { display:flex; flex:1 0 100%; align-items:center; gap:5px; padding-bottom:6px; min-width:0; }
.compass-waypoint-edit[hidden] { display:none; }
.compass-waypoint-edit input { flex:1; width:0; min-width:0; height:36px; font-size:16px; color:var(--compass-ink); background:#071b11; border:1px solid var(--compass-line); border-radius:3px; padding:4px; }
.compass-controls .compass-waypoint-edit button { min-height:36px; padding:4px; background:none; border:1px solid var(--compass-line); border-radius:3px; font-size:10px; }
.compass-waypoints-empty { font-size:11px; color:var(--compass-dim); padding:7px 0; }
.compass-marker { cursor:pointer; }
.compass-marker circle { fill:#254436; stroke:#a1c7b2; stroke-width:1; }
.compass-marker text { fill:#d8f2e5; font:8px var(--mono,monospace); stroke:none; pointer-events:none; }
.compass-marker-active circle { fill:#b6f5d1; stroke:#e3ffec; stroke-width:1.5; }
.compass-marker-active text { fill:#0a2115; }
.compass-marker:focus-visible { outline:none; }
.compass-marker:focus-visible circle { stroke:#efba83; stroke-width:2; }

