/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* maplibre-gl.css is auto-included as its own <link> by
 * `stylesheet_link_tag :app` (Rails 8 globs every top-level CSS file in
 * app/assets/stylesheets/). A plain `@import "vendor/maplibre-gl.css"`
 * used to live here, but Propshaft fingerprints the underlying file
 * without rewriting plain CSS `@import` URLs — so browsers fetched the
 * un-fingerprinted path and logged a 404 on every map page load. The
 * explicit link tag already loads the styles; no import needed. */

/* /map page: dim MapLibre's default white-on-black attribution bar so it
 * sits quietly under the heat field instead of punching a bright box
 * over it. Matches the now-card / scrubber translucent-dark aesthetic.
 *
 * Specificity note: vendor maplibre-gl.css ships
 *   `.maplibregl-ctrl.maplibregl-ctrl-attrib { background-color: rgba(255,255,255,.5); }`
 *   `.maplibregl-ctrl-attrib a { color: rgba(0,0,0,.75); }`
 * and is loaded AFTER application.css via Rails 8's stylesheet manifest,
 * so single-class selectors here lose the cascade. We chain
 * `.maplibregl-ctrl.maplibregl-ctrl-attrib` (two classes) plus the
 * controller attribute to land at specificity 0,2,1 — beating vendor's
 * 0,2,0 and also fixing the `a` rule that vendor's source-order tie was
 * winning. */
