/* Quiet maritime instruments: ink, chart paper and one warm signal color. */
:root {
  --ink: #102e39;
  --paper: #f4f2e7;
  --signal: #e8c779;
}
.chart-workspace {
  background: #172f46;
}
/* Repeated control taps stay with the control; the canvas owns map gestures. */
.chart-workspace button,
.chart-dialog button {
  touch-action: manipulation;
}
.chart-top {
  gap: 8px;
  top: calc(16px + var(--map-safe-top));
  left: max(18px, var(--safe-left));
  right: 86px;
  align-items: center;
}
.chart-search-wrap {
  max-width: 360px;
  border-radius: 7px;
  box-shadow: 0 3px 18px #061e2826;
}
/* Search owns the foreground until its field and results are dismissed. */
.chart-top:has(#chart-search:focus, #chart-search-results:not([hidden])) {
  z-index: 11;
}
.chart-workspace:has(#chart-search:focus, #chart-search-results:not([hidden]))
  > .cursor-tooltip {
  visibility: hidden;
}
.chart-top .chart-button,
.global-refresh {
  border-radius: 7px;
  min-height: 46px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 18px #061e281a;
}
.chart-top .map-help-button {
  display: none;
}
.chart-mode-row {
  display: none;
}
.chart-rail {
  top: calc(84px + var(--map-safe-top));
  right: max(18px, var(--safe-right));
  gap: 6px;
}
.chart-rail .rail-secondary {
  display: none;
}
.chart-rail [data-action="zoom-in"],
.chart-rail [data-action="zoom-out"] {
  display: flex;
}
.chart-rail .rail-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 7px;
  background: #133440ee;
  border: 1px solid #a9c5c84a;
}
.chart-rail [data-chart="map-tools"] {
  border-color: #e8c77980;
  color: var(--signal);
}
.chart-dock {
  width: 460px;
  max-width: calc(100% - 100px);
  padding: 0;
  border-radius: 10px;
  border: 1px solid #b5cccb66;
  box-shadow: 0 8px 30px #071d2c38;
  background: #11323eee;
  bottom: calc(32px + var(--map-safe-bottom));
  left: max(18px, var(--safe-left));
  max-height: 55%;
  overflow: auto;
  scrollbar-width: thin;
}
.instrument-dock {
  padding: 12px 16px 10px;
}
.dock-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin-bottom: 8px;
}
.dock-heading .region-chip {
  padding: 0;
  min-height: 32px;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.dock-heading .region-chip span {
  color: var(--signal);
}
.dock-source {
  margin-left: auto;
  font-size: 10px;
  color: #b5cccb;
  white-space: nowrap;
}
.dock-details-toggle {
  border: 0;
  background: none;
  min-width: 32px;
  width: 32px;
  height: 32px;
  padding: 6px;
  min-height: 32px;
  color: #c7d9d4;
}
.dock-details-toggle span {
  display: none;
}
.instrument-dock .chart-layer-tabs {
  display: flex;
  border: 0;
  padding: 0;
  gap: 3px;
  margin: 0 0 8px;
}
.instrument-dock .chart-layer-tabs > button {
  flex: 1;
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 5px;
  font-size: 12px;
  background: #24434b;
  color: #c5d6d2;
}
.instrument-dock .chart-layer-tabs > button.active {
  background: var(--paper);
  color: var(--ink);
}
.instrument-dock .chart-layer-tabs > .icon-only {
  flex: 0 0 38px;
}
.instrument-dock .chart-time-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  border: 0;
  padding: 0;
}
.instrument-dock .chart-time-row .chart-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 4px;
  background: none;
  border: 0;
}
.instrument-dock .chart-time-row input {
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  margin: 0;
  accent-color: var(--signal);
}
.instrument-dock .snapshot-date {
  margin: 0;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}
