/* Phone-only presentation. One live control tree and canonical palettes. */
@media (max-width: 900px), (max-width: 1100px) and (max-height: 520px) {
  @font-face { font-family: 'Swelle Manrope'; src: url('../fonts/ManropeVariable.woff2') format('woff2'); font-style: normal; font-weight: 200 800; font-display: swap; }
  html, body { height: 100%; min-height: 0; overflow: hidden; }
  /* Older Android browsers use vh; dynamic viewport support refines this below. */
  @supports not (height: 100dvh) {
    html[data-design-preview] .map-shell > .map-scale-overlay:not(.is-collapsed),
    html[data-design-preview] .map-shell > .map-scale-overlay.is-collapsed { --scale-height: max(72px, calc(100vh - 410px)) !important; }
  }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  html[data-design-preview] :is(input, select, textarea) { font-size: 16px; }
  html[data-design-preview] body, html[data-design-preview] :is(button, input, summary, a) { font-family: 'Swelle Manrope', 'Segoe UI', sans-serif; }
  html[data-design-preview] .layout {
    position: relative; display: block; width: 100%; height: 100vh; height: 100svh; height: 100dvh; min-height: 0; overflow: hidden;
    --mobile-surface: #fff; --mobile-text: #102c3d; --mobile-line: #dce6e9;
    --mobile-shadow: 0 3px 14px rgba(7,30,40,.12);
    --mobile-timeline-height: 108px;
    --mobile-bottom: calc(var(--mobile-timeline-height) + 70px + env(safe-area-inset-bottom, 0px));
  }
  html[data-design-preview] .map-column { position: relative; width: 100%; height: 100%; min-height: 0; }
  html[data-design-preview] .map-column > .map-shell { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; max-height: none; flex: none; }
  html[data-design-preview] .map-navigation-notice {
    top: auto; bottom: calc(var(--mobile-bottom) + 8px); z-index: 1802;
    left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px));
    max-width: none; font-size: 11px;
  }
  html[data-design-preview][data-ui-theme] .topbar {
    position: absolute; z-index: 1900; top: 0;
    left: 0; right: 0;
    height: calc(56px + env(safe-area-inset-top, 0px)); min-height: 0;
    padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
    gap: 8px; border: 0; border-radius: 0;
    background: #fff; color: #102c3d; box-shadow: none;
  }
  html[data-design-preview] .topbar .brand { flex: 1; min-width: 0; }
  html[data-design-preview] .brand-lockup { gap: 0; }
  html[data-design-preview] .brand-logo-test { width: 96px; height: 34px; }
  html[data-design-preview] .brand-logo-test img { width: 110%; height: auto; }
  /* The artwork has a white matte. Multiply removes it against the glass
     header without changing the approved image or desktop rendering. */
  html[data-design-preview] .brand-logo-test { mix-blend-mode: normal; }
  html[data-design-preview] .brand-logo-test img { filter: url('#brand-matte-knockout'); }
  html[data-design-preview] #map[data-land-theme="light"] .leaflet-coastline-pane path {
    stroke: #7c919e; stroke-width: .55px; stroke-opacity: .3; vector-effect: non-scaling-stroke;
  }
  /* Clicked phone cards retain the compact button styling of the former
     permanent reader, without enabling its live sampling lifecycle. */
  html[data-design-preview] .wave-point-popup .point-panel-tabs { display: block; padding-bottom: 0; }
  html[data-design-preview] .wave-point-popup .point-panel-actions { display: flex; justify-content: flex-end; gap: 5px; }
  html[data-design-preview] .wave-point-popup .point-panel-actions button {
    min-height: 28px; padding: 2px 10px; border: 1px solid #9ed9e32e; border-radius: 7px;
    font-family: inherit; font-size: 10px; font-weight: 650; color: #c6e6ef; background: #153746; cursor: pointer;
  }
  html[data-design-preview] .wave-point-popup .point-panel-actions button[aria-expanded="true"] { color: #062d40; background: #80e4ed; }
  html[data-design-preview] .wave-point-popup .mobile-point-wind-arrow { display: none; }
  html[data-design-preview] .brand-tagline { display: none !important; }
  html[data-design-preview] .brand-story { width: min(320px, calc(100vw - 40px)); max-height: 55dvh; overflow-y: auto; }
  html[data-design-preview] .design-header-spots { display: flex; flex: none; }
  html[data-design-preview] .design-spot-search { display: none; }
  html[data-design-preview] .topbar .design-header-spots button {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 44px; min-width: 0; padding: 0 9px; border: 1px solid #dce6e9; border-radius: 11px;
    color: #000; background: #fff; font-size: 11px; font-weight: 750; white-space: nowrap; cursor: pointer;
  }
  html[data-design-preview] .topbar .design-header-spots button svg { width: 20px; height: 20px; flex: none; }
  html[data-design-preview] .topbar .design-header-spots button[aria-expanded="true"] { background: #e6fbfd; border-color: #81e4f0; }
  html[data-design-preview][data-ui-theme] .topbar .contact-link {
    display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px;
    flex: none; padding: 0; border: 0; border-radius: 11px; box-shadow: none; background: #81e4f0; color: #102c3d;
  }
  html[data-design-preview] .contact-link span { display: none; }
  html[data-design-preview] .topbar .contact-link svg { stroke: currentColor; }
  html[data-design-preview] .topbar .header-theme-toggle { height: 44px; }
  html[data-design-preview] .topbar .header-theme-toggle .land-theme-option { height: 36px; flex-basis: 34px; width: 34px; }
  @media (max-width: 360px) { html[data-design-preview][data-ui-theme] .topbar .contact-link { display: none; } }

  html[data-design-preview] .favorites-bar {
    top: calc(56px + env(safe-area-inset-top, 0px)); left: 0; right: 0;
    height: 44px; padding: 0 max(12px, env(safe-area-inset-left, 0px)); gap: 10px;
    border: 0; border-bottom: 1px solid #dce6e9; border-radius: 0;
    font-size: 12px; box-shadow: 0 4px 12px #102c3d0a;
  }
  html[data-design-preview] .favorites-bar :is(.favorites-bar-title, .favorites-bar-add) { min-height: 44px; padding: 0 8px; }
  html[data-design-preview] .spots-maintenance-notice { top: calc(106px + env(safe-area-inset-top, 0px)); left: 12px; }

  /* Original marine controls move here on phones, retaining their listeners. */
  html[data-design-preview] .design-mobile-layers:not([hidden]) {
    position: absolute; z-index: 1800; top: auto; bottom: calc(var(--mobile-timeline-height) + 8px + env(safe-area-inset-bottom, 0px));
    left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px));
    display: block; padding: 5px; border: 1px solid #dce6e9; border-radius: 18px;
    background: #fff; box-shadow: 0 4px 20px #102c3d1a;
  }
  html[data-design-preview] .design-mobile-layers > .visual-setting { padding: 0; margin: 0; border: 0; background: none; }
  html[data-design-preview] .design-mobile-layers :is(.visual-setting-title, .design-unit) { display: none; }
  html[data-design-preview] .design-mobile-layers .visual-options-5 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
  html[data-design-preview] .design-mobile-layers .visual-options-5 > * { grid-column: auto; }
  html[data-design-preview] .secondary-wind-scale { width: 26px; right: calc(100% + 5px); }
  html[data-design-preview] .design-mobile-layers .layer-option {
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; grid-column: auto;
    min-width: 0; min-height: 44px; padding: 3px 0; margin: 0; background: transparent; color: #476270;
    border: 0; border-radius: 10px; box-shadow: none; font-size: 9px; font-weight: 750; line-height: 1.3;
    letter-spacing: 0; touch-action: manipulation; cursor: pointer;
  }
  html[data-design-preview] .design-mobile-layers .layer-option svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
  html[data-design-preview] .design-mobile-layers .layer-option.is-active { background: #81e4f0; color: #102c3d; }
  html[data-design-preview] .design-mobile-layers .layer-model-menu { top: auto; bottom: calc(100% + 12px); width: max-content; min-width: 112px; max-width: calc(100vw - 40px); }
  html[data-design-preview] .design-mobile-layers .model-menu-option { min-height: 44px; }
  html[data-design-preview] .design-mobile-layers .layer-option:is(:disabled, .is-disabled) { opacity: .45; cursor: not-allowed; }
  html[data-design-preview] .design-mobile-tools {
    display: flex; position: absolute; z-index: 1801; top: calc(112px + env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px)); gap: 0;
  }
  html[data-design-preview] .design-mobile-tools > button:first-child { display: none; }
  html[data-design-preview] .design-mobile-tools button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  html[data-design-preview] .design-mobile-tools button {
    display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; width: 44px; padding: 0;
    border: 1px solid #dce6e9; border-radius: 12px; color: #102c3d; background: #fff;
    font-size: 11px; font-weight: 750; box-shadow: var(--mobile-shadow); touch-action: manipulation;
  }
  html[data-design-preview] .design-mobile-tools button[aria-expanded="true"] { background: #81e4f0; border-color: #81e4f0; }
  html[data-design-preview] .design-mobile-tools svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
  html[data-design-preview] .parent-return {
    top: calc(112px + env(safe-area-inset-top, 0px)); left: max(10px, env(safe-area-inset-left, 0px)); right: auto;
    display: flex; align-items: center; justify-content: center; gap: 7px; width: auto; height: 44px; min-height: 44px;
    max-width: calc(100% - 144px); padding: 0 12px; border: 1px solid #dce6e9; border-radius: 12px;
    background: #fff; color: #102c3d; box-shadow: var(--mobile-shadow); font-size: 11px; touch-action: manipulation;
  }
  html[data-design-preview] .parent-return span { display: inline; }
  html[data-design-preview] .parent-return svg { width: 18px; height: 18px; }
  html[data-design-preview] .leaflet-control-zoom { display: none; }

  html[data-design-preview] .mobile-map-probe:not([hidden]) {
    position: absolute; left: 50%; top: 50%; width: 44px; height: 44px;
    transform: translate(-50%, -50%); z-index: 1250; pointer-events: none;
  }
  html[data-design-preview] .mobile-map-crosshair {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 6px;
    border: 0; background: transparent; color: #fff; cursor: pointer;
    pointer-events: auto; touch-action: manipulation;
  }
  html[data-design-preview] .mobile-map-crosshair svg {
    width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; filter: drop-shadow(0 1px 1px #102c3d) drop-shadow(0 -1px 1px #102c3d);
  }
  html[data-design-preview] .mobile-map-reading {
    position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
    display: grid; align-content: center; gap: 0; min-height: 44px;
    min-width: 0; max-width: min(220px, calc(100vw - 100px)); padding: 0 10px;
    isolation: isolate; border: 0; border-radius: 999px; background: transparent; color: #102c3d;
    box-shadow: none; text-align: center; white-space: nowrap;
    pointer-events: auto; touch-action: manipulation; cursor: pointer;
  }
  html[data-design-preview] .mobile-map-reading[hidden] { display: none; }
  html[data-design-preview] .mobile-map-reading::before {
    content: ''; position: absolute; inset: 8px 0; z-index: -1;
    border: 1px solid #d2e2e7; border-radius: inherit; background: #fffffff2;
    box-shadow: 0 2px 6px #102c3d18;
  }
  html[data-design-preview] .mobile-map-reading:has(.mobile-probe-wind:not(:empty)) { min-height: 52px; gap: 2px; }
  html[data-design-preview] .mobile-map-reading:has(.mobile-probe-wind:not(:empty))::before { inset: 6px 0; }
  html[data-design-preview] .mobile-probe-value:empty { display: none; }
  html[data-design-preview] .mobile-probe-value { font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
  html[data-design-preview] .mobile-probe-wind { font-size: 9px; color: #526f7c; }
  html[data-design-preview] .mobile-probe-wind:empty { display: none; }
  html[data-design-preview] .hs-cursor-bubble { display: none !important; }
  html[data-design-preview] .layout:has(.side-panel > details[open]) .mobile-map-probe,
  html[data-design-preview] .map-shell:is(.is-loading-map, .is-map-error, .analysis-popup-open, .wave-point-open) .mobile-map-probe,
  html[data-design-preview] .map-shell:has(.spot-detail-popup, .wave-detail-popup:not(.live-center-popup)) .mobile-map-probe { visibility: hidden; }

  /* Scale only artwork around Leaflet's22/56 anchor, never its translated
     marker. The original44x62 touch target and geographic point stay intact. */
  html[data-design-preview] .buoy-icon { filter: drop-shadow(0 1px 1px #18334140); }
  html[data-design-preview] .buoy-icon .buoy-img {
    position: absolute; left: 50%; top: 0; width: 44px; height: 62px;
    transform: translateX(-50%) scale(.6); transform-origin: 50% 56px;
  }
  html[data-design-preview] .buoy-icon .buoy-flash { top: 22px; width: 9px; height: 9px; box-shadow: 0 0 5px #ffe55b80; }
  html[data-design-preview] #map.map-theme-light .leaflet-mapDetails-pane .country-border-path,
  html[data-design-preview] #map.map-theme-dark .leaflet-mapDetails-pane .country-border-path { stroke-width: 1px !important; }
  html[data-design-preview] #map .swan-zone-rect-outer { stroke-width: 1.5px !important; }
  html[data-design-preview] #map .swan-zone-rect-inner { stroke-width: .65px !important; }
  html[data-design-preview] #map .map-country-label { font-size: 8px; letter-spacing: .12em; }
  html[data-design-preview] #map .map-city-label { font-size: 8px; letter-spacing: .04em; }
  html[data-design-preview] #map .map-city-anchor { width: 3px; height: 3px; left: -1.5px; top: -1.5px; }

  /* Smaller visible surfaces keep44px touch boxes and accessible names. */
  html[data-design-preview] .design-mobile-tools button,
  html[data-design-preview] .parent-return { isolation: isolate; background: transparent; border: 0; box-shadow: none; }
  html[data-design-preview] .design-mobile-tools button::before,
  html[data-design-preview] .parent-return::before {
    content: ''; position: absolute; inset: 6px; z-index: -1;
    border: 1px solid #dce6e9; border-radius: 9px; background: #fff; box-shadow: var(--mobile-shadow);
  }
  html[data-design-preview] .design-mobile-tools button[aria-expanded="true"] { background: transparent; }
  html[data-design-preview] .design-mobile-tools button[aria-expanded="true"]::before { background: #81e4f0; }
  html[data-design-preview] .parent-return { font-size: 10px; padding-inline: 14px; }
  html[data-design-preview] .parent-return svg { width: 15px; height: 15px; }
  html[data-design-preview] .design-mobile-tools svg { width: 17px; height: 17px; }

  /* Readable non-modal sheets, flat settings and 44px touch targets. */
  html[data-design-preview] .side-panel {
    position: absolute; z-index: 1900; inset: auto; width: 0; height: 0; min-width: 0; padding: 0;
    overflow: visible; border: 0; background: transparent; pointer-events: none;
  }
  html[data-design-preview] .side-panel > .map-controls:not([open]) { display: none; }
  html[data-design-preview] .side-panel > .map-controls[open] {
    position: fixed; left: auto; right: max(10px, env(safe-area-inset-right, 0px));
    top: calc(158px + env(safe-area-inset-top, 0px)); bottom: auto;
    width: min(288px, calc(100vw - 20px)); min-width: 0; margin: 0; padding: 0;
    max-height: calc(100dvh - 170px - var(--mobile-bottom) - env(safe-area-inset-top, 0px));
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
    border: 1px solid #dce6e9; border-radius: 14px; background: #fff; color: #102c3d;
    box-shadow: 0 8px 28px rgba(15,43,57,.18); pointer-events: auto;
  }
  html[data-design-preview] .side-panel > .map-controls[open] > .layer-controls-heading {
    position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between;
    min-height: 44px; margin: 0; padding: 0 12px; border-bottom: 1px solid #e4ecee;
    border-radius: 13px 13px 0 0; background: #fff; color: #102c3d; list-style: none;
  }
  html[data-design-preview] .side-panel > .map-controls[open] > .layer-controls-heading strong { font-size: 11px; font-weight: 750; letter-spacing: 0; }
  html[data-design-preview] .side-panel .mobile-panel-icon[hidden] { display: none; }
  html[data-design-preview] .side-panel .mobile-panel-icon svg { width: 20px; height: 20px; }
  html[data-design-preview] .side-panel .sidebar-chevron { width: 16px; height: 16px; color: #102c3d; }
  html[data-design-preview] .design-flow-settings { margin: 0; padding: 0 10px 10px; }
  html[data-design-preview] .design-flow-settings > summary { display: none; }
  html[data-design-preview] .design-flow-body { margin: 0; padding: 0; }
  html[data-design-preview] .side-panel .visual-setting { margin: 0; padding: 10px 0; border: 0; background: none; }
  html[data-design-preview] .side-panel .visual-setting + .visual-setting { margin-top: 0; padding-top: 10px; border-top: 1px solid #e4ecee; }
  html[data-design-preview] .side-panel .visual-setting-title { margin-bottom: 8px; }
  html[data-design-preview] .side-panel .visual-setting-title strong { font-size: 9px; font-weight: 750; letter-spacing: .03em; color: #57717d; }
  html[data-design-preview] .side-panel .design-flow-body .flow-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; border: 0; padding: 0; background: none; }
  html[data-design-preview] .side-panel .design-flow-body .flow-setting .flow-options .visual-option {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 48px; padding: 5px 1px; border: 1px solid #e4ecee; border-radius: 8px;
    background: #f1f5f6; color: #102c3d; box-shadow: none; font-size: 9px; font-weight: 700;
  }
  html[data-design-preview] .side-panel .flow-options .visual-option.is-active { background: #81e4f0; border-color: #81e4f0; }
  html[data-design-preview] .side-panel .design-flow-body .flow-setting .flow-options .visual-option svg { width: 16px; height: 16px; padding: 0; background: none; color: inherit; }
  html[data-design-preview] .side-panel .design-flow-body .flow-setting .flow-color-setting { min-height: 44px; margin-top: 6px; padding: 4px 7px; font-size: 10px; color: #57717d; }
  html[data-design-preview] .side-panel .design-flow-body .flow-setting .flow-color-setting input { width: 26px; height: 26px; border-radius: 7px; }
  html[data-design-preview] .side-panel .map-theme-picker { margin-bottom: 10px; padding-bottom: 10px; }
  html[data-design-preview] .side-panel .map-theme-picker > h3 { font-size: 11px; }
  html[data-design-preview] .side-panel .hs-palette-menu { padding-top: 7px; gap: 6px; }
  html[data-design-preview] .side-panel .hs-palette-menu > button { padding: 7px 5px 5px; min-height: 56px; border-radius: 8px; }
  html[data-design-preview] .side-panel .theme-name { padding-bottom: 6px; font-size: 10px; }
  html[data-design-preview] .side-panel .theme-spectrum { height: 12px; }
  html[data-design-preview] .side-panel .theme-spectrum-ticks { font-size: 7px; height: 10px; }
  html[data-design-preview] .side-panel .land-theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html[data-design-preview] .side-panel .land-theme-option {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px;
    border: 1px solid #e4ecee; border-radius: 12px; background: #f1f5f6; color: #102c3d; font-size: 12px; font-weight: 700; box-shadow: none;
  }
  html[data-design-preview] .side-panel .land-theme-option.is-active { background: #81e4f0; border-color: #81e4f0; }
  html[data-design-preview] .side-panel .land-theme-option svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
  html[data-design-preview] .side-panel .land-theme-option span { margin: 0; }
  html[data-design-preview] .side-panel .marker-options { display: grid; gap: 8px; }
  html[data-design-preview] .side-panel .visibility-toggle {
    display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px;
    border-radius: 12px; background: #f1f5f6; color: #102c3d; cursor: pointer;
  }
  html[data-design-preview] .side-panel .visibility-copy strong { color: #102c3d; font-size: 12px; font-weight: 650; white-space: normal; }
  html[data-design-preview] .side-panel .visibility-icon { width: 24px; height: 24px; color: #57717d; }
  html[data-design-preview] .side-panel .visibility-toggle input {
    position: static; opacity: 1; pointer-events: auto; appearance: auto; accent-color: #24bdce; width: 22px; height: 22px; flex: none; margin: 0 0 0 auto;
  }
  html[data-design-preview] .side-panel .spots-body { padding: 14px; }
  html[data-design-preview] .side-panel .design-spot-search {
    display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 12px; padding: 0 12px;
    background: #e4e7ed; border-radius: 999px;
  }
  html[data-design-preview] .side-panel .design-spot-search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: #99a6b6; stroke-width: 1.7; }
  html[data-design-preview] .side-panel .design-spot-search input {
    width: 100%; min-width: 0; height: 44px; padding: 0; border: 0; background: none; color: #102c3d; font-size: 16px;
  }
  html[data-design-preview] .side-panel .spots-add { min-height: 48px; background: #81e4f0; border: 0; border-radius: 12px; color: #102c3d; font-weight: 750; }
  html[data-design-preview] :is(.spots-cancel, .spot-visit) { min-height: 44px; }
  html[data-design-preview] .spot-remove { width: 44px; height: 44px; flex: none; }
  html[data-design-preview] .spots-list { max-height: 36dvh; overflow-y: auto; }
  html[data-design-preview] .spots-status:empty { display: none; }

  /* Exact desktop colour/value blocks. Short screens scroll, never drop values. */
  html[data-design-preview] .map-shell > .map-scale-overlay:not(.is-collapsed) {
    top: calc(210px + env(safe-area-inset-top, 0px)); bottom: auto; right: max(19px, calc(env(safe-area-inset-right, 0px) + 9px));
    width: 26px; height: auto; max-height: none; padding: 0; border: 0; border-radius: 0; background: transparent;
    color: #102c3d; box-shadow: none; overflow: visible; transform: none; backdrop-filter: none;
    --scale-height: calc(100dvh - 410px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
  html[data-design-preview] .map-shell > .map-scale-overlay .panel-heading { width: 26px; gap: 0; margin: 0; padding: 0; }
  html[data-design-preview] .map-shell > .map-scale-overlay .panel-heading p { display: none; }
  html[data-design-preview] .map-shell > .map-scale-overlay .panel-heading span { display: block; width: 26px; min-height: 0; padding: 2px 0; border-radius: 5px 5px 0 0; text-align: center; background: #fff; color: #102c3d; font-size: 9px; font-weight: 700; }
  html[data-design-preview] .map-shell > .map-scale-overlay .wave-scale { display: block; width: 26px; height: auto; min-height: 0; max-height: max(36px, var(--scale-height)); margin: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  html[data-design-preview] .map-shell > .map-scale-overlay .wave-scale i { display: none; }
  html[data-design-preview] .map-shell > .map-scale-overlay .scale-ticks { display: flex; flex-direction: column; width: 26px; height: auto; margin: 0; border-radius: 0 0 5px 5px; overflow: hidden; }
  html[data-design-preview] .map-shell > .map-scale-overlay .scale-ticks span,
  html[data-design-preview] .map-shell > .map-scale-overlay .scale-ticks .scale-tick-major,
  html[data-design-preview] .map-shell > .map-scale-overlay .scale-ticks .scale-tick-minor:nth-child(even) {
    position: static; transform: none; display: flex; align-items: center; justify-content: center;
    min-height: 10px; height: 10px;
    font-size: 9px; font-weight: 700; line-height: 1; color: var(--band-ink); background: var(--band-color);
  }
  html[data-design-preview] .map-shell > .map-scale-overlay .scale-ticks span::before { content: none; }
  html[data-design-preview] .map-shell > .map-scale-overlay .map-scale-toggle,
  html[data-design-preview] .map-shell > .map-scale-overlay.is-collapsed .map-scale-toggle {
    position: absolute; top: -36px; right: -9px; width: 44px; height: 44px; padding: 0; border-radius: 10px;
    display: grid; place-items: center;
    isolation: isolate; border: 0; background: transparent; color: #102c3d; box-shadow: none;
  }
  html[data-design-preview] .map-shell > .map-scale-overlay .map-scale-toggle::before {
    content: ''; position: absolute; inset: 12px; z-index: -1; border: 1px solid #dce6e9;
    border-radius: 6px; background: #fff; box-shadow: 0 1px 4px #102c3d18;
  }
  html[data-design-preview] .map-shell > .map-scale-overlay .map-scale-toggle svg { width: 11px; height: 11px; }
  html[data-design-preview] .map-shell > .map-scale-overlay.is-collapsed {
    top: calc(238px + env(safe-area-inset-top, 0px)); right: max(10px, env(safe-area-inset-right, 0px));
    width: 40px; height: 0; padding: 0; background: transparent; border: 0; box-shadow: none; overflow: visible;
  }
  html[data-design-preview] .layout:has(.side-panel > details[open]) .map-scale-overlay { visibility: hidden; }

  html[data-design-preview] .forecast-timeline {
    height: calc(108px + env(safe-area-inset-bottom, 0px)); grid-template-rows: 64px 44px;
    padding: 0 8px env(safe-area-inset-bottom, 0px); margin: 0; border: 0;
    background: linear-gradient(to bottom, rgba(16,48,62,.9) 0 64px, #0b1925 64px) !important;
    color: #eef9fc; border-top: 1px solid #ffffff18;
    --timeline-ink: #eef9fc; --timeline-muted: #a5bac5; --timeline-rule: #aed4e03d; --timeline-track-bg: #203541;
    box-shadow: none;
  }
  html[data-design-preview] .forecast-timeline-scroll { touch-action: pan-x; overscroll-behavior-x: contain; }
  html[data-design-preview] .forecast-timeline-ruler { padding-top: 20px; }
  html[data-design-preview] .forecast-timeline-track, html[data-design-preview] .forecast-timeline-slot { height: 24px; }
  html[data-design-preview] .forecast-timeline-days, html[data-design-preview] .forecast-timeline-day { height: 20px; }
  html[data-design-preview] .forecast-timeline-valid { height: 20px; padding: 2px 8px; font-size: 10px; font-weight: 750; box-shadow: none; }
  html[data-design-preview] .forecast-timeline-valid::after { height: 44px; box-shadow: none; }
  html[data-design-preview] .forecast-timeline-day strong { font-size: 10px; }
  html[data-design-preview] .forecast-timeline-day small { font-size: 9px; }
  html[data-design-preview] .forecast-timeline-control { width: 44px; height: 44px; border-radius: 10px; touch-action: manipulation; }
  html[data-design-preview] .forecast-timeline-footer { justify-content: center; border-top: 1px solid #ffffff12; }
  html[data-design-preview] .forecast-timeline-play { color: #102c3d; background: #81e4f0; }
  html[data-design-preview] .layout:has(.map-shell.analysis-popup-open, .map-shell.wave-point-open, .spot-detail-popup) :is(.side-panel, .design-mobile-tools, .design-mobile-layers, .map-scale-overlay, .parent-return, .forecast-timeline) { visibility: hidden; }

  /* Leaflet keeps positioning; content fits and scrolls inside the phone. */
  html[data-design-preview] .wave-detail-popup.buoy-unified-popup .leaflet-popup-content { width: min(460px, calc(100vw - 28px)) !important; }
  html[data-design-preview] :is(.wave-detail-popup, .wave-point-popup, .spot-detail-popup) .leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: 20px; }
  html[data-design-preview] :is(.wave-detail-popup, .wave-point-popup, .spot-detail-popup) .leaflet-popup-content,
  html[data-design-preview] .wave-point-popup:has(.wave-point-advanced[open]) .leaflet-popup-content,
  html[data-design-preview] .wave-point-popup:has(.point-tide-disclosure[open]) .leaflet-popup-content {
    width: calc(100vw - 24px) !important; max-width: none !important;
    max-height: min(var(--point-popup-max-height, 62dvh), 62dvh, calc(100dvh - 120px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))) !important;
    margin: 0 !important; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  }
  html[data-design-preview] :is(.wave-detail-popup, .wave-point-popup, .spot-detail-popup) .leaflet-popup-tip-container { display: none; }
  html[data-design-preview] :is(.wave-point-card, .wave-detail-card, .buoy-summary-card, .spot-detail) { padding: 16px; }
  html[data-design-preview] :is(.wave-point-card, .wave-detail-card, .buoy-summary-card) .wave-detail-close { position: sticky; float: right; top: 0; width: 44px; height: 44px; margin: -8px -8px -36px 0; z-index: 5; }
  html[data-design-preview] .wave-point-head { padding-right: 40px; }
  html[data-design-preview] .wave-point-head, html[data-design-preview] .buoy-summary-header { overflow-wrap: anywhere; }
  html[data-design-preview] .wave-point-facts strong { font-size: 14px; }
  /* Reference point band: translucent, dense and paired with the live timeline. */
  html[data-design-preview] .layout:has(.map-shell.wave-point-open) .forecast-timeline { visibility: visible; }
  html[data-design-preview] .wave-point-popup:has(.mobile-point-sheet) .leaflet-popup-content { max-height: min(var(--point-popup-max-height, 55dvh), 55dvh) !important; scrollbar-width: thin; }
  html[data-design-preview] .wave-point-popup:has(.mobile-point-sheet) .leaflet-popup-content-wrapper { border: 0; background: transparent; box-shadow: none; border-radius: 16px 16px 8px 8px; }
  html[data-design-preview] .wave-point-popup .mobile-point-sheet { padding: 12px 12px 0; border: 1px solid #c6edf22e; border-radius: 16px 16px 8px 8px; color: #f4fafc; background: linear-gradient(130deg, #071b26d9, #061f2bbd); box-shadow: inset 0 1px 0 #ffffff12; }
  html[data-design-preview] .mobile-point-sheet .wave-detail-close { position: absolute; float: none; top: 3px; right: 3px; margin: 0; width: 44px; height: 44px; border: 0; background: transparent; color: #e5f3f8; font-size: 23px; }
  html[data-design-preview] .mobile-sea-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 7px; padding-right: 28px; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
  html[data-design-preview] .mobile-sea-summary > strong { font-size: 13px; font-weight: 800; }
  html[data-design-preview] .mobile-sea-summary > b { font-size: 15px; font-weight: 800; }
  html[data-design-preview] .mobile-sea-energy { font-size: 11px; color: #d1e4ed; }
  html[data-design-preview] .mobile-point-sheet .wave-point-wind { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 3px 28px 9px 0; font-size: 12px; color: #e1eef3; }
  html[data-design-preview] .mobile-point-sheet .mobile-point-wind-arrow { width: 16px; height: 16px; fill: currentColor; }
  html[data-design-preview] .mobile-components { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 9px; padding: 10px; border: 1px solid #ffffff0a; border-radius: 10px; background: #020d16a6; }
  html[data-design-preview] .mobile-component { display: flex; align-items: center; gap: 4px; min-width: 0; color: #f3f8fc; white-space: nowrap; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
  html[data-design-preview] .mobile-component > i { width: 10px; height: 10px; flex: 0 0 10px; margin-right: 2px; border-radius: 50%; background: var(--component-color); }
  html[data-design-preview] .mobile-component-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  html[data-design-preview] .mobile-point-sheet .wave-point-more { margin-top: 2px; border: 0; }
  html[data-design-preview] .mobile-point-sheet .wave-point-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0; color: #cfdfE8; font-size: 10px; font-weight: 500; list-style: none; cursor: pointer; }
  html[data-design-preview] .mobile-point-details-label { color: #e1f8fc; font-size: 11px; font-weight: 700; }
  html[data-design-preview] .mobile-point-sheet .wave-point-more > summary::-webkit-details-marker { display: none; }
  html[data-design-preview] .mobile-point-sheet .wave-point-more[open] > summary > span { transform: none; }
  html[data-design-preview] .mobile-point-sheet .design-components { margin: 0 0 8px; padding-top: 8px; }
  html[data-design-preview] .mobile-point-sheet .design-components h3 { font-size: 11px; margin-bottom: 6px; }
  html[data-design-preview] .mobile-point-sheet :is(.design-component, .design-components-head) { font-size: 10px; gap: 4px; }
  html[data-design-preview] .map-shell.wave-point-open .mobile-map-probe { visibility: hidden; }
  html[data-design-preview] .mobile-selected-point { filter: drop-shadow(0 1px 3px #002e4d80); }
  html[data-design-preview] .mobile-wave-rose .wave-rose-svg { width: 100%; height: 100%; }
  html[data-design-preview] .mobile-wave-rose .wave-rose-halo { fill: #09202b29; }
  html[data-design-preview] .mobile-map-probe.has-live-inspector { visibility: visible; width: 72px; height: 72px; pointer-events: none; }
  html[data-design-preview] .has-live-inspector > button { display: none; }
  html[data-design-preview] .mobile-center-rose,
  html[data-design-preview] .mobile-center-rose > svg { display: block; width: 72px; height: 72px; color: #123d50; }
  html[data-design-preview] .mobile-center-rose .wave-rose-field { fill: #123d5008; }
  html[data-design-preview] .mobile-center-rose .wave-rose-ring { stroke-width: 1.2; }
  html[data-design-preview] .mobile-center-rose .wave-rose-inner { opacity: .35; }
  html[data-design-preview] .live-center-popup .wave-detail-close { display: none; }
  html[data-design-preview] .live-center-popup .mobile-sea-summary { padding-right: 0; }
  html[data-design-preview] .layout:has(.live-center-reading) .design-mobile-layers:not([hidden]) { bottom: calc(var(--mobile-timeline-height) + 8px + env(safe-area-inset-bottom, 0px)); }
  html[data-design-preview] .live-center-popup .mobile-point-sheet { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 8px; padding: 7px 10px 3px; border-radius: 12px; }
  html[data-design-preview] .live-center-popup .mobile-sea-summary { grid-column: 1 / -1; gap: 2px 5px; font-size: 11px; line-height: 1.45; }
  html[data-design-preview] .live-center-popup .mobile-sea-summary > strong { font-size: 11px; font-weight: 650; }
  html[data-design-preview] .live-center-popup .mobile-sea-summary > b { font-size: 14px; }
  html[data-design-preview] .live-center-popup .mobile-sea-energy { font-size: 9px; }
  html[data-design-preview] .live-center-popup .wave-point-wind { grid-column: 1 / -1; gap: 4px; margin: 1px 0 3px; font-size: 11px; }
  html[data-design-preview] .live-center-popup .mobile-components { grid-column: 1 / -1; gap: 3px 8px; padding: 3px 0 4px; border: 0; border-radius: 0; background: transparent; }
  html[data-design-preview] .live-center-popup .mobile-component { gap: 3px; font-size: 10px; font-weight: 500; }
  html[data-design-preview] .live-center-popup .mobile-component > i { width: 6px; height: 6px; flex-basis: 6px; margin-right: 1px; }
  html[data-design-preview] .live-center-popup .mobile-point-coordinates { align-self: center; margin: 0; font-size: 8px; line-height: 1.2; }
  html[data-design-preview] .live-center-popup .point-panel-tabs { display: block; min-width: 145px; padding: 0; }
  html[data-design-preview] .live-center-popup .point-panel-actions { display: flex; justify-content: flex-end; gap: 5px; }
  html[data-design-preview] .live-center-popup .point-panel-actions button { min-height: 28px; padding: 2px 10px; border: 1px solid #9ed9e32e; border-radius: 7px; font-family: inherit; font-size: 10px; font-weight: 650; color: #c6e6ef; background: #153746; cursor: pointer; }
  html[data-design-preview] .live-center-popup .point-panel-actions button[aria-expanded="true"] { color: #062d40; background: #80e4ed; border-color: #80e4ed; }
  html[data-design-preview] .live-center-popup .point-data-panel { display: block !important; margin: 5px 0 0; padding: 0; border: 0; background: transparent; color: #d9edf3; }
  html[data-design-preview] .live-center-popup .point-data-panel[hidden] { display: none !important; }
  html[data-design-preview] .live-center-popup .point-panel-tabs:is([data-active="tide"],[data-active="forecast"]) { grid-column: 1 / -1; }
  html[data-design-preview] .live-center-popup.wave-point-popup:has(.mobile-point-sheet) .leaflet-popup-content { max-height: var(--point-popup-max-height,40dvh) !important; }
  html[data-design-preview] .live-center-popup .mobile-point-sheet:has(.point-data-panel:not([hidden])) .mobile-components,
  html[data-design-preview] .live-center-popup .mobile-point-sheet:has(.point-data-panel:not([hidden])) .mobile-point-coordinates { display: none; }
  html[data-design-preview] .live-center-popup .mobile-point-wind-arrow { display: none; }
  html[data-design-preview] .live-center-popup .point-tide-chart { padding: 5px 3px 0; border-color: #315768; border-radius: 8px; }
  html[data-design-preview] .live-center-popup .point-tide-chart svg { height: auto; width: 100%; }
  html[data-design-preview] .live-center-popup .point-tide-readout { padding: 0 5px; font-size: 9px; }
  html[data-design-preview] .live-center-popup .point-tide-readout strong { font-size: 12px; }
  html[data-design-preview] .live-center-popup .point-tide-readout small { font-size: 8px; }
  html[data-design-preview] .live-center-popup .point-tide-events { gap: 5px; margin-top: 4px; }
  html[data-design-preview] .live-center-popup .point-tide-events > span { padding: 4px 6px; gap: 0; }
  html[data-design-preview] .live-center-popup .point-tide-events b { font-size: 9px; }
  html[data-design-preview] .live-center-popup .point-tide-events strong { font-size: 11px; }
  html[data-design-preview] .live-center-popup .point-tide-events small,
  html[data-design-preview] .live-center-popup .point-tide-missing { font-size: 8px; }
  html[data-design-preview] .live-center-popup .forecast-table-scroll { max-height: none; overflow-x: auto; overflow-y: hidden; border-radius: 7px; background: #0b2938; }
  html[data-design-preview] .live-center-popup .mobile-point-sheet:has(.point-data-panel:not([hidden])):has(.mobile-sea-summary:not([hidden])) .wave-point-wind { display: none; }
  html[data-design-preview] .live-center-popup .wind-forecast-provenance { margin: 0 0 4px; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html[data-design-preview] .live-center-popup .forecast-table { --forecast-table-bg: #0b2938; --forecast-table-ink: #d9ecf3; --forecast-table-muted: #aac8d5; }
  html[data-design-preview] .live-center-popup :is(.forecast-table-label,.forecast-table-hour) { background: #153c4b; color: #d6eaf1; font-size: 10px; }
  html[data-design-preview] .live-center-popup .mobile-point-sheet:has(.point-panel-tabs[data-active="forecast"]) .mobile-sea-summary { display: none; }
  html[data-design-preview] .live-center-popup .forecast-panel { padding-top: 0; }
  html[data-design-preview] .live-center-popup .forecast-table { grid-template-rows: 28px repeat(6,20px); }
  html[data-design-preview] .live-center-popup .forecast-table-cell { font-size: 11px; }
  html[data-design-preview] .live-center-popup .forecast-table-hour { position: sticky; top: 0; z-index: 2; line-height: 1; gap: 0; }
  html[data-design-preview] .live-center-popup .point-tide-disclosure { --tide-chart-bg: #082635; --tide-chart-axis: #c2dee8; --tide-chart-muted: #9ec1cf; --tide-chart-line: #83e2e9; --tide-chart-event-ink: #f1fbfd; }
  html[data-design-preview] .live-center-popup .point-tide-events > span { background: #103040; border-color: #315768; }
  html[data-design-preview] .live-center-popup .point-tide-events :is(b,small),
  html[data-design-preview] .live-center-popup .point-tide-chevron { color: #a8ceda; }
  html[data-design-preview] .live-center-popup .point-tide-events strong { color: #f3fdff; }
  html[data-design-preview] .layout:has(.live-center-reading) .design-mobile-layers .layer-option { min-height: 40px; padding: 2px 0; gap: 2px; font-size: 9px; }
  html[data-design-preview] .layout:has(.live-center-reading) .design-mobile-layers .layer-option svg { width: 16px; height: 16px; }
  html[data-design-preview] .layout:has(.live-center-reading) .mobile-dock-toggle { height: 40px; flex-basis: 30px; }
  html[data-design-preview] .buoy-summary-stat { min-width: 0; }
  html[data-design-preview] .buoy-summary-stat > strong { font-size: clamp(20px, 7vw, 32px); }
  html[data-design-preview] .forecast-table { --forecast-label-width: 96px; --forecast-cell-width: 44px; }
  html[data-design-preview] .forecast-table-label { white-space: normal; font-size: 10px; }
  html[data-design-preview] .forecast-table-cell { font-size: 14px; }
  html[data-design-preview] .forecast-table-scroll { max-width: 100%; touch-action: pan-x pan-y; }
  html[data-design-preview] .spot-name-form input { font-size: 16px; }
  html[data-design-preview] :is(.spot-name-form button, .wave-point-advanced > summary, .point-tide-disclosure > summary) { min-height: 44px; }
  html[data-design-preview] .layout:has(.is-picking-spot) .spots-list { display: none; }
  /* Reference glass: real alpha, directional reflections and inset highlights.
     No blur surface over the animated map. Data colours stay native. */
  html[data-design-preview] .layout { --mobile-shadow: 0 5px 14px #0a344018; }
  html[data-design-preview][data-ui-theme] .topbar {
    background: radial-gradient(ellipse at 8% 0%, #ffffffeb, transparent 66%),
      linear-gradient(110deg, #f6fcfff2 12%, #dceff5eb 65%, #ade5f2e0);
    border-bottom: 1px solid #e8faffc2; gap: 8px;
    box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 #82b8ca38, 0 3px 10px #082f4514;
  }
  html[data-design-preview] .brand-logo-test { width: 124px; height: 44px; }
  html[data-design-preview] .topbar .header-theme-toggle {
    height: 42px; padding: 2px; border: 0; border-radius: 25px;
    background: linear-gradient(145deg, #bdd8e673, #e5f4f9b3);
    box-shadow: inset 0 1px 3px #35678020, inset 0 -1px 0 #ffffffa8;
  }
  html[data-design-preview] .topbar .header-theme-toggle .land-theme-option {
    width: 38px; height: 38px; flex-basis: 38px; border-radius: 50%; color: #7596a8;
  }
  html[data-design-preview] .topbar .header-theme-toggle .land-theme-option.is-active {
    color: #10394e; background: linear-gradient(150deg, #fff, #e7f7fc);
    box-shadow: inset 0 1px 0 #fff, 0 2px 5px #153e4e26;
  }
  html[data-design-preview][data-ui-theme] .topbar .contact-link {
    border-radius: 15px; background: linear-gradient(145deg, #98f6fd, #47dff2 65%, #25c8e6);
    box-shadow: inset 0 1px 0 #dfffffd9, inset 0 -1px 1px #079ec45c, 0 4px 10px #17a7c333;
  }
  html[data-design-preview] .favorites-bar {
    left: 8px; right: 8px; height: 48px; padding: 4px 7px; gap: 2px;
    border: 1px solid #f1fcffbd; border-radius: 28px;
    background: radial-gradient(ellipse at 12% 0%, #ffffffd9, transparent 75%),
      linear-gradient(115deg, #eaf7ffdc, #cbe5f2ce 70%, #eefaffde);
    box-shadow: inset 0 1px 0 #ffffffeb, inset 0 -1px 0 #8cb7c54a, 0 5px 12px #092f472e;
  }
  html[data-design-preview] .favorites-bar :is(.favorites-bar-title, .favorites-bar-add) {
    display: flex; align-items: center; justify-content: center; flex: 1; gap: 7px;
    min-height: 38px; padding: 0 7px; border: 0; border-radius: 22px;
    color: #12364a; background: transparent; font-size: 12px; font-weight: 800;
  }
  html[data-design-preview] .favorites-bar .favorites-bar-title { background: linear-gradient(145deg, #ffffffd9, #e8f4fc91); box-shadow: inset 0 1px 0 #ffffffeb, 0 2px 5px #729bad1c; }
  html[data-design-preview] .favorites-bar .favorites-bar-list { display: none; }
  html[data-design-preview] .favorites-bar-title > svg { width: 22px; height: 22px; }
  html[data-design-preview] .favorites-bar-add > svg { display: block; width: 18px; height: 18px; }
  html[data-design-preview] .mobile-spot-search {
    display: grid; place-items: center; flex: 0 0 44px; height: 38px; padding: 0;
    border: 0; border-left: 1px solid #cee3ec; border-radius: 0 22px 22px 0;
    color: #12364a; background: transparent; cursor: pointer;
  }
  html[data-design-preview] .mobile-spot-search svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  html[data-design-preview] .parent-return { top: calc(116px + env(safe-area-inset-top, 0px)); gap: 8px; padding: 0 13px; max-width: calc(100% - 82px); font-size: 12px; font-weight: 800; }
  html[data-design-preview] .parent-return::before { inset: 2px 0; border-radius: 24px; border-color: #ffffffcf; background: #fffffff5; }
  html[data-design-preview] .parent-return > svg { display: block; width: 19px; height: 19px; }
  html[data-design-preview] .design-mobile-tools { top: calc(116px + env(safe-area-inset-top, 0px)); right: 14px; }
  html[data-design-preview] .design-mobile-tools button::before { inset: 1px; border-radius: 15px; background: #fffffff5; border-color: #fff; }
  html[data-design-preview] .design-mobile-tools svg { width: 21px; height: 21px; }
  html[data-design-preview] .design-mobile-layers:not([hidden]) {
    left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px));
    padding: 4px 5px; border: 1px solid #c4ecf36b; border-radius: 23px;
    background: #0d344d8c;
    box-shadow: inset 0 1px 0 #e7fbff5c, inset 0 -1px 0 #0317274d, 0 5px 14px #031c3540;
  }
  html[data-design-preview] .design-mobile-layers .visual-options-5 { gap: 2px; }
  html[data-design-preview] .design-mobile-layers:not([hidden]) { display: flex; align-items: center; gap: 2px; }
  html[data-design-preview] .design-mobile-layers > .visual-setting { flex: 1; min-width: 0; order: 1; }
  html[data-design-preview] .mobile-dock-toggle {
    display: grid; place-items: center; flex: 0 0 44px; height: 54px; padding: 0;
    border: 0; border-radius: 18px; color: #d9eef4; background: transparent; cursor: pointer;
  }
  html[data-design-preview] .mobile-dock-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
  html[data-design-preview] .design-mobile-layers.is-retracted:not([hidden]) { right: auto; width: 56px; }
  html[data-design-preview] .design-mobile-layers.is-retracted > .visual-setting { display: none; }
  html[data-design-preview] .design-mobile-layers.is-retracted .mobile-dock-toggle { flex-basis: 42px; }
  html[data-design-preview] .mobile-dock-toggle[aria-expanded="false"] svg { transform: rotate(180deg); }
  @media (prefers-reduced-motion: reduce) { html[data-design-preview] .mobile-dock-toggle svg { transition: none; } }
  html[data-design-preview] .design-mobile-layers .layer-option { min-height: 48px; padding: 4px 0; gap: 4px; border-radius: 15px; font-size: 10px; font-weight: 700; color: #e7f5fa; text-shadow: 0 1px 3px #001c39d9; }
  html[data-design-preview] .design-mobile-layers .layer-option svg { width: 19px; height: 19px; stroke-width: 1.7; }
  html[data-design-preview] .design-mobile-layers .layer-option.is-active { color: #07354b; text-shadow: none; background: linear-gradient(145deg, #a3f9fc, #4cdfee 70%, #2fc5e1); box-shadow: inset 0 1px 0 #e8ffffd9, inset 0 -1px 0 #1098b959, 0 2px 6px #001c3040; }
  html[data-design-preview] .design-mobile-layers .layer-option:not(.is-active):active,
  html[data-design-preview] .mobile-dock-toggle:active { background: #ffffff12; }
  /* Floating glass follows the selected theme, not a forced dark map. */
  html[data-design-preview][data-ui-theme="dark"] .parent-return { color: #e9f8fc; background: transparent; border-color: transparent; }
  html[data-design-preview][data-ui-theme="dark"] .parent-return::before,
  html[data-design-preview][data-ui-theme="dark"] .design-mobile-tools button::before { background: linear-gradient(145deg, #a9d8e436, #18364794); border-color: #c8edf266; box-shadow: inset 0 1px 0 #ffffff40, 0 2px 6px #0018273d; }
  html[data-design-preview][data-ui-theme="dark"] .design-mobile-tools button { color: #e9f8fc; background: transparent; border-color: transparent; }
  html[data-design-preview] .mobile-map-crosshair { color: #183e51; }
  html[data-design-preview] .mobile-map-crosshair svg { width: 32px; height: 32px; stroke-width: 1.6; filter: drop-shadow(0 1px 0 #fff9); }
  html[data-design-preview] .mobile-map-reading { top: 43px; padding: 5px 16px; min-height: 46px; gap: 1px; }
  html[data-design-preview] .mobile-map-reading::before,
  html[data-design-preview] .mobile-map-reading:has(.mobile-probe-wind:not(:empty))::before { inset: 0; border-color: #fff9; background: #fffffff5; box-shadow: 0 5px 10px #12384418; }
  html[data-design-preview] .mobile-probe-value { font-size: 14px; font-weight: 850; }
  html[data-design-preview] .mobile-probe-wind { font-size: 10px; color: #5c7c8f; }
  html[data-design-preview] .map-shell > .map-scale-overlay:not(.is-collapsed) {
    right: 12px; width: 38px; padding: 5px; border: 0; border-radius: 0;
    background: transparent; box-shadow: none;
  }
  html[data-design-preview] .map-shell > .map-scale-overlay:has(.secondary-wind-scale:not([hidden])) { width: 72px; }
  html[data-design-preview] .map-shell > .map-scale-overlay:not(.is-collapsed):has(.secondary-wind-scale:not([hidden])) { display: grid; grid-template-columns: 28px 28px; column-gap: 4px; }
  html[data-design-preview] .map-scale-overlay:has(.secondary-wind-scale:not([hidden])) > .panel-heading { grid-column: 2; grid-row: 1; }
  html[data-design-preview] .map-scale-overlay:has(.secondary-wind-scale:not([hidden])) > .wave-scale { grid-column: 2; grid-row: 2; }
  html[data-design-preview] .map-shell > .map-scale-overlay .secondary-wind-scale { position: static; grid-column: 1; grid-row: 1 / span 2; align-self: start; width: 28px; padding: 0; margin: 0; }
  html[data-design-preview] .map-shell > .map-scale-overlay .panel-heading,
  html[data-design-preview] .map-shell > .map-scale-overlay .panel-heading span,
  html[data-design-preview] .map-shell > .map-scale-overlay .wave-scale,
  html[data-design-preview] .map-shell > .map-scale-overlay .scale-ticks { width: 28px; }
  html[data-design-preview] .map-shell > .map-scale-overlay .panel-heading span { padding: 3px 0; margin-bottom: 3px; border: 1px solid #e0edf0; border-radius: 7px; color: #12364a; background: #fffffff2; font-size: 11px; }
  html[data-design-preview] .map-shell > .map-scale-overlay .scale-ticks { border-radius: 8px; }
  html[data-design-preview] .map-shell > .map-scale-overlay .scale-ticks span { height: 11px; min-height: 11px; font-size: 9px; }
  html[data-design-preview] .map-shell > .map-scale-overlay .map-scale-toggle,
  html[data-design-preview] .map-shell > .map-scale-overlay.is-collapsed .map-scale-toggle { right: calc(50% - 22px); }
  html[data-design-preview] .map-shell > .map-scale-overlay.is-collapsed { top: calc(210px + env(safe-area-inset-top, 0px)); right: 12px; width: 38px; height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
  html[data-design-preview] .forecast-timeline { border: 0; background: linear-gradient(180deg, #092b3bef, #041924) !important; padding-inline: 8px; }
  html[data-design-preview] .forecast-timeline-scroll { border: 1px solid #b9e7ef12; border-radius: 13px; background: #153746b3; }
  html[data-design-preview] .forecast-timeline-day { padding-inline: 8px; border-left-color: #ffffff0c; }
  html[data-design-preview] .forecast-timeline-day strong { font-size: 10px; letter-spacing: .02em; }
  html[data-design-preview] .forecast-timeline-day small { font-size: 10px; }
  html[data-design-preview] .forecast-timeline-controls { gap: 13px; }
  html[data-design-preview] .forecast-timeline-footer { border-top: 0; }
  html[data-design-preview] .forecast-timeline-control { position: relative; isolation: isolate; color: #d6edf4; background: transparent; font-size: 21px; border-radius: 15px; }
  html[data-design-preview] .forecast-timeline-control:not(.forecast-timeline-play)::before { content: ''; position: absolute; inset: 9px; z-index: -1; border: 1px solid #c3edf02e; border-radius: 9px; background: #ffffff04; }
  html[data-design-preview] .forecast-timeline-play { position: relative; isolation: isolate; width: 44px; height: 44px; color: #07354b; background: transparent; font-size: 15px; box-shadow: none; }
  html[data-design-preview] .forecast-timeline-play::before { content: ''; position: absolute; inset: 6px; z-index: -1; border-radius: 11px; background: linear-gradient(145deg, #8af4fb, #36d8f1); }
  html[data-design-preview] :is(button, summary, a, input):focus-visible { outline: 2px solid #24bdce; outline-offset: 2px; }
}
@media (max-width: 1100px) and (max-height: 520px) and (orientation: landscape) {
  html[data-design-preview][data-ui-theme] .topbar { right: auto; width: 292px; height: 54px; }
  html[data-design-preview] .favorites-bar { top: calc(54px + env(safe-area-inset-top, 0px)); width: 292px; height: 44px; }
  html[data-design-preview] .design-mobile-layers:not([hidden]) { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; left: calc(324px + env(safe-area-inset-left, 0px)); }
  html[data-design-preview] .design-mobile-layers .layer-model-menu { top: calc(100% + 10px); bottom: auto; }
  html[data-design-preview] .design-mobile-tools { top: calc(74px + env(safe-area-inset-top, 0px)); }
  html[data-design-preview] .parent-return { top: calc(122px + env(safe-area-inset-top, 0px)); }
  html[data-design-preview] .map-shell > .map-scale-overlay:not(.is-collapsed),
  html[data-design-preview] .map-shell > .map-scale-overlay.is-collapsed { top: calc(172px + env(safe-area-inset-top, 0px)); --scale-height: calc(100dvh - 350px); }
  html[data-design-preview] .side-panel > .map-controls[open] { left: auto; right: max(64px, env(safe-area-inset-right, 0px)); top: calc(74px + env(safe-area-inset-top, 0px)); bottom: calc(var(--mobile-timeline-height) + 8px + env(safe-area-inset-bottom, 0px)); width: min(288px, 48vw); max-height: none; }
  html[data-design-preview] :is(.wave-detail-popup, .wave-point-popup, .spot-detail-popup) .leaflet-popup-content,
  html[data-design-preview] .wave-point-popup:has(.wave-point-advanced[open]) .leaflet-popup-content,
  html[data-design-preview] .wave-point-popup:has(.point-tide-disclosure[open]) .leaflet-popup-content { width: min(420px, calc(100vw - 24px)) !important; }
}
@media (max-width: 600px) and (max-height: 740px) and (orientation: portrait) {
  /* dvh is the actual browser viewport. Never subtract Android/Chrome twice. */
  html[data-design-preview] .layout { --mobile-timeline-height: 108px; --mobile-bottom: calc(108px + 62px + env(safe-area-inset-bottom, 0px)); }
  html[data-design-preview][data-ui-theme] .topbar { height: calc(48px + env(safe-area-inset-top, 0px)); padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  html[data-design-preview] .brand-logo-test { width: 90px; height: 32px; }
  html[data-design-preview] .favorites-bar { top: calc(48px + env(safe-area-inset-top, 0px)); height: 44px; padding-block: 0; }
  html[data-design-preview] .favorites-bar :is(.favorites-bar-title, .favorites-bar-add),
  html[data-design-preview] .mobile-spot-search { min-height: 44px; height: 44px; }
  html[data-design-preview] .parent-return,
  html[data-design-preview] .design-mobile-tools { top: calc(100px + env(safe-area-inset-top, 0px)); }
  html[data-design-preview] .parent-return { font-size: 11px; }
  html[data-design-preview] .design-mobile-layers .layer-option { min-height: 44px; gap: 3px; font-size: 10px; }
  html[data-design-preview] .design-mobile-layers .layer-option svg { width: 18px; height: 18px; }
  html[data-design-preview] .mobile-dock-toggle { height: 44px; }
  html[data-design-preview] .forecast-timeline { height: calc(108px + env(safe-area-inset-bottom, 0px)); grid-template-rows: 64px 44px; }
  html[data-design-preview] .forecast-timeline-ruler { padding-top: 16px; }
  html[data-design-preview] .forecast-timeline-days,
  html[data-design-preview] .forecast-timeline-day { height: 22px; }
  html[data-design-preview] .forecast-timeline-track,
  html[data-design-preview] .forecast-timeline-slot { height: 26px; }
  html[data-design-preview] .forecast-timeline-valid { height: 16px; font-size: 9px; }
  html[data-design-preview] .forecast-timeline-valid::after { height: 48px; }
  html[data-design-preview] .map-shell > .map-scale-overlay:not(.is-collapsed),
  html[data-design-preview] .map-shell > .map-scale-overlay.is-collapsed { top: calc(178px + env(safe-area-inset-top, 0px)); --scale-height: max(36px, calc(100dvh - 404px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); }
  html[data-design-preview] .spots-maintenance-notice { top: calc(96px + env(safe-area-inset-top, 0px)); }
  html[data-design-preview] .side-panel > .map-controls[open] { top: calc(148px + env(safe-area-inset-top, 0px)); max-height: calc(100dvh - 164px - var(--mobile-bottom)); }
  html[data-design-preview] .side-panel .visual-setting { padding-block: 10px; }
}
