#ovx-record-app,
#ovx-record-app * {
  box-sizing: border-box;
}

#ovx-record-app {
  --n: #172439;
  --n2: #21334f;
  --o: #ee7628;
  --od: #d8641b;
  --c: #ffffff;
  --bg: #ffffff;
  --t: #142230;
  --m: #667788;
  --b: #d8e1e8;
  --s: #eef3f7;
  --danger: #c84a3a;
  --shadow: 0 14px 38px rgba(15, 34, 54, 0.08);
  --shadow-2: 0 10px 24px rgba(15, 34, 54, 0.18);
  --radius: 22px;
  width: 100%;
  max-width: 100%;
  color: var(--t);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}

.ovx-record-shell {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 100%;
}

.ovx-record-map-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--b);
  background: var(--c);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ovx-record-map {
  height: 82svh;
  min-height: 620px;
  background: #dce7ef;
}

.ovx-record-overlay {
  position: absolute;
  z-index: 800;
  pointer-events: none;
}

.ovx-record-overlay > * {
  pointer-events: auto;
}

.ovx-record-overlay-top {
  top: 12px;
  left: 12px;
  right: 12px;
}

.ovx-record-overlay-left-bottom {
  left: 12px;
  top: 108px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ovx-record-overlay-bottom-stack {
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 10px;
}

.ovx-record-topbar {
  display: grid;
  grid-template-columns: 78px 78px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(23, 36, 57, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-2);
}

.ovx-record-topslot {
  appearance: none;
  border: 0;
  background: transparent;
  color: #ffffff;
  min-height: 72px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.ovx-record-topslot + .ovx-record-topslot {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.ovx-record-topslot-control {
  justify-items: center;
  text-align: center;
}

.ovx-record-topslot-control .ovx-record-topslot-label {
  font-size: 12px;
}

.ovx-record-topslot-label {
  font-size: 11px;
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ovx-record-topslot-value {
  font-size: 17px;
  line-height: 1.1;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ovx-record-topslot-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ovx-record-rec-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid currentColor;
  color: var(--o);
}

.ovx-record-topslot.is-recording .ovx-record-rec-icon {
  background: currentColor;
  color: var(--o);
  border-color: var(--o);
  animation: ovx-record-rec-pulse 1.5s ease-in-out infinite;
}

@keyframes ovx-record-rec-pulse {
  0% { box-shadow: 0 0 0 0 rgba(238, 118, 40, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(238, 118, 40, 0); }
  100% { box-shadow: 0 0 0 0 rgba(238, 118, 40, 0); }
}

.ovx-record-pin-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--o);
}

.ovx-record-actions-popup,
.ovx-record-metric-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 176px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(23, 36, 57, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-2);
  display: grid;
  gap: 6px;
}

.ovx-record-metric-picker {
  width: 220px;
}

.ovx-record-popup-btn,
.ovx-record-metric-option {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.ovx-record-popup-btn-danger {
  color: #ff9088;
}

.ovx-record-map-fab {
  appearance: none;
  border: 0;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-2);
}

.ovx-record-map-fab-dark {
  background: rgba(23, 36, 57, 0.95);
  color: #ffffff;
}

.ovx-record-map-fab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ovx-record-notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 216, 164, 0.9);
  background: rgba(255, 244, 229, 0.96);
  color: #8a5200;
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(6px);
}

.ovx-record-notice-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ovx-record-notice-copy strong {
  font-size: 12px;
  line-height: 1.2;
}

.ovx-record-notice-copy span {
  font-size: 12px;
  line-height: 1.35;
}

.ovx-record-notice-dismiss {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.ovx-record-waypoint-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(216, 225, 232, 0.96);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(6px);
}

.ovx-record-waypoint-bar-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ovx-record-waypoint-bar-copy strong {
  font-size: 13px;
  line-height: 1.2;
  color: var(--n);
}

.ovx-record-waypoint-bar-copy span {
  font-size: 12px;
  line-height: 1.35;
  color: var(--m);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ovx-record-waypoint-bar-btn,
.ovx-record-btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
}

.ovx-record-waypoint-bar-btn {
  padding: 11px 14px;
  background: #eef3f7;
  color: var(--n);
  flex: 0 0 auto;
}

