/* ==========================================================================
   WakeSpotting SPA — one stylesheet, two chromes (html.mode-* set pre-paint
   by the boot script in mirror.html; see MODE in mirror/app.js):
   · mode-ios-mirror (/mirror): Apple-true replica of the native iOS app for
     validation. Desktop ≥900px renders inside a phone frame + watermark;
     below that it is full-bleed so the mirror is usable on a real phone.
   · mode-app (/app): the generic web/PWA product. No frame or ribbon ever;
     ≤900px keeps the phone layout (bottom tabs), >900px switches to a left
     nav rail + centered content column (section at the end of this file).
   The design language itself lives in tokens.css (--ws-*); everything here
   is app-scoped (.mir-*) and never leaks into other product pages. Light
   theme = the DS sun/glare tokens; mirror-scoped sun overrides are in the
   LIGHT THEME section below.
   ========================================================================== */

html, body { height: 100%; }
body { overflow: hidden; }

/* ---- stage: desktop phone frame vs full-bleed phone ---------------------- */
.mir-stage {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.mir-stage { perspective: 1400px; }
.mir-frame { position: relative; transition: transform 120ms linear;
  transform-style: preserve-3d; }
.mir-chrome {
  border-radius: 54px; padding: 10px;
  background: linear-gradient(145deg, #343b40, #0d1113 45%, #000);
  box-shadow: var(--ws-shadow-2), inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.mir-screen {
  width: 390px; height: 780px; border-radius: 44px; overflow: hidden;
  position: relative; background: var(--ws-bg);
  border: 1px solid rgba(255, 255, 255, .06);
}
.mir-island {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 27px; border-radius: 18px; background: #000;
  z-index: 60; pointer-events: none;
}
/* watermark bar — validation build, never a product surface. Slim bar across
   the top of the page, above the phone frame (never over the screen). */
.mir-ribbon {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  pointer-events: none; text-align: center;
  padding: 6px 16px; background: rgba(255, 181, 43, .92); color: #032027;
  font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.mir-stage { box-sizing: border-box; padding-top: 26px; }
/* clear the fake dynamic island inside the desktop frame (scoped selector:
   must out-rank the base .mir-nav padding shorthand declared later) */
@media (min-width: 900px) {
  .mir-screen .mir-nav { padding-top: 48px; }
  .mir-screen .mir-gate { padding-top: 60px; }
  /* quiet/suppressed bars still clear the dynamic island */
  .mode-ios-mirror .mir-screen .mir-nav.quiet,
  .mode-ios-mirror .mir-screen .mir-nav:has(> .title.redundant) {
    padding-top: 44px;
  }
}
.mir-simbar {
  display: flex; flex-direction: column; gap: 8px; margin-left: 26px;
  align-self: center;
}
.mir-simbar .lbl { font-size: 10px; letter-spacing: .12em; font-weight: 550;
  color: var(--ws-muted); }
@media (max-width: 899px) { .mir-simbar { display: none; } }

.mir-frame-caption {
  margin-top: 14px; text-align: center;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ws-muted); font-weight: 550;
}
@media (max-width: 899px) {
  .mir-stage { display: block; padding-top: 0; }
  .mir-frame, .mir-chrome { border-radius: 0; padding: 0; background: none;
    box-shadow: none; height: 100%; }
  .mir-screen { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .mir-island, .mir-ribbon, .mir-frame-caption { display: none; }
}

/* ---- 360° scene layer (pano.js) ------------------------------------------ */
/* The panorama sits under everything; its ::after scrim is the masking that
   keeps cards and type readable over the imagery. Content children stack
   above via z-index (the pano itself stays at 0). */
.mir-pano {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  background-image: url("/static/bg/pano-dusk.jpg");
  background-repeat: repeat-x; background-size: auto 128%;
  background-position: 0 0;
}
[data-ws-theme="sun"] .mir-pano { background-image: url("/static/bg/pano-day.jpg"); }
.mir-pano::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(4, 16, 31, .86) 0%, rgba(4, 16, 31, .56) 30%,
    rgba(2, 10, 20, .78) 100%);
}
[data-ws-theme="sun"] .mir-pano::after {
  background: linear-gradient(180deg,
    rgba(247, 250, 252, .9) 0%, rgba(247, 250, 252, .62) 32%,
    rgba(233, 239, 245, .85) 100%);
}
.mir-app > :not(.mir-pano) { position: relative; z-index: 1; }

/* ---- app scaffold -------------------------------------------------------- */
.mir-app {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 80% -5%, rgba(111, 180, 232, .10), transparent 30%),
    linear-gradient(180deg, #081a30 0, #04101f 55%, #020a14 100%);
}
.mir-nav {
  flex: none; display: grid; grid-template-columns: 72px 1fr 72px;
  align-items: center; min-height: 52px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 8px 6px;
  /* scroll-under chrome needs a plate + facing edge: without them, cards
     scrolling beneath the title ghost through and vanish edge-less */
  background: rgba(4, 16, 31, .94);
  border-bottom: 1px solid var(--ws-border);
}
.mir-nav .title {
  text-align: center; font-size: 17px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mir-nav .title.big { font-size: 24px; text-align: left; grid-column: 1 / 3; padding-left: 8px; }
.mir-nav-btn {
  border: 0; background: none; color: var(--ws-lime); cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 8px; text-align: left;
  white-space: nowrap;
}
.mir-nav-btn.right { text-align: right; }
/* icon variant (Sessions "Add photos"): 44px target, glyph-only */
.mir-nav-btn.icon { display: grid; place-items: center; min-width: 44px;
  min-height: 44px; padding: 8px; }
.mir-nav-btn.icon svg { width: 22px; height: 22px; display: block; }
.mir-nav-btn.icon.right { justify-self: end; }

.mir-view {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 16px 16px; -webkit-overflow-scrolling: touch;
}
.mir-view > * + * { margin-top: 18px; }

/* pinned action above the tab bar (Start / Stop / Done) */
/* Dock CTAs (Start / Done / Create) OVERLAY the card body (owner rule):
   the button floats above the tab bar, cards scroll beneath it, and the
   view keeps enough bottom padding that the last card can clear it.
   Desktop product mode keeps the in-flow column dock. */
.mir-dock { flex: none; padding: 8px 16px 10px; }
.mir-dock:empty { display: none; }
.mode-ios-mirror .mir-dock {
  position: absolute; left: 16px; right: 16px; z-index: 6;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
  padding: 0; background: none;
}
.mode-ios-mirror .mir-app:has(.mir-dock:not(:empty)) .mir-view {
  padding-bottom: 92px;
}
@media (max-width: 899px) {
  .mode-app .mir-dock {
    position: absolute; left: 16px; right: 16px; z-index: 6;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
    padding: 0; background: none;
  }
  .mode-app .mir-app:has(.mir-dock:not(:empty)) .mir-view {
    padding-bottom: 92px;
  }
}

/* ---- tab bar ------------------------------------------------------------- */
.mir-tabbar {
  flex: none; display: flex;
  border-top: 1px solid var(--ws-border);
  background: rgba(2, 10, 20, .92);   /* --ws-ink at .92 */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mir-tab {
  flex: 1; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 6px; color: var(--ws-muted);
}
/* glyphs are em-sized off the button so they track accessibility text
   scaling — fixed-px icons become the smallest thing on a large-text screen */
.mir-tab { font-size: 12px; }
.mir-tab svg { width: 2em; height: 2em; }
.mir-tab span { font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.mir-tab.active { color: var(--ws-lime); }

/* ---- recording live bar (above the tab bar, non-Record tabs) ------------- */
.mir-livebar {
  flex: none; margin: 0 12px 4px; padding: 12px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  background: var(--ws-ink); border: 1px solid var(--ws-border);
  border-radius: 10px; color: var(--ws-text);
  font-size: 12px; font-weight: 600;
}
.mir-livebar .dot { width: 8px; height: 8px; border-radius: 50%;
  background: var(--ws-live); flex: none;
  animation: ws-live-pulse 2.4s ease-in-out infinite; }
.mir-livebar .rec { letter-spacing: .1em; font-weight: 650; }
.mir-livebar .time { color: var(--ws-lime); font-variant-numeric: tabular-nums; }
.mir-livebar .where { color: var(--ws-muted); font-weight: 500; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mir-livebar .ret { color: var(--ws-lime); }

/* ---- generic building blocks -------------------------------------------- */
.mir-card { /* Sea & Sky card: a WATER DROP on the scene. ::before is the
  lens — the panorama again, magnified (pano.js keeps --lens-* in sync
  with the pan and the scroll) under a thin tint; ::after is the drop's
  optics: refraction rim, specular glint, slow caustic stir. */
  position: relative;
  background: none;
  border: 1px solid rgba(160, 200, 235, .2); border-radius: 14px;
  padding: 14px; box-shadow: var(--ws-shadow-1);
  overflow: hidden;
  --lens-x: 50%; --lens-y: 62%; --lens-h: 170%;
}
.mir-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  /* the blur filter promotes this layer — rounded overflow-clip can miss
     composited children, so the lens carries the card's radius itself */
  border-radius: inherit;
  background-image:
    linear-gradient(180deg, rgba(12, 28, 50, .42), rgba(4, 16, 31, .5)),
    url("/static/bg/pano-dusk.jpg");
  background-size: auto, auto var(--lens-h);
  background-position: 0 0, var(--lens-x) var(--lens-y);
  background-repeat: no-repeat, repeat-x;
  filter: blur(1px) saturate(1.15) brightness(1.04);
}
[data-ws-theme="sun"] .mir-card::before {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(233, 239, 245, .56)),
    url("/static/bg/pano-day.jpg");
}
.mir-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  /* refraction rim: bright where the drop bends light toward you,
     shadowed opposite; plus one specular glint and drifting caustics */
  box-shadow:
    inset 0 1.5px 1px rgba(242, 247, 252, .34),
    inset 1px 0 1px rgba(242, 247, 252, .12),
    inset 0 -10px 22px -14px rgba(2, 10, 20, .8),
    inset -6px 0 16px -14px rgba(2, 10, 20, .55);
  background:
    radial-gradient(56px 22px at 14% 6%, rgba(255, 255, 255, .28), transparent 70%),
    radial-gradient(closest-side at 24% 32%, rgba(242, 247, 252, .05), transparent 60%),
    radial-gradient(closest-side at 76% 68%, rgba(111, 180, 232, .06), transparent 55%);
  animation: mir-stir 26s ease-in-out infinite alternate;
}
[data-ws-theme="sun"] .mir-card::after {
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, .8),
    inset 1px 0 1px rgba(255, 255, 255, .4),
    inset 0 -10px 22px -14px rgba(11, 34, 55, .35),
    inset -6px 0 16px -14px rgba(11, 34, 55, .22);
}
@keyframes mir-stir {
  from { background-position: 0 0, -6px -4px, 5px 3px; }
  to   { background-position: 0 0, 6px 4px, -5px -3px; }
}
@media (prefers-reduced-motion: reduce) { .mir-card::after { animation: none; } }
/* spectral rim: sunlight refracted through the drop's edge — a rainbow
   segment aimed at the scene's sun (pano.js sets --rim-angle/--rim-vis).
   Spectral literals carry a design-system lint exception: this is light,
   not palette. */
.mir-card > .mir-drop-rim {
  position: absolute; inset: -1px; pointer-events: none;
  border-radius: inherit; padding: 2.75px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  background: conic-gradient(from calc(var(--rim-angle, 0deg) - 55deg),
    transparent 0deg,
    rgba(255, 96, 96, .62) 25deg,
    rgba(255, 181, 43, .57) 45deg,
    rgba(214, 255, 96, .52) 62deg,
    rgba(96, 240, 190, .57) 80deg,
    rgba(96, 170, 255, .62) 98deg,
    rgba(190, 120, 255, .57) 115deg,
    transparent 140deg);
  opacity: var(--rim-vis, 0);
  transition: opacity 300ms ease;
}

/* card content sits above the drop optics */
.mir-card > * { position: relative; z-index: 1; }
.mir-section { font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ws-muted); font-weight: 550; margin-bottom: 8px; }
.mir-card .mir-section:first-child { margin-bottom: 10px; }

.mir-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--ws-border);
}
.mir-row:first-child, .mir-section + .mir-row { border-top: 0; }
.mir-row .main { flex: 1; min-width: 0; }
.mir-row .t { font-size: 14px; font-weight: 550; }
.mir-row .s { font-size: 11px; color: var(--ws-muted); margin-top: 2px; }
/* disclosure chevrons are information, not decoration — faint (3.2:1) and
   even muted (measured 3.16:1 on card ground) fail 4.5:1 at this size;
   text-2 is the secondary-information token and holds in both themes */