[data-controller~="fishing-map-explore"] .maplibregl-ctrl.maplibregl-ctrl-attrib {
  background: rgba(13, 21, 33, 0.55);
  color: rgba(220, 230, 240, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

[data-controller~="fishing-map-explore"] .maplibregl-ctrl.maplibregl-ctrl-attrib a {
  color: rgba(220, 230, 240, 0.85);
}

[data-controller~="fishing-map-explore"] .maplibregl-ctrl.maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-button {
  background-color: rgba(13, 21, 33, 0.55);
}

/* The OPEN credit panel (tap the "i"). With every depth survey credited it
 * runs ~370 characters, and on a 320 px phone it grew up under the header
 * cards (z-20/z-30) past the top of the map, and in landscape off its left
 * edge. Open, its stack sits above the chrome (below the z-40 popovers), and
 * map_core.js fitAttributionPanel pins it where the "i" was (out of the
 * stack's flow, so it can't rewrap the landscape columns) and caps it to the
 * map (--attrib-*, measured on open and on resize): the text scrolls inside.
 * Every rule needs .maplibregl-compact-show, so the collapsed "i" is exactly
 * as before. */
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-bottom-right:has(> .maplibregl-ctrl-attrib.maplibregl-compact-show) {
  z-index: 35;
}
[data-controller~="fishing-map-explore"] .maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact-show {
  max-width: var(--attrib-max-w, none);
  background: rgba(13, 21, 33, 0.9);
}
[data-controller~="fishing-map-explore"] .maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact-show.fishing-map-attrib-pinned {
  position: absolute;
  right: var(--attrib-right, 0);
  bottom: var(--attrib-bottom, 0);
  margin: 0;
  /* Out of flow its shrink-to-fit width would be the narrow stack's: size to
   * the text, up to the cap. */
  width: max-content;
}
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {
  max-height: var(--attrib-max-h, none);
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}

/* Zoom +/- buttons on /map: dark translucent to match the chrome cards
 * rather than the bright-white default. Inverts the icon colour so the
 * +/- glyphs read against the dark background. */
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-group {
  background: rgba(13, 21, 33, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(220, 230, 240, 0.12);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-group button {
  filter: invert(1) hue-rotate(180deg);
  background-color: transparent;
  /* Touch-target bump. Vendor maplibre-gl.css ships fixed 29x29 buttons
   * — well below the 44x44 WCAG / Apple HIG / Material guideline and
   * cramped to mis-tap on mobile. Bump to 40x40 (Windy's zoom group is
   * ~36 each, so this lands just above their target while staying
   * compact). The 29x29 +/- glyph is a background-image at
   * `background-position: 50%` with no `background-size`, so it stays
   * pixel-perfectly centred inside the larger button — no icon scaling
   * needed. Chained-class specificity (0,2,1 with the controller attr)
   * beats vendor's single-class `.maplibregl-ctrl-group button` rule. */
  width: 40px;
  height: 40px;
}
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-group button:hover {
  background-color: rgba(255, 87, 34, 0.15);
}
/* Suppress the vendor blue `box-shadow: 0 0 2px 2px #0096ff` halo on
 * the +/- zoom buttons. Vendor maplibre-gl.css ships three layered
 * rules:
 *   `button:focus`               -> blue shadow
 *   `button:focus:focus-visible` -> blue shadow
 *   `button:focus:not(:focus-visible)` -> none
 * On mouse-click, between focus and the browser's :focus-visible
 * evaluation, only `:focus` matches — so the blue ring flashes briefly
 * before vendor's `:not(:focus-visible)` rule strips it. Cover BOTH
 * the plain :focus and the :focus:focus-visible variant so the only
 * ring on this control is our accent-orange outline (already in place
 * via the `[data-controller~="fishing-map-explore"] button:focus-visible`
 * rule below). Specificity: 0,2,2 — beats vendor's 0,1,2/0,1,3 thanks
 * to the controller attribute selector. Finishes the focus-consistency
 * thread started in iter 31/32 — canvas, attribution, and zoom controls
 * now all share one accent-orange `:focus-visible` ring. */
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-group button:focus,
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-group button:focus:focus-visible {
  box-shadow: none;
}
/* Vendor maplibre-gl.css separates stacked control buttons with
 *   `button + button { border-top: 1px solid #ddd; }`.
 * Against our dark translucent group bg that hairline reads as bright
 * white and breaks the "single rounded pill" look (cf. Windy's
 * .rhbottom__map-tools zoom group, which has no visible divider at
 * all). Drop it back to the same subtle on-dark line we use for the
 * group's own border. The invert filter on the buttons would flip a
 * dark divider to light, so we set the colour pre-invert — i.e. light
 * → dark after invert. Specificity matches the chained group selector
 * above so we beat vendor's source-order tie. */
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-group button + button {
  border-top-color: rgba(35, 25, 15, 0.12);
}

/* Lift the bottom-right MapLibre controls (zoom +/-, attribution) above
 * the full-width bottom timebar at every width — the bar owns the bottom
 * edge now (inset-x-0 bottom-0), so the default bottom:0 ctrl stack would
 * sit underneath it and lose its pointer events. Offset = the bar's height
 * (each control group adds its own 10px bottom margin as the gap). CSS
 * can't read the bar's height (anchor() can't reach it: the timebar sits
 * outside the map container that holds this stack), so
 * --fishing-map-ctrl-bottom is the measured height per layout:
 *   ≥md             one ~72–78px row
 *   <md             main row + one field-legend row + pin row: 115–120px
 *   <md, ≤500 tall  the wind legend row is shed (see below): 90px, but a
 *                   depth or swell legend row still shows: 120px
 * The old flat 100px left Zoom out under the bar on every phone (F14). */
[data-controller~="fishing-map-explore"] {
  --fishing-map-ctrl-bottom: 74px;
}
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-bottom-right {
  bottom: var(--fishing-map-ctrl-bottom);
}
@media (max-width: 767.98px) {
  [data-controller~="fishing-map-explore"] {
    --fishing-map-ctrl-bottom: 120px;
  }
}
@media (max-width: 767.98px) and (max-height: 500px) {
  [data-controller~="fishing-map-explore"] {
    --fishing-map-ctrl-bottom: 90px;
  }
  [data-controller~="fishing-map-explore"]:has(.fishing-map-timebar > aside:is([data-depth-legend], [data-swell-legend], [data-sst-legend], [data-current-legend]):not([hidden])) {
    --fishing-map-ctrl-bottom: 120px;
  }
}

/* Short viewports: the five-row layer rail (~274px tall from top-4) reached
 * down over the bottom-right stack — on an iPhone SE's Safari viewport
 * (375×548) it hid the attribution "i" (which carries the depth CC BY
 * credit) and 40px of Find-my-location; in landscape the Depth row sank
 * under the timebar and could not be tapped. Tighten the rail until the
 * stack (top ≈ viewport − 340px) has room again. The six-row rail (Sat)
 * is ~327px at full size, so it needs ≈ 690px of height; below that, a
 * first step keeps the 20px icons with 40px rows (~270px, fits down to
 * ≈ 630px), then the small-icon rail (~31px rows, ~213px). */
@media (max-height: 699.98px) {
  .fishing-map-layer-rail {
    gap: 0.25rem;
    padding: 0.25rem;
  }
  .fishing-map-layer-rail > label {
    padding-block: 0.125rem;
    min-height: 2.5rem;
  }
  .fishing-map-layer-rail > label > span {
    margin-top: 0;
    line-height: 1.2;
  }
}
@media (max-height: 639.98px) {
  .fishing-map-layer-rail > label {
    min-height: 0;
  }
  .fishing-map-layer-rail > label > svg {
    width: 1rem;
    height: 1rem;
  }
}
/* Seven rows (the Current row, MAP_CURRENTS_ENABLED): the full-size rail is
 * ~380px from top-4, so it needs ≈ 736px of height clear of the bottom-right
 * stack. The 40px-row step takes over below 740px (~312px, fits down to
 * ≈ 668px) and the small-icon step below 670px (~249px). The six-row rail
 * keeps the breakpoints above. */
@media (max-height: 739.98px) {
  .fishing-map-layer-rail:has(> label:nth-of-type(7)) {
    gap: 0.25rem;
    padding: 0.25rem;
  }
  .fishing-map-layer-rail:has(> label:nth-of-type(7)) > label {
    padding-block: 0.125rem;
    min-height: 2.5rem;
  }
  .fishing-map-layer-rail:has(> label:nth-of-type(7)) > label > span {
    margin-top: 0;
    line-height: 1.2;
  }
}
@media (max-height: 669.98px) {
  .fishing-map-layer-rail:has(> label:nth-of-type(7)) > label {
    min-height: 0;
  }
  .fishing-map-layer-rail:has(> label:nth-of-type(7)) > label > svg {
    width: 1rem;
    height: 1rem;
  }
}
/* Last resort for any rail that still doesn't fit (a landscape phone with a
 * legend row, 568×320): it scrolls inside the space above the timebar rather
 * than sinking under it. */
.fishing-map-layer-rail {
  max-height: calc(100% - var(--fishing-map-ctrl-bottom) - 1.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
/* Landscape phones (and ~200% zoom), and portrait phones too short for even
 * the small six-row rail (its ~229px bottom meets the stack below ≈ 578px,
 * e.g. 320×568, or 375×548 in Safari): no rail height clears the stack, so
 * stand the controls left of the rail (rail = right 16px + ~58px wide; the
 * groups add their own 10px margin). */
@media (max-height: 579.98px) {
  [data-controller~="fishing-map-explore"] .maplibregl-ctrl-bottom-right {
    right: 72px;
  }
}
/* A landscape phone has ~200–260px of map above the bar and the stack is
 * ~230px tall, so Zoom out sank under the timebar (568×320, 667×375). Let
 * the stack wrap into a second column on its left instead: column-reverse +
 * wrap-reverse fill from the bottom-right corner, and `order` keeps zoom in
 * that corner (the thumb's), then locate, share, attribution. */
@media (max-height: 500px) {
  [data-controller~="fishing-map-explore"] .maplibregl-ctrl-bottom-right {
    display: flex;
    flex-direction: column-reverse;
    flex-wrap: wrap-reverse;
    align-items: flex-end;
    align-content: flex-start;
    max-height: calc(100% - var(--fishing-map-ctrl-bottom) - 0.5rem);
  }
  [data-controller~="fishing-map-explore"] .maplibregl-ctrl-bottom-right > .maplibregl-ctrl:has(.maplibregl-ctrl-zoom-in) {
    order: -3;
  }
  [data-controller~="fishing-map-explore"] .maplibregl-ctrl-bottom-right > .maplibregl-ctrl:has(.maplibregl-ctrl-geolocate) {
    order: -2;
  }
  [data-controller~="fishing-map-explore"] .maplibregl-ctrl-bottom-right > .maplibregl-ctrl:not(.maplibregl-ctrl-attrib):not(:has(.maplibregl-ctrl-zoom-in, .maplibregl-ctrl-geolocate)) {
    order: -1;
  }
}
/* 568×320: a depth (or swell) legend row makes the bar 120px tall, which
 * leaves ~184px for the ~213px six-row rail, so the Sat row sat under the
 * timebar. Drop the row padding and most of the gap (~179px). */
@media (max-height: 359.98px) {
  .fishing-map-layer-rail {
    gap: 0.125rem;
  }
  .fishing-map-layer-rail > label {
    padding-block: 0;
  }
}

/* Phones (portrait): the layer rail wears the same chrome as the map's own
 * buttons under it (locate, share, zoom): separate dark 42px squares, 10px
 * apart, on the stack's right edge (its groups carry a 10px margin), instead
 * of a 62px card of ~52px rows. The rail itself is only the (invisible)
 * column: it keeps 8px of padding for the squares' shadows (it clips, being
 * the scroll container of last resort), is pulled back by the same amount to
 * stay in line, and lets taps on that padding through to the map. Captions
 * stay (wind / wave / current are all squiggles without them) at 8px with no
 * tracking so "CURRENT" fits the square. Locked rows are links, not labels.
 *
 * Height budget, seven rows (Sat) over a signed-in stack (add-spot, locate,
 * share, zoom pair, credit "i" = 282px) on a 120-130px bar: the last row
 * ends at 16 + 7 x row + 6 x gap and the stack starts at height - ~410, so
 * the squares step down as the screen shortens (42/10 from 790px, then 36/8,
 * 32/5, 28/4, 26/3) and below 630px the stack stands left of the rail
 * instead, as it already did below 580px. These outrank the older padding
 * steps above. Landscape phones (500px tall and under) keep the old card:
 * its rows are shorter than any square with a caption can be. */
@media (max-width: 767.98px) and (min-height: 500.02px) {
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail {
    top: 0.5rem;
    right: 2px;
    padding: 0.5rem 0.5rem 0.75rem;
    gap: 10px;
    background: none;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) {
    width: 42px;
    min-height: 42px;
    padding: 0;
    flex-shrink: 0;
    pointer-events: auto;
    background-color: rgba(13, 21, 33, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(220, 230, 240, 0.12);
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > label:has(:checked) {
    background-color: rgba(64, 34, 30, 0.9);
    border-color: rgba(255, 87, 34, 0.6);
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label:has(:focus-visible), a:focus-visible) {
    box-shadow: inset 0 0 0 2px var(--color-signal, #d9a44a);
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) svg:not(.absolute) {
    width: 1.125rem;
    height: 1.125rem;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) > span:last-child {
    margin-top: 1px;
    font-size: 0.5rem;
    line-height: 1.2;
    letter-spacing: 0;
  }
}
@media (max-width: 767.98px) and (min-height: 500.02px) and (max-height: 789.98px) {
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail {
    gap: 8px;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) {
    min-height: 36px;
  }
}
@media (max-width: 767.98px) and (min-height: 500.02px) and (max-height: 733.98px) {
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail {
    gap: 5px;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) {
    min-height: 32px;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) svg:not(.absolute) {
    width: 1rem;
    height: 1rem;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) > span:last-child {
    margin-top: 0;
    line-height: 1.1;
  }
}
@media (max-width: 767.98px) and (min-height: 500.02px) and (max-height: 689.98px) {
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail {
    gap: 4px;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) {
    min-height: 28px;
  }
}
@media (max-width: 767.98px) and (min-height: 500.02px) and (max-height: 653.98px) {
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail {
    gap: 3px;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) {
    min-height: 26px;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-layer-rail.fishing-map-layer-rail > :is(label, a) svg:not(.absolute) {
    width: 0.875rem;
    height: 0.875rem;
  }
}
/* Below 630px tall no square size clears a five-control stack, so the stack
 * stands left of the rail (the older rule above does this from 580px with
 * right: 72px, sized for the 62px card): the slim rail needs 10 + 42px, the
 * groups add their own 10px margin. */
@media (max-width: 767.98px) and (min-height: 500.02px) and (max-height: 629.98px) {
  [data-controller~="fishing-map-explore"] .maplibregl-ctrl-bottom-right {
    right: 52px;
  }
}

/* Floating chrome that sits on the timebar follows its measured height
 * (--fishing-map-ctrl-bottom, kept live by the controller's ResizeObserver;
 * the per-layout values above are the no-JS fallback): the status line and
 * the slow-3D banner clear the time bubble poking ~24 px above the strip,
 * the Guide trigger sits a little above the bar. With the strip gone
 * (data-timeline="off") there is no bubble, so both sit closer. :where()
 * keeps these at one attribute's weight so the landscape Guide rule below
 * (top, bottom: auto) still wins. */
:where([data-controller~="fishing-map-explore"]) .fishing-map-above-bar {
  bottom: calc(var(--fishing-map-ctrl-bottom) + 2.5rem);
}
:where([data-controller~="fishing-map-explore"]) [data-map-guide] {
  bottom: calc(var(--fishing-map-ctrl-bottom) + 1.5rem);
}
@media (min-width: 768px) {
  :where([data-controller~="fishing-map-explore"]) .fishing-map-above-bar {
    bottom: calc(var(--fishing-map-ctrl-bottom) + 1.5rem);
  }
  :where([data-controller~="fishing-map-explore"]) [data-map-guide] {
    bottom: calc(var(--fishing-map-ctrl-bottom) + 2rem);
  }
}
:where([data-controller~="fishing-map-explore"][data-timeline="off"]) .fishing-map-above-bar,
:where([data-controller~="fishing-map-explore"][data-timeline="off"]) [data-map-guide] {
  bottom: calc(var(--fishing-map-ctrl-bottom) + 0.75rem);
}

/* Landscape phones have no room for Guide between Search and the timebar.
 * Put its trigger beside the top controls and open the panel downward,
 * keeping both its heading and the search chip reachable. */
@media (min-width: 480px) and (max-height: 500px) {
  [data-map-guide] {
    top: 1rem;
    bottom: auto;
    left: 15.25rem;
  }
  [data-map-guide] > div {
    position: fixed;
    top: 4.5rem;
    bottom: auto;
    left: 1rem;
    max-height: min(60vh, calc(100dvh - 5.5rem));
  }
}

/* "Switching Premium on…" after a Stripe return (maps/premium_return), the
 * last item of the top-left control stack. Phones: in the stack's flow, so it
 * sits under the Search chip however tall the stack above has grown (a fixed
 * top let Search cover it once Sat added the Now card's Satellite row), and
 * wider than the stack but left of the layer rail (its ~4.5rem column kept
 * clear). md+: fixed at top centre, between the stack and the rail. Landscape
 * phones: beside the Guide trigger, which moved up beside the top controls
 * (above). The open search panel covers it (z-index below). */
.premium-settle {
  position: relative;
  width: min(24rem, calc(100vw - 6.5rem));
}
@media (min-width: 768px) {
  .premium-settle {
    position: fixed;
    z-index: 10;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
  }
}
@media (min-width: 480px) and (max-height: 500px) {
  .premium-settle {
    position: fixed;
    z-index: 10;
    top: 1rem;
    left: 21rem;
    transform: none;
    width: min(24rem, calc(100vw - 27rem));
  }
}

/* Loading-hint pulse — keeps the page from looking frozen when the
 * basemap takes more than a beat to paint. Fades the text between 30%
 * and 70% opacity over 1.4s. */
.fishing-map-loading {
  animation: fishing-map-loading-pulse 1.4s ease-in-out infinite;
}
@keyframes fishing-map-loading-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
  .fishing-map-loading { animation: none; opacity: 0.5; }
}

/* Hide the default disclosure triangle on the "Guide" panel summary.
 * Tailwind's `list-none` (list-style: none) drops the marker in
 * Chromium/Firefox, but Safari/iOS render it via this pseudo-element
 * which list-style doesn't reach — scope the rule to the disclosure
 * so we don't strip markers from any other <summary>. */
details[data-controller="map-disclosure"] > summary::-webkit-details-marker {
  display: none;
}

/* Keycap styling for the Guide's keyboard-shortcuts section. Scoped to
 * the disclosure so page-body <kbd> elsewhere keeps browser defaults. */
details[data-controller="map-disclosure"] kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 0.75em;
  padding: 1px 5px;
  border: 1px solid rgba(220, 230, 240, 0.3);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

/* Spot-pin name tooltip on hover (desktop). Sits above the cursor with
 * a translucent dark backdrop matching the chrome cards. Hidden by
 * default; the layer toggles data-visible on hover. Pointer-events
 * disabled so the tooltip itself never steals the hover from the pin
 * underneath, which would cause an mouseleave/mouseenter flicker. */
.fishing-map-spot-name-tip {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  padding: 2px 8px;
  background: rgba(13, 21, 33, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(220, 230, 240, 0.12);
  color: rgba(220, 230, 240, 0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.fishing-map-spot-name-tip[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fishing-map-spot-name-tip { transition: none; transform: none; }
}

/* Status banner self-hides when its text content is empty so the
 * background box doesn't sit there as a ghost rectangle when there's
 * nothing to announce. The Stimulus controller toggles [hidden] in
 * _setStatus; we keep the element in flow with opacity so the banner
 * fades in/out cleanly.
 *
 * Cascade NB (see windTip/nowCard rule below): Tailwind v4 preflight
 * ships `[hidden]:where(:not([hidden=until-found])) { display: none
 * !important }` inside `@layer base`. Plain `display: revert` (unlayered,
 * no !important) loses to that, so the element drops out of the render
 * tree and the 160ms opacity fade never runs — "Loading forecast…"
 * popped abruptly instead of fading out when the scrubber fetch
 * resolved. Land the override in the same `@layer base` with !important
 * to win on layer-reversed-!important cascade. */
.fishing-map-status {
  transition: opacity 160ms ease-out;
}
@layer base {
  .fishing-map-status[hidden] {
    display: block !important;
    opacity: 0;
    pointer-events: none;
  }
}
.fishing-map-status:not([hidden]) {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .fishing-map-status { transition: none; }
}

/* Keep status text out of open previews and popovers. Hidden, not cleared:
 * the same warning returns when the overlay closes. */
[data-controller~="fishing-map-explore"][data-sheet-open] .fishing-map-status,
[data-controller~="fishing-map-explore"]:has([data-map-guide][open]) .fishing-map-status,
[data-controller~="fishing-map-explore"]:has([data-depth-options][open]) .fishing-map-status {
  visibility: hidden;
}

/* A popup's own z-index cannot escape the timebar's stacking context.
 * Raise its parent while open so map tips / Guide cannot cover options. */
[data-map-guide][open] {
  z-index: 40;
}
@media (max-width: 479.98px) {
  [data-controller~="fishing-map-explore"]:has([data-playback-overflow][open]) .fishing-map-status {
    visibility: hidden;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-timebar:has([data-playback-overflow][open]) {
    z-index: 40;
  }
}

/* A selected spot turns the timebar into part of the sheet interaction
 * (feeding bands, next-window and linger). Lift the OPEN sheet above that
 * bar so those controls remain reachable, especially on phones. Scope the
 * offset to data-sheet-open: once close() starts, bottom returns to zero and
 * translate-y-full can still move the sheet completely off-canvas. */
[data-controller~="fishing-map-explore"][data-sheet-open][data-timeline-spot-selected]
  [data-fishing-map-sheet] {
  /* The controller measures the bar (_syncSheetLift); these are fallbacks. */
  bottom: var(--fishing-map-sheet-lift, 112px);
}
[data-controller~="fishing-map-explore"][data-timeline-spot-selected]
  .fishing-map-timebar {
  z-index: 30;
}
@media (min-width: 768px) {
  [data-controller~="fishing-map-explore"][data-sheet-open][data-timeline-spot-selected]
    [data-fishing-map-sheet] {
    bottom: var(--fishing-map-sheet-lift, 68px);
  }
}
/* The timebar's time bubble pokes ~19px up out of the bar, so with the sheet
 * sitting on the bar it drew over the sheet's bottom row ("TIDE NOW", F13).
 * Below md the open sheet stacks over the bubble (the bar is z-30 while a
 * spot is selected), hiding the bubble's top behind the sheet. Lifting the
 * sheet clear of the bubble instead cost the drone-ring planner map it needs
 * at its zoom floor and changed the peek's size (P20), so it stays on the
 * bar. An open playback-overflow menu lifts the bar back over the sheet. */
@media (max-width: 767.98px) {
  [data-controller~="fishing-map-explore"][data-sheet-open][data-timeline-spot-selected]
    [data-fishing-map-sheet] {
    z-index: 31;
  }
  [data-controller~="fishing-map-explore"] .fishing-map-timebar:has([data-playback-overflow][open]) {
    z-index: 40;
  }
}

/* Sheet loading skeleton — aria-hidden bars mirroring the preview card's
 * rows (hero window line, two metric columns, CTA) so the turbo-frame
 * response lands without a layout jump. Same pulse rhythm as the old
 * map-loading hint; static under reduced motion. */
.fishing-map-sheet-skeleton-bar {
  background: rgba(220, 230, 240, 0.12);
  border-radius: 3px;
  animation: fishing-map-loading-pulse 1.4s ease-in-out infinite;
}
.fishing-map-sheet-skeleton-bar--hero {
  height: 14px;
  width: 60%;
  max-width: 240px;
  margin-bottom: 18px;
}
.fishing-map-sheet-skeleton-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
.fishing-map-sheet-skeleton-bar--metric {
  height: 30px;
  flex: 1 1 0;
  max-width: 160px;
}
.fishing-map-sheet-skeleton-bar--cta {
  height: 38px;
  width: 100%;
}
@media (prefers-reduced-motion: reduce) {
  .fishing-map-sheet-skeleton-bar { animation: none; opacity: 0.7; }
}

/* Applied by `_onMapError` to interactive chrome (play button, scrubber,
 * wind toggle row, MapLibre zoom controls) when the basemap fails to load.
 * Those controls' wiring lives inside `map.on("load")`, which never fires
 * on a failed style fetch — so they appear interactive but are dead. The
 * dim + not-allowed cursor + pointer-events:none combination prevents
 * clicks (belt + braces alongside the real `disabled` attribute, since
 * the wind toggle is wrapped in a <label> that would otherwise still
 * forward clicks to its child input). Selectors not used in Tailwind
 * utility form because this class lives in a plain stylesheet. */
.fishing-map-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Basemap-failure dim for the timebar shell. Softer than
 * .fishing-map-disabled and without pointer-events:none — the play
 * button / scrubber inside it already carry the real disabled state
 * (tests pin that flow); this just makes the bar's passive furniture (day
 * track, legend) read offline with them. */
.fishing-map-timebar--offline {
  opacity: 0.65;
}

/* Depth and/or Sat on with no timed layer (_syncTimelineVisibility sets
 * data-timeline="off" on the root): nothing to scrub, so the play /
 * scrubber / day strip go and the row carries the depth toolbar (2D/3D +
 * the labelled Depth options chip) instead, the one options trigger in this
 * state — the legend gears hide. Desktop keeps toolbar left, legends right.
 * Below md, with Depth off (Sat only), the row holds nothing and goes too. */
[data-controller~="fishing-map-explore"][data-timeline="off"] [data-timeline-only],
[data-controller~="fishing-map-explore"][data-timeline="off"] [data-depth-options]:not([data-placement="toolbar"]) {
  display: none !important;
}
[data-depth-toolbar] {
  display: none;
}
[data-controller~="fishing-map-explore"][data-timeline="off"] [data-depth-toolbar]:not([hidden]) {
  display: flex;
}
[data-controller~="fishing-map-explore"][data-timeline="off"] [data-timeline-row] {
  justify-content: flex-end;
}
@media (max-width: 767.98px) {
  [data-controller~="fishing-map-explore"][data-timeline="off"] [data-timeline-row]:not(:has([data-depth-toolbar]:not([hidden]))) {
    display: none;
  }
  [data-controller~="fishing-map-explore"][data-timeline="off"]:not(:has([data-depth-toolbar]:not([hidden]))) .fishing-map-timebar {
    padding-top: 0.5rem;
  }
}

/* Exaggeration and Reset only mean something in 3D: hidden until the
 * group's 3D button is pressed (_syncTerrainControls sets aria-pressed). */
[role="group"]:has([data-terrain-view="3d"][aria-pressed="false"]) [data-terrain-3d-only] {
  display: none;
}

/* First Depth enable: the options trigger pulses twice so the eye finds it
 * (_nudgeDepthOptions). Static under reduced motion. */
@keyframes fishing-map-nudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0); }
  50% { box-shadow: 0 0 0 6px rgba(255, 87, 34, 0.45); }
}
[data-depth-options-chip][data-nudge] {
  animation: fishing-map-nudge 1.1s ease-in-out 3;
}
@media (prefers-reduced-motion: reduce) {
  [data-depth-options-chip][data-nudge] { animation: none; }
}

/* Wind forecast scrubber — the native range input stretched invisibly
 * over the whole timebar strip. It keeps everything a native slider
 * gives us for free (keyboard stepping, aria-valuetext, focusability,
 * the disabled flow the basemap-error tests pin) while the visible
 * rendering — day cells, hour ticks, progress fill, cursor line, time
 * bubble — is painted by pointer-events-none layers in the same strip.
 * Clicking anywhere on the strip therefore jumps the value there and
 * starts a drag, exactly like Windy's timebar. */
.fishing-map-scrubber {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  outline: none;
  cursor: ew-resize;
}
.fishing-map-scrubber::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  height: 100%;
}
.fishing-map-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: ew-resize;
}
.fishing-map-scrubber::-moz-range-track {
  background: transparent;
  border: 0;
  height: 100%;
}
.fishing-map-scrubber::-moz-range-thumb {
  width: 18px;
  height: 100%;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: ew-resize;
}

/* === Timebar visual layers (all pointer-events-none, painted under the
 * transparent native input above) === */

/* Cursor — the 2px accent line marking the scrubbed hour in the strip. */
.fishing-map-timebar-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ff5722;
  box-shadow: 0 0 8px rgba(255, 87, 34, 0.55);
  transform: translateX(-50%);
  pointer-events: none;
}

/* Time bubble — rides the cursor above the strip, Windy's amber pill
 * adapted to the accent token. The ::after triangle is the stem. The
 * controller clamps style.left so the pill never spills past the strip
 * edges; when that clamp engages, --stem-offset (set by
 * _positionScrubberVisuals, itself clamped to the pill's width minus
 * the rounded corners) slides the stem along the pill so it keeps
 * pointing at the accent cursor line instead of detaching from it. */
.fishing-map-timebar-bubble {
  position: absolute;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  padding: 3px 10px 4px;
  border-radius: 3px;
  background: #ff5722;
  color: #16202e;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(255, 87, 34, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.fishing-map-timebar-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(50% + var(--stem-offset, 0px));
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #ff5722;
  border-bottom-width: 0;
}

/* Linger mode deliberately slows the clock inside a selected spot's
 * feeding window. Swap the bubble from playback orange to the same
 * signal-gold as the window band so the speed change reads as intentional. */
.fishing-map-timebar-bubble[data-linger="true"] {
  background: var(--color-signal, #d9a44a);
  box-shadow: 0 2px 12px rgba(217, 164, 74, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.fishing-map-timebar-bubble[data-linger="true"]::after {
  border-top-color: var(--color-signal, #d9a44a);
}

/* Day cells — one per local calendar day across the forecast span,
 * rendered by _renderDayTrack. Hairline left borders mark midnights. */
.fishing-map-timebar-day {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fishing-map-timebar-day--bordered {
  border-left: 1px solid rgba(196, 165, 123, 0.16);
}
.fishing-map-timebar-day-label {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(196, 165, 123, 0.7);
}
.fishing-map-timebar-day-label.is-today {
  color: #ff5722;
}
.fishing-map-timebar-day-label.is-weekend {
  color: var(--color-signal, #d9a44a);
}

/* Selected-spot solunar windows. The signal-gold RGB is the concrete form
 * of --color-signal (#d9a44a); explicit rgba keeps the intended major/minor
 * alpha distinction in browsers without color-mix(). Day labels and ticks
 * are appended above this dedicated layer, so the bands read as a quiet
 * timeline wash rather than covering its calendar furniture. */
.fishing-map-band {
  position: absolute;
  top: 4px;
  bottom: 4px;
  min-width: 1px;
  border-radius: 2px;
}
.fishing-map-band-major {
  background: rgba(217, 164, 74, 0.28);
}
.fishing-map-band-minor {
  background: rgba(217, 164, 74, 0.14);
}

/* Hovered day cell — set by the controller's ghost handler (the
 * transparent range input on top of the strip swallows pointer events,
 * so a CSS :hover on the cells can never fire). Brightens the CELL wash;
 * the label brighten is scoped via :not() to plain labels only, so the
 * is-today / is-weekend tints are never recoloured under hover. No
 * transition — the highlight snaps with the pointer, so there's nothing
 * to guard for prefers-reduced-motion. */
.fishing-map-timebar-day.is-hovered {
  background: rgba(196, 165, 123, 0.07);
}
.fishing-map-timebar-day.is-hovered
  .fishing-map-timebar-day-label:not(.is-today):not(.is-weekend) {
  color: rgba(232, 229, 223, 0.85);
}

/* Night wash — from last light to the next first light, laid down under the
 * bands and the day furniture. Deliberately quiet: the strip already sits on
 * squid ink, so this only has to read as "darker than the day either side",
 * never as a black bar swallowing the labels and ticks. Explicit rgba (the
 * concrete form of --color-squid, #0f1e28) for the same reason the bands use
 * one — the alpha IS the effect, so color-mix() support can't be optional. */
.fishing-map-timebar-night {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 1px;
  background: rgba(15, 30, 40, 0.42);
  pointer-events: none;
}

/* First light — the moment most fishers actually plan around, so it gets a
 * mark of its own rather than being left as the edge of the night wash.
 * Hangs from the top edge and stops short of the hour ticks so it never
 * reads as another midnight border. */
.fishing-map-timebar-firstlight {
  position: absolute;
  top: 0;
  height: 45%;
  width: 1px;
  background: var(--color-dawn, #f0b254);
  box-shadow: 0 0 4px rgba(240, 178, 84, 0.5);
  transform: translateX(-50%);
  pointer-events: none;
}

/* Hour ticks along the strip's bottom edge — one per available forecast
 * hour, instrument-panel texture. */
.fishing-map-timebar-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 5px;
  background: rgba(196, 165, 123, 0.28);
  transform: translateX(-50%);
}

/* Hover time-preview ghost — faint line + hour pill following a fine
 * pointer across the strip (created lazily by the controller; never
 * rendered on touch devices). Quieter than the accent bubble so the two
 * read as "preview" vs "selected". */
.fishing-map-timebar-ghost {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(232, 229, 223, 0.35);
  transform: translateX(-50%);
  pointer-events: none;
}
.fishing-map-timebar-ghost-label {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 0;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: rgba(232, 229, 223, 0.92);
  background: rgba(13, 21, 33, 0.92);
  border: 1px solid rgba(196, 165, 123, 0.25);
  border-radius: 3px;
  padding: 2px 7px;
}

/* Now marker — thin signal-gold line at wall-clock now. Gold = now,
 * accent orange = where you've scrubbed to; the two read independently
 * when they separate. */
.fishing-map-timebar-now {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--color-signal, #d9a44a);
  box-shadow: 0 0 6px rgba(217, 164, 74, 0.5);
  transform: translateX(-50%);
  opacity: 0.9;
}

/* Play button "active/playing" state — deepen the accent fill and pull
 * the glow in so the pressed state reads at a glance. Plain CSS with
 * attribute specificity because Tailwind's aria-pressed variant loses
 * to bg-accent in the v4 source-order cascade. */
.fishing-map-play-button[aria-pressed="true"] {
  background-color: #e64a19 !important;
  box-shadow: 0 1px 6px rgba(255, 87, 34, 0.5), inset 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}
/* Hover/active feedback (mouse only — :not(:disabled) keeps the dimmed
 * offline state inert). */
.fishing-map-play-button:hover:not(:disabled) {
  background-color: #e64a19;
  transform: scale(1.05);
}
.fishing-map-play-button:active:not(:disabled) {
  transform: scale(0.96);
}
@media (prefers-reduced-motion: reduce) {
  .fishing-map-play-button:hover:not(:disabled),
  .fishing-map-play-button:active:not(:disabled) {
    transform: none;
  }
}

/* Keyboard focus rings on /map controls. Browser-default 1px sandbar
 * outline barely registers against the dark cards — switching to a
 * 2px accent ring with offset so it stands clear of the button's own
 * border. Only :focus-visible (not :focus) so mouse-clicks don't
 * leave the ring stuck on. The rail rows are <label>s around an sr-only
 * checkbox: a click or tap focuses that checkbox, so :focus-within lit the
 * row you had just turned OFF brighter than the rows that were on (F8);
 * :has(:focus-visible) rings it for the keyboard only. */
[data-controller~="fishing-map-explore"] button:focus-visible,
[data-controller~="fishing-map-explore"] label:has(:focus-visible),
[data-controller~="fishing-map-explore"] .fishing-map-scrubber:focus-visible {
  outline: 2px solid #ff5722 !important;
  outline-offset: 2px !important;
}

/* MapLibre's <canvas class="maplibregl-canvas" tabindex="0"> is the
 * first focusable element on /map — MapKeyboardHandler needs the
 * tabindex so +/-/arrow keys can pan & zoom. The vendor stylesheet
 * leaves Chrome's default 1px UA outline (rgb(11,87,208) auto 1px) in
 * place, which is barely visible against the dark slate basemap — a
 * WCAG 2.4.7 focus-visibility failure on the page's primary surface.
 *
 * Match the rest of /map's chrome (2px solid accent orange) but use a
 * negative outline-offset so the ring sits INSIDE the canvas edges
 * instead of being clipped by the viewport — the canvas is sized to
 * fill the map container, so a positive offset would render off-screen
 * on most edges. -3px keeps the ring fully visible and clear of the
 * canvas border. */
[data-controller~="fishing-map-explore"] .maplibregl-canvas:focus-visible {
  outline: 2px solid #ff5722 !important;
  outline-offset: -3px !important;
}

/* Attribution toggle (the small "i" details/summary in the bottom-right)
 * focus ring. Vendor maplibre-gl.css ships
 *   `.maplibregl-ctrl-attrib-button:focus { box-shadow: 0 0 2px 2px #0096ff }`
 * — a bright blue 2px halo that fires on any focus (including
 * programmatic / mouse), and is inconsistent with the rest of /map's
 * chrome which uses accent orange via :focus-visible only. Bring it
 * in line with the canvas / zoom-button rule above.
 *
 * Two parts:
 *   1. Suppress the vendor blue box-shadow on plain :focus so mouse
 *      clicks don't leave a ring stuck on (matches the zoom-group
 *      treatment already in vendor, which the attribution rule was
 *      missing).
 *   2. Apply our 2px accent-orange outline on :focus-visible so
 *      keyboard users get a clear, on-brand ring.
 *
 * Specificity: chained controller-attr + class beats vendor's single
 * `.maplibregl-ctrl-attrib-button:focus` (0,2,0 vs 0,1,1). */
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-attrib summary:focus {
  box-shadow: none;
}
[data-controller~="fishing-map-explore"] .maplibregl-ctrl-attrib summary:focus-visible {
  outline: 2px solid #ff5722;
  outline-offset: 2px;
  border-radius: 12px;
}

/* Windows High Contrast Mode / forced-colors users have their system
 * theme remap author colours to system keywords. Our accent-orange
 * focus rings get remapped to a contrast-safe colour by the UA, but
 * vendor MapLibre only ships explicit forced-colors rules for
 * `.maplibregl-ctrl-group` — leaving the canvas, attribution toggle,
 * our own buttons, and the global share-sheet without a guaranteed
 * outline declaration when those rings are needed. Re-state the focus
 * outline using the `CanvasText` system colour so keyboard focus stays
 * unambiguous in HCM regardless of how the UA remaps author colours.
 *
 * `!important` mirrors the base /map focus-visible rule above — without
 * it the cascade tie goes to the older `!important` declaration and
 * the forced-colors override never takes effect. */
@media (forced-colors: active) {
  [data-controller~="fishing-map-explore"] .maplibregl-ctrl-attrib summary:focus-visible,
  [data-controller~="fishing-map-explore"] button:focus-visible,
  .share-sheet-panel :is(button, input, a):focus-visible {
    outline: 2px solid CanvasText !important;
    outline-offset: 2px !important;
  }
  /* Canvas fills the viewport — keep the negative offset so the ring
   * paints INSIDE the canvas edges (otherwise it's clipped off-screen,
   * see the base rule's comment above). */
  [data-controller~="fishing-map-explore"] .maplibregl-canvas:focus-visible {
    outline: 2px solid CanvasText !important;
    outline-offset: -3px !important;
  }
}

/* Play button transitions. Explicit property list (rather than Tailwind's
 * transition-colors / transition-all) for two reasons: v4's colour list
 * includes `outline-color`, which made the focus ring fade in over 150ms
 * instead of snapping like every other control; and we want transform +
 * box-shadow covered for the hover scale/glow without transitioning
 * layout properties. */
.fishing-map-play-button {
  transition-property: color, background-color, border-color, transform, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .fishing-map-play-button { transition: none; }
}

/* Wind-tip & now-card fade in/out instead of popping. The Stimulus
 * controller toggles the [hidden] attribute, so we keep the element in
 * layout and animate opacity. pointer-events: none while hidden so the
 * click-through passes to the canvas underneath.
 *
 * Cascade NB: Tailwind v4 preflight ships
 *   `[hidden]:where(:not([hidden=until-found])) { display: none !important }`
 * inside `@layer base`. For !important declarations the layer cascade
 * is REVERSED, so unlayered !important (and any later-layer !important)
 * still loses to that base-layer rule. We have to land our override in
 * the same `@layer base` with !important, then higher selector
 * specificity decides — `[data-…][hidden]` is 0,2,0 vs Tailwind's
 * `[hidden]:where(...)` at 0,1,0, so we win cleanly.
 * Without the override, `display: revert` resolved to the UA `[hidden]`
 * default of `display: none`, the element dropped out of the render
 * tree, and the opacity transition never ran — the now-card popped in
 * once data arrived, leaving the top-left slot blank under the drawer
 * trigger on slow loads. Keeping the chip in layout with opacity 0 and
 * the placeholder dashes ("— m/s", "—") gives it a skeleton state. */
[data-fishing-map-explore-target="windTip"],
[data-fishing-map-explore-target="nowCard"] {
  transition: opacity 160ms ease-out;
}
@layer base {
  [data-fishing-map-explore-target="windTip"][hidden],
  [data-fishing-map-explore-target="nowCard"][hidden] {
    display: block !important;
    opacity: 0;
    pointer-events: none;
  }
}
[data-fishing-map-explore-target="windTip"]:not([hidden]),
[data-fishing-map-explore-target="nowCard"]:not([hidden]) {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  [data-fishing-map-explore-target="windTip"],
  [data-fishing-map-explore-target="nowCard"] {
    transition: none;
  }
}

/* WCAG 1.4.4 — at very short viewports (mobile-landscape, or desktop zoomed
 * to ~200% on a small laptop) vertical space is the scarce resource.
 * Auxiliary info is shed: the now-card (top-left) and the mobile legend
 * row inside the timebar (its ~26px makes the bar fit at 500px heights).
 * The legend remains accessible via the wind heat-field tooltip; both
 * re-emerge as soon as the viewport is tall enough.
 *
 * The `!important` on the now-card overrides the [hidden] layer-base rule
 * above that intentionally keeps the card in layout at opacity 0. */
@media (max-height: 500px) and (max-width: 768px) {
  [data-fishing-map-explore-target="nowCard"] {
    display: none !important;
  }
  aside[aria-label="Wind speed legend"] {
    display: none;
  }
  /* The bar drops to its main row + pin row; --fishing-map-ctrl-bottom
   * (with the other control-stack offsets near the top of this file)
   * pulls the controls down with it. */
}

/* Narrow phones: the mobile pin-colour row needs ~373px on one line, so on a
 * 320px phone "Pins · today" broke into three lines and "No score" into two,
 * making the timebar 136px (more than the control stack and the sheet lift
 * allow for; F14). Tighter tracking and gaps put it on one line from ~330px;
 * below that whole items wrap to a second line instead of breaking words. */
@media (max-width: 374.98px) {
  .fishing-map-timebar > aside[data-testid="pin-legend"] {
    flex-wrap: wrap;
    gap: 0.125rem 0.25rem;
    padding-inline: 0.5rem;
    letter-spacing: 0;
  }
  .fishing-map-timebar > aside[data-testid="pin-legend"] > * {
    white-space: nowrap;
  }
}

/* Keep the active search above status messages, sheets and map controls.
 * On phones, use the top edge so results have room above the keyboard,
 * instead of starting below the entire conditions/state-switcher stack. */
.fishing-map-control-stack:has([data-map-spot-search-target="panel"]:not([hidden])) {
  z-index: 40;
}
/* Above the stack's later items too: the Stripe-return card (.premium-settle). */
[data-map-spot-search-target="panel"] {
  z-index: 11;
}
@media (max-width: 767.98px), (max-height: 500px) {
  [data-map-spot-search-target="panel"] {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    left: max(1rem, env(safe-area-inset-left));
    width: min(420px, calc(100vw - 2rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
  }
}

/* === #7 Mobile hide-chrome toggle ==================================== */
/* When the wrapper carries data-chrome-hidden (flipped by the explore
 * controller's toggleChrome), collapse the floating panels so the map is
 * edge-to-edge. Scoped to mobile: on md+ the toggle button is display:none
 * (md:hidden) and there's room for all chrome, so a stale attribute after
 * a resize can never blank the desktop chrome. !important is unlayered, so
 * it wins the reversed-layer cascade against the now-card's @layer base
 * [hidden] skeleton rule (which is also !important) — the collapsed card
 * must vanish, not sit invisibly in layout. */
@media (max-width: 767.98px) {
  [data-controller~="fishing-map-explore"][data-chrome-hidden] .js-map-chrome {
    display: none !important;
  }
}
/* Icon swap on the toggle itself: eye when chrome is shown (tap to hide),
 * eye-off when hidden (tap to show). */
.fishing-map-icon-show { display: none; }
[data-chrome-hidden] .fishing-map-chrome-toggle .fishing-map-icon-hide { display: none; }
[data-chrome-hidden] .fishing-map-chrome-toggle .fishing-map-icon-show { display: block; }

/* === Placing a private spot (lazy/mark_editor) ======================== */
/* The panel tops the map (a phone keyboard rises from below), a fixed pin
 * marks the map's centre, and the chrome steps aside — every size, since
 * the panel needs the top of the screen. The zoom and locate buttons stay:
 * both help put the pin down. */
.fishing-map-mark-editor {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 40;
}
@media (min-width: 768px) {
  .fishing-map-mark-editor { left: 50%; right: auto; width: 24rem; transform: translateX(-50%); }
}
[data-controller~="fishing-map-explore"][data-mark-editing] .js-map-chrome,
[data-controller~="fishing-map-explore"][data-mark-editing] .fishing-map-chrome-toggle,
[data-controller~="fishing-map-explore"][data-mark-editing] .fishing-map-timebar,
[data-controller~="fishing-map-explore"][data-mark-editing] .fishing-map-status,
[data-controller~="fishing-map-explore"][data-mark-editing] .fishing-map-add-spot-ctrl {
  visibility: hidden !important;
}
.fishing-map-mark-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 20;
  pointer-events: none;
}
/* The mark-pin diamond (lazy/mark_layer), lifting while the map moves. */
.fishing-map-mark-crosshair-diamond {
  position: absolute;
  left: -11px;
  top: -11px;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  background: rgba(255, 183, 77, 0.45);
  box-shadow: 0 0 0 2px rgba(10, 16, 24, 0.55), 0 6px 14px rgba(0, 0, 0, 0.35);
  transform: rotate(45deg);
  transition: transform 120ms ease-out;
}
.fishing-map-mark-crosshair[data-lifted] .fishing-map-mark-crosshair-diamond {
  transform: translateY(-10px) rotate(45deg);
}
/* The exact point: never lifts. */
.fishing-map-mark-crosshair-dot {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px rgba(10, 16, 24, 0.8);
}
@media (prefers-reduced-motion: reduce) {
  .fishing-map-mark-crosshair-diamond { transition: none; }
}

/* === #8 Keyboard/AT spot listbox ===================================== */
/* Visually-hidden, but kept in the a11y tree + tab order so keyboard and
 * screen-reader users can reach the canvas-drawn pins. sr-only clip lives
 * on each OPTION (not the <ul>) so a focused option can escape it — a
 * clip-path on the container would clip even a position:fixed child. */
.fishing-map-spot-option {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  cursor: pointer;
}
/* The roving-focused option reveals as a chip pinned near the top of the
 * map so keyboard-only users can see which spot they're on. position:fixed
 * escapes the sr-only clip; the accent ring matches the rest of /map's
 * focus treatment. */
.fishing-map-spot-option:focus-visible {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.4rem 0.85rem;
  overflow: visible;
  clip: auto;
  clip-path: none;
  background: rgba(13, 21, 33, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 87, 34, 0.6);
  color: rgba(232, 229, 223, 0.95);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 0.8rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  outline: 2px solid #ff5722;
  outline-offset: 2px;
}

/* Share sheet */
.share-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0);
  transition: background 200ms ease;
  pointer-events: none;
}

.share-sheet-backdrop.open {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.share-sheet-panel {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 51;
  /* visibility trails the slide-out (0s delayed 200ms) so the exit animation
     still plays, then the closed panel is fully hidden — paired with the `inert`
     the controller toggles, its Copy/WhatsApp buttons leave the tab order + AT
     tree instead of lurking off-screen inside an aria-hidden container. */
  transition: transform 200ms ease, visibility 0s linear 200ms;
  pointer-events: none;
  visibility: hidden;
  /* Mobile: slide up from bottom — above AdSense's anchor ad when one is
     showing (--ad-adhesion, lib/ads_adhesion.js). */
  bottom: var(--ad-adhesion, 0px);
  transform: translateY(100%);
}

.share-sheet-panel.open {
  /* Show immediately on open (no visibility delay) so the slide-in is visible. */
  transition: transform 200ms ease, visibility 0s linear 0s;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

/* Desktop: center vertically instead of anchoring to bottom */
@media (min-width: 768px) {
  .share-sheet-panel {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    opacity: 0;
    transition: transform 200ms ease, opacity 200ms ease, visibility 0s linear 200ms;
  }

  .share-sheet-panel.open {
    transform: translateY(-50%) scale(1);
    opacity: 1;
    transition: transform 200ms ease, opacity 200ms ease, visibility 0s linear 0s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-sheet-backdrop,
  .share-sheet-panel {
    transition: none;
  }
}

/* Share-sheet focus rings — replace Chrome's default 1px blue with the
   site accent so keyboard nav matches the rest of /map (iter 30 thread).
   Scoped to the panel so the rule never bleeds into app chrome. */
.share-sheet-panel :is(button, input, a):focus-visible {
  outline: 2px solid #ff5722;
  outline-offset: 2px;
  box-shadow: none;
}

/* /biting-now 12-month strip: the tapped month gets a persistent selected state
   (accent tint + border), distinct from the always-on current-month outline, so
   the strip shows which cell fired after a tap. Set by month_strip_controller —
   the Turbo-frame swap it triggers can't re-render the strip server-side. The
   element+attribute selector (0,1,1) outranks the `border-transparent` utility,
   so the accent border wins without !important. --color-accent is emitted at
   :root by the Tailwind @theme build (#ff6b4a). */
a[data-almanac-selected] {
  border-color: var(--color-accent);
  background-color: rgba(255, 107, 74, 0.14);
}

/* Article body — rendered markdown, on the First Light reading system.
   Headings ride the display face; body stays warm sandbar at a comfortable
   measure; links pick up sea-glass wayfinding. All colours read the @theme
   tokens (emitted at :root by the Tailwind build) — no palette hex here. */
.article-body h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--color-breakwater);
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.article-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.6rem);
  line-height: 1.2;
  color: var(--color-breakwater);
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
}

.article-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.25;
  color: var(--color-breakwater);
  margin-top: 1.75rem;
  margin-bottom: 0.4rem;
}

.article-body p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: color-mix(in srgb, var(--color-breakwater) 85%, transparent);
  margin-bottom: 1.1rem;
}

.article-body a {
  color: var(--color-glass);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: var(--color-breakwater);
}

.article-body ul,
.article-body ol {
  font-size: 1.02rem;
  line-height: 1.75;
  color: color-mix(in srgb, var(--color-breakwater) 85%, transparent);
  margin-bottom: 1.1rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body li::marker {
  color: var(--color-glass);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--color-border-subtle);
  margin: 2.25rem 0;
}

.article-body strong {
  color: var(--color-breakwater);
  font-weight: 600;
}

/* Mobile overflow guards for rendered markdown. Article bodies come from
 * Kramdown (GFM) + the Rails SafeListSanitizer, whose allowlist (plus the
 * table tags Article::SANITIZE_TAGS adds) passes <table>, <pre>, <code>,
 * <img> and <blockquote> through to .article-body.
 * None of these are width-constrained by the rules above, so a future
 * article with a wide table, a fenced code block, a long URL, or a large
 * image would push past the 720px column and overflow the viewport at
 * 360px (forcing a horizontal page scroll). Constrain each one. */
.article-body img {
  max-width: 100%;
  height: auto;
}

/* Tables and pre scroll inside their own box rather than the page. The
 * display:block on the table lets overflow-x apply (a default table is
 * shrink-to-fit and ignores it). */
.article-body table,
.article-body pre {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-body pre {
  font-size: 0.8rem;
}

.article-body table {
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: 0.85rem;
  line-height: 1.4;
}

.article-body th,
.article-body td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
  vertical-align: top;
}

.article-body th {
  color: var(--color-breakwater);
  font-weight: 600;
  white-space: nowrap;
  border-bottom-color: var(--color-border);
}

.article-body td {
  color: var(--color-sandbar);
}

.article-body td:first-child {
  color: var(--color-breakwater);
}

/* A regs-table row's species anchor (#dusky-flathead), deep-linked from the
 * state species pages: land it clear of the sticky header and mark the row
 * the reader came for. */
.article-body [id] {
  scroll-margin-top: 6rem;
}

.article-body tr:has(:target) td {
  background: var(--color-squid-lighter);
}

/* Long inline code spans and long links (e.g. bare URLs) wrap instead of
 * stretching the column. overflow-wrap handles unbroken strings without
 * the aggressive mid-word breaks of word-break:break-all. */
.article-body code,
.article-body a {
  overflow-wrap: anywhere;
}

/* Code inside <pre> must stay on its own line; the box scrolls. Reset the
 * inline wrapping rule above so fenced blocks keep their formatting. */
.article-body pre code {
  overflow-wrap: normal;
  white-space: pre;
}

.article-body blockquote {
  max-width: 100%;
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--color-dawn);
  color: var(--color-sandbar);
  font-style: italic;
}

/* Article show-page layout (Articles::BodyLayout): the intro reads as a
 * lede, and copy inside tiles/FAQ cards/the sign-off sits tighter so the
 * card padding, not the paragraph margin, sets the rhythm. */
.article-lede p {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--color-breakwater);
}

.article-lede p:first-child::first-letter {
  font-family: var(--font-display);
  font-weight: 700;
  float: left;
  font-size: 3.4rem;
  line-height: 0.9;
  padding: 0.3rem 0.55rem 0 0;
  color: var(--color-accent);
}

.article-tile .article-body p,
.article-tile.article-body p,
.article-tile .article-body ul,
.article-tile .article-body ol {
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 0.7rem;
}

/* A "**Rig:** a light…" paragraph loses its label to the tile heading; lift
 * the now-leading lowercase letter without touching the copy. */
.article-label-tile .article-body > p:first-child::first-letter {
  text-transform: uppercase;
}

.article-tile .article-body > :last-child,
.article-tile.article-body > :last-child {
  margin-bottom: 0;
}

/* Bold-led list items (the rules/limits bullets) read as a ruled list. */
.article-body ul:has(> li > strong:first-child) {
  list-style: none;
  padding-left: 0;
  border-top: 1px solid var(--color-border-subtle);
}

.article-body ul:has(> li > strong:first-child) > li {
  margin: 0;
  padding: 0.55rem 0 0.55rem 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  position: relative;
}

.article-body ul:has(> li > strong:first-child) > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 9999px;
  background: var(--color-glass);
}

/* Tables get a framed, headed look. */
.article-body table {
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.5rem;
}

.article-body thead th {
  background: var(--color-squid-lighter);
  font-family: var(--font-heading);
  font-size: 0.78rem;
}

.article-body tbody tr:last-child td {
  border-bottom: none;
}

/* Rig builder scene + card thumbnails (small for cross-links, larger for
 * /rigs index). All three wrap one inline SVG sized to its parent. */
.rig-scene { display: inline-block; width: 100%; max-width: 440px; }
.rig-card-preview { width: 72px; }
.rig-index-preview { width: 110px; }
.rig-scene > svg,
.rig-card-preview > svg,
.rig-index-preview > svg { display: block; width: 100%; height: auto; }

.rig-scene [data-component-type="hook"],
.rig-scene [data-component-type="bait"],
.rig-scene [data-component-type="leader"] {
  transform-origin: 50% 0%;
  animation: rig-sway 4s ease-in-out infinite;
}

@keyframes rig-sway {
  0%, 100% { transform: rotate(-0.5deg) translateX(-1px); }
  50%      { transform: rotate(0.5deg)  translateX(1px); }
}

.rig-scene [data-component-index][role="button"] { cursor: pointer; }

.rig-scene [data-component-index][role="button"]:hover {
  filter: drop-shadow(0 0 4px rgba(255, 200, 80, 0.45));
}

/* Only :focus-visible (not :focus) so mouse-clicks don't leave the
 * ring stuck on after the active-state animation finishes. Split
 * from the active-state rule below so the two paths can diverge. */
.rig-scene [data-component-index][tabindex]:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.85));
}

.rig-scene [data-component-index][data-active="true"] {
  outline: none;
  filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.85));
}

.rig-scene [data-component-index][data-active="true"]:not([data-component-type="hook"]):not([data-component-type="bait"]):not([data-component-type="leader"]) {
  transform: scale(1.08);
  transform-origin: 50% 50%;
  transition: transform 180ms ease-out;
}

.rig-scene[data-tap-hint="true"] [data-component-index][role="button"]:not([data-component-type="hook"]):not([data-component-type="bait"]):not([data-component-type="leader"]) {
  animation: rig-tap-hint 2.4s ease-in-out 3;
}

.rig-scene .rig-slot { cursor: pointer; opacity: 0.55; transition: opacity 160ms ease-out; }
.rig-scene .rig-slot:hover,
.rig-scene .rig-slot:focus-visible { opacity: 1; outline: none; }

[data-rig-builder-target="anatomyItem"] { transition: background 200ms ease-out, border-color 200ms ease-out; }
[data-rig-builder-target="anatomyItem"][data-active="true"] {
  border-left-color: rgba(255, 200, 80, 0.75) !important;
  background: rgba(255, 200, 80, 0.06);
}

@keyframes rig-tap-hint {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 200, 80, 0)); }
  50%      { filter: drop-shadow(0 0 5px rgba(255, 200, 80, 0.55)); }
}