.ovx-record-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 18px 28px;
  background: rgba(15, 34, 54, 0.56);
  backdrop-filter: blur(4px);
}

.ovx-record-modal-card {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 100px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--b);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(15, 34, 54, 0.22);
  padding: 18px 18px 22px;
}

.ovx-record-modal-card-sm {
  width: min(560px, 100%);
}

.ovx-record-modal-card-lg {
  width: min(860px, 100%);
}

.ovx-record-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--m);
}

.ovx-record-modal-head {
  margin-bottom: 14px;
}

.ovx-record-modal-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--m);
  margin-bottom: 4px;
}

.ovx-record-modal-title {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.08;
  color: var(--n);
}

.ovx-record-modal-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--m);
}

.ovx-record-form {
  display: grid;
  gap: 12px;
}

.ovx-record-form-lg {
  gap: 14px;
}

.ovx-record-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ovx-record-field {
  min-width: 0;
}

.ovx-record-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--m);
}

.ovx-record-input,
.ovx-record-select,
.ovx-record-textarea {
  width: 100%;
  border: 1px solid var(--b);
  border-radius: 14px;
  background: #fff;
  color: var(--t);
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
}

.ovx-record-input:focus,
.ovx-record-select:focus,
.ovx-record-textarea:focus {
  border-color: var(--o);
  box-shadow: 0 0 0 3px rgba(238, 118, 40, 0.14);
}

.ovx-record-textarea {
  resize: vertical;
  min-height: 96px;
}

.ovx-record-field-help {
  font-size: 12px;
  line-height: 1.4;
  color: var(--m);
}

.ovx-record-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ovx-record-btn {
  min-height: 42px;
  padding: 10px 14px;
  white-space: nowrap;
}

.ovx-record-btn-primary {
  background: var(--o);
  color: #fff;
}

.ovx-record-btn-secondary {
  background: var(--s);
  color: var(--n);
}

.ovx-record-btn-danger {
  background: var(--danger);
  color: #fff;
}

.ovx-record-subsection {
  display: grid;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--b);
}

.ovx-record-subsection-headline {
  display: grid;
  gap: 2px;
}

.ovx-record-subsection-title {
  font-size: 16px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--n);
}

.ovx-record-subsection-meta {
  font-size: 12px;
  line-height: 1.35;
  color: var(--m);
}

.ovx-record-finish-main-marker {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--b);
  background: #fbfdff;
}

.ovx-record-finish-main-marker-meta {
  font-size: 13px;
  line-height: 1.45;
  color: var(--t);
}

.ovx-record-finish-waypoint-editor,
.ovx-record-waypoint-list {
  display: grid;
  gap: 10px;
}

.ovx-record-empty {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--b);
  background: #fbfdff;
  color: var(--m);
  font-size: 14px;
}

.ovx-record-waypoint-item,
.ovx-record-finish-waypoint-card {
  border: 1px solid var(--b);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.ovx-record-waypoint-item {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.ovx-record-waypoint-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.ovx-record-waypoint-title {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.2;
  color: var(--n);
}

.ovx-record-waypoint-meta {
  font-size: 12px;
  color: var(--m);
  line-height: 1.4;
}

.ovx-record-waypoint-photo {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--b);
  flex: 0 0 64px;
}

.ovx-record-waypoint-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ovx-record-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  background: #eef3f7;
  color: #274055;
  border: 1px solid #d6e0e8;
}

.ovx-record-finish-waypoint-card summary {
  list-style: none;
}

.ovx-record-finish-waypoint-card summary::-webkit-details-marker {
  display: none;
}

.ovx-record-finish-waypoint-summary {
  cursor: pointer;
  padding: 10px 12px;
  background: #fbfdff;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.ovx-record-finish-waypoint-thumb,
.ovx-record-finish-waypoint-icon {
  width: 56px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--b);
  object-fit: cover;
  background: #eef3f7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ovx-record-finish-waypoint-icon {
  color: var(--o);
}

.ovx-record-finish-waypoint-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ovx-record-finish-waypoint-copy {
  min-width: 0;
}