.instrument-dock .snapshot-date strong {
  font-size: 12px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.instrument-dock .snapshot-date small {
  font-size: 10px;
  color: #b5cccb;
}
.instrument-dock .snapshot-date:has(.region-week-download) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
}
.instrument-dock .snapshot-date:has(.region-week-download) > strong {
  grid-column: 1;
  grid-row: 1;
}
.instrument-dock .snapshot-date:has(.region-week-download) > small {
  grid-column: 1;
  grid-row: 2;
}
.instrument-dock .snapshot-date .region-week-download {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 10px;
  white-space: nowrap;
  gap: 5px;
}
.instrument-dock .region-week-download svg {
  width: 14px;
  height: 14px;
}
.dock-details {
  padding-top: 12px;
  margin-top: calc(10px + var(--map-safe-top));
  border-top: 1px solid #b5cccb30;
}
.dock-details[hidden] {
  display: none !important;
}
.instrument-dock .snapshot-source {
  display: flex;
  gap: 8px;
}
.instrument-dock .snapshot-source select {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
.instrument-dock .chart-dock-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
}
.instrument-dock .chart-dock-foot .chart-button,
.instrument-dock .chart-toggle {
  font-size: 11px;
  padding: 7px 9px;
  min-height: 36px;
}
.instrument-dock .recent-status,
.instrument-dock .snapshot-quality {
  font-size: 11px;
  color: #b5cccb;
  margin: 8px 0 0;
}
.chart-quick-actions {
  left: max(18px, var(--safe-left));
  bottom: calc(var(--chart-dock-height, 220px) + 42px + var(--map-safe-bottom));
  gap: 6px;
}
.chart-quick-actions .chart-button {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  background: #163844ed;
  border: 1px solid #aac8c352;
}
.chart-quick-actions .chart-button.trip-end-button {
  flex: 0 0 44px;
  min-width: 44px;
  min-height: 44px;
  flex-direction: column;
  gap: 1px;
  padding: 4px;
  font-size: 9px;
}
.chart-quick-actions .trip-end-button svg {
  width: 16px;
  height: 16px;
}
.cursor-tooltip {
  border-radius: 6px;
  padding: 9px 12px;
  background: #123c47ed;
  border: 1px solid #b8cdc173;
  box-shadow: 0 5px 18px #0a223526;
}
.cursor-tooltip strong {
  font-size: 22px;
}
.chart-attribution {
  font-size: 9px;
  letter-spacing: 0;
  right: 16px;
  bottom: 8px;
}
.forecast-heading .eyebrow {
  letter-spacing: 0.18em;
  color: #638b8a;
}
.forecast-heading h1 {
  font-family: Georgia, serif;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 500;
  letter-spacing: -0.03em;
}
.forecast-card {
  border-radius: 7px;
}
.forecast-summary-grid {
  border-left: 3px solid var(--signal);
}
.forecast-caption {
  line-height: 1.55;
}
@media (min-width: 761px) {
  .chart-workspace:has(.dock-layout[data-expanded="true"])
    .chart-quick-actions {
    display: none;
  }
}
@media (max-width: 760px) {
  .chart-workspace:has(.dock-layout[data-expanded="true"]) .cursor-tooltip {
    padding: 6px 8px;
  }
  .chart-workspace:has(.dock-layout[data-expanded="true"]) .cursor-tooltip strong {
    font-size: 18px;
  }
  .chart-workspace:has(.dock-layout[data-expanded="true"]) .cursor-tooltip .cursor-secondary:not(.cursor-depth) {
    display: none;
  }
  .chart-top {
    top: calc(10px + var(--map-safe-top));
    left: max(10px, var(--safe-left));
    right: max(10px, var(--safe-right));
    gap: 6px;
  }
  .chart-search-wrap {
    flex: 1;
    min-width: 0;
    max-width: none;
  }
  .chart-top .map-clear-button {
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 11px;
    padding: 8px 10px;
  }
  .chart-top .offline-chip {
    display: none;
    width: 42px;
    padding: 9px;
    min-width: 42px;
  }
  .chart-top .offline-chip span {
    display: none;
  }
  .chart-top .global-refresh {
    width: 42px;
    padding: 10px;
    min-width: 42px;
  }
  .chart-top .chart-button,
  .chart-top .global-refresh {
    min-height: 44px;
  }
  .chart-rail {
    left: max(10px, var(--safe-left));
    right: max(10px, var(--safe-right));
    top: calc(68px + var(--map-safe-top));
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
  }
  .chart-rail .rail-button {
    height: 44px;
    width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
  }
  .chart-rail [data-action="zoom-in"],
  .chart-rail [data-action="zoom-out"] {
    display: none;
  }
  .chart-dock {
    left: max(10px, var(--safe-left));
    right: max(10px, var(--safe-right));
    width: auto;
    max-width: none;
    bottom: calc(26px + var(--map-safe-bottom));
    max-height: 54%;
    border-radius: 9px;
  }
  .instrument-dock {
    padding: 9px 12px 8px;
  }
  .dock-heading {
    gap: 6px;
    margin-bottom: 4px;
    min-height: 30px;
  }
  .dock-heading .region-chip {
    font-size: 12px;
  }
  .dock-source {
    font-size: 9px;
  }
  .instrument-dock .chart-layer-tabs > button {
    min-height: 34px;
    font-size: 11px;
    padding: 6px;
  }
  .instrument-dock .snapshot-date strong {
    font-size: 11px;
  }
  .chart-quick-actions {
    left: max(10px, var(--safe-left));
    right: 60px;
    bottom: calc(
      var(--chart-dock-height, 220px) + 36px + var(--map-safe-bottom)
    );
    display: flex;
  }
  .chart-quick-actions .chart-button {
    flex: 1;
    min-height: 44px;
    padding: 6px;
    font-size: 10px;
    justify-content: center;
  }
  .chart-quick-actions .chart-button svg {
    width: 14px;
  }
  .chart-workspace:has(.dock-layout[data-expanded="true"])
    .chart-quick-actions {
    display: none;
  }
  .chart-attribution {
    bottom: 7px;
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

/* Readings lead the forecast; setup and explanation stay secondary. */
.forecast-page .forecast-heading {
  margin-bottom: 12px;
  align-items: center;
}
.forecast-page .forecast-heading h1 {
  margin: 0;
}
.forecast-page .forecast-map-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.forecast-page .weather-location {
  margin-bottom: 12px;
  padding: 14px 18px;
  border-radius: 7px;
}
.forecast-page #forecast-summary {
  margin: 0 0 14px;
}
.forecast-page #forecast-summary .forecast-summary-grid {
  margin: 0;
  border-radius: 0;
  background: #e5ece6;
}
.forecast-page .forecast-primary {
  border-top: 2px solid #a6bdb7;
}
@media (max-width: 760px) {
  .forecast-page .forecast-heading .eyebrow {
    display: none;
  }
  .forecast-page .forecast-map-link .chart-button {
    padding: 8px;
    min-height: 40px;
  }
  .forecast-page .forecast-map-link .chart-button span {
    display: none;
  }
  .forecast-page .forecast-metric {
    padding: 10px 12px;
  }
  .forecast-page .forecast-metric strong {
    font-size: 22px;
  }
  .forecast-page .forecast-metric span {
    font-size: 10px;
  }
}