@media (prefers-reduced-motion: reduce) {
  .rig-scene [data-component-type] { animation: none !important; }
  .rig-scene[data-tap-hint="true"] [data-component-index][role="button"] { animation: none !important; }
  .rig-scene [data-component-index][data-active="true"],
  .rig-scene .rig-slot,
  [data-rig-builder-target="anatomyItem"] { transition: none !important; }
}

/* === Unlock ceremony (spec §8, 1f) ====================================
 * The ONE keyframe the ceremony is allowed (spec: the card "rises"); every
 * other ceremony motion — the count-up, the actions reveal, copy feedback —
 * is JS-driven or a plain CSS transition. Kept deliberately short and eased
 * so it reads as a settle, not a bounce. Under prefers-reduced-motion the
 * card is placed with no animation (the JS controller likewise skips the
 * count-up and shows the actions immediately), so numbers are static and the
 * card simply appears. */
@keyframes catch-ceremony-rise {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.catch-ceremony-card {
  animation: catch-ceremony-rise 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .catch-ceremony-card { animation: none; }
}

/* === /map print stylesheet ============================================
 * The /map page is a full-bleed WebGL canvas with floating chrome — neither
 * survives Ctrl+P intact. WebGL canvases typically render blank/black on
 * paper (the GPU buffer isn't part of the document's paint tree the print
 * pipeline reads), and the absolutely-positioned cards (menu pill, now
 * card, layer rail, legend, scrubber, attribution, drawer, share-sheet)
 * float over the empty rectangle as useless boxes if printed as-is.
 *
 * One coordinated rule: hide everything inside the fishing-map controller
 * container and replace it with a clean printed header (brand + "visit
 * the live map" message), so the printed page reads as a deliberate
 * fallback page instead of a broken screenshot. The site layout (header
 * rail, drawer, share-sheet, GA script) is positioned outside the
 * controller container, so we hide those siblings too. Zero markup
 * change — uses a ::before pseudo on the controller container itself.
 *
 * Scope: only triggers when the fishing-map controller is present, so
 * other pages keep their default browser print rendering. */
@media print {
  /* Reset the body and main wrapper to white-on-black ink defaults —
   * the screen `.bg-squid` (#1a2332) would otherwise burn the whole
   * page in dark ink, since most browsers honour `background-color`
   * in print when the user has "Background graphics" enabled. Scope
   * to body:has(...) so non-/map pages keep their default print
   * rendering. `:has()` is supported in all major print engines that
   * also support the rest of this block (Chromium 105+, Safari 15.4+,
   * Firefox 121+). */
  body:has([data-controller~="fishing-map-explore"]),
  body:has([data-controller~="fishing-map-explore"]) main {
    background: #fff !important;
    color: #000 !important;
  }
  /* Reset the controller container from 100vh to natural height and
   * remove its fixed sizing — print pages are paged, not viewport-sized.
   * Children get hidden via the descendant rule below; the container
   * itself stays visible to host the ::before fallback. */
  [data-controller~="fishing-map-explore"] {
    height: auto !important;
    min-height: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  /* Inside @layer base because the iter-37 status-banner fix lives in
   * @layer base with `.fishing-map-status[hidden] { display: block
   * !important; }` (so the fade transition can run while [hidden] is
   * applied). For !important declarations the cascade reverses, so a
   * `base` layer rule beats an unlayered !important. Match the layer
   * to win against the iter-37 rule.
   *
   * Specificity NB: the iter-37 rule is (0,2,1) — class + attribute +
   * element. To beat it (or match + win on source order, which we do
   * since this block lives later in the file), I include `[hidden]`
   * variants explicitly. Without them, `[data-controller~="..."] > *`
   * is only (0,1,1) and loses to (0,2,1) regardless of layer. */
  @layer base {
    [data-controller~="fishing-map-explore"] > *,
    [data-controller~="fishing-map-explore"] > *[hidden] {
      display: none !important;
    }
  }
  /* Branded fallback header. Two-line layout: site name in heading
   * weight, then a one-line invitation back to the interactive page.
   * `attr(...)` would let us pull the URL dynamically but only Chromium
   * supports it for non-`content` properties; the explicit string is
   * future-proof across print engines. */
  [data-controller~="fishing-map-explore"]::before {
    content: "Bite Compass — Fishing map\A Visit bitecompass.com/map for the live, interactive forecast.";
    display: block;
    white-space: pre-line;
    padding: 24pt 0;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 14pt;
    line-height: 1.6;
    color: #000;
    border-bottom: 1pt solid #000;
  }
  /* Hide the rest of the page chrome that lives outside the controller
   * (drawer rail is position:fixed off-canvas, share-sheet ditto, GA
   * script tags are display:none already but keep them out for clarity).
   * Scope to body > [data-controller~="drawer"] so we only fire this on
   * the /map fullscreen layout where the floating drawer is the wrapper. */
  body:has([data-controller~="fishing-map-explore"]) [data-controller~="drawer"] > :not(main) {
    display: none !important;
  }
  /* Tidy paper margins. Default Chromium prints with ~10mm margin and a
   * page-header/footer URL + date — leave those at user-agent defaults
   * so the user can toggle them in the print dialog. */
  @page {
    margin: 12mm;
  }
}

/* iOS Safari (and iOS Chrome, which shares the WebKit engine) auto-zooms
 * the viewport whenever a focused <input>/<textarea>/<select> has a
 * computed font-size below 16px — then leaves the page zoomed-in, forcing
 * the user to pinch back out. Every form control in the app is styled with
 * Tailwind's text-[0.9rem]/text-[0.85rem]/text-[0.75rem] utilities (14.4 /
 * 13.6 / 12px), so each one triggers this jank: the spot combobox + date
 * field, the mobile bottom-sheet filter/geo/coord inputs, and the drawer's
 * weekly-forecast email capture. We override to a 16px minimum only on
 * coarse-pointer, narrow viewports (i.e. phones) so the desktop visual
 * sizing is untouched. type-scoped so range/checkbox/radio/color/file
 * controls keep their native sizing. */
@media (max-width: 640px) and (pointer: coarse) {
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]),
  textarea,
  select {
    font-size: 16px;
  }
}

