:root {
  --ink: #0b1f2a;
  --ink-soft: #4a626e;
  --ink-faint: #7c919b;
  --bg: #ffffff;
  --bg-alt: #f4f8fa;
  --sky: #e6f1f6;
  --line: #e3eaee;
  --ocean: #0e7c99;
  --ocean-deep: #0a5a71;
  --ocean-ink: #073b4c;
  --sailing: #2f80ed;
  --motoring: #f2994a;
  --anchored: #0ca5a5;
  --night: #5454b8;
  --error: #a23a3a;
  --error-bg: #fff2f2;
  --header-bg: rgba(255, 255, 255, .82);
  --map-heading-bg: rgba(255, 255, 255, .2);
  --panel-translucent: rgba(255, 255, 255, .94);
  --detail-translucent: rgba(255, 255, 255, .9);
  --detail-border: rgba(227, 234, 238, .9);
  --bg-raised: #fbfdfe;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 2px 4px rgba(11, 31, 42, .06), 0 12px 24px -10px rgba(11, 31, 42, .2), 0 40px 80px -28px rgba(11, 31, 42, .34);
  --shadow-sm: 0 1px 2px rgba(11, 31, 42, .05), 0 10px 26px -14px rgba(11, 31, 42, .22);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --ink: #e7edf5;
  --ink-soft: #b5c1d0;
  --ink-faint: #8d9caf;
  --bg: #151a24;
  --bg-alt: #0d1118;
  --sky: #1b2433;
  --line: #2d3748;
  --ocean: #6bb7ff;
  --ocean-deep: #b0d6ff;
  --ocean-ink: #e2f0ff;
  --sailing: #7ab8ff;
  --motoring: #ffb36b;
  --anchored: #45c7c7;
  --night: #9696ff;
  --error: #ffaaaa;
  --error-bg: #48252a;
  --header-bg: rgba(21, 26, 36, .88);
  --map-heading-bg: rgba(21, 26, 36, .2);
  --panel-translucent: rgba(21, 26, 36, .94);
  --detail-translucent: rgba(21, 26, 36, .9);
  --detail-border: rgba(72, 86, 107, .9);
  --bg-raised: #1c2431;
  --shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 12px 24px -10px rgba(0, 0, 0, .45), 0 40px 80px -28px rgba(0, 0, 0, .62);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .16), 0 10px 26px -14px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { min-height: 100%; color-scheme: light; background: var(--bg-alt); }
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  min-width: 320px;
  flex-direction: column;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0, var(--bg-alt) 540px);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.022em; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2.5px solid var(--ocean); outline-offset: 3px; }
[hidden] { display: none !important; }