.mir-row .chev { color: var(--ws-text-2); font-size: 13px; }
/* tappable rows are a DISTINCT signature from static rows (affordance-
   collision rule: one look = one behavior) — every .tap row shows a
   disclosure chevron unless it already renders an explicit .chev */
.mir-row.tap:not(:has(.chev))::after {
  content: "›"; color: var(--ws-text-2); font-size: 13px; padding-left: 8px;
}
.mir-link {
  border: 0; background: none; color: var(--ws-lime); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 4px 0; white-space: nowrap;
  min-height: 44px;  /* full-size hit area even for quiet text actions */
}
.mir-link:disabled { opacity: .4; cursor: default; }
.mir-link.muted { color: var(--ws-muted); font-weight: 500; }

.mir-error { font-size: 12px; color: var(--ws-live); font-weight: 600; }
.mir-note { font-size: 12px; color: var(--ws-muted); line-height: 1.5; }

/* iOS-style switch */
.mir-switch { position: relative; display: inline-block; flex: none;
  width: 46px; height: 28px; }
.mir-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.mir-switch .knob {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: rgba(94, 122, 129, .35); transition: background var(--ws-t-fast);
}
.mir-switch .knob::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  transition: transform var(--ws-t-fast);
}
.mir-switch input:checked + .knob { background: var(--ws-lime); }
.mir-switch input:checked + .knob::before { transform: translateX(18px); }
.mir-switch input:focus-visible + .knob { outline: 2px solid var(--ws-lime); outline-offset: 2px; }

/* selectable chip row (lens switcher, going control, audience targets) */
.mir-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mir-chips .lbl { font-size: 11px; color: var(--ws-muted); font-weight: 550; }
.mir-chip { cursor: pointer; border: 1px solid var(--ws-border);
  border-radius: 999px; background: rgba(10, 28, 35, .72);
  padding: 7px 12px; font-size: 11px; font-weight: 500; color: var(--ws-text-2);
  font-variant-numeric: tabular-nums; }
/* Toggles carry state markers on BOTH sides — ✓ selected, ○ unselected —
   so a resting row of options never reads as applied facts, and neither
   state is confusable with a plain display chip (ui-rules RULES.md).
   .mir-chip is always a toggle (ui.js chip() sets aria-pressed). */
.mir-chip::before { content: "○ "; opacity: .55; font-weight: 550; }
.mir-chip.sel { background: var(--ws-lime); color: var(--ws-on-lime); border-color: transparent; }
.mir-chip.sel::before { content: "✓ "; opacity: 1; font-weight: 700; }

/* metric tile grid (summary, replay header) */
.mir-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mir-metrics.four { grid-template-columns: repeat(4, 1fr); }
.mir-metrics .ws-metric { padding: 10px 12px; }
.mir-metrics .ws-value { font-size: 20px; }

/* ---- Record tab ---------------------------------------------------------- */
.mir-prelaunch-head { text-align: center; padding-top: 8px; }
.mir-prelaunch-head h2 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.mir-prelaunch-head p { margin: 4px 0 0; font-size: 12px; color: var(--ws-muted); }