.ovx-record-finish-waypoint-copy h4 {
  margin: 0 0 3px;
  font-size: 14px;
  line-height: 1.2;
  color: var(--n);
}

.ovx-record-finish-waypoint-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--m);
}

.ovx-record-finish-waypoint-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(238, 118, 40, 0.14);
  color: var(--o);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex: 0 0 auto;
}

.ovx-record-finish-waypoint-body {
  padding: 12px;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--b);
}

.ovx-record-stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ovx-record-stats-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--b);
  background: #fbfdff;
  display: grid;
  gap: 4px;
}

.ovx-record-stats-item span {
  font-size: 11px;
  font-weight: 700;
  color: var(--m);
}

.ovx-record-stats-item strong {
  font-size: 14px;
  line-height: 1.3;
  color: var(--n);
  word-break: break-word;
}

.ovx-record-stats-item-full {
  grid-column: 1 / -1;
}

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

.leaflet-container {
  font: inherit;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
}

.leaflet-popup-content {
  margin: 10px 10px 8px;
  width: min(240px, calc(100vw - 80px)) !important;
  max-width: 240px !important;
}

.ovx-record-live-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--n);
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(238, 118, 40, 0.16), 0 3px 10px rgba(15, 34, 54, 0.24);
}

.ovx-record-waypoint-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(15, 34, 54, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--o);
  color: #fff;
}

