/* norte-viewer · app layout over the linked house skin (redfish-style.css).
   Floors: 15px body, 14px controls, 13px captions, nothing below. One accent per view:
   the playhead on the clock, the selected camera on the grid and the map. */
[hidden] { display: none !important; }
body.rf-map-page { position: fixed; inset: 0; overflow: hidden; }
:root { --bar-h: 44px; --dock-h: 41px; }

/* ── minimal header ─────────────────────────────────────────────────────── */
#bar { position: absolute; top: 0; left: 0; right: 0; height: var(--bar-h); z-index: 1100;
       display: flex; align-items: center; gap: 10px; padding: 0 92px 0 8px;
       border-bottom: 1px solid var(--rf-rule); background: var(--rf-ground); }
#bar .title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bar .ver { font-size: 13px; color: var(--rf-ink-faint); flex: none; }
.spacer { flex: 1; }
button.quiet { border: 0; background: none; padding: 4px 8px; font: 600 14px var(--rf-sans); color: var(--rf-ink-quiet); }
button.quiet:hover { color: var(--rf-accent); }
#fabs { position: absolute; top: 6px; right: 8px; z-index: 1200; display: flex; gap: 8px; }

/* chips: small toggles that sign their state by ink inversion (never the accent) */
button.chip { font: 600 14px/1 var(--rf-sans); padding: 5px 9px; color: var(--rf-ink-quiet);
              border: 1px solid var(--rf-rule-strong); background: none; flex: none; }
button.chip[aria-pressed="true"] { background: var(--rf-ink); color: var(--rf-ground); border-color: var(--rf-ink); }
button.chip:hover { border-color: var(--rf-ink); color: var(--rf-ink); }
button.chip[aria-pressed="true"]:hover { color: var(--rf-ground); }

/* ── stage: grid | split | map ──────────────────────────────────────────── */
#stage { position: absolute; top: var(--bar-h); bottom: var(--dock-h); left: 0; right: 0; display: flex; }
body.rf-ui-hidden #stage { top: 0; bottom: 0; }
#gridPane { position: relative; flex: 0 0 var(--split, 58%); min-width: 0; display: flex; flex-direction: column;
            background: var(--rf-ground); }
#split { flex: 0 0 6px; cursor: col-resize; background: var(--rf-rule); }
#split:hover, #split:focus-visible { background: var(--rf-rule-strong); }
#mapPane { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--rf-ground-sunk); }

#gridHead { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--rf-rule); flex: none; }
#gridHead .lbl { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gridHead .lbl .q { font-weight: 400; color: var(--rf-ink-quiet); }
#gridHead .filters { display: flex; gap: 6px; }
#grid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px;
        display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; align-content: start; }

/* ── a tile ─────────────────────────────────────────────────────────────── */
.tile { margin: 0; border: 1px solid var(--rf-rule); background: var(--rf-ground); cursor: pointer;
        display: flex; flex-direction: column; outline-offset: 1px;
        transition: border-color var(--rf-t-quick) var(--rf-ease); }
