@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@100;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap') screen;

#sd-root {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "ss01", "cv11";
  background-color: #eef1e7;
  min-height: 100vh;
  padding-bottom: 24px;
}

#sd-root .sd-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ── Glass page header strip ───────────────────────────────────────── */
#sd-root .sd-pheader {
  position: relative;
  z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(29,29,31,0.10);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  margin: 12px 16px 0 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset,
              0 12px 30px -16px rgba(20,30,40,0.18),
              0 2px 6px rgba(20,30,40,0.04);
}

/* breadcrumb */
#sd-root .sd-crumb-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #9a9a9f;
  font-weight: 600;
  line-height: 1.2;
}
#sd-root .sd-crumb-title {
  font-size: 17px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
  line-height: 1.2;
}
#sd-root .sd-crumb-sub {
  font-size: 12px;
  font-weight: 500;
  color: #5b5b60;
}

/* vertical separator */
#sd-root .sd-sep {
  width: 1px;
  height: 22px;
  background: rgba(0,0,0,0.08);
  flex-shrink: 0;
}

/* pill direction toggle */
#sd-root .sd-toggle-track {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(29,29,31,0.10);
  border-radius: 999px;
  padding: 3px;
  display: flex;
  gap: 2px;
}
#sd-root .sd-toggle-btn {
  border: none;
  background: transparent;
  color: #5b5b60;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}
@keyframes sd-pill-blink {
  0%, 100% { color: #34c759; }
  50%       { color: #fff; }
}

#sd-root .sd-toggle-btn:hover { color: #1d1d1f; }
#sd-root .sd-toggle-btn.sd-active {
  background: #1d1d1f;
  color: #34c759;
  box-shadow: 0 4px 10px -4px rgba(0,0,0,0.3);
  animation: sd-pill-blink 1s ease-in-out 1;
}

/* ── Main grid ─────────────────────────────────────────────────────── */
#sd-root .sd-main {
  display: grid;
  grid-template-columns: 360px 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  padding: 14px 16px 0 16px;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 52px - 56px - 28px);  /* 100vh - navbar - header - outer pad */
}

/* left column spans both rows */
#sd-root .sd-left-combo {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Left column map wrapper ────────────────────────────────────────── */
#sd-root .sd-left-combo > div:first-child {
  /* the relative wrapper around dl.Map */
}

#sd-root .sd-left-combo .leaflet-container {
  background: #eef1e7;
  border-radius: 0;
}

/* ── Glass card ─────────────────────────────────────────────────────── */
#sd-root .sd-card {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(29,29,31,0.10);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset,
              0 14px 40px -18px rgba(20,30,40,0.20),
              0 2px 6px rgba(20,30,40,0.05);
}

#sd-root .sd-card-title {
  padding: 12px 16px 8px;
  color: #1d1d1f;
  flex-shrink: 0;
}

/* Erstes Wort der Chart-Titel ("Häufigkeit", "Dauer", "Profil") in denselben
   Parametern wie die Stationsinformation-Überschrift (.sd-sect-lg .sd-sect-hd),
   der Rest wie deren Felder (.sd-sect-lg .sd-k), je eine Stufe kleiner. */
#sd-root .sd-card-title-word {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #9a9a9f;
}
#sd-root .sd-card-title .sd-card-sub {
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.10em;
  color: #9a9a9f;
  margin-left: 4px;
}

#sd-root .sd-chart-body {
  flex: 1;
  min-height: 0;
}

/* ── Facts box ──────────────────────────────────────────────────────── */
#sd-root .sd-info {
  flex: 1 1 auto;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
  min-height: 0;
}

/* section with hairline rule */
#sd-root .sd-sect-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #9a9a9f;
  margin-bottom: 6px;
}

/* Stationsinformation-Überschrift: eine Schriftstufe grösser als die anderen
   sd-info-Sektionen (10px -> 11px, siehe sd-v-mono) */
#sd-root .sd-sect-lg .sd-sect-hd {
  font-size: 11px;
}
/* Stationsinformation-Felder (Station / Spuren · Richtung): zurück auf 10px,
   dafür leichteres Gewicht 500 statt der sonst üblichen 600 */
#sd-root .sd-sect-lg .sd-k {
  font-size: 10px;
  font-weight: 500;
}
/* PREVIEW zum Vergleich: Stau-Felder auf Gewicht 500 (wie Stationsinformation) */
#sd-root .sd-sect-thin .sd-k {
  font-weight: 500;
}
#sd-root .sd-sect-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
#sd-root .sd-sect-hd::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.08);
}

/* 2-column fact grid */
#sd-root .sd-sect-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 7px;
}

/* Dynamische Spuren-Tabelle (Freie Fahrt): Kopfzeile Spurnamen + Zeile Ø Geschwindigkeit */
#sd-root .sd-peak-grid {
  display: grid;
  column-gap: 6px;
  row-gap: 7px;
  margin-top: 10px;
}

#sd-root .sd-k {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #9a9a9f;
  line-height: 1.3;
}
#sd-root .sd-v {
  font-size: 12px;
  font-weight: 500;
  color: #1d1d1f;
  line-height: 1.3;
}
#sd-root .sd-v.sd-v-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
#sd-root .sd-v.sd-v-dim {
  font-style: italic;
  color: #9a9a9f;
}

/* ── Dignified empty state ──────────────────────────────────────────── */
#sd-root .sd-empty {
  flex: 1;
  margin: 10px;
  border: 1.5px dashed rgba(0,0,0,0.15);
  border-radius: 10px;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 6px,
    rgba(0,0,0,0.022) 6px,
    rgba(0,0,0,0.022) 7px
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 20px;
}
#sd-root .sd-empty-glyph {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #9a9a9f;
}
#sd-root .sd-empty-title {
  font-size: 12px;
  font-weight: 600;
  color: #1d1d1f;
}
#sd-root .sd-empty-desc {
  font-size: 11px;
  color: #5b5b60;
  text-align: center;
  max-width: 200px;
  line-height: 1.4;
}
#sd-root .sd-empty-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9a9a9f;
  margin-top: 2px;
}
#sd-root .sd-empty-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9a9a9f;
}

/* Geschlossener Dropdown-Wert: Gewicht an die West/Ost-Pille (.sd-toggle-btn,
   600) angleichen. Muss explizit gesetzt werden – das Gewicht der inneren
   Dash-Elemente erbt nicht vom Inline-Style des äusseren dcc.Dropdown-Wrappers. */
#sd-root #st-station-dd .dash-dropdown-value,
#sd-root #st-station-dd .dash-dropdown-value-item {
  font-weight: 600;
}

/* ── Station dropdown option states (Dash 4.1 classes) ──────────────── */
#sd-root .dash-dropdown-options {
  z-index: 200;
  border-radius: 8px;
  border: 1px solid rgba(29,29,31,0.12);
  box-shadow: 0 8px 24px rgba(20,30,40,0.14);
  overflow: hidden;
  max-height: none !important;
}
#sd-root .dash-dropdown-option {
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 400;
  color: #1d1d1f;
  background-color: #fff;
}
#sd-root .dash-dropdown-option:hover {
  font-weight: 700 !important;
  background-color: #fff !important;
  color: #1d1d1f !important;
}
#sd-root .dash-dropdown-option.selected {
  font-weight: 400 !important;
  background-color: #fff !important;
  color: #1d1d1f !important;
}