.ovx-record-waypoint-marker svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1024px) {
  .leaflet-control-zoom {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .ovx-record-map {
    height: 86svh;
    min-height: 640px;
  }

  .ovx-record-overlay-top,
  .ovx-record-overlay-bottom-stack {
    left: 8px;
    right: 8px;
  }

  .ovx-record-overlay-top {
    top: 8px;
  }

  .ovx-record-overlay-left-bottom {
    left: 8px;
    top: calc(env(safe-area-inset-top, 0px) + 94px);
    gap: 8px;
  }

  .ovx-record-topbar {
    grid-template-columns: 70px 70px minmax(0, 1fr) minmax(0, 1fr);
  }

  .ovx-record-topslot {
    min-height: 66px;
    padding: 8px 10px;
  }

  .ovx-record-topslot-tablet {
    display: none;
  }

  .ovx-record-topslot-label {
    font-size: 10px;
  }

  .ovx-record-topslot-value {
    font-size: 15px;
  }

  .ovx-record-actions-popup,
  .ovx-record-metric-picker {
    width: 170px;
  }

  .ovx-record-map-fab {
    width: 44px;
    height: 44px;
  }

  .ovx-record-map-fab svg {
    width: 20px;
    height: 20px;
  }

  .ovx-record-notice {
    padding: 9px 10px;
    gap: 10px;
  }

  .ovx-record-notice-copy strong,
  .ovx-record-notice-copy span {
    font-size: 11px;
  }

  .ovx-record-waypoint-bar {
    padding: 10px 12px;
    gap: 10px;
  }

  .ovx-record-waypoint-bar-copy strong,
  .ovx-record-waypoint-bar-copy span {
    font-size: 11px;
  }

  .ovx-record-waypoint-bar-btn {
    padding: 10px 12px;
    font-size: 12px;
  }

  .ovx-record-modal-backdrop {
    padding: 58px 10px 16px;
  }

  .ovx-record-modal-card {
    padding: 14px 14px 18px;
    border-radius: 18px;
    max-height: calc(100svh - 74px);
  }

  .ovx-record-modal-title {
    font-size: 20px;
  }

  .ovx-record-modal-subtitle {
    font-size: 12px;
  }

  .ovx-record-form-grid-2,
  .ovx-record-stats-grid {
    grid-template-columns: 1fr;
  }

  .ovx-record-modal-actions {
    flex-direction: column;
  }

  .ovx-record-modal-actions .ovx-record-btn {
    width: 100%;
  }

  .ovx-record-finish-waypoint-summary {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .ovx-record-finish-waypoint-thumb,
  .ovx-record-finish-waypoint-icon {
    width: 48px;
    height: 38px;
  }

  .ovx-record-waypoint-photo {
    width: 56px;
    height: 42px;
    flex-basis: 56px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .ovx-record-map {
    height: 82vh;
    min-height: 700px;
  }

  .ovx-record-topbar {
    grid-template-columns: 74px 74px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .ovx-record-topslot {
    min-height: 68px;
  }

  .ovx-record-topslot-label {
    font-size: 10px;
  }

  .ovx-record-topslot-value {
    font-size: 16px;
  }
}
@media (max-width: 767px) {
  .ovx-record-map {
    height: 86svh;
    min-height: 640px;
  }
}

.ovx-record-map-fab.is-gps-pending {
  opacity: 0.7;
}

.ovx-record-map-fab.is-gps-ready {
  background: rgba(23, 36, 57, 0.95);
  color: #ffffff;
}

.ovx-record-map-fab.is-following {
  background: #ee7628;
  color: #ffffff;
}

.ovx-record-layer-picker {
  position: absolute;
  left: calc(100% + 10px);
  bottom: 0;
  width: 190px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(23, 36, 57, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(15, 34, 54, 0.18);
  display: grid;
  gap: 6px;
}

.ovx-record-layer-option {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.ovx-record-layer-option.is-active {
  background: var(--o);
  color: #ffffff;
}

@media (max-width: 767px) {
  .ovx-record-layer-picker {
    left: calc(100% + 8px);
    width: 170px;
  }
}

/* =========================================================
   OVEX TRACK BOTTOM NAV – P1.2
   ========================================================= */

#ovx-record-app {
  --ovx-record-bottom-nav-height: 78px;
  --ovx-record-bottom-nav-offset: calc(var(--ovx-record-bottom-nav-height) + 12px);
}

.ovx-record-bottom-nav {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 950;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(23, 36, 57, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(15, 34, 54, 0.28);
}

.ovx-record-bottom-nav-btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  min-height: 62px;
  padding: 8px 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  cursor: pointer;
}

.ovx-record-bottom-nav-btn.is-active {
  background: var(--o);
  color: #ffffff;
}

.ovx-record-bottom-nav-btn-home {
  color: #ffffff;
}

.ovx-record-bottom-nav-btn-home .ovx-record-bottom-nav-icon {
  background: linear-gradient(180deg, #ee7628, #d8641b);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(238, 118, 40, 0.34);
}

.ovx-record-bottom-nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ovx-record-bottom-nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ovx-record-bottom-nav-label {
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
}

#ovx-record-app .ovx-record-overlay-bottom-stack {
  bottom: var(--ovx-record-bottom-nav-offset);
}

@media (max-width: 767px) {
  #ovx-record-app {
    --ovx-record-bottom-nav-height: 74px;
  }

  .ovx-record-bottom-nav {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 4px;
    padding: 6px;
    border-radius: 20px;
  }

  .ovx-record-bottom-nav-btn {
    min-height: 58px;
    padding: 6px 4px;
    gap: 4px;
  }

  .ovx-record-bottom-nav-icon {
    width: 30px;
    height: 30px;
  }

  .ovx-record-bottom-nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .ovx-record-bottom-nav-label {
    font-size: 10px;
  }
}

html.ovx-track-app-mode #ovx-record-app .ovx-record-overlay-bottom-stack {
  bottom: calc(var(--ovx-record-bottom-nav-offset) + env(safe-area-inset-bottom, 0px));
}

html.ovx-track-app-mode .ovx-record-bottom-nav {
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 767px) {
  html.ovx-track-app-mode .ovx-record-bottom-nav {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  html.ovx-track-app-mode #ovx-record-app .ovx-record-overlay-bottom-stack {
    bottom: calc(var(--ovx-record-bottom-nav-offset) + env(safe-area-inset-bottom, 0px) + 8px);
  }
}



/* =========================================================
   OVEX TRACK RESTORE PATCH
   - volle Displayhöhe / Safe-Area-Topbar global wiederherstellen
   - bewusst global, damit es auch ohne app-mode Klasse greift
   ========================================================= */

:root {
  --ovx-track-app-height: 100dvh;
}

#ovx-record-app,
#ovx-record-app .ovx-record-shell,
#ovx-record-app .ovx-record-map-card {
  min-height: var(--ovx-track-app-height) !important;
}

#ovx-record-app .ovx-record-map {
  height: var(--ovx-track-app-height) !important;
  min-height: var(--ovx-track-app-height) !important;
}

@supports not (height: 100dvh) {
  :root {
    --ovx-track-app-height: 100svh;
  }
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
  }

  /* Karte darf bis oben laufen; nur die Topbar wird nach unten versetzt */
  #ovx-record-app .ovx-record-overlay-top {
    top: max(8px, calc(env(safe-area-inset-top, 0px) + 8px)) !important;
  }

  /* Bottom-Stack / Waypoint-Bar wieder sauber über Bottom-Bar + Safe Area */
  #ovx-record-app .ovx-record-overlay-bottom-stack {
    bottom: calc(var(--ovx-record-bottom-nav-offset) + env(safe-area-inset-bottom, 0px) + 8px) !important;
  }

  .ovx-record-bottom-nav {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #ovx-record-app .ovx-record-modal-backdrop {
    padding-top: max(58px, calc(env(safe-area-inset-top, 0px) + 18px)) !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
  }
}

