/* ==========================================================
   AGALID Premium History Panel V2
   ========================================================== */

#objPanel {
  overflow: hidden;
}

.hp-hidden {
  display: none !important;
}

.hp-root {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% -10%, rgba(41,121,255,.13), transparent 36%),
    linear-gradient(180deg, #fbfcff 0%, #f5f8fc 100%);
  color: #172b4d;
  animation: hpPanelIn .28s cubic-bezier(.2,.8,.2,1);
}

@keyframes hpPanelIn {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hp-header {
  position: relative;
  flex: 0 0 auto;
  padding: 17px 16px 14px;
  border-bottom: 1px solid #e9eef6;
  background: rgba(255,255,255,.91);
  backdrop-filter: blur(16px);
}

.hp-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hp-back,
.hp-icon-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5ebf3;
  border-radius: 11px;
  background: #fff;
  color: #41516b;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(31,51,84,.06);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.hp-back:hover,
.hp-icon-btn:hover {
  transform: translateY(-1px);
  border-color: #cfd9e8;
  background: #f8faff;
}

.hp-heading {
  min-width: 0;
  flex: 1;
}

.hp-eyebrow {
  margin-bottom: 2px;
  color: #8a98ac;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .85px;
  text-transform: uppercase;
}

.hp-title {
  overflow: hidden;
  margin: 0;
  color: #15233b;
  font-size: 17px;
  font-weight: 780;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-subtitle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: #77869b;
  font-size: 11px;
}

.hp-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16b87a;
  box-shadow: 0 0 0 4px rgba(22,184,122,.12);
}

.hp-period {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.hp-period-pill {
  flex: 1;
  padding: 7px 5px;
  border: 1px solid #e3e9f2;
  border-radius: 9px;
  background: #f8faff;
  color: #697991;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.hp-period-pill.active {
  border-color: rgba(41,121,255,.28);
  background: rgba(41,121,255,.10);
  color: #2469d8;
}

.hp-scroll {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px;
  scroll-behavior: smooth;
}

.hp-scroll::-webkit-scrollbar {
  width: 6px;
}

.hp-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #d4deeb;
}

.hp-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.hp-kpi {
  position: relative;
  min-height: 75px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid #e8edf5;
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 6px 18px rgba(31,51,84,.045);
}

.hp-kpi::after {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--hp-soft, rgba(41,121,255,.08));
  content: "";
}

.hp-kpi-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8290a5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.hp-kpi-icon {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--hp-soft, rgba(41,121,255,.09));
  color: var(--hp-color, #2979ff);
}

.hp-kpi-value {
  margin-top: 8px;
  color: #14233d;
  font-size: 19px;
  font-weight: 790;
  letter-spacing: -.35px;
}

.hp-kpi-unit {
  margin-left: 3px;
  color: #8190a5;
  font-size: 10px;
  font-weight: 650;
}

.hp-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 19px 2px 10px;
}

.hp-section-title strong {
  color: #273954;
  font-size: 12px;
  letter-spacing: .1px;
}

.hp-section-title span {
  color: #94a0b1;
  font-size: 10px;
}

.hp-timeline {
  position: relative;
}

.hp-event {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 10px;
  padding-bottom: 11px;
  animation: hpEventIn .3s ease both;
}