/* Keep compact controls comfortable on touch screens. */
@media (pointer: coarse) {
  .instrument-dock .chart-layer-tabs > button,
  .instrument-dock .dock-details-toggle,
  .instrument-dock .chart-dock-foot .chart-button,
  .instrument-dock .chart-toggle {
    min-height: 44px;
    min-width: 44px;
  }
}

.cursor-secondary[hidden] {
  display: none;
}

/* The same rail and header frame every workspace. */
@media (min-width: 621px) and (min-height: 541px), (min-width: 1001px) {
  .sidebar,
  .chart-open .sidebar {
    padding: calc(18px + var(--safe-top)) 8px 16px calc(8px + var(--safe-left));
  }
  .sidebar .brand {
    justify-content: center;
    margin-bottom: 18px;
  }
  .sidebar .brand > span,
  .sidebar .nav-label,
  .sidebar .sidebar-note {
    display: none;
  }
  .sidebar .nav {
    gap: 3px;
  }
  .sidebar .nav button {
    height: 54px;
    min-height: 54px;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    padding: 6px 0;
    border-radius: 6px;
  }
  .sidebar .nav button > span {
    display: block;
    font-size: 9px;
    font-weight: 500;
  }
  .sidebar .nav svg {
    width: 20px;
    height: 20px;
  }
}
.topbar-label,
.chart-open .topbar-label {
  font-size: 10px;
  letter-spacing: 1.5px;
}
.topbar-label strong,
.chart-open .topbar-label strong {
  font-size: 11px;
  letter-spacing: 0;
}
.boat-select,
.chart-open .boat-select {
  font-size: 12px;
}
.page-heading {
  align-items: center;
  flex-wrap: wrap;
}
.page-heading h1 {
  font-family: Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.page-heading .actions:empty {
  display: none;
}
.page-heading .actions {
  margin: 0;
}
.page-heading .actions > .btn,
.settings-row > .btn {
  min-height: 44px;
}
.content > .actions {
  margin-bottom: 20px;
}
.settings-row {
  gap: 16px;
}
.settings-row > :first-child {
  min-width: 0;
}
.settings-row > .btn {
  flex-shrink: 0;
}
.settings-sources {
  margin-top: 18px;
}
.contact-list {
  border-top: 2px solid #a6bdb7;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #cbd7cd;
}
.contact-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 550;
}
.contact-row > .btn {
  margin-left: auto;
  min-height: 44px;
  flex-shrink: 0;
}
.contact-row > div,
.contact-row h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.contact-row .help {
  margin: 6px 0 0;
}
.contact-monogram {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #315f59;
  background: #dfe8dc;
  border-radius: 5px;
  font:
    20px Georgia,
    serif;
}
.dock-details-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23426066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 13px center !important;
  background-size: 12px 8px !important;
  padding-right: 38px !important;
  text-overflow: ellipsis;
}
.chart-dock select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23c5d6d2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
.group-member .actions {
  margin: 0;
}
.group-member h3 {
  margin: 0;
}
.content > h2 {
  margin-top: 28px;
}
.form-error:empty {
  display: none;
}

