html.standalone-temporal-root,
.standalone-temporal-page {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

.standalone-temporal-page {
  --temporal-bg: #061726;
  --temporal-panel: rgba(5, 20, 32, 0.78);
  --temporal-panel-2: rgba(10, 42, 67, 0.82);
  --temporal-border: rgba(124, 200, 255, 0.18);
  --temporal-text: #d7e9f7;
  --temporal-muted: rgba(215, 233, 247, 0.72);
  --temporal-teal: #7cc8ff;
  --temporal-amber: #ffd166;
  --temporal-ink: #f4fbff;
  min-height: 100vh;
  overflow: hidden;
  color: var(--temporal-text);
  font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(79, 195, 247, 0.18), transparent 32%),
    linear-gradient(180deg, #04131f 0%, var(--temporal-bg) 100%);
}

.standalone-temporal-page button,
.standalone-temporal-page select {
  font: inherit;
}

.temporal-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  height: 100vh;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
  box-sizing: border-box;
}

.temporal-header,
.temporal-controls,
.temporal-workspace {
  width: min(1680px, 100%);
  margin: 0 auto;
}

.temporal-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.temporal-eyebrow,
.temporal-controls span,
.temporal-panel__header p {
  color: var(--temporal-teal);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.temporal-header h1 {
  margin: 0.18rem 0 0;
  color: var(--temporal-ink);
  font-size: clamp(1.6rem, 2vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.temporal-header p {
  margin: 0.35rem 0 0;
  color: var(--temporal-muted);
  font-size: 0.98rem;
}

.temporal-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.temporal-links a,
.temporal-controls select {
  border: 1px solid var(--temporal-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--temporal-text);
}

.temporal-links a {
  padding: 0.72rem 0.9rem;
  text-decoration: none;
  font-weight: 700;
}

.temporal-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--temporal-border);
  border-radius: 8px;
  backdrop-filter: blur(18px);
  background:
    radial-gradient(circle at top right, rgba(79, 195, 247, 0.12), transparent 35%),
    rgba(5, 20, 32, 0.76);
}

.temporal-controls label {
  display: grid;
  gap: 6px;
}

.temporal-controls select {
  min-width: 12rem;
  height: 2.25rem;
  padding: 0 0.7rem;
  background: #071d2d;
  color: var(--temporal-text);
  color-scheme: dark;
}

.temporal-controls option {
  background: #071d2d;
  color: var(--temporal-text);
}

.temporal-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.temporal-chart-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(240px, 0.88fr);
  gap: 12px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.temporal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--temporal-border);
  border-radius: 8px;
  backdrop-filter: blur(18px);
  background:
    radial-gradient(circle at top right, rgba(79, 195, 247, 0.1), transparent 34%),
    var(--temporal-panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.temporal-panel__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.temporal-panel__header h2 {
  margin: 0;
  color: var(--temporal-ink);
  font-size: 1rem;
  letter-spacing: 0;
}

.temporal-panel__header p {
  margin: 0.25rem 0 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.temporal-pill {
  display: inline-flex;
  max-width: 18rem;
  overflow: hidden;
  padding: 0.38rem 0.55rem;
  border: 1px solid rgba(124, 200, 255, 0.32);
  border-radius: 8px;
  color: var(--temporal-teal);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#temporal-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 6px;
  background: #04131f;
  cursor: pointer;
}

.temporal-chart {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#temporal-map.leaflet-container {
  background: #04131f;
  color: var(--temporal-text);
  font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#temporal-map .leaflet-control-attribution,
#temporal-map .leaflet-control-zoom a {
  border-color: rgba(124, 200, 255, 0.22);
  background: rgba(5, 20, 32, 0.9);
  color: var(--temporal-text);
}

#temporal-map .leaflet-control-attribution a,
#temporal-map .leaflet-control-zoom a:hover {
  color: var(--temporal-teal);
}

.leaflet-tooltip.temporal-leaflet-tooltip {
  max-width: 260px;
  border: 1px solid var(--temporal-border);
  border-radius: 8px;
  background: rgba(5, 20, 32, 0.98);
  color: var(--temporal-text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.78rem;
}

.temporal-chart .modebar {
  color: var(--temporal-muted);
}

#temporal-map path.leaflet-interactive {
  cursor: pointer;
}

@media (max-width: 980px) {
  .temporal-workspace {
    grid-template-columns: 1fr;
  }

  .temporal-chart-stack {
    grid-template-rows: repeat(2, minmax(320px, 1fr));
  }
}

@media (max-width: 720px) {
  .temporal-shell {
    padding: 10px;
  }

  .temporal-header {
    align-items: start;
    flex-direction: column;
  }

  .temporal-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .temporal-controls label,
  .temporal-controls select {
    width: 100%;
  }
}

@media (max-width: 980px), (max-height: 720px) {
  .standalone-temporal-page {
    overflow: auto;
  }

  .temporal-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .temporal-panel {
    min-height: 360px;
  }
}

.temporal-load-failed .temporal-workspace,
.temporal-load-failed .temporal-controls {
  opacity: 1;
}

.temporal-error-state {
  width: min(920px, 100%);
  margin: 2rem auto 0;
  padding: 1.2rem 1.35rem;
  border: 1px solid var(--temporal-border);
  border-radius: 8px;
  background:
    radial-gradient(circle at top right, rgba(79, 195, 247, 0.12), transparent 35%),
    rgba(5, 20, 32, 0.82);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.temporal-error-state h2 {
  margin: 0 0 0.5rem;
  color: var(--temporal-ink);
  font-size: 1.25rem;
}

.temporal-error-state p {
  margin: 0.35rem 0;
  color: var(--temporal-muted);
}

.temporal-error-state code {
  color: var(--temporal-teal);
  overflow-wrap: anywhere;
}

.temporal-controls select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}