.tile:hover, .tile.hot { border-color: var(--rf-ink-quiet); }
.tile.sel { border-color: var(--rf-accent); box-shadow: inset 0 0 0 1px var(--rf-accent); }
.tile .frame { position: relative; aspect-ratio: 16 / 9; background: #0d0d0d; overflow: hidden; }
.tile .frame img, .tile .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .frame .empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center;
                      font-size: 13px; line-height: 1.4; color: #a6a6a6; pointer-events: none; }
.tile.stale .frame img { opacity: 0.45; }
.tile .cap { padding: 5px 8px 6px; display: flex; flex-direction: column; gap: 1px; }
.tile .nm { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta { font: 13px/1.35 var(--rf-mono); color: var(--rf-ink-quiet); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .flag { font: 600 13px var(--rf-sans); color: var(--rf-ink); }
.tile .flag.no { color: var(--rf-ink-faint); font-weight: 400; }
.tile .links { font-size: 13px; }
.tile .links a { margin-right: 10px; }
/* the aerial tile spans two columns where there is room: it is the moving picture */
.tile.aerial { grid-column: span 2; }
@media (max-width: 560px) { .tile.aerial { grid-column: auto; } }
.tile.aerial.slot .frame { background: var(--rf-ground-sunk); }
.tile.aerial.slot .frame .empty { color: var(--rf-ink-quiet); }

/* ── inspector ──────────────────────────────────────────────────────────── */
#insp { position: absolute; inset: 0; z-index: 20; background: var(--rf-ground); display: flex; flex-direction: column; }
#inspHead { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--rf-rule); }
#inspHead button.quiet { font-size: 20px; line-height: 1; }
#inspTitle { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#inspSrc { font-size: 14px; }
#inspFrame { flex: 1; min-height: 0; background: #0d0d0d; position: relative; }
#inspImg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#inspRead { padding: 6px 10px 8px; }

/* ── layers overlay on the map ──────────────────────────────────────────── */
#layers { top: 10px; left: 10px; width: 300px; max-width: calc(100% - 20px); max-height: calc(100% - 44px);
          display: flex; flex-direction: column; z-index: 1001; }
#layers > .rf-min-tab { width: 100%; border: 0; border-bottom: 1px solid var(--rf-rule); border-radius: 0; justify-content: flex-start; background: none; padding: 8px 12px; }
#layers.rf-collapsed { width: auto; border-color: transparent; background: none; }
#layers.rf-collapsed > .rf-min-tab { width: auto; border: 1px solid var(--rf-rule); border-radius: var(--rf-radius); background: var(--rf-ground); }
.rf-min-tab .glyph { color: var(--rf-ink-faint); }
body.rf-ui-hidden .rf-overlay.rf-collapsed, body.rf-ui-hidden #layers.rf-collapsed { display: flex !important; }
redfish-layer-panel { flex: 0 1 auto; min-height: 120px; height: 260px;
  --lp-bg: var(--rf-ground); --lp-ink: var(--rf-ink); --lp-dim: var(--rf-ink-quiet);
  --lp-line: var(--rf-rule); --lp-rule: var(--rf-rule-strong); --lp-accent: var(--rf-accent);
  --lp-hover: var(--rf-ground-sunk); --lp-sel: var(--rf-accent-wash); --lp-radius: 2px; }
#stacNote { overflow-wrap: anywhere; margin: 0; padding: 6px 12px 8px; border-top: 1px solid var(--rf-rule); font-size: 13px; line-height: 1.45; color: var(--rf-ink-quiet); }
#stacNote:empty { display: none; }

/* leaflet in the house idiom */
.leaflet-container { font: 15px/1.45 var(--rf-sans); }
.leaflet-control-attribution { font-size: 13px; background: color-mix(in srgb, var(--rf-ground) 85%, transparent); color: var(--rf-ink-quiet); }
.leaflet-control-attribution a { color: var(--rf-ink-quiet); }
.leaflet-popup-content-wrapper { background: var(--rf-ground); color: var(--rf-ink); border: 1px solid var(--rf-rule); border-radius: var(--rf-radius); box-shadow: none; }
.leaflet-popup-tip { background: var(--rf-ground); box-shadow: none; }
.leaflet-popup-content { margin: 10px 12px; max-width: 300px; }
.nv-pop h3 { margin: 0 0 4px; font-size: 15px; line-height: 1.3; }
.nv-pop .meta { color: var(--rf-ink-quiet); font-size: 13px; margin: 0 0 4px; }
.nv-pop .rights { font-size: 13px; color: var(--rf-ink-quiet); border-left: 2px solid var(--rf-rule); padding-left: 8px; margin: 6px 0; }
.nv-pop .links a { margin-right: 10px; font-size: 14px; }
.nv-icon { background: none; border: 0; }
.nv-site { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--rf-ink); border: 2px solid var(--rf-ground); box-sizing: content-box; }
.nv-fire { display: block; width: 14px; height: 14px; transform: rotate(45deg); background: var(--rf-ground); border: 2px solid var(--rf-ink); box-sizing: border-box; }
.nv-acft { display: grid; place-items: center; width: 22px; height: 22px; font-size: 16px; line-height: 1; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }

/* ── dock ───────────────────────────────────────────────────────────────── */
#dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1100; background: var(--rf-ground);
        border-top: 1px solid var(--rf-rule); display: flex; flex-direction: column; }