/* prelaunch gear tiles — one per kind; lime = selected, muted = none */
.mir-gear-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mir-gear-tile {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 0; padding: 10px 6px 9px; cursor: pointer; text-align: center;
  border: 1px solid var(--ws-border); border-radius: 9px;
  background: rgba(10, 28, 35, .72); color: var(--ws-muted);
  transition: border-color var(--ws-t-fast), background var(--ws-t-fast);
}
.mir-gear-tile svg { width: 32px; height: 32px; display: block; }
.mir-gear-tile.sel {
  color: var(--ws-lime); border-color: rgba(63, 232, 216, .38);
  background: rgba(63, 232, 216, .08);
}
.mir-gear-tile .big {
  margin-top: 4px; font-size: 16px; font-weight: 700; letter-spacing: -.03em;
  color: var(--ws-text); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.mir-gear-tile:not(.sel) .big { color: var(--ws-muted); font-weight: 650; }
.mir-gear-tile .sub {
  max-width: 100%; font-size: 10px; color: var(--ws-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* leading gear icon on rows (pickers, Me→quiver) */
.mir-gear-glyph { flex: none; width: 24px; height: 24px;
  display: grid; place-items: center; color: var(--ws-muted); }
.mir-gear-glyph svg { width: 22px; height: 22px; display: block; }

/* prelaunch empty quiver — "Add your gear" CTA row */
.mir-gear-empty { text-align: center; padding: 10px 4px 6px; }
.mir-gear-empty .t { font-size: 14px; font-weight: 650; }
.mir-gear-empty .mir-note { margin: 4px 0 12px; }
.mir-gear-empty .mir-chips { justify-content: center; }
.mir-gear-add { display: inline-flex; align-items: center; gap: 6px; }
.mir-gear-add svg { width: 18px; height: 18px; display: block; }

/* prelaunch spot conditions — cyan wind (environment), lime riders */
.mir-spot-atoms {
  display: flex; gap: 12px; align-items: baseline; margin-top: 6px;
  font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums;
}
.mir-spot-atoms .wind { color: var(--ws-cyan); }
.mir-spot-atoms .riders { color: var(--ws-lime); }
.mir-spot-atoms .riders.none { color: var(--ws-muted); font-weight: 550; }

.mir-hud { text-align: center; }
.mir-hud .ws-pill { margin-top: 4px; }
.mir-speed { margin-top: 10px; }
.mir-speed .num { font-size: clamp(64px, 22vw, 96px); line-height: .9; font-weight: 700;
  letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.mir-speed .num.idle { opacity: .6; }
.mir-speed .unit { font-size: 16px; font-weight: 550; color: var(--ws-muted); margin-top: 4px; }
.mir-hud-stats { display: flex; justify-content: center; gap: 40px; margin-top: 18px; }
.mir-hud-stats .v { font-size: 26px; font-weight: 700; letter-spacing: -.05em;
  font-variant-numeric: tabular-nums; }
.mir-hud-stats .l { font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ws-muted); font-weight: 550; margin-top: 2px; }
.mir-hud-chips { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
.mir-hud-chips .ws-chip b { font-size: 13px; font-weight: 650; margin-left: 2px;
  font-variant-numeric: tabular-nums; }
.mir-hud-chips .ws-chip .foil { color: var(--ws-lime); }
.mir-watching { font-size: 12px; font-weight: 600; color: var(--ws-cyan);
  font-variant-numeric: tabular-nums; }

/* camera + video during recording — camera vocabulary (white ring, DS §7.2),
   not form buttons. Media is content: neutral/white affordances only.
   Clearly visible on the HUD: solid ink pucks with captions, every session
   (record-anywhere included). */
.mir-cam-row { display: flex; align-items: flex-start; justify-content: center;
  gap: 18px; margin-top: 18px; }
.mir-cam-item { display: flex; flex-direction: column; align-items: center;
  gap: 5px; }
.mir-cam-item .cap { font-size: 10px; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ws-text-2); }
.mir-cam-btn {
  width: 54px; height: 54px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: rgba(2, 8, 11, .72); border: 2px solid rgba(255, 255, 255, .92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
  transition: transform var(--ws-t-fast), filter var(--ws-t-fast);
}
.mir-cam-btn svg { width: 24px; height: 24px; }
.mir-cam-btn:active { transform: scale(.96); filter: brightness(1.15); }
/* video puck: filled dot on the ring = REC vocabulary without using red */
.mir-cam-btn.video { position: relative; }
.mir-cam-btn.video::after { content: ""; position: absolute; top: 3px; right: 3px;
  width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.mir-photo-badge {
  border: 1px solid var(--ws-border); border-radius: 999px; cursor: pointer;
  background: rgba(10, 28, 35, .72); color: var(--ws-text-2);
  padding: 7px 12px; font-size: 11px; font-weight: 550;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* horizontal media strip (replay, summary) — thumbs are the affordance.
   Videos wear a ▶ scrim; on-device drafts are visually distinct: dashed
   white border + "on device" tag (they exist ONLY on this phone). */
.mir-photo-strip { display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.mir-photo-strip .ph { flex: none; width: 74px; height: 74px; padding: 0;
  border: 1px solid var(--ws-border); border-radius: 8px; overflow: hidden;
  background: var(--ws-bg-2); cursor: pointer; position: relative; }
.mir-photo-strip .ph img { width: 100%; height: 100%; object-fit: cover;
  display: block; }
.mir-photo-strip .ph .play { position: absolute; inset: 0; display: grid;
  place-items: center; color: #fff; background: rgba(2, 8, 11, .28);
  pointer-events: none; }
.mir-photo-strip .ph .play svg { width: 22px; height: 22px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.mir-photo-strip .ph.draft { border: 1.5px dashed rgba(255, 255, 255, .6); }
.mir-photo-strip .ph .ondevice { position: absolute; left: 4px; bottom: 4px;
  padding: 2px 5px; border-radius: 999px; background: rgba(2, 8, 11, .82);
  color: #fff; font-size: 7.5px; font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; pointer-events: none; white-space: nowrap; }

/* full-screen photo viewer (inside the app screen) */
.mir-lightbox {
  position: absolute; inset: 0; z-index: 46;
  background: rgba(2, 8, 11, .93);
  display: flex; align-items: center; justify-content: center;
  animation: mir-fade var(--ws-t-med) var(--ws-ease);
}
.mir-lightbox .media { display: flex; align-items: center; justify-content: center;
  width: 100%; max-height: 74%; }
.mir-lightbox img { max-width: 92%; max-height: 74vh; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16); object-fit: contain;
  box-shadow: var(--ws-shadow-2); }
.mir-lightbox .ws-vplayer { width: min(92%, 640px); }
.mir-lightbox .ws-vplayer video { max-height: 66vh; }
.mir-lightbox .x, .mir-lightbox .nav {
  position: absolute; display: grid; place-items: center; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(2, 8, 11, .72); color: #fff; font-size: 17px;
}
.mir-lightbox .x { top: 14px; right: 14px; }
.mir-lightbox .nav { top: 50%; transform: translateY(-50%); font-size: 24px; }
.mir-lightbox .nav.prev { left: 10px; }
.mir-lightbox .nav.next { right: 10px; }
.mir-lightbox .bar { position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: baseline; gap: 10px; padding: 12px 16px
  calc(env(safe-area-inset-bottom, 0px) + 14px); }
.mir-lightbox .meta { flex: 1; display: flex; gap: 8px; align-items: baseline;
  min-width: 0; }
.mir-lightbox .who { font-size: 13px; font-weight: 650; color: #fff; }
.mir-lightbox .when { font-size: 11px; color: var(--ws-muted); }
.mir-lightbox .count { font-size: 11px; color: var(--ws-muted);
  font-variant-numeric: tabular-nums; }
.mir-lightbox .meta .tag { padding: 2px 7px; border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, .55); color: #fff; font-size: 8.5px;
  font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap; }
/* draft actions (Share / Delete draft) in the lightbox bar */
.mir-lightbox .actions { display: flex; gap: 8px; align-items: center; }
.mir-lightbox .actions:empty { display: none; }
.mir-lightbox .actions .del { color: var(--ws-live);
  border-color: rgba(255, 75, 50, .4); background: rgba(2, 8, 11, .6); }

/* runs list */
.mir-run { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.mir-run .n { width: 24px; height: 24px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--ws-bg-2);
  border: 1px solid var(--ws-border); font-size: 11px; font-weight: 650;
  font-variant-numeric: tabular-nums; }
.mir-run .d { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mir-run .m { margin-left: auto; font-size: 11px; color: var(--ws-muted);
  font-variant-numeric: tabular-nums; display: flex; gap: 10px; }

/* ---- Spots tab ----------------------------------------------------------- */
.mir-checkin {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: rgba(63, 232, 216, .12); border: 1px solid rgba(63, 232, 216, .3);
  border-radius: 10px;
}
.mir-checkin .t { font-size: 14px; font-weight: 600; }
.mir-checkin .s { font-size: 11px; color: var(--ws-muted); margin-top: 2px; }
.mir-checkin .ws-btn { min-height: 36px; }

.mir-fav-top { display: flex; align-items: flex-start; gap: 12px; }
.mir-fav-top .names { flex: 1; min-width: 0; cursor: pointer; }
.mir-fav-top .name { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.mir-fav-top .status { font-size: 11px; color: var(--ws-muted); margin-top: 3px; }
.mir-wind { text-align: right; flex: none; }
.mir-wind .v { display: flex; align-items: center; gap: 4px;
  font-size: 22px; font-weight: 700; letter-spacing: -.04em; color: var(--ws-cyan);
  font-variant-numeric: tabular-nums; }
.mir-wind .arrow { font-size: 13px; display: inline-block; }
.mir-wind .u { font-size: 10px; color: var(--ws-muted); }
.mir-heart { border: 0; background: none; cursor: pointer; color: var(--ws-lime);
  font-size: 18px; padding: 2px; flex: none; }
.mir-going { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.mir-going .lbl { font-size: 11px; color: var(--ws-muted); font-weight: 550; }

/* wind hero (spot detail) */
.mir-windhero .now { display: flex; align-items: baseline; gap: 6px; }
.mir-windhero .ms { font-size: 52px; font-weight: 700; letter-spacing: -.05em;
  line-height: .95; color: var(--ws-cyan); font-variant-numeric: tabular-nums; }
.mir-windhero .u { font-size: 16px; font-weight: 550; color: var(--ws-muted); }
.mir-windhero .dir { margin-left: auto; text-align: right; }
.mir-windhero .dir .c { font-size: 15px; font-weight: 650; }
.mir-windhero .dir .g { font-size: 11px; color: var(--ws-muted); margin-top: 3px;
  font-variant-numeric: tabular-nums; }
.mir-windhero .src { font-size: 10px; color: var(--ws-muted); margin-top: 10px; }
.mir-windbars { display: flex; align-items: flex-end; gap: 8px; height: 76px; margin-top: 14px; }
.mir-windbars .col { flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px; justify-content: flex-end; }
.mir-windbars .bar { width: 8px; border-radius: 4px; background: var(--ws-panel-solid); }
.mir-windbars .bar.ok { background: rgba(80, 233, 226, .45); }
.mir-windbars .bar.good { background: var(--ws-lime); }
.mir-windbars .tick { font-size: 9px; color: var(--ws-muted);
  font-variant-numeric: tabular-nums; height: 12px; }

.mir-maplens { border-radius: 12px; overflow: hidden; border: 1px solid var(--ws-border);
  height: 320px; }
.mir-maplens iframe { width: 100%; height: 100%; border: 0; display: block; }
.mir-rider { display: flex; align-items: center; gap: 12px; padding: 9px 0;
  border-top: 1px solid var(--ws-border); }
.mir-rider:first-child { border-top: 0; }
.mir-rider .arr { color: var(--ws-lime); font-size: 13px; }
.mir-rider .name { font-size: 14px; font-weight: 600; flex: 1; }
.mir-rider .spd { font-size: 18px; font-weight: 700; letter-spacing: -.04em;
  color: var(--ws-lime); font-variant-numeric: tabular-nums; }
.mir-live-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.mir-arlens { text-align: center; padding: 8px 0; }
.mir-arlens .glyph { font-size: 34px; color: var(--ws-lime); }
.mir-arlens p { font-size: 12px; color: var(--ws-muted); margin: 8px auto 12px; max-width: 240px; }

/* ---- Sessions tab -------------------------------------------------------- */
.mir-session-card .head { display: flex; align-items: center; gap: 8px; }
.mir-session-card .date { font-size: 15px; font-weight: 550; letter-spacing: -.01em; flex: 1; }
.mir-session-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.mir-session-card .chips .ws-chip { padding: 5px 9px; font-size: 10px; }
/* list-end add-photos action: quiet, labeled, full width */
/* track tools overlay: crop lives on the map it crops */
.mir-trackwrap { position: relative; }
.mir-track-tools { position: absolute; top: 8px; right: 8px;
  display: flex; align-items: center; gap: 6px; }
.mir-track-tool {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 999px; cursor: pointer; border: 1px solid var(--ws-border-hi);
  background: var(--ws-panel); color: var(--ws-text);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.mir-track-tool svg { width: 17px; height: 17px; }
.mir-track-tool:disabled { opacity: .5; }

/* a session with no telemetry shows NO thumb — a grey band reads as a
   broken image (imported summary sessions are the common case) */
.mir-track-thumb.empty { display: none; }

/* spot row in session detail: where it happened, one tap to set/change.
   Glass row, min tap height, pin + name + trailing verb glyph. */
.mir-spot-row {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 8px 12px; margin: 2px 0 10px; cursor: pointer;
  border: 1px solid var(--ws-border-hi); border-radius: var(--ws-r-card);
  background: var(--ws-panel); color: var(--ws-text);
}
.mir-spot-pin { display: grid; place-items: center; color: var(--ws-cyan); }
.mir-spot-pin svg { width: 17px; height: 17px; }
.mir-spot-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 13px; font-weight: 500; }
.mir-spot-go { color: var(--ws-muted); }
.mir-spot-go svg { width: 15px; height: 15px; }
.mir-spot-choice {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 8px 6px; cursor: pointer;
  border-bottom: 1px solid var(--ws-border);
}
.mir-spot-choice:last-child { border-bottom: 0; }
.mir-spot-choice .mir-spot-name { font-size: 14px; }
.mir-spot-dist { font-size: 11px; color: var(--ws-muted); font-variant-numeric: tabular-nums; }
.mir-spot-cur { color: var(--ws-lime); font-weight: 600; }

/* quiver: type-centered groups with an iconic add under each kind */
.mir-quiver-kind { padding: 6px 0 10px; }
.mir-quiver-kind + .mir-quiver-kind { border-top: 1px solid var(--ws-border); }
.mir-quiver-kind .khead { display: flex; align-items: center; gap: 8px;
  padding: 4px 0 2px; }
.mir-quiver-kind .khead svg { width: 22px; height: 22px; color: var(--ws-lime); }
.mir-quiver-kind .kname { font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 550; color: var(--ws-muted); }
.mir-quiver-kind .kcount { font-size: 11px; color: var(--ws-faint);
  font-variant-numeric: tabular-nums; }
.mir-kind-add {
  display: grid; place-items: center; width: 44px; height: 44px;
  margin-top: 2px; border-radius: 999px; cursor: pointer;
  border: 1.5px dashed var(--ws-border-hi); background: none;
  color: var(--ws-lime);
  transition: border-color var(--ws-t-fast), background var(--ws-t-fast);
}
.mir-kind-add svg { width: 18px; height: 18px; }
.mir-kind-add:hover { border-color: var(--ws-lime); background: rgba(63, 232, 216, .08); }
[data-ws-theme="sun"] .mir-kind-add:hover { background: rgba(19, 72, 166, .08); }

/* iconized chips/links: glyph + text share the line */
.ws-chip svg, .mir-link svg { width: 12px; height: 12px; flex: none; }
.ws-chip { gap: 5px; }
.mir-link { display: inline-flex; align-items: center; gap: 5px; }

/* metric cardlets on the session card — compact instrument tiles */
.mir-session-card .mir-metrics { margin-top: 10px; }
.mir-session-card .ws-metric { padding: 9px 10px; border-radius: 9px; }
.mir-session-card .ws-value { font-size: 17px; }
.mir-session-card .ws-label { font-size: 9px; }

/* foot: sharing state left, actions right — one compact row, not two */
/* wrap-friendly: on narrow phones the chips block drops to its own row
   (flex-basis 150px) instead of crushing short labels into ellipses. */
.mir-session-card .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
.mir-session-card .foot .mir-share-chips { flex: 1 1 150px; min-width: 0; margin-top: 0; }
.mir-session-card .foot .actions { margin-left: auto; }
.mir-session-card .foot.confirming .mir-share-chips { display: none; }
.mir-session-card .actions { display: flex; gap: 8px; align-items: center; flex: none; }
.mir-session-card .foot.confirming .actions { flex: 1; }
/* icon action buttons (sharing / delete): 44px touch target, muted stroke;
   accent only on press/hover — lime for share, live-red for delete */
.mir-iconbtn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 0; background: none; cursor: pointer; border-radius: 9px;
  color: var(--ws-muted);
  transition: color var(--ws-t-fast), background var(--ws-t-fast);
}
.mir-iconbtn { font-size: 14px; }
.mir-iconbtn svg { width: 1.6em; height: 1.6em; }
.mir-iconbtn:hover, .mir-iconbtn:active { color: var(--ws-lime); }
.mir-iconbtn.danger:hover, .mir-iconbtn.danger:active { color: var(--ws-live); }
.mir-iconbtn:disabled { opacity: .4; cursor: default; }
/* optical alignment: the 11px inner padding hangs into the card gutter */
.mir-session-card .actions .mir-iconbtn:first-child { margin-left: -11px; }
.mir-session-card .actions .mir-iconbtn.danger { margin-right: -11px; }

/* speed-colored track thumbnail (lazy; empty band when <12 points) */
.mir-track-thumb { display: block; width: 100%; height: 96px; margin-top: 10px;
  border-radius: 9px; border: 1px solid var(--ws-border); background: var(--ws-bg-2); }

/* sharing grants as chips; tap opens the sharing sheet */
.mir-share-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; cursor: pointer; }
.mir-share-chips:empty { display: none; }
.mir-share-chips .ws-chip { padding: 5px 9px; font-size: 10px;
  /* sharing state is metadata, not action — quiet chips (§2.2 one
     luminous focus). Chips carry scope glyphs now, so they're flex; the
     TEXT span does the truncating (audience names are user content and
     can be arbitrarily long/unbroken). */
  border-color: var(--ws-border-hi); color: var(--ws-text-2);
  display: inline-flex; align-items: center; max-width: 100%; flex: none; }
.mir-share-chips .ws-chip > span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mir-share-chips .ws-chip.private { border-color: var(--ws-border); color: var(--ws-muted); }
.mir-share-chips .ws-chip.anon { border-color: var(--ws-border); color: var(--ws-text-2); }

/* two-step delete confirm — red only on the destructive action itself */
.mir-del-confirm {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 9px;
  background: rgba(255, 75, 50, .08); border: 1px solid rgba(255, 75, 50, .3);
}
.mir-del-confirm .q { flex: 1; font-size: 11px; line-height: 1.4; color: var(--ws-text-2); }
.mir-link.danger { color: var(--ws-live); }

.mir-track-canvas, .mir-chart-canvas { display: block; width: 100%;
  border-radius: 10px; border: 1px solid var(--ws-border);
  /* a water wash, not dead grey — the track floats on sea-tinted ground */
  background: linear-gradient(180deg, rgba(111, 180, 232, .1), rgba(111, 180, 232, .2)),
    var(--ws-bg-2); }
[data-ws-theme="sun"] .mir-track-canvas, [data-ws-theme="sun"] .mir-chart-canvas {
  background: linear-gradient(180deg, rgba(14, 111, 168, .08), rgba(14, 111, 168, .16)),
    var(--ws-bg-2); }

/* live GL map in session detail: hidden until the lib + style are ready,
   then it replaces the canvas composite (which keeps the layout height) */
/* two-class selector: must outrank maplibre-gl.css's .maplibregl-map
   { position: relative } (injected later, same single-class specificity) */
.mir-trackwrap .mir-track-map { visibility: hidden; position: absolute; inset: 0;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--ws-border); }
.mir-trackwrap.mapped .mir-track-map { visibility: visible; }
.mir-trackwrap.mapped .mir-track-canvas { visibility: hidden; }
.mir-track-tools { z-index: 5; }
/* map markers — same vocabulary as the canvas: lime start, live-red end,
   aqua cursor, white content dots for photos/clips */
.mir-map-dot { width: 10px; height: 10px; border-radius: 999px;
  background: var(--ws-lime); border: 2.5px solid var(--ws-text); }
.mir-map-dot.end { background: var(--ws-live); }
.mir-map-cursor { width: 12px; height: 12px; border-radius: 999px;
  background: var(--ws-lime); border: 2px solid var(--ws-ink-plate, #020a14); }
.mir-map-photo { width: 11px; height: 11px; border-radius: 999px;
  background: var(--ws-cloud, #fff); border: 1.5px solid var(--ws-ink-plate, #020a14);
  cursor: pointer; }

/* photo count chip on session cards — neutral: photos are content */
.mir-photo-chip { display: inline-flex; align-items: center; gap: 5px;
  color: var(--ws-text-2); }
.mir-photo-chip svg { width: 13px; height: 13px; }
.mir-photo-chip b { font-weight: 650; font-variant-numeric: tabular-nums; }

/* session timeline strip (runs + photo dots) under the speed chart */
.mir-timeline-canvas { display: block; width: 100%; height: 34px;
  cursor: pointer; }

/* add-photos review list (proposal rows) */
.mir-ap-row { display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-top: 1px solid var(--ws-border); }
.mir-ap-row:first-child { border-top: 0; }
.mir-ap-row .thumb { width: 46px; height: 46px; flex: none; border-radius: 8px;
  object-fit: cover; border: 1px solid var(--ws-border); background: var(--ws-bg-2); }
.mir-ap-row .main { flex: 1; min-width: 0; }
.mir-ap-row .t { font-size: 13px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.mir-ap-row .s { display: flex; align-items: baseline; gap: 7px; margin-top: 3px;
  font-size: 11px; color: var(--ws-muted); font-variant-numeric: tabular-nums;
  flex-wrap: wrap; row-gap: 3px; }
/* spot-targeted rows: full-width auto-match hint under the chips */
.mir-ap-row .s.note { display: block; font-size: 10px; margin-top: 2px; }
.mir-ap-row .src { font-size: 9px; font-weight: 550; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 999px;
  border: 1px solid var(--ws-border); color: var(--ws-muted); white-space: nowrap; }
.mir-ap-row .st { font-size: 12px; font-weight: 650; flex: none; }
.mir-ap-row .st.ok { color: var(--ws-lime); }
.mir-ap-row .st.err { color: var(--ws-amber); }
/* video rows: ▶ placeholder thumb + dashed "saved on device" badge */
.mir-ap-row .thumb.videoph { display: grid; place-items: center; color: #fff;
  background: rgba(2, 8, 11, .85); }
.mir-ap-row .thumb.videoph svg { width: 18px; height: 18px; }
.mir-ap-row .src.video { border-style: dashed;
  border-color: rgba(255, 255, 255, .45); color: var(--ws-text-2); }

/* replay: explicit labeled entry into the add flow (pre-targeted) */
.mir-add-media { width: 100%; display: flex; align-items: center;
  justify-content: center; gap: 9px; font-size: 13px; }
.mir-add-media svg { width: 18px; height: 18px; }

/* spot timeline (photos at the spot + my sessions, day-grouped) */
.mir-tl-day { font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ws-muted); font-weight: 550; margin: 12px 0 2px; }
.mir-tl-day:first-of-type { margin-top: 2px; }
.mir-tl-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.mir-tl-row[role="button"] { cursor: pointer; }
.mir-tl-row .thumb { width: 46px; height: 46px; flex: none; border-radius: 8px;
  object-fit: cover; border: 1px solid var(--ws-border); background: var(--ws-bg-2); }
.mir-tl-row .wave { width: 46px; height: 46px; flex: none; border-radius: 8px;
  display: grid; place-items: center; color: var(--ws-lime); font-size: 17px;
  background: rgba(63, 232, 216, .08); border: 1px solid rgba(63, 232, 216, .25); }
.mir-tl-row .main { flex: 1; min-width: 0; }
.mir-tl-row .t { font-size: 13px; font-weight: 600; }
.mir-tl-row .s { font-size: 11px; color: var(--ws-muted); margin-top: 2px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.mir-scrub { width: 100%; margin-top: 8px; }
.mir-scrub-meta { display: flex; justify-content: space-between; font-size: 11px;
  color: var(--ws-muted); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ---- Feed tab ------------------------------------------------------------ */
.mir-post .head { display: flex; align-items: baseline; gap: 6px; }
.mir-post .author { font-size: 14px; font-weight: 600; }
.mir-post .at { font-size: 11px; color: var(--ws-muted); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mir-post .when { font-size: 11px; color: var(--ws-muted); flex: none; }
.mir-post .text { font-size: 14px; line-height: 1.45; margin-top: 8px; color: var(--ws-text-2); }
.mir-post .media { margin-top: 10px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--ws-border); cursor: pointer; }
.mir-post .media img { width: 100%; height: 200px; object-fit: cover; display: block; }
/* video posts: the inline overlay player replaces the still */
.mir-post .media.video { cursor: default; }
.mir-post .media.video .ws-vplayer video { border: 0; border-radius: 9px;
  box-shadow: none; max-height: 300px; }
.mir-sessionchip { display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 10px; border-radius: 9px; background: var(--ws-bg-2);
  border: 1px solid var(--ws-border); cursor: pointer; }
.mir-sessionchip .wave { color: var(--ws-lime); }
.mir-sessionchip .t { font-size: 12px; font-weight: 600; }
.mir-sessionchip .s { font-size: 10px; color: var(--ws-muted); margin-top: 2px;
  font-variant-numeric: tabular-nums; display: flex; gap: 8px; }
.mir-reactions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mir-reaction { cursor: pointer; border: 1px solid var(--ws-border); border-radius: 999px;
  background: rgba(10, 28, 35, .72); color: var(--ws-muted);
  padding: 5px 10px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mir-reaction.mine { background: rgba(63, 232, 216, .18);
  border-color: rgba(63, 232, 216, .4); color: var(--ws-lime); }
.mir-replies { margin-top: 8px; }
.mir-reply { padding: 6px 0 0; }
.mir-reply .h { font-size: 11px; font-weight: 600; }
.mir-reply .h span { color: var(--ws-muted); font-weight: 500; margin-left: 6px; }
.mir-reply .b { font-size: 12px; color: var(--ws-text-2); margin-top: 1px; }
.mir-replybox { display: flex; gap: 8px; margin-top: 8px; }
.mir-replybox .ws-input { padding: 8px 12px; font-size: 13px; }

.mir-composer { flex: none; padding: 10px 12px; border-top: 1px solid var(--ws-border);
  background: rgba(6, 17, 22, .96); }
.mir-composer .attach-previews { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.mir-attachment { display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(63, 232, 216, .12); border: 1px solid rgba(63, 232, 216, .3);
  color: var(--ws-lime); }
.mir-attachment button { border: 0; background: none; color: var(--ws-muted);
  cursor: pointer; font-size: 12px; padding: 0; }
.mir-composer .mir-chips { margin-bottom: 8px; }
.mir-composer .bar { display: flex; gap: 8px; align-items: center; }
.mir-composer .plus { border: 0; background: none; color: var(--ws-lime);
  font-size: 24px; cursor: pointer; padding: 0 2px; line-height: 1; flex: none; }
.mir-composer .ws-input { flex: 1; padding: 9px 13px; font-size: 14px; }
.mir-composer .post { min-height: 38px; padding: 0 15px; border-radius: 9px; }

/* ---- Me tab -------------------------------------------------------------- */
.mir-profile { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.mir-profile .avatar { width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: rgba(63, 232, 216, .14);
  color: var(--ws-lime); font-size: 20px; font-weight: 650; }
.mir-profile .t { font-size: 16px; font-weight: 650; }
.mir-profile .s { font-size: 11px; color: var(--ws-muted); margin-top: 2px; }
.mir-kind { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: rgba(63, 232, 216, .15); color: var(--ws-lime); flex: none; }
.mir-joinrow { display: flex; gap: 8px; align-items: center; padding-top: 10px;
  border-top: 1px solid var(--ws-border); margin-top: 2px; }
/* appearance segmented control (Light / Dark / Auto) */
.mir-seg { /* water-drop selector: glass track, the selected option is a
  bead — accent fill, rim glint, pill shape (same optics family as cards) */
  display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(111, 180, 232, .08), rgba(111, 180, 232, .14)),
    var(--ws-bg-2);
  border: 1px solid var(--ws-border);
}
.mir-seg-btn {
  flex: 1; min-height: 38px; border: 1px solid transparent; border-radius: 999px;
  background: none; cursor: pointer; color: var(--ws-muted);
  font-size: 13px; font-weight: 550;
  transition: background var(--ws-t-fast), color var(--ws-t-fast);
}
.mir-seg-btn.sel { /* the bead: accent drop with a rim glint */
  background: linear-gradient(180deg, var(--ws-lime-2), var(--ws-lime));
  color: var(--ws-on-lime); border-color: transparent;
  box-shadow: var(--ws-shadow-1),
    inset 0 1px 1px rgba(242, 247, 252, .45),
    inset 0 -4px 8px -6px rgba(2, 10, 20, .5);
}
.mir-joinrow .ws-input { padding: 9px 12px; font-size: 13px; }
.mir-signout { width: 100%; border: 0; cursor: pointer; border-radius: 10px;
  background: rgba(255, 75, 50, .1); border: 1px solid rgba(255, 75, 50, .3);
  color: var(--ws-live); font-weight: 650; font-size: 14px; min-height: 46px; }

/* QR plate (share sheet, audience invite) */
.mir-qrplate { display: grid; place-items: center; padding: 14px;
  background: #fff; border-radius: 10px; width: fit-content; margin: 0 auto; }
.mir-qrplate canvas { display: block; image-rendering: pixelated; }
.mir-invite-url { font-size: 11px; font-family: var(--ws-font-mono);
  color: var(--ws-muted); text-align: center; word-break: break-all; margin-top: 10px; }

/* ---- sheets (modal pickers) ---------------------------------------------- */
.mir-sheet-backdrop {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(2, 8, 11, .6);
  display: flex; flex-direction: column; justify-content: flex-end;
  animation: mir-fade var(--ws-t-med) var(--ws-ease);
}
.mir-sheet {
  max-height: 82%; overflow-y: auto;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, var(--ws-panel-solid), var(--ws-bg-2));
  border: 1px solid var(--ws-border); border-bottom: 0;
  padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  animation: mir-rise var(--ws-t-med) var(--ws-ease);
}
.mir-sheet .handle { width: 36px; height: 4px; border-radius: 2px;
  background: var(--ws-border-hi); margin: 2px auto 8px; }
.mir-sheet .bar { display: grid; grid-template-columns: 72px 1fr 72px;
  align-items: center; margin-bottom: 8px; }
.mir-sheet .bar .mir-nav-btn { min-height: 44px; }
.mir-sheet .bar .t { text-align: center; font-size: 15px; font-weight: 650; }
@keyframes mir-rise { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes mir-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mir-sheet, .mir-sheet-backdrop { animation: none; }
  .mir-livebar .dot { animation: none; }
}

/* form rows inside sheets */
.mir-field { margin-top: 12px; }
.mir-field label { display: block; margin-bottom: 6px; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ws-muted); font-weight: 550; }
.mir-slider-row { display: flex; align-items: center; gap: 12px; }
.mir-slider-row output { font-size: 13px; font-weight: 600; width: 58px;
  text-align: right; font-variant-numeric: tabular-nums; }

/* ---- login gate ---------------------------------------------------------- */
.mir-gate {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 32px; text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(80, 233, 226, .1), transparent 40%),
    linear-gradient(180deg, #040d11, #020a14);
}
.mir-gate .wave { color: var(--ws-lime); }
.mir-gate h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.mir-gate .sub { margin: 0; color: var(--ws-muted); font-size: 14px; }
.mir-gate .ws-input { max-width: 300px; text-align: center; margin-top: 12px; }
.mir-gate .ws-btn { width: 300px; max-width: 100%; }
.mir-gate .ws-hint { max-width: 300px; }
.mir-gate-or {
  display: flex; align-items: center; gap: 10px; width: 300px; max-width: 100%;
  margin-top: 10px; color: var(--ws-muted); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.mir-gate-or::before, .mir-gate-or::after {
  content: ""; flex: 1; height: 1px; background: var(--ws-line, rgba(126, 147, 168, .25));
}
.mir-gate .mir-link.muted { font-size: 12px; margin-top: 4px; }

/* empty state */
.mir-empty { text-align: center; padding: 40px 16px; color: var(--ws-muted); }
.mir-empty .glyph { font-size: 30px; margin-bottom: 8px; }
.mir-empty .title { font-size: 14px; font-weight: 550; color: var(--ws-text-2); }
.mir-empty .body { font-size: 12px; margin-top: 4px; line-height: 1.5; }

/* toast */
.mir-toast { position: absolute; left: 50%; bottom: 96px; z-index: 55;
  transform: translateX(-50%); padding: 11px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 650; background: var(--ws-panel-solid);
  border: 1px solid var(--ws-border-hi); box-shadow: var(--ws-shadow-1);
  opacity: 0; pointer-events: none; transition: opacity var(--ws-t-med); white-space: nowrap; }
.mir-toast.show { opacity: 1; }
.mir-toast.err { border-color: rgba(255, 75, 50, .5); }

/* ==========================================================================
   LIGHT THEME — [data-ws-theme="sun"] (DS sun/glare tokens, REDLINES-CARDS
   §11). Hardcoded dark surfaces above re-derived; lime tints become olive
   tints, lime FILLS stay true lime + ink. Canvas renders (track thumbs,
   replay track, speed chart) stay dark-palette per DS §9 — their containers
   keep a fixed night-water ground + token border so they read intentional.
   Keep this section BEFORE the product-mode section: the desktop nav rail
   is theme-independent and must win specificity ties.
   ========================================================================== */
[data-ws-theme="sun"] .mir-app {
  background: linear-gradient(180deg, #ffffff 0, #f4f8f9 55%, #e9f0f1 100%);
}
[data-ws-theme="sun"] .mir-gate {
  background: linear-gradient(180deg, #ffffff, #f4f8f9);
}
[data-ws-theme="sun"] .mir-card { border-color: rgba(11, 34, 55, .22); }
[data-ws-theme="sun"] .mir-tabbar { background: rgba(255, 255, 255, .94); }
[data-ws-theme="sun"] .mir-nav { background: rgba(255, 255, 255, .94); }
/* TRUE-lime fills keep their lime (§11.1) but get a solid olive boundary —
   lime on light grey is ~1.3:1 at the edge; the eye hunts for it */
[data-ws-theme="sun"] .mir-chip.sel { border-color: #1348a6; }
[data-ws-theme="sun"] .mir-composer { background: rgba(255, 255, 255, .96); }
[data-ws-theme="sun"] .mir-sheet { background: var(--ws-panel-solid); }
[data-ws-theme="sun"] .mir-chip,
[data-ws-theme="sun"] .mir-reaction,
[data-ws-theme="sun"] .mir-gear-tile { background: var(--ws-panel-solid); }
/* lime fills keep TRUE lime + ink text (DS §11.1 color law) */
[data-ws-theme="sun"] .mir-chip.sel { background: #1348a6; color: #ffffff; }
[data-ws-theme="sun"] .mir-gear-tile.sel {
  background: rgba(19, 72, 166, .10); border-color: rgba(19, 72, 166, .38);
}
[data-ws-theme="sun"] .mir-checkin {
  background: rgba(19, 72, 166, .10); border-color: rgba(19, 72, 166, .3);
}
[data-ws-theme="sun"] .mir-reaction.mine {
  background: rgba(19, 72, 166, .12); border-color: rgba(19, 72, 166, .4);
}
[data-ws-theme="sun"] .mir-attachment {
  background: rgba(19, 72, 166, .10); border-color: rgba(19, 72, 166, .3);
}
[data-ws-theme="sun"] .mir-profile .avatar,
[data-ws-theme="sun"] .mir-kind { background: rgba(19, 72, 166, .12); }
[data-ws-theme="sun"] .mir-share-chips .ws-chip { border-color: rgba(19, 72, 166, .35); }
[data-ws-theme="sun"] .mir-share-chips .ws-chip.private,
[data-ws-theme="sun"] .mir-share-chips .ws-chip.anon { border-color: var(--ws-border); }
[data-ws-theme="sun"] .mir-windbars .bar { background: rgba(10, 20, 24, .08); }
[data-ws-theme="sun"] .mir-windbars .bar.ok { background: rgba(11, 110, 105, .3); }
/* Light-canvas decision (2026-08-22, PARITY toolkit round 3): track thumbs
   and track canvases follow the theme — the sun ramp (--ws-track-* sun
   values) is tuned for light ground, so a dark slab per card is no longer
   needed. The replay CHART keeps its self-drawn night plate (a data plate,
   not a map — deliberate, still DS §9). */

[data-ws-theme="sun"] .mir-photo-badge { background: var(--ws-panel-solid); }
[data-ws-theme="sun"] .mir-tl-row .wave {
  background: rgba(19, 72, 166, .10); border-color: rgba(19, 72, 166, .3);
  color: #1348a6;
}
/* bare red text is banned in sun (3.1:1) — destructive goes white-on-red */
[data-ws-theme="sun"] .mir-error { color: var(--ws-text); }
[data-ws-theme="sun"] .mir-link.danger {
  color: #fff; background: var(--ws-live); padding: 4px 10px; border-radius: 9px;
}
[data-ws-theme="sun"] .mir-signout {
  background: var(--ws-live); border-color: transparent; color: #fff;
}

/* ==========================================================================
   PRODUCT MODE — /app (html.mode-app): the generic web/PWA app.
   No watermark ribbon, no phone frame at any size. ≤900px keeps the phone
   layout (bottom tab bar); >900px lays out a left nav rail (5 tabs vertical,
   brand mark on top, theme-independent dark) + a centered ~640px content
   column. The recording live bar spans the content column.
   ========================================================================== */
.mode-app .mir-ribbon,
.mode-app .mir-island,
.mode-app .mir-frame-caption { display: none; }
.mode-app .mir-stage { display: block; padding: 0; }
.mode-app .mir-frame, .mode-app .mir-chrome {
  border-radius: 0; padding: 0; background: none; box-shadow: none; height: 100%;
}
.mode-app .mir-screen { width: 100%; height: 100%; border-radius: 0; border: 0; }
/* no fake dynamic island to clear — safe-area insets only (Android/desktop) */
.mode-app .mir-screen .mir-nav {
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
}
.mode-app .mir-screen .mir-gate { padding-top: 32px; }

/* brand: hidden everywhere except the desktop nav rail */
.mir-brand {
  display: none; align-items: center; gap: 10px; padding: 6px 14px 20px;
  font-size: 12px; font-weight: 550; letter-spacing: .08em; color: #f2f7fc;
}
.mir-brand .ws-brand-mark { display: block; flex: none; }

/* The tab bar IS the page selector — a headline repeating it is dropped,
   and a bar with no actions collapses to the safe-area strip (detail pages
   keep their real titles). Applies to the phone-frame mirror at every
   viewport, and to the product chrome on mobile. */
.mode-ios-mirror .mir-nav .title.redundant { display: none; }
.mode-ios-mirror .mir-nav:has(> .title.redundant) {
  min-height: 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
  padding-bottom: 4px;
}
.mode-ios-mirror .mir-nav.quiet {
  min-height: 0; padding: env(safe-area-inset-top, 0px) 0 0;
  border-bottom: 0; background: transparent;
}
.mode-ios-mirror .mir-nav.quiet > * { display: none; }
@media (max-width: 899px) {
  .mode-app .mir-nav .title.redundant { display: none; }
  .mode-app .mir-nav:has(> .title.redundant) {
    min-height: 0;
    padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
    padding-bottom: 4px;
  }
  .mode-app .mir-nav.quiet {
    min-height: 0; padding: env(safe-area-inset-top, 0px) 0 0;
    border-bottom: 0; background: transparent;
  }
  .mode-app .mir-nav.quiet > * { display: none; }
}

@media (min-width: 900px) {
  .mode-app .mir-app {
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
    grid-template-rows: auto 1fr auto auto auto;
  }
  /* the tab bar becomes the rail — theme-independent night-water dark, so
     colors are literals here (tokens flip under the sun theme) */
  .mode-app .mir-tabbar {
    grid-column: 1; grid-row: 1 / -1;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 20px 12px calc(env(safe-area-inset-bottom, 0px) + 20px);
    border-top: 0; border-right: 1px solid rgba(160, 200, 235, .12);
    background: linear-gradient(180deg, #081a30, #04101f 60%, #020a14);
  }
  .mode-app .mir-tabbar .mir-brand { display: flex; }
  .mode-app .mir-tabbar .mir-tab {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 11px 14px; border-radius: 9px; color: #7e93a8;
  }
  .mode-app .mir-tabbar .mir-tab span { font-size: 13px; }
  .mode-app .mir-tabbar .mir-tab:hover { background: rgba(160, 200, 235, .06); }
  .mode-app .mir-tabbar .mir-tab.active {
    color: #3fe8d8; background: rgba(63, 232, 216, .08);
  }

  /* content column: everything except the rail, centered at ~640px */
  .mode-app .mir-nav      { grid-column: 2; grid-row: 1; }
  .mode-app .mir-view     { grid-column: 2; grid-row: 2; }
  .mode-app .mir-composer { grid-column: 2; grid-row: 3; }
  .mode-app .mir-dock     { grid-column: 2; grid-row: 4; }
  .mode-app .mir-livebar  { grid-column: 2; grid-row: 5; margin: 0 auto 10px; }
  .mode-app .mir-nav, .mode-app .mir-view, .mode-app .mir-composer,
  .mode-app .mir-dock, .mode-app .mir-livebar {
    width: min(640px, 100%); margin-left: auto; margin-right: auto;
  }
  .mode-app .mir-sheet {
    width: min(640px, 100%); margin: 0 auto; border-radius: 16px 16px 0 0;
  }
}

/* ---- Spots tab: rows + search + favourites drag order (spot-domain) ------ */
.mir-spot-search { min-height: 40px; padding: 10px 14px; font-size: 14px; }
/* every spot is its own card (owner rule) — cards in a section stack with
   their own rhythm; the row divider is history */
.mir-cardlist { display: grid; gap: 12px; }
.mir-cardlist .mir-card { margin: 0; }

.mir-spotrow {
  display: flex; align-items: center; gap: 10px; padding: 2px 0; min-height: 48px;
  /* rows must read as rows: the quiet border melted into the card ground
     (divider-visibility check) — the hi token keeps the separation real */
  border-top: 0;
}
.mir-spotrow:first-child { border-top: 0; }
.mir-spotrow.dragging {
  opacity: .92; background: rgba(63, 232, 216, .06);
  border-radius: 8px; border-top-color: transparent;
}
.mir-spotrow .main { flex: 1; min-width: 0; cursor: pointer; }
.mir-spotrow .t { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mir-spotrow .t .nm {
  font-size: 14px; font-weight: 600;
  /* names wrap (never single-line-truncate) but clamp at two lines so a
     long name can't squeeze the row into a ragged column */
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mir-spotrow .s { font-size: 11px; color: var(--ws-muted); margin-top: 2px; }
.mir-spotrow .wind {
  display: flex; align-items: baseline; gap: 3px; flex: none;
  color: var(--ws-cyan); font-variant-numeric: tabular-nums;
}
.mir-spotrow .wind .arrow { font-size: 10px; display: inline-block; align-self: center; }
.mir-spotrow .wind .v { font-size: 14px; font-weight: 650; letter-spacing: -.03em; }
.mir-spotrow .wind .u { font-size: 9px; color: var(--ws-muted); }
.mir-spotrow .riders {
  flex: none; font-size: 10px; font-weight: 650; color: var(--ws-lime);
  padding: 2px 6px; border-radius: 999px; border: 1px solid rgba(63, 232, 216, .3);
}
.mir-spotrow .riders.none { color: var(--ws-muted); border-color: var(--ws-border); }
.mir-vis { display: inline-grid; place-items: center; flex: none;
  width: 14px; height: 14px; color: var(--ws-muted); }
.mir-vis svg { width: 14px; height: 14px; display: block; }
.mir-vis.private { color: var(--ws-amber); }
.mir-vis.audience { color: var(--ws-cyan); }
.mir-star { min-width: 44px; min-height: 44px;
  border: 0; background: none; cursor: pointer; flex: none;
  font-size: 20px; line-height: 1; color: var(--ws-faint);
  min-width: 38px; min-height: 40px; margin: -8px -12px -8px -8px;
}
.mir-star.on { color: var(--ws-lime); }
.mir-star.big { font-size: 24px; margin: -6px 0; }
.mir-drag {
  flex: none; cursor: grab; color: var(--ws-faint); font-size: 16px;
  min-width: 34px; min-height: 40px; display: grid; place-items: center;
  margin: -8px 0 -8px -8px; user-select: none;
  touch-action: none; /* pointer events own the gesture (long-press-drag) */
}
.mir-spotrow.dragging .mir-drag { cursor: grabbing; color: var(--ws-lime); }

/* spot detail: about card (visibility badge + description + rose + owner) */
.mir-visbadge { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.mir-visbadge svg { width: 12px; height: 12px; }
.mir-visbadge.private { border-color: rgba(255, 181, 43, .4); color: var(--ws-amber); }
.mir-visbadge.audience { border-color: rgba(80, 233, 226, .35); color: var(--ws-cyan); }
.mir-spot-desc { margin: 10px 0 0; font-size: 13px; line-height: 1.55;
  color: var(--ws-text-2); white-space: pre-line; }
.mir-owner-row { display: flex; align-items: center; gap: 10px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--ws-border); }

/* multi-owner: owners summary row (detail) + manage-owners sheet */
.mir-owners-row { display: flex; align-items: center; gap: 10px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--ws-border); }
.mir-owner-avs { display: flex; flex: none; }
.mir-owner-av { width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: rgba(63, 232, 216, .14);
  color: var(--ws-lime); font-size: 12px; font-weight: 650; }
.mir-owner-avs .mir-owner-av { border: 1.5px solid var(--ws-bg-2); }
.mir-owner-avs .mir-owner-av + .mir-owner-av { margin-left: -7px; }
.mir-creator-chip { font-size: 9px; font-weight: 550; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px; flex: none;
  background: rgba(80, 233, 226, .12); color: var(--ws-cyan);
  border: 1px solid rgba(80, 233, 226, .3); }
[data-ws-theme="sun"] .mir-owner-av { background: rgba(19, 72, 166, .12); }

/* wind rose (Studio meta control + read-only detail display) */
.mir-rose-wrap { display: flex; justify-content: center; padding: 4px 0; }
.mir-rose-wrap.small { flex-direction: column; align-items: center; gap: 2px;
  margin-top: 12px; }
.mir-rose-wrap.small .lbl { font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ws-muted); font-weight: 550; }
.mir-rose .wedge path {
  fill: rgba(10, 28, 35, .8); stroke: var(--ws-border-hi); stroke-width: 1;
  transition: fill var(--ws-t-fast);
}
.mir-rose .wedge text { fill: var(--ws-muted); font: 700 11px var(--ws-font); }
.mir-rose .wedge.sel path { fill: var(--ws-lime); stroke: transparent; }
.mir-rose .wedge.sel text { fill: var(--ws-on-lime); font-weight: 650; }
.mir-rose .wedge[role="button"] { cursor: pointer; }
.mir-rose .hub { fill: none; stroke: var(--ws-border); }

/* ---- Spot Studio: full-screen MapLibre polygon editor -------------------- */
.mir-studio {
  position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column;
  background: var(--ws-bg);
}
.mir-studio-head {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; height: 52px; padding: 0 6px;
  border-bottom: 1px solid var(--ws-border);
}
.mir-studio-head .t { font-size: 15px; font-weight: 650; text-align: center; }
.mir-studio-body { flex: 1; position: relative; min-height: 0; }
/* doubled class beats maplibre-gl.css's own `.maplibregl-map{position:relative}`
   (it loads after this file and would collapse the container to 0 height) */
.mir-studio-map.mir-studio-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.mir-studio-map .maplibregl-ctrl-attrib { font-size: 9px; }
.mir-studio-tools {
  position: absolute; left: 10px; right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border-radius: var(--ws-r-md);
  background: var(--ws-glass-solid); border: 1px solid var(--ws-border-hi);
  box-shadow: var(--ws-shadow-1);
}
.mir-studio-tools .stages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mir-studio-tools .stages .mir-chip { padding: 5px 9px; }
.mir-studio-tools .hint { font-size: 11px; line-height: 1.45; color: var(--ws-muted); }
.mir-studio-tools .acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mir-hug-stat {
  font-size: 11px; font-weight: 650; color: var(--ws-lime);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* hazard ⚠ + POI pins on the studio map (twin styles live in tokens.css for
   the live viewer) */
.mir-hz-pin, .mir-poi-pin {
  display: grid; place-items: center; cursor: pointer;
  border-radius: 50%; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.mir-hz-pin {
  width: 26px; height: 26px; color: var(--ws-amber);
  background: var(--ws-glass-solid); border: 1.5px solid var(--ws-amber);
}
.mir-hz-pin svg { width: 16px; height: 16px; }
.mir-poi-pin {
  width: 28px; height: 28px; color: var(--ws-text);
  background: var(--ws-glass-solid); border: 1.5px solid var(--ws-border-hi);
}
.mir-poi-pin svg { width: 17px; height: 17px; }

/* POI palette in the toolbar */
.mir-poi-palette { align-items: center; }
.mir-poi-tool {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 8px; cursor: pointer; color: var(--ws-text);
  background: var(--ws-glass-solid); border: 1px solid var(--ws-border-hi);
}
.mir-poi-tool svg { width: 20px; height: 20px; }
.mir-poi-tool.sel {
  color: var(--ws-on-lime); background: var(--ws-lime); border-color: transparent;
}
.mir-poi-hint { font-size: 11px; font-weight: 600; color: var(--ws-lime); }

/* note editor + shore-trim warning dialog (in-studio card, above the tools) */
.mir-studio-dialog {
  position: absolute; left: 14px; right: 14px; z-index: 3;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  padding: 14px; border-radius: var(--ws-r-md);
  background: var(--ws-glass-solid); border: 1px solid var(--ws-border-hi);
  box-shadow: var(--ws-shadow-2);
}
.mir-studio-dialog .t { font-size: 14px; font-weight: 650; }
.mir-studio-dialog .b {
  margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--ws-muted);
}
.mir-studio-dialog .btns {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
}
.mir-studio-notefield {
  margin-top: 10px; min-height: 56px; resize: vertical; font-size: 14px;
  width: 100%;
}
@media (min-width: 900px) {
  .mir-studio-dialog { left: auto; right: 24px; width: 360px; }
}
.mir-studio-meta {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  background: var(--ws-bg);
}
.mir-studio-metabar {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; height: 46px; padding: 0 6px;
  border-bottom: 1px solid var(--ws-border);
}
.mir-studio-metabar .t { font-size: 14px; font-weight: 650; text-align: center; }
.mir-studio-metabody { flex: 1; overflow-y: auto; padding: 4px 16px 24px; }
.mir-studio-desc { min-height: 74px; resize: vertical; font-size: 14px; }
.mir-studio .vis-ic { display: inline-grid; place-items: center; margin-right: 5px; }
.mir-studio .vis-ic svg { width: 12px; height: 12px; }
.mir-studio .mir-chip { display: inline-flex; align-items: center; }

/* ---- sessions & plans polish batch ---------------------------------------- */

/* one-button Going (spot detail): lime outline → filled when set */
.mir-goingbtn { width: 100%; background: transparent;
  border: 1.5px solid var(--ws-lime); color: var(--ws-lime); font-weight: 650; }
.mir-goingbtn.set { background: var(--ws-lime); color: var(--ws-on-lime);
  border-color: transparent; }
/* sun: outrank tokens' .ws-btn:not(primary):not(danger) reskin — a SET plan
   keeps the true-lime fill with ink text (same law as .ws-btn-primary) */
html[data-ws-theme="sun"] .ws-btn.mir-goingbtn.set {
  background: #1348a6; color: #ffffff; }

/* Going sheet: native date/time pickers in DS clothes */
.mir-goingsheet .mir-going-fields { display: flex; gap: 10px; }
.mir-goingsheet .mir-field { flex: 1; margin-top: 4px; }
.mir-goingsheet input { width: 100%; color-scheme: dark; }
[data-ws-theme="sun"] .mir-goingsheet input { color-scheme: light; }
.mir-notgoing { background: rgba(255, 75, 50, .1);
  border: 1px solid rgba(255, 75, 50, .3); color: var(--ws-live); font-weight: 650; }
/* sun: bare red text is banned (3.1:1) — destructive goes white-on-red.
   (.mir-sheet keeps the selector above tokens' .ws-btn:not():not() reskin) */
html[data-ws-theme="sun"] .mir-sheet .ws-btn.mir-notgoing {
  background: var(--ws-live); border-color: transparent; color: #fff; }

/* replay tools row: Cropped chip + Crop / Undo actions */
.mir-replay-tools { display: flex; align-items: center; gap: 12px;
  margin: 10px 2px 2px; }
.mir-crop-chip { color: var(--ws-amber);
  border-color: rgba(255, 181, 43, .4); background: rgba(255, 181, 43, .1); }

/* crop mode: time strip with two drag handles */
.mir-crop-strip { position: relative; margin-top: 12px; height: 44px; }
.mir-crop-canvas { display: block; width: 100%; height: 44px; }
.mir-crop-handle { position: absolute; top: 0; bottom: 0; width: 30px;
  margin-left: -15px; display: grid; place-items: center; cursor: grab;
  touch-action: none; z-index: 2; }
.mir-crop-handle .grip { width: 14px; height: 30px; border-radius: 7px;
  background: var(--ws-lime); border: 2px solid #032027;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .45); pointer-events: none; }
.mir-crop-handle.drag { cursor: grabbing; }
.mir-crop-handle.drag .grip, .mir-crop-handle:active .grip {
  transform: scale(1.12); }
.mir-crop-handle:focus-visible .grip { outline: 2px solid var(--ws-cyan);
  outline-offset: 2px; }
.mir-crop-hint { color: var(--ws-amber); font-weight: 600; margin: 8px 2px 0; }
.mir-crop-preview { display: flex; align-items: baseline; gap: 8px;
  margin: 8px 2px 0; font-variant-numeric: tabular-nums; }
.mir-crop-preview .lbl { font-size: 11px; color: var(--ws-muted); font-weight: 550; }
.mir-crop-preview .v { font-size: 16px; font-weight: 650; }
.mir-crop-preview .dot { color: var(--ws-faint); }
.mir-crop-actions { display: flex; gap: 10px; margin-top: 12px; }

/* share-link row: mono truncated URL + copy */
.mir-linkrow { display: flex; align-items: center; gap: 6px; min-width: 0;
  margin-top: 2px; }
.mir-linkrow .url { flex: 1; min-width: 0; font-family: var(--ws-font-mono);
  font-size: 11.5px; color: var(--ws-text-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.mir-linkexp { margin-top: 6px; font-size: 11px; font-weight: 600;
  color: var(--ws-amber); }
.mir-linkactions { display: flex; align-items: center; gap: 16px; margin-top: 6px; }

/* feed v2: shared sessions in the stream */
.mir-feedsess-head { display: flex; align-items: baseline; gap: 8px; }
.mir-feedsess-rider { font-size: 14px; font-weight: 700; color: var(--ws-text); }
.mir-feedsess-where { font-size: 11px; color: var(--ws-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mir-feed-media { display: flex; gap: 6px; overflow-x: auto; margin-top: 9px; }
.mir-feed-thumb { width: 84px; height: 84px; object-fit: cover; flex: none;
  border-radius: 10px; border: 1px solid var(--ws-border); cursor: pointer; }

/* unattached footage pile */
.mir-footage { display: flex; flex-direction: column; gap: 10px; }
.mir-footage-row { display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--ws-border); border-radius: 12px; padding: 8px; }
.mir-footage-thumb { width: 56px; height: 56px; object-fit: cover;
  border-radius: 8px; flex: none; }
.mir-footage-meta { min-width: 0; }
.mir-footage-when { font-size: 12px; font-weight: 600; color: var(--ws-text); }
.mir-footage-kind { font-size: 11px; color: var(--ws-muted); }
.mir-footage-actions { margin-left: auto; display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mir-footage-pick { font-size: 12px; padding: 6px 8px; max-width: 130px;
  background: var(--ws-panel); color: var(--ws-text);
  border: 1px solid var(--ws-border-hi); border-radius: 9px; }