.container { width: calc(100% - 40px); margin-inline: auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.viewer-page {
  height: 100vh;
  height: 100dvh;
  min-height: 320px;
}
.viewer-page .site-header, .viewer-page .site-footer { flex: none; }
.site-header__inner { min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.brand { display: inline-flex; min-width: 0; align-items: center; justify-self: start; gap: 10px; }
.brand__mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}
.brand strong { font-size: 16.5px; }
.site-nav { display: flex; grid-column: 2; align-items: center; gap: 4px; }
.site-nav a, .site-nav button { padding: 7px 10px; border: 0; border-radius: 8px; color: var(--ink-soft); background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; }
.site-nav a:hover, .site-nav button:hover { background: var(--bg-alt); }
.site-nav a.is-active, .site-nav button.is-active { color: var(--ocean-deep); background: rgba(14, 124, 153, .1); }
.site-nav__map { display: none; }
.site-header__spacer { grid-column: 3; }

.dashboard { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; padding-block: clamp(7.5px, 1.25vw, 16px); }
.eyebrow { margin-bottom: 8px; color: var(--ocean); font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }

.notice { margin-bottom: 24px; padding: 16px 18px; border-radius: var(--radius-sm); }
.notice--error { border: 1px solid rgba(162, 58, 58, .22); color: var(--error); background: var(--error-bg); }
.summary-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 12px; margin-bottom: 22px; }
.metric {
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-translucent);
  box-shadow: var(--shadow-sm);
}
.metric span { display: block; color: var(--ink-faint); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 10px; font-size: clamp(17px, 1.5vw, 22px); white-space: nowrap; }
.statistics-page { flex: 1 0 auto; padding-block: clamp(32px, 6vw, 88px) 56px; }
.statistics { max-width: 1080px; margin-inline: auto; }
.statistics h1 { margin-bottom: 28px; font-size: clamp(32px, 5vw, 52px); }
.statistics__grid { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.statistics-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.statistics-chart { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-translucent); box-shadow: var(--shadow-sm); }
.statistics-chart h2 { margin-bottom: 18px; font-size: 20px; }
.sea-time-chart { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .8fr); align-items: center; gap: 20px; }
.chart-canvas { display: block; width: 100%; }
.chart-canvas--pie { height: 230px; }
.chart-canvas--bars { height: 300px; }
.chart-canvas--rose { height: 340px; }
.chart-legend { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.chart-legend li { display: grid; grid-template-columns: 10px 1fr; gap: 2px 9px; align-items: center; }
.chart-legend__swatch { width: 10px; height: 10px; grid-row: span 2; border-radius: 50%; }
.chart-legend li span:not(.chart-legend__swatch) { color: var(--ink-soft); font-size: 13px; }
.chart-legend strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.rose-legend { display: flex; margin: 12px 0 0; padding: 0; flex-wrap: wrap; justify-content: center; gap: 8px 16px; color: var(--ink-soft); font-size: 11px; list-style: none; }
.rose-legend li { display: inline-flex; align-items: center; gap: 5px; }
.rose-legend .chart-legend__swatch { border-radius: 3px; }
.rose-legend__caption { width: 100%; color: var(--ink-faint); text-align: center; }
.chart-empty { min-height: 300px; display: grid; place-items: center; color: var(--ink-soft); text-align: center; }

.workspace { display: grid; min-height: 0; flex: 1 1 auto; grid-template-columns: minmax(520px, 640px) minmax(640px, 1fr); gap: 18px; align-items: stretch; }
.panel { display: flex; min-width: 0; min-height: 0; overflow: hidden; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow); }
.panel__header { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel__header .eyebrow { margin-bottom: 5px; }
.panel__header h2 { font-size: 22px; }
.table-scroll { min-height: 0; flex: 1 1 auto; overflow: auto; }
.voyage-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.voyage-table th { position: sticky; top: 0; z-index: 2; padding: 11px 10px; color: var(--ink-faint); background: var(--bg-alt); font-size: 10px; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.voyage-table th:first-child { width: 34px; }
.voyage-table td { padding: 12px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
.voyage-table tbody tr { cursor: pointer; transition: background .14s ease; }
.voyage-table tbody tr:hover { background: rgba(14, 124, 153, .055); }
.voyage-table tbody tr.is-selected { color: var(--ocean-ink); background: rgba(14, 124, 153, .12); }
.voyage-table .trip-name { max-width: 190px; overflow: hidden; font-weight: 700; text-overflow: ellipsis; }
.voyage-table .leg-row { color: var(--ink-soft); background: var(--bg-raised); }
.voyage-table .leg-row .trip-name { padding-left: 22px; font-weight: 600; }
.expand-button { display: grid; width: 24px; height: 24px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ocean-deep); background: var(--bg); cursor: pointer; }

.map-panel { position: relative; --map-heading-height: 63px; }
.map-heading {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  min-height: 63px;
  padding-block: 10px;
  background: var(--map-heading-bg);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.map-heading .eyebrow { color: var(--ocean); }
html[data-theme="dark"] .map-heading .eyebrow { color: #d7edff; }
.map-toggles { display: flex; gap: 10px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 650; cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--ocean); }
.toggle:has(input:disabled) { cursor: not-allowed; opacity: .45; }
.map-frame { position: relative; z-index: 1; min-height: 0; flex: 1 1 auto; }
#map .leaflet-top { top: calc(var(--map-heading-height) + 10px); }
#map { width: 100%; height: 100%; background: var(--sky); }
html[data-theme="dark"] .leaflet-basemap-pane { filter: brightness(.73) contrast(1.27) saturate(.82); }
.point-details {
  position: absolute;
  top: calc(var(--map-heading-height) + 14px);
  left: 54px;
  z-index: 500;
  width: min(330px, calc(100% - 68px));
  max-height: 48%;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--detail-border);
  border-radius: var(--radius-sm);
  background: var(--detail-translucent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.point-details__header { display: flex; align-items: center; gap: 8px; padding: 4px; border-bottom: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; }
.point-details__header.is-dragging { cursor: grabbing; }
.point-details__title { min-width: 0; flex: 1 1 auto; margin: 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.point-details__content { padding: 12px 4px 4px; }
.point-details__hint { color: var(--ink-soft); font-size: 12.5px; }
.point-details dl { margin: 0; }
.point-details dl div { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(120px, 1.2fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.point-details dt { color: var(--ink-faint); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.point-details dd { margin: 0; font-size: 12.5px; text-align: right; }
.wind-marker { color: var(--ocean-ink); text-align: center; filter: drop-shadow(0 1px 1px var(--bg)); }
.wind-marker span { display: block; height: 22px; font-size: 22px; font-weight: 800; line-height: 22px; }
.wind-marker small { display: inline-block; padding: 0 3px; border-radius: 4px; color: white; background: rgba(47, 128, 237, .88); font-size: 9px; }
.leaflet-control-attribution { font-family: var(--font); font-size: 9px; }
.map-control__button { width: 30px; height: 30px; padding: 0; border: 0; color: var(--ink); background: var(--bg); font-size: 21px; line-height: 1; cursor: pointer; }
.map-control__button:hover { background: var(--bg-alt); }
html[data-theme="dark"] .leaflet-control-zoom a { color: var(--ink); border-bottom-color: var(--line); background: var(--bg); }
html[data-theme="dark"] .leaflet-control-zoom a:hover { background: var(--bg-alt); }

.mobile-tabs { display: none; }
.site-footer { padding: 14px 0; border-top: 1px solid var(--line); color: var(--ink-faint); background: var(--bg); font-size: 12px; }
.site-footer__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.site-footer__status { grid-column: 2; grid-row: 1; margin: 0; text-align: center; }
.layout-control { grid-column: 1; grid-row: 1; justify-self: start; min-width: 0; margin: 0; padding: 0; border: 0; }
.appearance-control { grid-column: 3; grid-row: 1; justify-self: end; min-width: 0; margin: 0; padding: 0; border: 0; }
html[data-layout-control="unavailable"] .layout-control { display: none; }
.layout-control legend, .appearance-control legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.layout-control__options, .appearance-control__options { position: relative; display: grid; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-alt); isolation: isolate; }
.layout-control__options { min-width: 168px; grid-template-columns: repeat(4, 1fr); }
.appearance-control__options { min-width: 126px; grid-template-columns: repeat(3, 1fr); }
.layout-control__options::before, .appearance-control__options::before { position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px; border-radius: 999px; background: var(--bg); box-shadow: var(--shadow-sm); content: ""; transition: transform .18s ease; }
.layout-control__options::before { width: calc((100% - 6px) / 4); }
.appearance-control__options::before { width: calc((100% - 6px) / 3); }
.layout-control__options[data-value="portrait"]::before { transform: translateX(100%); }
.layout-control__options[data-value="landscape"]::before { transform: translateX(200%); }
.layout-control__options[data-value="auto"]::before { transform: translateX(300%); }
.appearance-control__options[data-value="system"]::before { transform: translateX(100%); }
.appearance-control__options[data-value="dark"]::before { transform: translateX(200%); }
.layout-control__options input, .appearance-control__options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.layout-control__options label, .appearance-control__options label { position: relative; z-index: 1; display: grid; min-height: 30px; padding: 5px 8px; place-items: center; border-radius: 999px; color: var(--ink-soft); cursor: pointer; }
.layout-icon, .appearance-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.layout-control__label, .appearance-control__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.layout-control__options input:checked + label, .appearance-control__options input:checked + label { color: var(--ink); }
.layout-control__options input:focus-visible + label, .appearance-control__options input:focus-visible + label { outline: 2.5px solid var(--ocean); outline-offset: 2px; }

@media (max-width: 1260px) {
  html:not([data-layout-override]) .summary-grid { grid-template-columns: repeat(4, 1fr); }
  html:not([data-layout-override]) .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 2fr); }
}

@media (min-width: 761px) {
  html:not([data-layout="phone"]) .viewer-page { min-height: 600px; }
}

@media (max-width: 760px) {
  html:not([data-layout-override]) .container { width: min(100% - 24px, 720px); }
  html:not([data-layout-override]) .site-header__inner { min-height: 58px; display: flex; gap: 10px; }
  html:not([data-layout-override]) .site-header__spacer { display: none; }
  html:not([data-layout-override]) .brand__mark { width: 32px; height: 32px; }
  html:not([data-layout-override]) .brand strong { max-width: 100px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  html:not([data-layout-override]) .site-nav { margin-left: auto; }
  html:not([data-layout-override]) .site-nav a, html:not([data-layout-override]) .site-nav button { padding: 6px 8px; font-size: 12px; }
  html:not([data-layout-override]) .viewer-page .dashboard { padding-block: 7px; }
  html:not([data-layout-override]) .summary-grid { grid-template-columns: repeat(2, 1fr); }
  html:not([data-layout-override]) .metric { min-height: 84px; padding: 14px; }
  html:not([data-layout-override]) .metric:last-child { grid-column: span 2; }
  html:not([data-layout-override]) .statistics-page { padding-block: 32px; }
  html:not([data-layout-override]) .statistics h1 { margin-bottom: 20px; }
  html:not([data-layout-override]) .statistics-charts { grid-template-columns: 1fr; }
  html:not([data-layout-override]) .sea-time-chart { grid-template-columns: 1fr; }
  html:not([data-layout-override]) .mobile-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 10px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); box-shadow: var(--shadow-sm); }
  html:not([data-layout-override]) .mobile-tab { padding: 9px; border: 0; border-radius: 999px; color: var(--ink-soft); background: transparent; font-weight: 700; cursor: pointer; }
  html:not([data-layout-override]) .mobile-tab.is-active { color: white; background: var(--ocean); }
  html:not([data-layout-override]) .workspace { display: flex; }
  html:not([data-layout-override]) .workspace > .panel { width: 100%; flex: 1 1 auto; }
  html:not([data-layout-override]) body[data-mobile-view="voyages"] .map-panel,
  html:not([data-layout-override]) body[data-mobile-view="map"] .voyages-panel { display: none; }
  html:not([data-layout-override]) .panel { border-radius: var(--radius-sm); }
  html:not([data-layout-override]) .panel__header { min-height: 72px; padding: 14px 16px; }
  html:not([data-layout-override]) .map-panel { --map-heading-height: 54px; }
  html:not([data-layout-override]) .map-heading { min-height: 54px; padding-block: 8px; }
  html:not([data-layout-override]) .panel__header h2 { font-size: 19px; }
  html:not([data-layout-override]) .table-scroll, html:not([data-layout-override]) .map-frame { height: auto; min-height: 0; flex: 1 1 auto; }
  html:not([data-layout-override]) .voyage-table { font-size: 11.5px; }
  html:not([data-layout-override]) .voyage-table th, html:not([data-layout-override]) .voyage-table td { padding: 10px 8px; }
  html:not([data-layout-override]) .voyage-table .optional-column { display: none; }
  html:not([data-layout-override]) .map-heading { align-items: flex-start; }
  html:not([data-layout-override]) .map-toggles { flex-direction: column; gap: 4px; }
  html:not([data-layout-override]) .point-details { max-height: 42%; }
  html:not([data-layout-override]) .site-footer__inner { grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; }
  html:not([data-layout-override]) .layout-control { grid-column: 1; grid-row: 1; justify-self: start; }
  html:not([data-layout-override]) .appearance-control { grid-column: 2; grid-row: 1; justify-self: start; }
  html:not([data-layout-override]) .site-footer__status { min-width: 0; grid-column: 3; grid-row: 1; justify-self: end; overflow-wrap: anywhere; text-align: end; }
}

@media (max-width: 760px) and (orientation: portrait) {
  html:not([data-layout-override]) .site-header__inner { display: flex; min-height: 58px; gap: 0; }
  html:not([data-layout-override]) .brand { flex-shrink: 0; }
  html:not([data-layout-override]) .brand strong { max-width: min(180px, calc(100vw - 228px)); }
  html:not([data-layout-override]) .site-nav { gap: 2px; }
  html:not([data-layout-override]) .site-nav a, html:not([data-layout-override]) .site-nav button { padding-inline: 4px; }
  html:not([data-layout-override]) .site-nav__map { display: block; }
  html:not([data-layout-override]) .mobile-tabs { display: none; }
}

@media (max-width: 360px) and (orientation: portrait) {
  html:not([data-layout-override]) .brand strong { max-width: 54px; }
}

html[data-layout-override="portrait"] .container { width: calc(100% - 40px); }
html[data-layout-override="portrait"] .viewer-page { min-height: 600px; }
html[data-layout-override="portrait"] .summary-grid { grid-template-columns: repeat(4, 1fr); }
html[data-layout-override="portrait"] .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 2fr); }

html[data-layout="phone"] .container { width: calc(100% - 24px); }
html[data-layout="phone"] .site-header__inner { min-height: 58px; display: flex; gap: 0; }
html[data-layout="phone"] .site-header__spacer { display: none; }
html[data-layout="phone"] .brand { flex-shrink: 0; }
html[data-layout="phone"] .brand__mark { width: 32px; height: 32px; }
html[data-layout="phone"] .brand strong { max-width: min(180px, calc(100vw - 228px)); overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
html[data-layout="phone"] .site-nav { margin-left: auto; gap: 2px; }
html[data-layout="phone"] .site-nav a, html[data-layout="phone"] .site-nav button { padding: 6px 4px; font-size: 12px; }
html[data-layout="phone"] .site-nav__map { display: block; }
html[data-layout="phone"] .viewer-page .dashboard { padding-block: 7px; }
html[data-layout="phone"] .summary-grid { grid-template-columns: repeat(2, 1fr); }
html[data-layout="phone"] .metric { min-height: 84px; padding: 14px; }
html[data-layout="phone"] .metric:last-child { grid-column: span 2; }
html[data-layout="phone"] .statistics-page { padding-block: 32px; }
html[data-layout="phone"] .statistics h1 { margin-bottom: 20px; }
html[data-layout="phone"] .statistics-charts { grid-template-columns: 1fr; }
html[data-layout="phone"] .sea-time-chart { grid-template-columns: 1fr; }
html[data-layout="phone"] .mobile-tabs { display: none; }
html[data-layout="phone"] .workspace { display: flex; }
html[data-layout="phone"] .workspace > .panel { width: 100%; flex: 1 1 auto; }
html[data-layout="phone"] body[data-mobile-view="voyages"] .map-panel,
html[data-layout="phone"] body[data-mobile-view="map"] .voyages-panel { display: none; }
html[data-layout="phone"] .panel { border-radius: var(--radius-sm); }
html[data-layout="phone"] .panel__header { min-height: 72px; padding: 14px 16px; }
html[data-layout="phone"] .map-panel { --map-heading-height: 54px; }
html[data-layout="phone"] .map-heading { min-height: 54px; padding-block: 8px; align-items: flex-start; }
html[data-layout="phone"] .panel__header h2 { font-size: 19px; }
html[data-layout="phone"] .table-scroll, html[data-layout="phone"] .map-frame { height: auto; min-height: 0; flex: 1 1 auto; }
html[data-layout="phone"] .voyage-table { font-size: 11.5px; }
html[data-layout="phone"] .voyage-table th, html[data-layout="phone"] .voyage-table td { padding: 10px 8px; }
html[data-layout="phone"] .voyage-table .optional-column { display: none; }
html[data-layout="phone"] .map-toggles { flex-direction: column; gap: 4px; }
html[data-layout="phone"] .point-details { max-height: 42%; }
html[data-layout="phone"] .site-footer__inner { width: calc(100% - 40px); grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; }
html[data-layout="phone"] .layout-control { grid-column: 1; grid-row: 1; justify-self: start; }
html[data-layout="phone"] .appearance-control { grid-column: 2; grid-row: 1; justify-self: start; }
html[data-layout="phone"] .site-footer__status { min-width: 0; grid-column: 3; grid-row: 1; justify-self: end; overflow-wrap: anywhere; text-align: end; }
html[data-layout="phone"] body[data-mobile-view="map"] .site-footer { display: none; }
html[data-layout="phone"] body[data-mobile-view="map"] .workspace { flex: 1 1 0; }
html[data-layout="phone"] body[data-mobile-view="map"] .workspace > .map-panel { min-height: 0; flex: 1 1 0; }

html[data-layout-override="landscape"] .viewer-page { min-height: 600px; }

@media (max-width: 760px) {
  html:not([data-layout-override]) .layout-control__options, html[data-layout="phone"] .layout-control__options { min-width: 144px; }
  html:not([data-layout-override]) .appearance-control__options, html[data-layout="phone"] .appearance-control__options { min-width: 108px; }
  html:not([data-layout-override]) .layout-control__options label, html[data-layout="phone"] .layout-control__options label { padding-inline: 5px; }
  html:not([data-layout-override]) .appearance-control__options label, html[data-layout="phone"] .appearance-control__options label { padding-inline: 5px; }
  html[data-layout="phone"] .site-footer__inner { width: min(100% - 24px, 720px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