@media (min-width: 768px) {
  .ovx-record-bottom-nav {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #ovx-record-app .ovx-record-overlay-bottom-stack {
    bottom: calc(var(--ovx-record-bottom-nav-offset) + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* =========================================================
   OVEX TRACK CI / MOTION PATCH
   ========================================================= */

.ovx-record-topslot.is-active,
.ovx-record-map-fab.is-active,
.ovx-record-waypoint-bar-btn.is-active {
  background: rgba(238, 118, 40, 0.18) !important;
  color: #ffffff !important;
}

.ovx-record-waypoint-bar-btn.is-active {
  box-shadow: inset 0 0 0 1px rgba(238, 118, 40, 0.28);
}

.ovx-record-modal-backdrop,
.ovx-record-actions-popup,
.ovx-record-metric-picker,
.ovx-record-layer-picker {
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  will-change: opacity, transform;
}

.ovx-record-modal-backdrop {
  transform: none;
}

.ovx-record-modal-card {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 200ms ease, transform 200ms ease;
  will-change: opacity, transform;
}

.ovx-record-actions-popup,
.ovx-record-metric-picker,
.ovx-record-layer-picker {
  transform: translateY(8px) scale(0.985);
}

.ovx-record-modal-backdrop.is-open,
.ovx-record-actions-popup.is-open,
.ovx-record-metric-picker.is-open,
.ovx-record-layer-picker.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ovx-record-modal-backdrop.is-open .ovx-record-modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .ovx-record-modal-backdrop,
  .ovx-record-modal-card,
  .ovx-record-actions-popup,
  .ovx-record-metric-picker,
  .ovx-record-layer-picker {
    transition: none !important;
    animation: none !important;
  }
}



.ovx-record-saved-sections {
  display: grid;
  gap: 14px;
}

.ovx-record-saved-section {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.ovx-record-saved-list {
  display: grid;
  gap: 10px;
}

.ovx-record-saved-item {
  border: 1px solid var(--b);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.ovx-record-saved-item-head {
  display: grid;
  gap: 4px;
}

.ovx-record-saved-item-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  color: var(--n);
}

.ovx-record-saved-item-meta {
  font-size: 12px;
  line-height: 1.4;
  color: var(--m);
}

.ovx-record-saved-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ovx-record-saved-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 999px;
  background: #eef3f7;
  color: #274055;
  border: 1px solid #d6e0e8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}



/* =========================================================
   OVEX TRACK REC BUGFIX
   - REC Topslot soll bei offenem Popup nicht vollflächig orange werden
   - bei Recording bleibt nur der rote REC-Punkt aktiv/pulsierend
   ========================================================= */

#ovxRecordControl.is-active {
  background: transparent !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

#ovxRecordControl.is-active .ovx-record-topslot-label,
#ovxRecordControl.is-active .ovx-record-topslot-value {
  color: #ffffff !important;
}

#ovxRecordControl.is-active .ovx-record-rec-icon {
  background: transparent;
  color: var(--o);
  border-color: currentColor;
}

#ovxRecordControl.is-recording.is-active .ovx-record-rec-icon,
#ovxRecordControl.is-recording .ovx-record-rec-icon {
  background: currentColor !important;
  color: #ff4e45 !important;
  border-color: #ff4e45 !important;
}