.feedback-button {
  position: relative;
}
.feedback-button .feedback-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.feedback-button .feedback-state {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}
.feedback-button .feedback-state svg {
  width: 22px;
  height: 22px;
}
.feedback-button[data-feedback-state="busy"] {
  cursor: progress;
}
.feedback-button:not([data-feedback-state="idle"]) .feedback-content {
  visibility: hidden;
}
.feedback-button:not([data-feedback-state="idle"]) .feedback-state {
  display: flex;
}
.feedback-button[data-feedback-state="busy"] .feedback-state svg {
  animation: refresh-turn 1s linear infinite;
}
.feedback-button[data-feedback-state="success"] .feedback-state {
  color: #237348;
}
.feedback-button[data-feedback-state="error"] .feedback-state {
  color: #95600a;
}
.feedback-button:focus-visible {
  outline: 3px solid #b78027;
  outline-offset: 3px;
}
.feedback-icon,
.global-refresh.feedback-button,
.chart-top .global-refresh.feedback-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  flex-shrink: 0;
}
.feedback-icon svg {
  width: 20px;
  height: 20px;
}
.global-refresh.feedback-button > .feedback-content {
  display: inline-flex;
}
@media (prefers-reduced-motion: reduce) {
  .feedback-button[data-feedback-state="busy"] .feedback-state svg {
    animation: none;
  }
}