/* AdSense reserves an Auto ads slot's full height before it knows whether it
   has an ad for it, and marks the slot data-ad-status="unfilled" when it
   doesn't. Left alone that is a blank block in the page (390px above the
   title on a phone, the day AdSense went live). This is Google's own
   documented rule for it: an empty slot leaves the layout, a filled one is
   never touched. */
ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}

/* The fixed ad units lib/ads_slots places (one on a phone, more on tablets
   and desktops). Three states:
   - Google hasn't touched it (its script blocked, or not there yet): no room
     at all, whatever size the slot was given.
   - Google has sized it: it holds its full room from then on (the spacing of
     the section around it and the label's line included), so an ad arriving
     moves nothing on the page. The label itself shows once there is an ad
     under it.
   - Google has no ad for it: the rule above hides the slot, but the unit
     keeps the room until lib/ads_slots takes it out, where doing so moves
     nothing the reader is looking at. What keeps it is a strut that script
     puts in the unit when Google sizes the slot: a float as tall as the
     unit and no wider than nothing, which the unit (a flow root) must
     contain. A height on the unit itself would not last: Google resets it
     when it asks for the ad. */
.bc-ad {
  clear: both;
  display: flow-root;
  text-align: center;
}
.bc-ad-strut {
  float: left;
  width: 0;
}
.bc-ad:not(:has(> ins[data-adsbygoogle-status])) {
  height: 0;
  overflow: hidden;
  margin-block: 0 !important;
  padding-block: 0 !important;
}
/* The sidebar unit comes straight after whatever ends the sidebar, and on WA
   pages that is the weekly email form: a little more room between its button
   and the ad than the sidebar's own spacing gives. */
.bc-ad-rail {
  padding-top: 1.5rem;
}
.bc-ad-label {
  display: block;
  visibility: hidden;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in oklab, currentColor 55%, transparent);
}
.bc-ad:has(> ins[data-ad-status="filled"]) .bc-ad-label {
  visibility: visible;
}

/* The spot page's map card pin (lib/fishing_map/lazy/spot_card_map): the
   accent dot with a dark ring, legible over imagery and over the chart. */
.spot-map-card-pin {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: var(--color-accent, #f97316);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgb(5 12 17 / 0.7), 0 2px 6px rgb(0 0 0 / 0.5);
}
