/* Internal vessel-history playback on the Navigation map (history-playback.js).
   Colours follow the map theme: light by default, body.dark-water-theme for dark.
   Accent and button values match the layer bar and the route planner (#2388f8). */
.dt-history-pane,.dt-history-panel,.dt-history-toggle{
  --h-accent:#2388f8;--h-accent-strong:#1670d6;--h-on-accent:#fff;
  --h-text:#1d2f52;--h-muted:#516b96;--h-border:#c8d6ea;--h-field:#ffffffeb;--h-field-hover:#eef5ff;
  --h-rail:#d4e2f3;--h-surface:#ffffffeb;--h-option:#ffffff;--h-shadow:0 6px 22px rgba(23,58,98,.18);color-scheme:light}
body.dark-water-theme .dt-history-pane,body.dark-water-theme .dt-history-panel,body.dark-water-theme .dt-history-toggle{
  --h-accent:#22a9ff;--h-accent-strong:#2388f8;--h-on-accent:#fff;
  --h-text:#e7f5ff;--h-muted:#bad7ed;--h-border:rgba(91,180,237,.47);--h-field:#132a40;--h-field-hover:#193e56;
  --h-rail:rgba(124,208,255,.22);--h-surface:#102538f2;--h-option:#132a40;--h-shadow:0 6px 22px rgba(0,0,0,.45);color-scheme:dark}

/* ---- shared controls ---------------------------------------------------- */
.dt-history-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.dt-history-row select,.dt-history-live-button,.dt-history-clear{
  height:28px;box-sizing:border-box;padding:0 10px;border:1px solid var(--h-border);border-radius:6px;
  background:var(--h-field);color:var(--h-text);font:600 12px/1 system-ui,sans-serif;cursor:pointer}
.dt-history-row select{padding:0 6px}
/* Native option lists take their colours from here (dark lists were white-on-white). */
.dt-history-row select option{background:var(--h-option);color:var(--h-text)}
.dt-history-row select:hover,.dt-history-clear:hover{background:var(--h-field-hover);border-color:var(--h-accent)}
.dt-history-play{min-width:76px;height:28px;padding:0 14px;border:0;border-radius:6px;background:var(--h-accent-strong);color:var(--h-on-accent);
  font:700 12px/1 system-ui,sans-serif;cursor:pointer;box-shadow:0 1px 3px rgba(23,58,98,.25)}
.dt-history-play:hover{background:var(--h-accent)}
.dt-history-play[aria-pressed="true"]{background:transparent;color:var(--h-accent);box-shadow:inset 0 0 0 1.5px var(--h-accent)}
.dt-history-live-button{border-color:var(--h-accent);color:var(--h-accent);background:transparent}
.dt-history-live-button:hover{background:var(--h-accent);color:var(--h-on-accent)}
.dt-history-clock{margin-left:auto;color:var(--h-text);font:600 12px/1 system-ui,sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap}
:is(.dt-history-pane,.dt-history-panel,.dt-history-toggle) :focus-visible,.dt-history-toggle:focus-visible{outline:2px solid var(--h-accent);outline-offset:2px}

/* Time slider: thin rail, filled up to the current time (--p is set by the script). */
.dt-history-slider{-webkit-appearance:none;appearance:none;display:block;width:100%;height:16px;margin:6px 0 4px;background:transparent;cursor:pointer}
.dt-history-slider::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:linear-gradient(to right,var(--h-accent) var(--p,0%),var(--h-rail) var(--p,0%))}
.dt-history-slider::-moz-range-track{height:4px;border-radius:2px;background:var(--h-rail)}
.dt-history-slider::-moz-range-progress{height:4px;border-radius:2px;background:var(--h-accent)}
.dt-history-slider::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;margin-top:-5px;border-radius:50%;background:var(--h-accent);border:2px solid #fff;box-shadow:0 1px 4px rgba(23,58,98,.35)}
.dt-history-slider::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:var(--h-accent);border:2px solid #fff;box-shadow:0 1px 4px rgba(23,58,98,.35)}

.dt-history-status{margin:0;color:var(--h-muted);font-size:12px;white-space:nowrap}
.dt-history-status[data-busy="true"]{opacity:.7}
.dt-history-legend{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12px;color:var(--h-muted)}
.dt-history-chip{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.dt-history-chip i{width:10px;height:10px;border-radius:50%;box-shadow:0 0 0 1.5px var(--h-field),0 0 0 2.5px var(--h-border)}
.dt-history-track{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:12px;color:var(--h-text)}
.dt-history-label{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--h-accent);font-weight:700}
.dt-history-meta,.dt-history-hint{color:var(--h-muted)}
.dt-history-clear{margin-left:auto}
.dt-history-note{margin:6px 0 0;font-size:11.5px;color:var(--h-muted)}

/* ---- History tab in the layer bar and its pane --------------------------- */
.layer-switcher.dt-history-tab-open .dropdown-panel:not(.dt-history-pane){display:none!important}
html body .layer-switcher-wrapper .layer-switcher.dt-history-tab-open .el-tabs__item.is-active:not(.dt-history-tab){color:var(--dt-history-idle-tab,#516b96)!important;box-shadow:none!important}
.dt-history-tab.dt-history-running::after{content:"";display:inline-block;width:6px;height:6px;margin-left:5px;border-radius:50%;background:#2388f8;vertical-align:1px;box-shadow:0 0 0 2px rgba(35,136,248,.22)}
body.dark-water-theme .dt-history-tab.dt-history-running::after{background:#22a9ff;box-shadow:0 0 0 2px rgba(34,169,255,.28)}
/* Same values as the site's own narrow-screen tab style (water-map-theme.css). */
html body.dt-map-shell .map .layer-switcher-wrapper .el-card.layer-switcher.dt-history-tabs-compact .el-tabs__item{padding:0 3px!important;font-size:11px!important}
.dt-history-tab.dt-history-tab-icon{min-width:30px;text-align:center}
.dt-history-visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.dt-history-pane{padding:8px 14px!important;font:12.5px/1.4 system-ui,sans-serif;text-align:left;color:var(--h-text);max-height:calc(100vh - 140px);overflow:auto}
.dt-history-pane .dt-history-info{gap:4px 12px}
.dt-history-pane .dt-history-info .dt-history-track{flex:1 1 auto}
.dt-history-pane .dt-history-info.dt-history-has-track .dt-history-legend{display:none}
.dt-history-pane .dt-history-info .dt-history-track:empty{display:none}

/* ---- phones: floating button and panel ---------------------------------- */
.dt-history-toggle{position:absolute;right:16px;bottom:96px;z-index:30;height:34px;padding:0 14px;border:1px solid var(--h-border);border-radius:17px;
  background:var(--h-surface);color:var(--h-text);font:600 13px/1 system-ui,sans-serif;box-shadow:var(--h-shadow);cursor:pointer}
.dt-history-toggle[aria-pressed="true"]{background:var(--h-accent-strong);border-color:var(--h-accent-strong);color:var(--h-on-accent)}
.dt-history-panel{position:absolute;right:16px;bottom:140px;z-index:31;width:min(520px,calc(100% - 32px));box-sizing:border-box;
  padding:10px 14px 8px;border:1px solid var(--h-border);border-radius:12px;background:var(--h-surface);color:var(--h-text);box-shadow:var(--h-shadow);font:13px/1.4 system-ui,sans-serif}
.dt-history-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.dt-history-close{border:0;background:none;font-size:20px;line-height:1;cursor:pointer;color:inherit;padding:2px 6px}
.dt-history-panel .dt-history-options{margin-top:2px}
.dt-history-option-label{font-size:12px;color:var(--h-muted)}
.dt-history-panel .dt-history-legend{margin:6px 0 2px}
.dt-history-panel .dt-history-status{min-height:18px}
.dt-history-panel .dt-history-track{margin-top:4px;padding-top:6px;border-top:1px solid var(--h-border)}
@media (max-width:699px){
  .dt-history-panel{left:8px;right:8px;width:auto;bottom:150px;padding:8px 10px}
  .dt-history-clock{margin-left:0;width:100%}
  .dt-history-toggle{bottom:140px}
  .dt-history-toggle[aria-pressed="true"],.dt-history-note,.dt-history-hint{display:none}
  .dt-history-legend{font-size:11px;gap:2px 8px}
}
/* Desktop: keep clear of the right-hand information column (navigation-environment-drawer.js). */
@media (min-width:1101px){
  .dt-history-panel,.dt-history-toggle{transition:right .22s ease}
  .map[data-side-information-collapsed="false"]:not([data-side-information-stage="idle"]) .dt-history-panel,
  .map[data-side-information-collapsed="false"]:not([data-side-information-stage="idle"]) .dt-history-toggle{right:calc(var(--dt-environment-handle-right,406px) + 34px)}
  .map[data-side-information-collapsed="false"]:not([data-side-information-stage="idle"]) .dt-history-panel{width:max(340px,min(520px,calc(100% - var(--dt-environment-handle-right,406px) - 34px - 480px)))}
}

/* Hover label on the map. */
.dt-history-tip{position:absolute;z-index:32;pointer-events:none;display:flex;flex-direction:column;gap:1px;padding:5px 8px;border-radius:6px;
  background:rgba(17,24,39,.9);color:#fff;font:12px/1.35 system-ui,sans-serif;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,.25)}
body.dark-water-theme .dt-history-tip{background:#102538f2;border:1px solid rgba(91,180,237,.47)}
.dt-history-tip[hidden]{display:none}