/* =========================================================
   OVEX TRACK CLEAN STATE PATCH
   - gepatcht auf bestätigter Baseline
   - vereinheitlicht Active States
   - REC Sonderfall
   - Layer-Picker safe
   ========================================================= */

/* globale Active States: klares OVEX Orange */
.ovx-record-topslot.is-active,
.ovx-record-map-fab.is-active,
.ovx-record-waypoint-bar-btn.is-active,
.ovx-record-bottom-nav-btn.is-active,
.ovx-record-layer-option.is-active {
  background: var(--o) !important;
  color: #ffffff !important;
}

.ovx-record-waypoint-bar-btn.is-active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16) !important;
}

.ovx-record-topslot.is-active .ovx-record-topslot-label,
.ovx-record-topslot.is-active .ovx-record-topslot-value,
.ovx-record-bottom-nav-btn.is-active .ovx-record-bottom-nav-label,
.ovx-record-map-fab.is-active svg {
  color: #ffffff !important;
}

/* REC ist Sonderfall: Kachel bleibt navy, nur Punkt reagiert */
#ovxRecordControl.is-active {
  background: transparent !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

#ovxRecordControl.is-active .ovx-record-topslot-label,
#ovxRecordControl.is-active .ovx-record-topslot-value {
  color: #ffffff !important;
}

#ovxRecordControl.is-active .ovx-record-rec-icon {
  background: transparent !important;
  color: var(--o) !important;
  border-color: currentColor !important;
}

/* laufende Aufzeichnung: nur REC-Punkt rot und pulsierend */
.ovx-record-topslot.is-recording .ovx-record-rec-icon,
#ovxRecordControl.is-recording.is-active .ovx-record-rec-icon,
#ovxRecordControl.is-recording .ovx-record-rec-icon {
  background: currentColor !important;
  color: #ff4e45 !important;
  border-color: #ff4e45 !important;
  animation: ovx-record-rec-pulse-red 1.35s ease-in-out infinite !important;
}

@keyframes ovx-record-rec-pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255, 78, 69, 0.52); }
  70% { box-shadow: 0 0 0 12px rgba(255, 78, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 78, 69, 0); }
}

/* Layer-Picker CSS-Basis robust von oben öffnen */
.ovx-record-layer-picker {
  top: 0 !important;
  bottom: auto !important;
}

@media (max-width: 767px) {
  .ovx-record-layer-picker {
    top: 0 !important;
    bottom: auto !important;
  }
}



/* =========================================================
   OVEX TRACK REC PULSE FIX
   - sichtbarer Pulse ohne Clipping im Topbar-Container
   - finale Orange-Active-States
   ========================================================= */

.ovx-record-bottom-nav-btn.is-active,
.ovx-record-layer-option.is-active,
.ovx-record-waypoint-bar-btn.is-active,
.ovx-record-map-fab.is-active,
.ovx-record-topslot.is-active {
  background: var(--o) !important;
  color: #ffffff !important;
}

#ovxRecordControl.is-active {
  background: transparent !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

#ovxRecordControl.is-active .ovx-record-topslot-label,
#ovxRecordControl.is-active .ovx-record-topslot-value {
  color: #ffffff !important;
}

.ovx-record-rec-icon {
  position: relative;
  overflow: visible;
}

.ovx-record-rec-icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid transparent;
  opacity: 0;
  transform: scale(1);
  pointer-events: none;
}

#ovxRecordControl.is-active .ovx-record-rec-icon {
  background: transparent !important;
  color: var(--o) !important;
  border-color: currentColor !important;
}

.ovx-record-topslot.is-recording .ovx-record-rec-icon,
#ovxRecordControl.is-recording.is-active .ovx-record-rec-icon,
#ovxRecordControl.is-recording .ovx-record-rec-icon {
  background: currentColor !important;
  color: #ff4e45 !important;
  border-color: #ff4e45 !important;
  animation: ovx-record-rec-dot-pulse 1.15s ease-in-out infinite !important;
}