#dockBar { display: flex; align-items: center; gap: 8px; padding: 4px 8px; flex: none; min-width: 0; }
#dockBar .rf-min-tab { border: 0; padding: 6px 4px; background: none; }
#clock { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
#clock b { color: var(--rf-ink); font-weight: 600; }
#dock.rf-collapsed > #dockBar { display: flex; }
#tl { flex: none; max-height: calc(min(62vh, 420px) - 40px); border-top: 1px solid var(--rf-rule); }
.tile .links button.go { padding: 0 10px 0 0; font: 600 13px var(--rf-sans); color: var(--rf-ink); text-decoration: underline; }
#tl canvas:focus-visible { outline: 2px solid var(--rf-accent); outline-offset: -2px; }

dialog#info { max-width: min(560px, calc(100vw - 32px)); border: 1px solid var(--rf-rule); border-radius: var(--rf-radius);
              background: var(--rf-ground); color: var(--rf-ink); padding: 18px 22px; }
dialog#info::backdrop { background: rgba(0,0,0,0.35); }
dialog#info h2 { margin: 0 0 6px; font-size: 21px; }
dialog#info li { margin: 4px 0; }
dialog#info .small { font-size: 13px; color: var(--rf-ink-quiet); }

/* ── narrow: map over grid, the grid scrolls in its own pane ─────────────── */
@media (max-width: 760px) {
  #stage { flex-direction: column; }
  #mapPane { order: 0; flex: 0 0 34%; }
  #split { display: none; }
  #gridPane { order: 1; flex: 1 1 auto; min-height: 0; }
  #grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 6px; }
  #layers { width: 240px; }
  #bar { padding-right: 84px; }
  #bar .ver { display: none; }
  #rateBtn, #zoneBtn { padding: 5px 6px; }
}

/* ── v0.4.0: panorama crops and pano mode ───────────────────────────────── */
/* a crop is drawn per pixel through the calibration; what no subframe imaged is transparent and
   shows this hatch (the gap is information, never stretched over) */
.tile .frame canvas.pano { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  background: repeating-linear-gradient(135deg, #181818 0 5px, #2b2b2b 5px 10px); }
.tile .frame .pfb { position: absolute; inset: 0; overflow: hidden; }
.tile .frame .pfb img { position: absolute; inset: auto; height: auto; max-width: none; object-fit: fill; }
.tile .cap { position: relative; }
.tile .nm { padding-right: 52px; }
.tile .ptog { position: absolute; top: 4px; right: 6px; font-size: 13px; padding: 3px 7px; }
.tile .flag.pano { color: var(--rf-ink); font-weight: 600; }
#inspHead .chip { font-size: 14px; }
#inspPano { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; }
#inspStrip { position: relative; height: 100%; aspect-ratio: 11520 / 1080;
  background: repeating-linear-gradient(135deg, #181818 0 5px, #2b2b2b 5px 10px); }
#inspPanoImg, #inspSvg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#inspSvg { pointer-events: none; overflow: visible; }
.nv-aim { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--rf-ground);
  box-shadow: 0 0 0 1px var(--rf-ink); background: radial-gradient(circle, var(--rf-ink) 0 2px, transparent 3px),
  linear-gradient(var(--rf-ink), var(--rf-ink)) center / 2px 100% no-repeat, linear-gradient(var(--rf-ink), var(--rf-ink)) center / 100% 2px no-repeat; box-sizing: border-box; }