/* Landscape keeps a scrollable instrument column beside the chart. */
@container (max-height: 380px) {
  .chart-rail [data-action="zoom-in"],
  .chart-rail [data-action="zoom-out"] {
    display: none;
  }
  .instrument-dock .chart-layer-tabs > button {
    font-size: 11px;
    padding: 6px;
    min-width: 0;
  }

  .chart-dock {
    left: auto;
    right: var(--map-right);
    top: calc(12px + var(--map-safe-top));
    bottom: calc(12px + var(--map-safe-bottom));
    width: min(330px, 42cqw);
    max-width: 42cqw;
    max-height: none;
  }
  .chart-top {
    right: calc(42cqw + var(--map-right) + 15px);
  }
  /* Searching needs readable results even in a short portrait window. */
  .chart-top:has(#chart-search:focus, #chart-search-results:not([hidden])) {
    right: var(--map-right);
  }
  .chart-rail {
    left: max(10px, var(--safe-left));
    right: calc(42cqw + var(--map-right) + 12px);
    top: calc(70px + var(--map-safe-top));
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
    max-height: calc(
      100% - 90px - var(--map-safe-top) - var(--map-safe-bottom)
    );
  }
  .chart-quick-actions {
    bottom: calc(12px + var(--map-safe-bottom));
    right: calc(42cqw + var(--map-right) + 65px);
    max-width: none;
  }
  .chart-quick-actions .chart-button {
    min-height: 44px;
  }
}

/* Phone controls stay focused; secondary instruments remain in Map tools. */
@media (max-width: 760px), (max-height: 540px) and (max-width: 1000px) {
  .chart-rail [data-chart="mode"],
  .chart-rail [data-chart="course-line"] {
    display: none;
  }
  .chart-top .map-clear-button {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 92px;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 11px;
  }
  .chart-top .offline-chip {
    display: none;
  }
}

/* Invitations remain legible and visibly inactive while delivery is pending. */
.invite-fields .feedback-button { min-width: 170px; }
.invite-fields .feedback-button .feedback-content { visibility: visible; }
.invite-fields .feedback-button .feedback-state { position: static; }
.invite-fields .feedback-button .feedback-state svg { width: 17px; height: 17px; }