@keyframes hpEventIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hp-event:not(:last-child)::before {
  position: absolute;
  top: 31px;
  bottom: -2px;
  left: 14px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(#d9e3ef, #eaf0f7);
  content: "";
}

.hp-event-node {
  position: relative;
  z-index: 2;
  width: 29px;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #f6f9fd;
  border-radius: 50%;
  background: var(--event-color, #2979ff);
  color: #fff;
  box-shadow: 0 3px 9px rgba(31,51,84,.15);
  font-size: 10px;
  font-weight: 800;
}

.hp-event-card {
  overflow: hidden;
  border: 1px solid #e7edf5;
  border-radius: 15px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 7px 20px rgba(31,51,84,.05);
  cursor: pointer;
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.hp-event-card:hover {
  transform: translateY(-1px);
  border-color: #cfdbeb;
  box-shadow: 0 10px 24px rgba(31,51,84,.08);
}

.hp-event-card.active {
  border-color: rgba(41,121,255,.58);
  box-shadow:
    0 0 0 3px rgba(41,121,255,.09),
    0 12px 28px rgba(31,72,135,.10);
}

.hp-trip-accent {
  height: 3px;
  background: var(--trip-color, #2979ff);
}

.hp-event-content {
  padding: 12px;
}

.hp-event-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.hp-event-type {
  color: #30425e;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.hp-event-time {
  margin-top: 3px;
  color: #14233d;
  font-size: 15px;
  font-weight: 780;
}

.hp-event-date {
  margin-top: 3px;
  color: #8b98aa;
  font-size: 10px;
}

.hp-badge {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 999px;
  background: #eef4ff;
  color: #286bd5;
  font-size: 9px;
  font-weight: 760;
}

.hp-trip-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 7px;
  margin-top: 11px;
}

.hp-mini-stat {
  min-width: 0;
  padding: 8px 5px;
  border-radius: 10px;
  background: #f7f9fc;
  text-align: center;
}

.hp-mini-value {
  overflow: hidden;
  color: #233550;
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-mini-label {
  margin-top: 3px;
  color: #94a0b1;
  font-size: 8px;
  font-weight: 650;
  text-transform: uppercase;
}

.hp-idle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 7px 8px;
  border: 1px solid #ffe3ab;
  border-radius: 9px;
  background: #fff9ec;
  color: #a96500;
  font-size: 10px;
  font-weight: 650;
}

.hp-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.hp-action {
  flex: 1;
  height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #e1e8f1;
  border-radius: 9px;
  background: #fff;
  color: #53657e;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 730;
}

.hp-action.primary {
  border-color: #2979ff;
  background: linear-gradient(135deg,#347fff,#216de5);
  color: #fff;
  box-shadow: 0 5px 12px rgba(41,121,255,.20);
}

.hp-parking-card {
  border-color: #ece7ff;
  background: linear-gradient(180deg,#fff 0%,#fbfaff 100%);
}

.hp-parking-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 9px;
  border-radius: 10px;
  background: #f8f6ff;
}

.hp-parking-icon {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(124,77,255,.11);
  color: #7046dd;
  font-size: 13px;
  font-weight: 800;
}

.hp-footer {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 11px 14px 13px;
  border-top: 1px solid #e8edf5;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}

.hp-footer button {
  height: 38px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 730;
  cursor: pointer;
}

.hp-footer-back {
  flex: 1;
  border: 1px solid #dfe6ef;
  background: #fff;
  color: #55667d;
}

.hp-footer-clear {
  flex: 1.2;
  border: 0;
  background: #172b4d;
  color: #fff;
}

.hp-empty {
  padding: 45px 18px;
  color: #8a98aa;
  font-size: 12px;
  text-align: center;
}

/* Keep the parent panel fully sized while premium history is displayed */
#objPanel.hp-history-open {
  height: calc(100% - 32px);
  max-height: calc(100% - 32px);
  min-height: 420px;
}

/* Definitive premium history layout */
#objPanel.hp-history-open {
  top: 16px !important;
  bottom: 16px !important;
  height: auto !important;
  min-height: 420px !important;
  max-height: calc(100% - 32px) !important;
  width: min(380px, calc(100vw - 28px)) !important;
  display: block !important;
  overflow: hidden !important;
  transform: translateX(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Unified route picker: one list controls exactly what is visible on the map. */
.hp-route-picker .hp-summary,
.hp-route-picker .hp-total-idle,
.hp-route-picker .hp-orbit,
.hp-route-picker .hp-playback-now,
.hp-route-picker .hp-section-title {
  display: none !important;
}

.hp-route-picker .hp-header {
  padding: 10px 11px 9px;
}

.hp-route-picker .hp-back,
.hp-route-picker .hp-icon-btn {
  width: 31px;
  height: 31px;
  border-radius: 9px;
}

.hp-route-picker .hp-eyebrow { display: none; }
.hp-route-picker .hp-title { font-size: 14px; }
.hp-route-picker .hp-subtitle { margin-top: 2px; font-size: 8.5px; }
.hp-route-picker .hp-live-dot { width: 6px; height: 6px; }

.hp-route-picker .hp-period {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.hp-route-picker .hp-period-pill {
  min-width: 0;
  min-height: 28px;
  padding: 5px 6px;
  overflow: hidden;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-custom-period {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #e5ebf4;
  border-radius: 11px;
  background: #f8faff;
}

.hp-custom-period[hidden] { display: none; }
.hp-custom-period label { min-width: 0; }
.hp-custom-period label span {
  display: block;
  margin: 0 0 4px 2px;
  color: #8794a8;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}
.hp-custom-period input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 6px;
  color: #34465f;
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  font: 600 8.5px inherit;
}
.hp-custom-period > button {
  grid-column: 1 / -1;
  height: 31px;
  color: #fff;
  background: #1769ff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: 700 9.5px inherit;
}

.hp-selection-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid #e8edf5;
}
.hp-selection-bar > div:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hp-selection-bar strong { color: #263a55; font-size: 10px; }
.hp-selection-bar [data-hp-selected-count] { color: #8d9aab; font-size: 8px; }
.hp-selection-bar > div:last-child { display: flex; gap: 5px; }
.hp-selection-bar button {
  height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  color: #52657e;
  background: #f7f9fc;
  border: 1px solid #e2e8f1;
  border-radius: 8px;
  cursor: pointer;
  font: 690 8px inherit;
  white-space: nowrap;
}
.hp-selection-bar button:first-child { color: #1769ff; background: #eff5ff; border-color: #d8e6ff; }

.hp-route-picker .hp-scroll { padding: 7px 8px 10px; }
.hp-route-picker .hp-event { grid-template-columns: 22px minmax(0, 1fr); gap: 7px; padding-bottom: 8px; }
.hp-route-picker .hp-event-node {
  width: 22px;
  height: 22px;
  border-width: 3px;
}
.hp-route-picker .hp-event:not(:last-child)::before { top: 23px; left: 10px; }
html[dir="rtl"] .hp-route-picker .hp-event:not(:last-child)::before { right: 10px; left: auto; }
.hp-route-picker .hp-event-card { border-radius: 12px; }
.hp-route-picker .hp-event-content { padding: 8px 9px 7px; }
.hp-route-picker .hp-event-time { font-size: 11.5px; }
.hp-route-picker .hp-trip-grid { gap: 5px; margin-top: 8px; }
.hp-route-picker .hp-mini-stat { padding: 6px 4px; border-radius: 8px; }
.hp-route-picker .hp-mini-value { font-size: 9.5px; }
.hp-route-picker .hp-mini-label { font-size: 7.2px; }
.hp-trip-quality { display: flex; margin-top: 5px; }
.hp-route-picker .hp-badge { padding: 3px 6px; font-size: 7.5px; }

.hp-trip-selector {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.hp-trip-selector input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.hp-trip-selector span {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1.5px solid #cdd7e5;
  border-radius: 5px;
  transition: .16s ease;
}
.hp-trip-selector input:checked + span {
  background: var(--trip-color);
  border-color: var(--trip-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--trip-color) 13%, transparent);
}
.hp-trip-selector input:checked + span::after {
  width: 7px;
  height: 4px;
  border-bottom: 1.7px solid #fff;
  border-left: 1.7px solid #fff;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}
.hp-event-card.hp-route-hidden { opacity: .5; filter: saturate(.45); }
.hp-event-card.hp-route-hidden:hover { opacity: .72; }

.hp-route-picker .hp-footer { padding: 7px 9px 9px; }
.hp-route-picker .hp-footer button { height: 32px; font-size: 9px; }

html[data-theme="dark"] .hp-custom-period,
html[data-theme="dark"] .hp-selection-bar { background: rgba(15, 24, 38, .94); border-color: rgba(183, 201, 224, .12); }
html[data-theme="dark"] .hp-custom-period input,
html[data-theme="dark"] .hp-selection-bar button { color: #dbe7f7; background: #152237; border-color: rgba(183, 201, 224, .14); }
html[data-theme="dark"] .hp-selection-bar strong { color: #eef4ff; }

#objPanel.hp-history-open .hp-root {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 420px !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 999 !important;
}

/* Display premium history above vehicle information panels */
#objPanel.hp-history-open {
  position: absolute !important;
  z-index: 99999 !important;
  isolation: isolate;
}

#objPanel.hp-history-open #historyPremiumRoot {
  position: absolute !important;
  inset: 0 !important;
  z-index: 100000 !important;
}

/* Horizon 2035 refinement: verified metrics + synchronized playback */
.hz-history-open .detail.hz-vehicle-cockpit { opacity: 0 !important; pointer-events: none !important; transform: translateY(18px) !important; }

.hp-period-pill {
  appearance: none;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
}

.hp-period-pill:hover { border-color: rgba(23,105,255,.22); color: #1769ff; }
.hp-badge { display: inline-flex; align-items: center; gap: 4px; }
.hp-badge.verified { color: #05795a; background: rgba(0,169,120,.11); }
.hp-badge.parking { color: #7046dd; background: #f0ebff; }

.hp-trip-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }

.hp-card-progress {
  height: 3px;
  margin: 10px 0 2px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9eef6;
}

.hp-card-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1769ff, #00a978);
  transition: width .18s linear;
}

.hp-playback-now {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 11px 0 4px;
  padding: 11px 12px 9px;
  overflow: hidden;
  border: 1px solid rgba(23,105,255,.18);
  border-radius: 13px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 34px rgba(23,54,94,.11);
  backdrop-filter: blur(18px);
}

.hp-playback-now[hidden] { display: none; }
.hp-playback-now > div:first-child { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #758399; }
.hp-playback-now > div:first-child strong { color: #1769ff; font-size: 11px; }
.hp-playback-now > b { position: absolute; inset-inline-end: 12px; top: 11px; font-size: 11px; color: #172b4d; }
.hp-play-pulse { width: 7px; height: 7px; border-radius: 50%; background: #00a978; box-shadow: 0 0 0 4px rgba(0,169,120,.12); animation: hpPulse 1.5s ease infinite; }
.hp-live-progress { height: 3px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: #e8eef7; }
.hp-live-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg,#1769ff,#00a978); transition: width .16s linear; }

@keyframes hpPulse { 50% { box-shadow: 0 0 0 7px rgba(0,169,120,0); } }

.hp-parking-node { background: #7c4dff !important; color: #fff; font-size: 9px; font-weight: 800; }
.hp-stop-title { font-size: 11px; font-weight: 750; color: #374963; }
.hp-stop-copy { margin-top: 3px; font-size: 9px; color: #909caf; }
.hp-total-idle { margin-top: 10px; }

html[dir="rtl"] .hp-root { animation-name: hpPanelInRtl; }
@keyframes hpPanelInRtl { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }

html[data-theme="dark"] .hp-root {
  color: #eef4ff;
  background: radial-gradient(circle at 90% -10%, rgba(23,105,255,.18), transparent 38%), linear-gradient(180deg,#111a29,#0e1623);
}
html[data-theme="dark"] .hp-header,
html[data-theme="dark"] .hp-footer { border-color: rgba(183,201,224,.12); background: rgba(15,24,38,.92); }
html[data-theme="dark"] .hp-back,
html[data-theme="dark"] .hp-icon-btn,
html[data-theme="dark"] .hp-event-card,
html[data-theme="dark"] .hp-kpi,
html[data-theme="dark"] .hp-playback-now { color: #eaf2ff; border-color: rgba(183,201,224,.13); background: rgba(22,34,51,.92); }
html[data-theme="dark"] .hp-title,
html[data-theme="dark"] .hp-event-time,
html[data-theme="dark"] .hp-mini-value,
html[data-theme="dark"] .hp-kpi-value,
html[data-theme="dark"] .hp-playback-now > b,
html[data-theme="dark"] .hp-stop-title { color: #eef4ff; }
html[data-theme="dark"] .hp-event-date,
html[data-theme="dark"] .hp-mini-label,
html[data-theme="dark"] .hp-stop-copy { color: #91a1b7; }
html[data-theme="dark"] .hp-mini-stat,
html[data-theme="dark"] .hp-parking-row { background: #101a29; border-color: rgba(183,201,224,.1); }
html[data-theme="dark"] .hp-card-progress,
html[data-theme="dark"] .hp-live-progress { background: #26354a; }

@media (max-width: 720px) {
  #objPanel.hp-history-open {
    top: auto !important;
    right: 8px !important;
    bottom: calc(var(--hz-dock) + 8px) !important;
    left: 8px !important;
    height: min(72vh, 610px) !important;
    max-height: calc(100% - var(--hz-fleetbar) - var(--hz-dock) - 16px) !important;
    width: auto !important;
    min-height: 0 !important;
    border-radius: 22px !important;
  }
  .hp-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Phase 12 — map/time synchronization and premium journey navigator */
body.hz-history-open { --hz-attention: 0px; }
body.hz-history-open #hzAttention {
  opacity: 0;
  pointer-events: none;
  transform: translateX(28px);
}
html[dir="rtl"] body.hz-history-open #hzAttention { transform: translateX(-28px); }
body.hz-history-open .hz-attention-trigger { opacity: 0; pointer-events: none; }

.hp-root {
  --hp-blue: #1769ff;
  --hp-cyan: #19b8d4;
  --hp-violet: #7757e8;
  background:
    radial-gradient(circle at 94% -8%, rgba(23,105,255,.09), transparent 33%),
    linear-gradient(180deg, #fbfdff 0%, #f7fafe 100%);
}

.hp-header {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(24px) saturate(150%);
}

.hp-summary { gap: 9px; }
.hp-kpi {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(41,67,105,.08);
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,251,255,.9));
  box-shadow: 0 8px 24px rgba(31,66,114,.055);
}
.hp-kpi::after {
  content: '';
  position: absolute;
  width: 54px;
  height: 54px;
  inset-inline-end: -24px;
  bottom: -30px;
  border-radius: 50%;
  background: var(--hp-soft);
}

.hp-orbit {
  margin: 12px 0 7px;
  padding: 13px 14px 10px;
  border: 1px solid rgba(35,74,126,.10);
  border-radius: 17px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 34px rgba(26,60,105,.075);
}
.hp-orbit-head,
.hp-orbit-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hp-orbit-head > div:first-child { min-width: 0; }
.hp-orbit-head strong {
  display: block;
  color: #192b45;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.hp-orbit-head > div:first-child > span {
  display: block;
  margin-top: 2px;
  color: #8795a9;
  font-size: 8.5px;
}
.hp-orbit-status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 999px;
  color: #08745a;
  background: rgba(0,169,120,.09);
  font-size: 8px;
  font-weight: 800;
}
.hp-orbit-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00a978;
  box-shadow: 0 0 0 3px rgba(0,169,120,.12);
}
.hp-orbit-track {
  position: relative;
  height: 42px;
  margin: 10px 0 5px;
  overflow: hidden;
  border: 1px solid rgba(63,92,130,.09);
  border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(82,109,145,.08) calc(25% - 1px), rgba(82,109,145,.08) 25%),
    #f2f6fb;
}
.hp-orbit-segment {
  position: absolute;
  top: 13px;
  inset-inline-start: var(--hp-start);
  width: var(--hp-span);
  min-width: 3px;
  height: 16px;
  border-radius: 5px;
  pointer-events: none;
}
.hp-orbit-segment.trip {
  background: linear-gradient(90deg, var(--hp-blue), var(--hp-cyan));
  box-shadow: 0 4px 10px rgba(23,105,255,.22);
}
.hp-orbit-segment.parking {
  top: 16px;
  height: 10px;
  background: linear-gradient(90deg, #8c6cf0, #6844d4);
  box-shadow: 0 3px 9px rgba(119,87,232,.2);
}
.hp-orbit-cursor {
  position: absolute;
  z-index: 4;
  top: 6px;
  bottom: 6px;
  inset-inline-start: var(--hp-progress, 0%);
  width: 2px;
  border-radius: 3px;
  background: #0b1f3a;
  box-shadow: 0 0 0 3px rgba(255,255,255,.82), 0 2px 9px rgba(16,37,67,.28);
  transform: translateX(-1px);
  pointer-events: none;
  transition: inset-inline-start .12s linear;
}
.hp-orbit-cursor::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0b1f3a;
  transform: translateX(-50%);
}
#hpOrbitRange {
  position: absolute;
  z-index: 6;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.hp-orbit-meta { color: #8996a8; font-size: 8px; font-variant-numeric: tabular-nums; }
.hp-orbit-meta strong { color: #243852; font-size: 9px; font-weight: 800; }

.hp-event-card {
  position: relative;
  border-color: rgba(49,78,117,.09);
  box-shadow: 0 5px 18px rgba(25,55,96,.045);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.hp-event-card:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(27,63,112,.09); }
.hp-event-card.active {
  border-color: rgba(23,105,255,.34);
  background: linear-gradient(145deg, #fff, #f5f9ff);
  box-shadow: 0 14px 36px rgba(23,105,255,.13), inset 0 0 0 1px rgba(23,105,255,.06);
}
.hp-event-card.active::after {
  content: '';
  position: absolute;
  top: 18px;
  inset-inline-end: -4px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--hp-blue);
  box-shadow: 0 2px 8px rgba(23,105,255,.32);
}

.hp-playback-now {
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(244,249,255,.95));
}

html[data-theme="dark"] .hp-orbit {
  border-color: rgba(183,201,224,.12);
  background: rgba(20,31,48,.94);
  box-shadow: 0 16px 38px rgba(0,0,0,.22);
}
html[data-theme="dark"] .hp-orbit-head strong,
html[data-theme="dark"] .hp-orbit-meta strong { color: #edf4ff; }
html[data-theme="dark"] .hp-orbit-head > div:first-child > span,
html[data-theme="dark"] .hp-orbit-meta { color: #8fa0b7; }
html[data-theme="dark"] .hp-orbit-track {
  border-color: rgba(183,201,224,.09);
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(183,201,224,.07) calc(25% - 1px), rgba(183,201,224,.07) 25%), #101a28;
}
html[data-theme="dark"] .hp-orbit-cursor { background: #f6f9ff; box-shadow: 0 0 0 3px rgba(14,23,36,.8), 0 2px 10px rgba(0,0,0,.5); }
html[data-theme="dark"] .hp-orbit-cursor::before { background: #f6f9ff; }
html[data-theme="dark"] .hp-kpi,
html[data-theme="dark"] .hp-event-card.active,
html[data-theme="dark"] .hp-playback-now { background: linear-gradient(145deg, rgba(24,38,58,.98), rgba(17,28,44,.96)); }

@media (max-width: 720px) {
  .hp-orbit { padding: 11px 12px 9px; border-radius: 15px; }
  .hp-orbit-head > div:first-child > span { display: none; }
  .hp-orbit-track { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .hp-orbit-cursor,
  .hp-event-card { transition: none !important; }
}
