/* RailPoint v82 - unified dark mode, shared by all pages. */
:root[data-railpoint-theme="dark"]{
  --bg:#111821;--card:#1c2633;--navy:#f1f5fa;--ink:#f1f5fa;--text:#e8eef7;
  --muted:#aab7c7;--line:#344254;--white:#1c2633;--shadow:0 12px 30px rgba(0,0,0,.35);
  --db-red-soft:#3e232c;--red:#ed0a16;--green:#50dca4;
}
:root[data-railpoint-theme="dark"] body{background:#111821;color:#e8eef7}
:root[data-railpoint-theme="dark"] :is(input,textarea,select){background:#15202d!important;color:#f0f4fa!important;border-color:#485568!important;caret-color:#fff}
:root[data-railpoint-theme="dark"] :is(input,textarea)::placeholder{color:#9aabbe!important;opacity:1}
:root[data-railpoint-theme="dark"] :is(input,textarea,select,button):focus-visible{outline:2px solid #ff6270;outline-offset:2px}
:root[data-railpoint-theme="dark"] :is(.card,.whitecard,.modal-card,.dialog,.panel,.vehicle-card,.stat,.menu-card,.main-menu-card,.search-float-card,.onboard-card,.about-card,.help-card,.referenceCard,.scopeinfo,.orientBox,.orientCard,.learnCard,.quizQuestion,.result,.info,.legend,.history-item,.filter,.modebar,.footer,.sectionbar,.searchbar,.month-wrap,.bottom,.results,.details,.hero-card,.sheet-card){background-color:#1c2633!important;color:#e8eef7!important;border-color:#344254!important}
:root[data-railpoint-theme="dark"] :is(.top,.topbar,.header,.menu-entry,.menu-icon,.menu-list,.tool,.iconbtn,.back,.modebtn,.filter,.qopt,.pill,.stat-icon,.date-input,.detail-row,.plate,.plate-mid,.result,.status,.sheet-head,.about-box,.formrow,.typebtn,.radius-btn,.radius-item,.search-pro-field,.search-pro-head,.search-pro-body,.menu-root-entry,.admin-row,.history-table,.history-table td,.history-table th,.quick,.tabs){background-color:#202b39!important;color:#e8eef7!important;border-color:#344254!important}
:root[data-railpoint-theme="dark"] :is(.menu-entry:hover,.modebtn:hover,.filter:hover,.qopt:hover,.radius-btn:hover,.tool:hover){background-color:#303e50!important}
:root[data-railpoint-theme="dark"] :is(.menu-entry b,.menu-copy b,.section-title,.page-title,.title,.title b,.hero h1,.hero h2,.card h2,.card h3,.card h4,.panel h2,.stat b,.stat strong,.model,.name,.meaning,.code,.quizQuestion,.head h1,h1,h2,h3,h4){color:#f2f5fb}
:root[data-railpoint-theme="dark"] :is(.menu-copy small,.head p,.title small,.meta,.muted,.small,.note,.info-copy small,.result small,.updated,.month-note,.auto-note,.footer,.scopeinfo){color:#aab7c7}
:root[data-railpoint-theme="dark"] :is(.note,.about-note,.scopeinfo,.referenceIntro,.empty-state,.month-note,.auto-note){background-color:#243144!important;border-color:#46546b!important;color:#d7e1ee!important}
:root[data-railpoint-theme="dark"] :is(.primary,.close,.closebtn,.wash-btn,.searchbtn,.red,.btn.primary){color:#fff!important}
:root[data-railpoint-theme="dark"] :is(.secondary,.reset,.btn.secondary,.details-btn,.tiny-btn,.manage-btn,.back-live-btn){background-color:#2b394b!important;color:#e8eef7!important;border-color:#415369!important}
:root[data-railpoint-theme="dark"] :is(.dialog,.modal-card,.search-float-card,.main-menu-card,.info,.legend){box-shadow:0 18px 50px rgba(0,0,0,.55)!important}
:root[data-railpoint-theme="dark"] :is(.leaflet-popup-content-wrapper,.leaflet-popup-tip,.leaflet-control-zoom a,.leaflet-control-layers,.leaflet-control-attribution){background:#1c2633!important;color:#e8eef7!important;border-color:#344254!important}
:root[data-railpoint-theme="dark"] .leaflet-container{background:#182332}
:root[data-railpoint-theme="dark"] .leaflet-control-attribution a{color:#9bd5ff}
/* Native images, DOP20 and satellite imagery are intentionally left unfiltered. */
:root[data-railpoint-theme="dark"] .topbar .brand, :root[data-railpoint-theme="dark"] .brandtxt{color:#f5f7fa}
:root[data-railpoint-theme="dark"] .plate{background:#e8ecf1!important;color:#101827!important}
:root[data-railpoint-theme="dark"] .plate *{color:#101827!important}
:root[data-railpoint-theme="dark"] .hero{background-color:#140406}
:root[data-railpoint-theme="dark"] .hero :is(h1,h2,p,.eyebrow){color:#fff}
:root[data-railpoint-theme="dark"] .note a, :root[data-railpoint-theme="dark"] a:not(.btn){color:#ff8a97}
/* Theme selector inside Mehr -> Darstellung */
.rp-theme-picker{padding:14px 16px 16px;border-top:1px solid var(--line,#ddd)}
.rp-theme-label{font-size:13px;font-weight:750;margin:0 0 10px;color:var(--navy,#222)}
.rp-theme-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.rp-theme-choice{appearance:none;border:1px solid var(--line,#ddd);border-radius:11px;padding:10px 5px;min-height:44px;background:var(--card,#fff);color:var(--navy,#222);font-size:12px;font-weight:700;cursor:pointer}
.rp-theme-choice.rp-selected{border-color:#ec0016;box-shadow:inset 0 0 0 1px #ec0016;background:#fff0f1;color:#9e0010}
.rp-theme-hint{font-size:11px;margin-top:9px;color:var(--muted,#666);line-height:1.45}
:root[data-railpoint-theme="dark"] .rp-theme-picker{background:#1c2633;border-color:#344254}
:root[data-railpoint-theme="dark"] .rp-theme-label{color:#f1f5fa}
:root[data-railpoint-theme="dark"] .rp-theme-choice{background:#263445;color:#eff4fb;border-color:#46566c}
:root[data-railpoint-theme="dark"] .rp-theme-choice.rp-selected{background:#52232e;color:#fff;border-color:#ff6475}

/* v83 – targeted readability and contrast repairs across every screen. */
:root[data-railpoint-theme="dark"]{
  --rp-surface:#1c2633;--rp-surface-soft:#243244;--rp-text:#f1f5fa;--rp-sub:#c3cedd;
  --rp-edge:#415369;
}
/* Common elements with fixed light-theme text colors. */
:root[data-railpoint-theme="dark"] :is(
  .changelog-item,.changelog-intro,.changelog-release,.changelog-popup-copy,
  .changelog-empty,.location-help-guide-body,.location-help-guide-body li,
  .location-help-guide-body p,.location-help-note,.menu-section-kicker,
  .legend .row,.legend .section,.legend .note,.area,.info-copy,
  .history-table th,.history-table td,.stat small,.panel-head small,
  .model,.auto-note,.admin-auth-note,.history-item .meta,
  .month-stats,.donut-text,.field label,.details,.formrow,
  .info-item,.change-row,.remember-row,.remember-row small,
  .on-hint,.onboard-card p,.whitecard p,.fieldlabel,
  .help-card p,.about-card p,.about-note,.sheet-note
){color:var(--rp-text)!important}
:root[data-railpoint-theme="dark"] :is(
  .changelog-intro small,.changelog-release-head-copy small,
  .changelog-popup-copy small,.changelog-empty small,
  .legend .note,.legend .section,.location-help-guide-body p,
  .location-help-note,.info-copy small,.stat small,.panel-head small,
  .history-item .meta,.admin-auth-note,.remember-row small,
  .menu-section-kicker,.auto-note
){color:var(--rp-sub)!important}
:root[data-railpoint-theme="dark"] :is(
  .changelog-intro,.changelog-release,.changelog-empty,
  .location-help-note,.location-help-guide-body,
  .info-item,.change-row,.area,.legend-head,.menu-root-entry,
  .menu-root-logout,.help-card,.about-card,.whitecard,.onboard-card,
  .region-label span,.place-tag div,.xbtn,.main-menu-head .menu-back,
  .donut:after,.quick button,.counter,.month-wrap,.history-table,
  .remember-row,.location-help-guide,.dialog-head,.dialog-body
){background-color:var(--rp-surface)!important;border-color:var(--rp-edge)!important}
:root[data-railpoint-theme="dark"] :is(
  .changelog-release,.changelog-intro,.changelog-empty,.location-help-note,
  .info-item,.change-row,.area,.help-card,.about-card,.main-menu-head .menu-back,
  .legend-head,.region-label span,.place-tag div,.xbtn,.quick button,
  .donut-text,.counter,.menu-root-entry,.menu-root-logout
){color:var(--rp-text)!important}
:root[data-railpoint-theme="dark"] :is(
  .changelog-version,.changelog-tag,.changelog-tag.new,
  .changelog-tag.improved,.changelog-tag.fixed
){background:#33445b!important;color:#f3f6fa!important;border-color:#576b85!important}
:root[data-railpoint-theme="dark"] .changelog-tag.new{background:#512630!important;color:#ffd5dc!important;border-color:#97525d!important}
:root[data-railpoint-theme="dark"] .changelog-tag.fixed{background:#193e34!important;color:#b3f8da!important;border-color:#3f816a!important}
:root[data-railpoint-theme="dark"] :is(.changelog-popup-icon,.menu-root-entry .menu-icon){background:#42252c!important;color:#ff8997!important;border-color:#754752!important}
:root[data-railpoint-theme="dark"] .legend :is(.row,.area,.note,.section){color:var(--rp-text)!important}
:root[data-railpoint-theme="dark"] .legend-head{background:var(--rp-surface)!important}
:root[data-railpoint-theme="dark"] :is(.region-label span,.place-tag div){background:#243244!important;color:#fff!important;border-color:#53657b!important}
:root[data-railpoint-theme="dark"] .info-phone a{color:#ff9ba6!important}
:root[data-railpoint-theme="dark"] :is(.quick button,.counter){background:#482b35!important;color:#ffb2bb!important;border-color:#855361!important}
:root[data-railpoint-theme="dark"] .counter.goal-met{background:#1b4136!important;color:#b2f5d5!important;border-color:#377963!important}
/* Preserve authentic EU registration plates and red primary actions. */
:root[data-railpoint-theme="dark"] .plate{background:#fff!important;color:#111827!important}
:root[data-railpoint-theme="dark"] .plate .eu{background:#0755d9!important;color:#fff!important}
:root[data-railpoint-theme="dark"] .plate :not(.eu){color:#111827!important}
:root[data-railpoint-theme="dark"] :is(.primary,.wash-btn,.searchbtn,.btn.primary,.closebtn,.menu-root-entry .menu-icon svg){color:#fff}
/* Avoid the generic colored-header and dark back-button overrides in the fleet page. */
:root[data-railpoint-theme="dark"] .hero .back-live-btn{background:rgba(255,255,255,.1)!important;color:#fff!important;border-color:#8d929e!important}
:root[data-railpoint-theme="dark"] .hero .manage-btn{background:linear-gradient(180deg,#f31521,#d90a14)!important;color:#fff!important}
/* Stronger dark-mode selection and accessible navigation. */
:root[data-railpoint-theme="dark"] .rp-theme-hint{color:var(--rp-sub)!important}
:root[data-railpoint-theme="dark"] .rp-theme-choice.rp-selected{color:#fff!important;background:#6a2433!important;border-color:#ff8997!important}
:root[data-railpoint-theme="dark"] :is(a,button,input,select,textarea):focus-visible{outline:2px solid #ff8997;outline-offset:2px}


/* v84 – screenshot-based dark-mode polish for menus, dialogs, search and BPOL legend. */
:root[data-railpoint-theme="dark"]{
  --rp-surface-2:#223143;--rp-surface-3:#2a3a4d;--rp-edge-2:#51657d;
  --rp-accent-soft:#432730;--rp-accent-edge:#7c4f5b;--rp-accent-text:#ffb3bc;
}
/* Top-right menu button and all sheet chrome buttons must stay visible in dark mode. */
:root[data-railpoint-theme="dark"] :is(.menu-btn,.icon-close,.icon-back,.xbtn,.iconbtn,.tool,.changes-dismiss){
  background:var(--rp-surface-2)!important;
  color:#f4f7fb!important;
  border:1px solid var(--rp-edge)!important;
  box-shadow:none!important;
}
:root[data-railpoint-theme="dark"] :is(.menu-btn,.icon-close,.icon-back,.xbtn,.iconbtn,.tool):hover{
  background:var(--rp-surface-3)!important;
}
:root[data-railpoint-theme="dark"] .tool.closebtn{background:#3a2630!important;color:#fff!important;border-color:#80505e!important}
:root[data-railpoint-theme="dark"] :is(.sheet-head h3,.sheet-head h3 *, .modal h3, .modal h4, .main-menu-head-copy b, .title b){color:#f4f7fb!important}
:root[data-railpoint-theme="dark"] :is(.main-menu-head-copy small,.title small,.modal p,.sheet-head small){color:var(--rp-sub)!important}
:root[data-railpoint-theme="dark"] .menu-arrow{color:#d7e0ea!important}

/* Main menu + submenus: no bright white/red icon tiles, use dark subtle tiles everywhere. */
:root[data-railpoint-theme="dark"] :is(.main-menu-card,.modal-card,.search-float-card){background:var(--rp-surface)!important;border-color:var(--rp-edge)!important}
:root[data-railpoint-theme="dark"] :is(.main-menu-card .menu-entry,.menu-root-entry,.menu-root-logout){
  background:var(--rp-surface)!important;
  border-color:var(--rp-edge)!important;
  box-shadow:none!important;
}
:root[data-railpoint-theme="dark"] :is(.main-menu-card .menu-icon,.menu-root-entry .menu-icon,.menu-root-logout .menu-icon,.menu-entry .menu-icon){
  background:rgba(255,255,255,.035)!important;
  border:1px solid var(--rp-edge-2)!important;
  color:var(--rp-accent-text)!important;
}
:root[data-railpoint-theme="dark"] :is(.main-menu-card .menu-copy b,.menu-root-entry .menu-copy b,.menu-root-logout .menu-copy b,.menu-copy b){color:#f3f7fc!important}
:root[data-railpoint-theme="dark"] :is(.main-menu-card .menu-copy small,.menu-root-entry .menu-copy small,.menu-root-logout .menu-copy small,.menu-copy small){color:var(--rp-sub)!important}

/* VzG/BKM search header and result card readability. */
:root[data-railpoint-theme="dark"] :is(.search-float-card,.search-pro-head,.search-pro-body,.search-pro-result,.search-pro-status){
  background:var(--rp-surface)!important;border-color:var(--rp-edge)!important;
}
:root[data-railpoint-theme="dark"] .search-pro-head{background:linear-gradient(180deg,#1f2c3d 0%, #1c2633 100%)!important}
:root[data-railpoint-theme="dark"] .search-pro-icon{background:var(--rp-accent-soft)!important;border-color:var(--rp-accent-edge)!important;color:var(--rp-accent-text)!important}
:root[data-railpoint-theme="dark"] :is(.search-pro-title h3,.search-pro-field label,.search-pro-result strong){color:#f4f7fb!important}
:root[data-railpoint-theme="dark"] :is(.search-pro-title p,.search-pro-example,.search-pro-example svg,.search-pro-status,.search-pro-result .coords,.coords){color:var(--rp-sub)!important;stroke:var(--rp-sub)!important}
:root[data-railpoint-theme="dark"] .search-pro-actions .btn.secondary{background:#2b394b!important;color:#edf3fa!important;border:1px solid var(--rp-edge)!important}

/* Generic content cards inside sheets / dialogs / status helpers. */
:root[data-railpoint-theme="dark"] :is(.help-card,.about-card,.about-note,.radius-origin,.radius-summary,.radius-item,.empty-state,
.location-permission-status,.location-guide,.search-pro-result,.admin-review-bar,.admin-review-reason,
.location-help-note,.location-help-guide,.dialog,.dialog-head,.dialog-body,.results,.details,.history-item,
.info,.legend,.month-wrap,.radius-item-info,.radius-item-copy,.radius-item-actions button,.radius-list){
  border-color:var(--rp-edge)!important;
}
:root[data-railpoint-theme="dark"] :is(.help-card,.about-card,.radius-origin,.radius-summary,.radius-item,.empty-state,
.location-permission-status,.location-guide,.search-pro-result,.admin-review-bar,.admin-review-reason,.result,
.location-help-note,.location-help-guide,.dialog-head,.dialog-body){
  background:var(--rp-surface)!important;
}
:root[data-railpoint-theme="dark"] :is(.help-card-copy b,.about-card strong,.about-note b,.radius-origin,.radius-origin b,
.radius-item-copy b,.empty-state b,.location-permission-copy b,.location-guide h4,.admin-review-copy b,
.admin-review-reason b,.location-help-status-copy b,.location-help-guide-title,.info-copy b){color:#f4f7fb!important}
:root[data-railpoint-theme="dark"] :is(.help-card-copy p,.about-card,.about-note,.radius-summary,.radius-item-copy small,
.radius-item-info,.empty-state,.location-permission-copy small,.location-guide p,.location-guide ol,.location-guide li,
.admin-review-copy small,.admin-review-reason,.location-help-status-copy small,.location-help-note,
.location-help-guide-body,.location-help-guide-body p,.location-help-guide-body li,.info-copy small){color:var(--rp-sub)!important}
:root[data-railpoint-theme="dark"] .help-card-icon{background:rgba(255,255,255,.045)!important;color:var(--rp-accent-text)!important;border:1px solid var(--rp-edge)!important}

/* Inputs / bars that were still turning white in dark mode. */
:root[data-railpoint-theme="dark"] :is(.textbox,.date-input,.search-field,#search,.search-pro-field .textbox){background:#172230!important;color:#f0f4fa!important;border-color:#4a5c72!important}
:root[data-railpoint-theme="dark"] :is(.textbox,.date-input,.search-field,#search,.search-pro-field .textbox)::placeholder{color:#9eb0c3!important;opacity:1}

/* Radius / action buttons readability. */
:root[data-railpoint-theme="dark"] .radius-btn{background:#223143!important;color:#eef3fa!important;border-color:#475a71!important}
:root[data-railpoint-theme="dark"] .radius-btn.active{background:#ec0016!important;color:#fff!important;border-color:#ec0016!important}
:root[data-railpoint-theme="dark"] :is(.radius-item-actions button,.btn.secondary,.details-btn,.manage-btn,.back-live-btn){background:#2b394b!important;color:#edf3fa!important;border-color:#42556c!important}

/* BPOL legend: improve visibility of dark inline icons and swatches. */
:root[data-railpoint-theme="dark"] .legend .sym{outline:1px solid rgba(255,255,255,.32)!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)!important}
:root[data-railpoint-theme="dark"] .legend .swatch{border-color:rgba(255,255,255,.35)!important}
:root[data-railpoint-theme="dark"] .legend .line{filter:drop-shadow(0 0 1px rgba(255,255,255,.35))}

/* Keep critical primary actions red. */
:root[data-railpoint-theme="dark"] :is(.btn.primary,.wash-btn,.searchbtn,.primary){background:#ec0016!important;color:#fff!important;border-color:#ec0016!important}


/* v85 – precise corrections to visible screenshot issues. Scoped to dark mode. */
/* BPOL toolbar belongs above the map; never a solid rectangular strip. */
:root[data-railpoint-theme="dark"] .searchbar{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:inherit!important;
  padding:0!important;
}
:root[data-railpoint-theme="dark"] .searchbar input,
:root[data-railpoint-theme="dark"] .searchbar #search{
  background:#1a2736!important;
  color:#f2f6fb!important;
  border:1px solid #51647b!important;
  border-radius:13px!important;
  box-shadow:0 5px 20px rgba(0,0,0,.24)!important;
}
:root[data-railpoint-theme="dark"] .searchbar .searchbtn{
  background:#ec0016!important;color:#fff!important;border:0!important;border-radius:12px!important;
}
:root[data-railpoint-theme="dark"] .searchbar .locate-search{
  background:#253447!important;color:#f2f6fb!important;
  border:1px solid #51647b!important;border-radius:12px!important;
  box-shadow:0 5px 20px rgba(0,0,0,.24)!important;
}
:root[data-railpoint-theme="dark"] .searchbar :is(button,input){min-height:40px}
/* Signalkatalog: remove white filter background, improve descriptions and button contrast. */
:root[data-railpoint-theme="dark"] .tools{
  background:#111821!important;
  color:#eef4fa!important;
  border-color:#344254!important;
}
:root[data-railpoint-theme="dark"] .filters{
  background:transparent!important;
  color:#eef4fa!important;
  border:0!important;
  box-shadow:none!important;
}
:root[data-railpoint-theme="dark"] .filter{
  background:#243244!important;
  border:1px solid #47596f!important;
  color:#eaf1f9!important;
}
:root[data-railpoint-theme="dark"] .filter.active{
  background:#ec0016!important;border-color:#ec0016!important;color:#fff!important;
}
:root[data-railpoint-theme="dark"] .detailbody,
:root[data-railpoint-theme="dark"] .detailbody b{
  color:#e3ebf5!important;
}
:root[data-railpoint-theme="dark"] .details>button{
  background:#293a4e!important;
  color:#f4f7fb!important;
  border-color:#53667c!important;
}
:root[data-railpoint-theme="dark"] .badge:not(.east):not(.west):not(.both){
  background:#293b4e!important;color:#ecf2fa!important;border-color:#5c6d81!important;
}
:root[data-railpoint-theme="dark"] :is(.east,.west,.both){
  background:#253548!important;color:#eaf1fb!important;border-color:#51637b!important;
}
:root[data-railpoint-theme="dark"] .source{color:#b9c8d7!important}
:root[data-railpoint-theme="dark"] .meta b{color:#eef4fb!important}
:root[data-railpoint-theme="dark"] .meta small{color:#bac9d8!important}
/* Keep technical signal drawings legible on their original light background. */
:root[data-railpoint-theme="dark"] .signalImages{background:#f4f5f6!important;border-color:#687889!important}
:root[data-railpoint-theme="dark"] .signalImages img{background:#fff!important}
/* Poolfahrzeuge: donut center should match dark card, with clear white counters. */
:root[data-railpoint-theme="dark"] .month-wrap,
:root[data-railpoint-theme="dark"] .month-stats{
  background:#1c2633!important;color:#f0f5fb!important;
}
:root[data-railpoint-theme="dark"] .donut{
  background:conic-gradient(#ed0a16 0 var(--p),#39495c var(--p) 100%)!important;
}
:root[data-railpoint-theme="dark"] .donut:after{
  background:#1c2633!important;
  border:1px solid #52667d!important;
}
:root[data-railpoint-theme="dark"] .donut-text,
:root[data-railpoint-theme="dark"] .donut-text small{
  color:#f2f6fb!important;
}
:root[data-railpoint-theme="dark"] .month-stats div{border-bottom-color:#47596e!important}
:root[data-railpoint-theme="dark"] .month-note{background:#26354a!important;color:#e1e9f4!important}


/* v86: cohesive signal learning/quiz dark mode and BPOL floating search bar. */
:root[data-railpoint-theme="dark"] .hero{
  background:#1c2633!important;
  border-color:#415369!important;
  color:#f1f5fa!important;
}
:root[data-railpoint-theme="dark"] .hero :is(h1,p){color:#f1f5fa!important}
:root[data-railpoint-theme="dark"] .heroIcon{
  background:#42252c!important;
  border-color:#754752!important;
  color:#ff9eaa!important;
}
:root[data-railpoint-theme="dark"] :is(.prompt,.learnName,.quizQuestion,.score,.result,.answer,.learnCode){
  color:#e8eef7!important;
}
:root[data-railpoint-theme="dark"] :is(.prompt,.score){color:#c3cedd!important}
:root[data-railpoint-theme="dark"] .answer{
  background:#243244!important;
  border-left-color:#ed0a16!important;
}
:root[data-railpoint-theme="dark"] .learnImage{
  background:#f4f5f6!important;
  border-color:#66768a!important;
}
:root[data-railpoint-theme="dark"] .learnImage img{background:#fff!important}
:root[data-railpoint-theme="dark"] .quizOptions .qopt{
  background:#243244!important;
  color:#eff4fa!important;
  border:1px solid #4d6078!important;
}
:root[data-railpoint-theme="dark"] .quizOptions .qopt:hover{
  background:#303f53!important;
}
:root[data-railpoint-theme="dark"] .quizOptions .qopt.correct{
  background:#174a38!important;
  color:#e2fff0!important;
  border-color:#58bd8c!important;
}
:root[data-railpoint-theme="dark"] .quizOptions .qopt.wrong{
  background:#5b2631!important;
  color:#ffe5e8!important;
  border-color:#e47d91!important;
}
:root[data-railpoint-theme="dark"] .study .actions .secondary,
:root[data-railpoint-theme="dark"] .quiz .actions .secondary{
  background:#2b394b!important;
  color:#f1f5fa!important;
  border:1px solid #51647b!important;
}
:root[data-railpoint-theme="dark"] .quiz .result{
  background:transparent!important;
  color:#edf4fa!important;
}
:root[data-railpoint-theme="dark"] .searchbar{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  gap:8px!important;
}
:root[data-railpoint-theme="dark"] .searchbar > *{
  box-shadow:0 5px 18px rgba(0,0,0,.26)!important;
}


/* v87 - Map control bar: dark/light separation, preserve DB-red active actions. */
:root[data-railpoint-theme="dark"] .maptools > button:not(.active):not(.compass-btn){
  background:#243244!important;
  color:#f1f5fa!important;
  border:1px solid #51647b!important;
  box-shadow:0 6px 18px rgba(0,0,0,.34)!important;
}
:root[data-railpoint-theme="dark"] .maptools > button:not(.active):not(.compass-btn):hover{
  background:#304258!important;
  border-color:#7287a1!important;
}
:root[data-railpoint-theme="dark"] .maptools > button:not(.active):not(.compass-btn) svg{
  color:#f1f5fa!important;
  stroke:#f1f5fa!important;
}
:root[data-railpoint-theme="dark"] .maptools > button.active:not(.compass-btn){
  background:#ec0016!important;
  color:#fff!important;
  border:1px solid #ec0016!important;
}
:root[data-railpoint-theme="dark"] .maptools > button.active svg{
  stroke:#fff!important;
}
:root[data-railpoint-theme="dark"] .gps-accuracy-badge{
  background:#243244!important;
  color:#f1f5fa!important;
  border:1px solid #51647b!important;
  box-shadow:0 6px 18px rgba(0,0,0,.34)!important;
}
:root[data-railpoint-theme="dark"] .maptools .compass-btn{
  background:#243244!important;
  color:#f1f5fa!important;
  border:1px solid #51647b!important;
  box-shadow:0 6px 18px rgba(0,0,0,.34)!important;
}
:root[data-railpoint-theme="dark"] .maptools .compass-btn .ring{
  fill:#243244!important;
  stroke:#becbdd!important;
}
:root[data-railpoint-theme="dark"] .maptools .compass-btn .south{
  fill:#d4dfeb!important;
}
:root[data-railpoint-theme="dark"] .maptools .compass-btn .hub{
  fill:#243244!important;
  stroke:#d4dfeb!important;
}
:root[data-railpoint-theme="dark"] .maptools .compass-btn .north,
:root[data-railpoint-theme="dark"] .maptools .compass-btn .compass-n{
  fill:#ff5665!important;
}
:root[data-railpoint-theme="dark"] .maptools > button:disabled{
  opacity:.52;
}


/* v88: header quick light/dark toggle; icons inherit active theme state. */
.rp-quick-theme{width:40px;height:40px;flex:0 0 40px;border-radius:13px;
 display:grid;place-items:center;cursor:pointer;background:#f3f3f3;color:#242c36;
 border:1px solid #d8dee7;padding:0;transition:background-color .15s,color .15s}
.rp-quick-theme svg{width:20px;height:20px;fill:none;stroke:currentColor;
 stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;grid-area:1/1}
.rp-quick-theme .rp-icon-sun{display:none}
:root[data-railpoint-theme="dark"] .rp-quick-theme{
 background:#273647!important;color:#f2f5fb!important;border-color:#53657b!important}
:root[data-railpoint-theme="dark"] .rp-quick-theme .rp-icon-moon{display:none}
:root[data-railpoint-theme="dark"] .rp-quick-theme .rp-icon-sun{display:block}
.rp-quick-theme:focus-visible{outline:2px solid #ed0a16;outline-offset:2px}

/* v89: high-contrast quick theme switch in both themes.
   Sun = current light appearance; Moon = current dark appearance. */
:root:not([data-railpoint-theme="dark"]) #rpQuickTheme{
  background:#e1e8f0!important;
  color:#17283b!important;
  border:1.5px solid #99aabd!important;
  box-shadow:0 1px 3px rgba(22,39,57,.17)!important;
}
:root:not([data-railpoint-theme="dark"]) #rpQuickTheme:hover{
  background:#d3dfea!important;
}
:root[data-railpoint-theme="dark"] #rpQuickTheme{
  background:#26394f!important;
  color:#fff3c4!important;
  border:1.5px solid #71839a!important;
  box-shadow:0 1px 4px rgba(0,0,0,.24)!important;
}
/* Explicit display rules prevent the previous crescent-only/poor visibility. */
:root:not([data-railpoint-theme="dark"]) #rpQuickTheme .rp-icon-sun{display:block!important}
:root:not([data-railpoint-theme="dark"]) #rpQuickTheme .rp-icon-moon{display:none!important}
:root[data-railpoint-theme="dark"] #rpQuickTheme .rp-icon-sun{display:none!important}
:root[data-railpoint-theme="dark"] #rpQuickTheme .rp-icon-moon{display:block!important}
#rpQuickTheme svg{width:22px!important;height:22px!important;flex:none;pointer-events:none}
#rpQuickTheme .rp-icon-sun{fill:none;stroke:currentColor;stroke-width:2.2}
#rpQuickTheme .rp-icon-moon{fill:currentColor;stroke:none}
#rpQuickTheme:active{transform:scale(.96)}

/* v90: make theme toggle icon reliable, independent of SVG fills/strokes. */
#rpQuickTheme .rp-quick-symbol{
 display:grid!important;place-items:center!important;
 width:100%!important;height:100%!important;
 font-family:Arial,"Segoe UI Symbol",sans-serif!important;
 font-size:25px!important;font-weight:700!important;
 line-height:1!important;color:inherit!important;
 user-select:none!important;pointer-events:none!important;
}
:root[data-railpoint-theme="dark"] #rpQuickTheme .rp-quick-symbol{font-size:27px!important}

/* v91: professional monochrome theme control. No text glyphs or emoji.
   Moon is the action in light mode; Sun is the action in dark mode. */
#rpQuickTheme {
  box-sizing:border-box!important; width:40px!important; height:40px!important;
  min-width:40px!important; min-height:40px!important;
  padding:0!important; display:grid!important; place-items:center!important;
  border-radius:12px!important;
  transition:background-color .15s ease,border-color .15s ease!important;
}
:root:not([data-railpoint-theme="dark"]) #rpQuickTheme {
  background:#edf1f5!important; color:#243346!important;
  border:1px solid #c8d0da!important; box-shadow:none!important;
}
:root:not([data-railpoint-theme="dark"]) #rpQuickTheme:hover {
  background:#e2e8ef!important; border-color:#a3b2c4!important;
}
:root[data-railpoint-theme="dark"] #rpQuickTheme {
  background:#263548!important; color:#e7eef8!important;
  border:1px solid #52647a!important; box-shadow:none!important;
}
:root[data-railpoint-theme="dark"] #rpQuickTheme:hover {
  background:#34455b!important; border-color:#7f91a8!important;
}
#rpQuickTheme .rp-theme-icon {
  box-sizing:content-box!important; display:block!important;
  width:20px!important; height:20px!important; max-width:none!important;
  fill:none!important; stroke:currentColor!important; stroke-width:1.85!important;
  stroke-linecap:round!important; stroke-linejoin:round!important;
  overflow:visible!important; pointer-events:none!important;
}
#rpQuickTheme .rp-theme-icon .rp-theme-moon,
#rpQuickTheme .rp-theme-icon .rp-theme-sun {
  fill:none!important; stroke:currentColor!important; stroke-width:1.85!important;
}
:root:not([data-railpoint-theme="dark"]) #rpQuickTheme .rp-theme-moon {display:inline!important}
:root:not([data-railpoint-theme="dark"]) #rpQuickTheme .rp-theme-sun {display:none!important}
:root[data-railpoint-theme="dark"] #rpQuickTheme .rp-theme-moon {display:none!important}
:root[data-railpoint-theme="dark"] #rpQuickTheme .rp-theme-sun {display:inline!important}
#rpQuickTheme:focus-visible {outline:2px solid #ed0a16!important;outline-offset:2px!important}

/* v108: Only the "Fahrzeugübersicht" heading has no dark-mode background. */
:root[data-railpoint-theme="dark"] body .sectionbar,
:root[data-railpoint-theme="dark"] body .sectionbar .section-title,
:root[data-railpoint-theme="dark"] body .sectionbar h2 {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border: 0 !important;
}


/* v109 – compact, consistent first-run introduction (iPhone/Android/desktop).
   Scoped to #onboarding to prevent side effects in other RailPoint screens. */
#onboarding.screen.onboard{
  padding: max(18px,env(safe-area-inset-top,0px)) 16px max(18px,env(safe-area-inset-bottom,0px));
  background: radial-gradient(ellipse at 50% 0%,#b20d20 0%,#770b18 57%,#3b1019 100%) !important;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
}
#onboarding .onboard-card{
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:center;
  width:min(100%,420px);
  max-width:420px;
  min-width:0;
  margin:auto;
  padding:clamp(20px,5vw,28px) clamp(18px,5vw,26px) 22px;
  background:#1c2633 !important;
  color:#f3f6fb !important;
  border:1px solid rgba(180,195,214,.18) !important;
  border-radius:24px !important;
  box-shadow:0 24px 58px rgba(0,0,0,.33);
  text-align:center;
}
#onboarding .onboard-card .logo{
  display:block;
  width:70px;
  height:70px;
  border-radius:18px;
  flex:0 0 auto;
  filter:drop-shadow(0 7px 12px rgba(0,0,0,.20));
}
#onboarding .dots{margin:17px 0 14px;gap:8px}
#onboarding .dot{width:7px;height:7px;background:#68768a}
#onboarding .dot.active{width:23px;background:#f4f7fa}
#onboarding .on-step{font-size:11px;font-weight:800;letter-spacing:.17em;color:#c4d0de;opacity:1}
#onboarding .onboard-card h2{
  max-width:100%;
  margin:10px 0 10px;
  font-size:clamp(23px,5.6vw,29px);
  line-height:1.17;
  letter-spacing:-.035em;
  color:#f5f7fb !important;
  overflow-wrap:break-word;
}
#onboarding .onboard-card p{
  max-width:345px;
  margin:0;
  font-size:clamp(13px,3.6vw,15px);
  line-height:1.5;
  font-weight:400;
  color:#e0e7f1 !important;
  overflow-wrap:break-word;
}
#onboarding .on-hint{
  width:100%;
  max-width:100%;
  margin:17px 0 19px;
  padding:12px 14px;
  border:1px solid #4b5b6f !important;
  border-radius:14px !important;
  background:#283649 !important;
  color:#dce5ef !important;
  font-size:12.5px;
  line-height:1.45;
  overflow-wrap:break-word;
}
#onboarding .on-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  width:100%;
}
#onboarding .on-actions .btn{
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  width:100%;
  min-width:0;
  min-height:46px;
  height:auto;
  padding:11px 12px;
  border-radius:12px !important;
  font-size:14px;
  line-height:1.2;
  white-space:normal;
}
#onboarding .on-actions .btn.secondary{
  background:#324258 !important;
  border:1px solid #50637b !important;
  color:#f5f7fa !important;
}
#onboarding #onNext.btn.primary{
  background:#ec0016 !important;
  border:1px solid #ec0016 !important;
  color:#fff !important;
}
#onboarding .on-actions .btn:focus-visible{outline:2px solid #fff;outline-offset:3px}
@media(max-width:360px){
  #onboarding.screen.onboard{padding-left:12px;padding-right:12px}
  #onboarding .onboard-card{padding:19px 16px}
  #onboarding .on-hint{margin:14px 0 16px}
  #onboarding .on-actions{gap:8px}
}
@media(max-height:650px){
  #onboarding.screen.onboard{align-items:flex-start}
  #onboarding .onboard-card{margin:auto}
  #onboarding .onboard-card .logo{width:54px;height:54px}
  #onboarding .dots{margin:11px 0 9px}
  #onboarding .onboard-card h2{margin:7px 0}
  #onboarding .on-hint{margin:11px 0 13px}
}