/* Selected marks have their own dismiss action, clear of the instrument rail. */
.map-target-chip {
  box-sizing: border-box;
  z-index: 4;
  gap: 6px;
  max-width: min(340px, calc(100% - var(--map-left) - var(--map-right) - 64px));
  padding: 4px 4px 4px 12px;
}
.map-target-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-target-name small {
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-target-chip .map-target-dismiss {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #153b4b30;
  border-radius: 7px;
  background: #fffef4;
  color: #173d48;
  cursor: pointer;
}
.map-target-dismiss svg {
  width: 18px;
  height: 18px;
}
.map-target-dismiss:focus-visible {
  outline: 2px solid #215d69;
  outline-offset: 2px;
}
.chart-probe .destination-reading button {
  pointer-events: auto;
  min-width: 44px;
}
@media (max-width: 760px) {
  .map-target-chip {
    top: calc(120px + var(--map-safe-top));
    max-width: min(340px, calc(100% - var(--map-left) - var(--map-right)));
  }
  .chart-workspace.probe-visible .chart-probe {
    top: calc(120px + var(--map-safe-top));
  }
}
@container (max-height: 380px) {
  .map-target-chip {
    top: calc(122px + var(--map-safe-top));
    max-width: calc(58cqw - var(--map-left) - var(--map-right) - 20px);
  }
  .map-target-name small {
    display: none;
  }
}
.chart-workspace.map-quiet > .map-target-chip:not([hidden]) {
  display: flex;
  top: calc(70px + var(--map-safe-top));
  max-width: min(340px, calc(100% - var(--map-left) - var(--map-right)));
}
.invite-fields .feedback-button[data-feedback-state="busy"] {
  background: #dae3df;
  border-color: #c3d0c9;
  color: #465f56;
  opacity: 1;
  cursor: wait;
}
.invite-fields .feedback-button[data-feedback-state="success"] .feedback-state,
.invite-fields .feedback-button[data-feedback-state="error"] .feedback-state { color: inherit; }

/* Refresh details wrap within the dialog on phones instead of scrolling sideways. */
.weather-compare-wrap table.feed-status-table {
  min-width: 0;
  table-layout: fixed;
}
.feed-status-table th:first-child { width: 32%; }
.feed-status-table th, .feed-status-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Saved trips give the route the map; playback stays within one compact dock. */
.trip-review > .chart-top,
.trip-review > .chart-quick-actions,
.trip-review > .chart-replay-banner,
.trip-review > .map-target-chip,
.trip-review > .chart-probe,
.trip-review > .cursor-tooltip {
  display: none !important;
}
.trip-review > .chart-rail {
  top: calc(12px + var(--map-safe-top));
}
.trip-review > .chart-dock,
.trip-review.map-quiet > .chart-dock {
  display: block;
  top: auto;
  width: min(490px, calc(100% - 36px));
  max-width: none;
  max-height: min(50%, 320px);
  overflow: auto;
}
.trip-review-dock {
  display: grid;
  gap: 7px;
  padding: 7px 10px;
  max-height: none;
  overflow: visible;
}
.replay-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 36px auto;
  align-items: center;
  gap: 6px;
}
.trip-review-dock .replay-heading .chart-button,
.trip-review-dock .replay-controls .chart-button {
  min-height: 36px;
  height: 36px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 11px;
}
.trip-review-dock .chart-button.icon-only {
  width: 36px;
  min-width: 36px;
}
.trip-review-dock .replay-back {
  background: transparent;
  border-color: #d5e6e14d;
  color: var(--paper);
}
.replay-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.trip-review-dock .replay-controls {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 0 9px;
  align-items: center;
}
.trip-review-dock #track-timeline {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  height: 36px;
  margin: 0;
  touch-action: pan-y;
}
.trip-review-dock #track-time {
  grid-column: 2;
  margin-top: -2px;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  line-height: 1.3;
}
.replay-context {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  border-top: 1px solid #d5e6e126;
}
.replay-context details { min-width: 0; }
.replay-context summary {
  padding: 6px 0;
  color: #e4eae4;
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
  touch-action: manipulation;
}
.replay-context details[open] {
  flex: 1 1 100%;
}
.replay-event-list,
.replay-imagery-context {
  display: grid;
  gap: 5px;
  padding: 0 0 6px;
}
.replay-event-list {
  max-height: 130px;
  overflow: auto;
}
.replay-context .trip-pin-strip .chart-button {
  min-height: 36px;
  padding: 5px 9px;
}
.trip-review-dock .replay-recording {
  min-height: 32px;
  padding: 5px 8px;
  justify-self: start;
  border: 1px solid #f3cd7b66;
  border-radius: 5px;
  background: transparent;
  color: #f3cd7b;
  font-size: 10px;
  touch-action: manipulation;
}
.trip-review-dock button:focus-visible,
.replay-context summary:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .trip-review > .chart-dock,
  .trip-review.map-quiet > .chart-dock {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: calc(26px + var(--map-safe-bottom));
    max-height: 44%;
  }
  .trip-review-dock { gap: 5px; padding: 6px 8px; }
  .replay-heading { gap: 4px; }
  .trip-review-dock .replay-heading .chart-button { padding: 6px; }
}

/* The closed phone dock keeps its source, active scale and date in view. */
.dock-active-layer {
  display: none;
}
@media (max-width: 760px), (max-height: 540px) and (max-width: 1000px) {
  .instrument-dock[data-expanded="false"] > .dock-mobile-controls {
    display: none;
  }
  .instrument-dock[data-expanded="false"] > .dock-active-layer {
    display: block;
    margin: 0 0 5px;
    color: var(--paper);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.4;
  }
  .instrument-dock .dock-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
    align-items: center;
  }
  .instrument-dock .dock-heading .region-chip {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }
  .instrument-dock .dock-source {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    margin-left: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .instrument-dock .dock-details-toggle {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 44px;
    max-width: 126px;
    height: auto;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 11px;
    white-space: nowrap;
  }
  .instrument-dock .dock-details-toggle span {
    display: inline;
  }
  .instrument-dock .chart-time-row .chart-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 4px;
  }
  .instrument-dock .chart-time-row input {
    height: 32px;
    min-height: 32px;
  }
}