.ovx-record-topslot.is-recording .ovx-record-rec-icon::after,
#ovxRecordControl.is-recording.is-active .ovx-record-rec-icon::after,
#ovxRecordControl.is-recording .ovx-record-rec-icon::after {
  border-color: rgba(255, 78, 69, 0.72) !important;
  animation: ovx-record-rec-ring-pulse 1.15s ease-out infinite !important;
}

@keyframes ovx-record-rec-dot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.10); }
}

@keyframes ovx-record-rec-ring-pulse {
  0% {
    opacity: 0.72;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ovx-record-topslot.is-recording .ovx-record-rec-icon,
  #ovxRecordControl.is-recording.is-active .ovx-record-rec-icon,
  #ovxRecordControl.is-recording .ovx-record-rec-icon,
  .ovx-record-topslot.is-recording .ovx-record-rec-icon::after,
  #ovxRecordControl.is-recording.is-active .ovx-record-rec-icon::after,
  #ovxRecordControl.is-recording .ovx-record-rec-icon::after {
    animation: none !important;
  }
}

/* =========================================================
   OVEX TRACK UI STATE FINAL
   - authoritative final UI state block
   - fixes orange active states
   - fixes REC special case
   - fixes popup/layer picker anchoring
   ========================================================= */

.ovx-record-topslot.is-active,
.ovx-record-map-fab.is-active,
.ovx-record-waypoint-bar-btn.is-active,
.ovx-record-bottom-nav-btn.is-active,
.ovx-record-layer-option.is-active {
  background: var(--o) !important;
  color: #ffffff !important;
}

.ovx-record-topslot.is-active .ovx-record-topslot-label,
.ovx-record-topslot.is-active .ovx-record-topslot-value,
.ovx-record-map-fab.is-active svg,
.ovx-record-bottom-nav-btn.is-active .ovx-record-bottom-nav-label,
.ovx-record-layer-option.is-active {
  color: #ffffff !important;
}

.ovx-record-waypoint-bar-btn.is-active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16) !important;
}

#ovxRecordControl.is-active {
  background: transparent !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

#ovxRecordControl.is-active .ovx-record-topslot-label,
#ovxRecordControl.is-active .ovx-record-topslot-value {
  color: #ffffff !important;
}

.ovx-record-rec-icon {
  position: relative;
  overflow: visible;
}

.ovx-record-rec-icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid transparent;
  opacity: 0;
  transform: scale(1);
  pointer-events: none;
}

#ovxRecordControl.is-active .ovx-record-rec-icon {
  background: transparent !important;
  color: var(--o) !important;
  border-color: currentColor !important;
}

.ovx-record-topslot.is-recording .ovx-record-rec-icon,
#ovxRecordControl.is-recording.is-active .ovx-record-rec-icon,
#ovxRecordControl.is-recording .ovx-record-rec-icon {
  background: currentColor !important;
  color: #ff4e45 !important;
  border-color: #ff4e45 !important;
  animation: ovx-record-rec-dot-pulse 1.15s ease-in-out infinite !important;
}

.ovx-record-topslot.is-recording .ovx-record-rec-icon::after,
#ovxRecordControl.is-recording.is-active .ovx-record-rec-icon::after,
#ovxRecordControl.is-recording .ovx-record-rec-icon::after {
  border-color: rgba(255, 78, 69, 0.72) !important;
  animation: ovx-record-rec-ring-pulse 1.15s ease-out infinite !important;
}

@keyframes ovx-record-rec-dot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.10); }
}

@keyframes ovx-record-rec-ring-pulse {
  0% {
    opacity: 0.72;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

.ovx-record-actions-popup,
.ovx-record-metric-picker {
  left: auto;
  right: auto;
}

.ovx-record-layer-picker {
  top: 0 !important;
  bottom: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  .ovx-record-topslot.is-recording .ovx-record-rec-icon,
  #ovxRecordControl.is-recording.is-active .ovx-record-rec-icon,
  #ovxRecordControl.is-recording .ovx-record-rec-icon,
  .ovx-record-topslot.is-recording .ovx-record-rec-icon::after,
  #ovxRecordControl.is-recording.is-active .ovx-record-rec-icon::after,
  #ovxRecordControl.is-recording .ovx-record-rec-icon::after {
    animation: none !important;
  }
}
