.bahn-menu-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bahn-menu-button {
  display: inline-grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #384a5c;
  border-radius: 10px;
  background: #172332;
  color: #deebf5;
  cursor: pointer;
  touch-action: manipulation;
}

.bahn-menu-button:hover { background: #203548; }
.bahn-menu-button svg, .bahn-menu-links svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#bahntrainer-menu {
  position: fixed;
  inset: 0 auto 0 0;
  box-sizing: border-box;
  width: min(350px, calc(100% - 46px));
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0 16px max(20px, env(safe-area-inset-bottom));
  border: 0;
  border-right: 1px solid #344654;
  border-radius: 0;
  background: #121d29;
  color: #eef4fa;
  box-shadow: 16px 0 56px #0006;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-top: calc(max(16px, env(safe-area-inset-top)) + 68px);
  touch-action: pan-y;
  transform: translate3d(var(--bahn-menu-x,0px),0,0);
}

#bahntrainer-menu[open] { display: flex; flex-direction: column; will-change: transform; }
#bahntrainer-menu::backdrop { background:transparent; }
.bahn-menu-shade {position:fixed;inset:0;z-index:2147480000;background:#05090fcc;pointer-events:none;will-change:opacity;}
.bahn-menu-shade[hidden] {display:none;}
html:has(#bahntrainer-menu[open]) { overflow: hidden; }

.bahn-menu-head {
  position: sticky;
  flex: none;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: max(16px, env(safe-area-inset-top)) 2px 12px;
  margin-bottom: 12px;
  background: inherit;
  border-bottom: 1px solid var(--ui-border,#304356);
}
.bahn-menu-head img { border-radius: 10px; }
#bahntrainer-menu .bahn-menu-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 20px; font-weight: 750; overflow-wrap: anywhere; }
.bahn-menu-close { flex-basis: 38px; width: 38px; height: 38px; background: transparent; border-color: transparent; }
.bahn-menu-label { margin: 0 0 10px 8px; color: #9eb3c8; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.bahn-menu-links { display: grid; grid-template-columns: minmax(0,1fr); gap: 4px; }
.bahn-menu-head, .bahn-menu-label, .bahn-menu-links, .bahn-menu-foot { flex-shrink: 0; }
.bahn-menu-links :is(a,.bahn-menu-backup) {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 49px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  text-decoration: none;
  color: #d0deea;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}
.bahn-menu-links :is(a,.bahn-menu-backup) svg { flex: 0 0 21px; color: #96c9e7; }
.bahn-menu-links :is(a,.bahn-menu-backup) small { display: block; margin-top: 2px; color: #a3b8c9; font-size: 11px; font-weight: 500; }
.bahn-menu-links :is(a,.bahn-menu-backup):hover { background: #1b2c3c; }
.bahn-menu-links :is(a,.bahn-menu-backup)[aria-current="page"] { border-color: #41637c; background: #203648; color: #bce9ff; }
.bahn-menu-links :is(a,.bahn-menu-backup)[aria-current="page"]::after {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  border-radius: 50%;
  background: #9cddff;
  margin-left: auto;
}

.bahn-menu-foot { margin-top: auto; padding-top: 24px; }
.bahn-menu-about {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid #304556;
  border-radius: 11px;
  background: #172735;
  color: #d0e0eb;
  font: 600 13px/1.4 system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}
.bahn-menu-about:hover { background: #203648; }
.bahn-menu-about > span {min-width:0;overflow-wrap:anywhere}
.bahn-info-symbol { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border: 1.5px solid #96c9e7; border-radius: 50%; color: #bce9ff; font-size: 16px; font-weight: 750; }
.bahn-menu-about small { display: block; margin-top: 2px; color: #94adbf; font-size: 10px; font-weight: 400; }
.bahn-menu-about:focus-visible, #bahntrainer-info :is(a,button,summary):focus-visible { outline: 2px solid #bce9ff; outline-offset: 3px; }

#bahntrainer-info {
  box-sizing: border-box;
  width: min(600px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #3a566b;
  border-radius: 18px;
  background: #14212d;
  color: #e5eff7;
  box-shadow: 0 24px 90px #0008;
  font: 400 14px/1.6 system-ui, sans-serif;
}
#bahntrainer-info[open] {display:grid;grid-template-rows:auto minmax(0,1fr)}
#bahntrainer-info::backdrop { background: #050b12bd; }
html:has(#bahntrainer-info[open]) { overflow: hidden; }
.bahn-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--ui-border,#304356);
}
.bahn-info-body {min-height:0;overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:8px;padding:0 24px 24px}
#bahntrainer-info h2 { margin: 0; color: inherit; font-size: 25px; font-weight: 700; line-height: 1.3; letter-spacing: -.5px; }
#bahntrainer-info .bahn-info-kicker { margin: 0 0 5px; color: #96c9e7; font-size: 10px; font-weight: 650; letter-spacing: .13em; }
#bahntrainer-info .bahn-info-version { display: inline-block; margin: 14px 0 6px; padding: 2px 9px; border: 1px solid #3d586d; border-radius: 20px; color: #b7dff3; font-size: 11px; }
.bahn-info-intro { margin: 12px 0 20px; color: #c1d1de; }
.bahn-info-facts { display: grid; gap: 14px; margin: 0 0 24px; }
.bahn-info-facts dt { color: #e5eff7; font-size: 12px; font-weight: 700; }
.bahn-info-facts dd { margin: 3px 0 0; color: #9fb6c8; font-size: 12px; }
.bahn-info-actions {display:grid;gap:8px}
.bahn-app .bahn-info-actions .bahn-secondary-action {justify-content:flex-start;text-align:left}
.bahn-history { border: 1px solid #38556b; border-radius: 12px; background: #101c26; }
.bahn-history summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; list-style: none; cursor: pointer; color: #dfecf5; font-size: 14px; font-weight: 650; }
.bahn-history summary::-webkit-details-marker { display: none; }
.bahn-history summary::after { content: ""; flex: none; width: 8px; height: 8px; border: solid currentColor; border-width: 0 1.7px 1.7px 0; transform: rotate(45deg); color: #9ccde8; margin: -3px 4px 2px; }
.bahn-history details[open] > summary::after, .bahn-history[open] > summary::after { transform: rotate(225deg); margin-block: 3px -2px; }
.bahn-history summary small { display: block; margin-top: 2px; color: #8da6b9; font-size: 10px; font-weight: 400; line-height: 1.5; }
.bahn-history-content { padding: 0 12px 12px; }
.bahn-history-intro { margin: 0 2px 14px; color: #9db2c3; font-size: 12px; }
.bahn-history-versions { list-style: none; padding: 0; margin: 12px 0 0; }
.bahn-history-entry { margin-top: 6px; border: 1px solid #2d4354; border-radius: 9px; background: #172633; }
.bahn-history-entry summary { padding: 10px 12px; font-size: 12px; }
.bahn-history-entry summary strong { font-weight: 650; }
.bahn-history-entry ul { margin: 0; padding: 0 15px 12px 30px; color: #bdcfdc; font-size: 12px; }
.bahn-history-entry li { margin: 6px 0; padding-left: 2px; }
.bahn-history-entry li::marker { color: #96c9e7; }
.bahn-history-day-area {margin:14px 14px 7px;color:#e5eff7;font-size:13px;line-height:1.4;font-weight:650}
.bahn-history-retry { min-height: 44px; padding: 8px 12px; border: 1px solid #45687f; border-radius: 8px; background: #203b4e; color: #e1f1fc; font: inherit; cursor: pointer; }

@media (max-width: 520px) {
  #bahntrainer-info { max-height: calc(100dvh - 24px); }
  .bahn-info-head {padding:14px 16px 10px}
  .bahn-info-body {padding-inline:16px;padding-bottom:16px}
  #bahntrainer-info h2 { font-size: 22px; }
}

@media (max-width: 520px) {
  .bahn-menu-identity { gap: 8px; }
  .bahn-menu-identity > .brand > :is(.mark, .brand-mark) { display: none; }
}

/* Shared navigation stays readable across all trainer themes. */
.bahn-menu-button{width:44px;height:44px;flex-basis:44px;border-radius:12px}
.bahn-menu-label{font-size:11px;letter-spacing:.1em;color:#b5c7d7}
.bahn-menu-links{gap:5px}
.bahn-menu-links :is(a,.bahn-menu-backup){min-height:52px;border-radius:11px;padding:11px 12px;font-size:15px;font-weight:600}
.bahn-menu-links :is(a,.bahn-menu-backup) small{font-size:12px;line-height:1.45;color:#b3c5d4}
.bahn-menu-about{min-height:60px;border-radius:12px;font-size:14px}
.bahn-menu-about small{font-size:12px;color:#b0c4d2}
#bahntrainer-info{line-height:1.6}
.bahn-info-facts dt{font-size:13px}.bahn-info-facts dd{font-size:13px;color:#b4c7d6}
.bahn-history summary{min-height:48px}.bahn-history summary small{font-size:12px;color:#afc3d2}
.bahn-history-entry summary{font-size:13px}.bahn-history-entry ul{font-size:13px;line-height:1.6}

.bahn-data-open{cursor:pointer}
.bahn-data-open:disabled{opacity:.65;cursor:wait}
.bahn-data-status{margin:8px 0 0;color:#bed2e2;font-size:12px}
.bahn-data-status:empty{margin:0}
.bahn-info-actions ~ .bahn-history {margin-top:14px}

/* Task groups keep the familiar trainer names within one compact menu. */
.bahn-menu-group {display:grid;grid-template-columns:minmax(0,1fr);gap:3px;margin-top:10px}
.bahn-menu-group h3 {margin:10px 12px 4px;color:#b5c7d7;font-size:11px;line-height:1.5;letter-spacing:.08em;text-transform:uppercase}
.bahn-menu-backup {width:100%;background:transparent;cursor:pointer;font-family:inherit;text-align:left}
.bahn-menu-trainers {min-width:0}
.bahn-menu-trainers > summary {min-height:44px;padding:11px 12px;cursor:pointer;color:#d0deea;font-size:14px;font-weight:600;border-radius:9px}
.bahn-menu-trainers > summary:hover {background:#1b2c3c}
.bahn-menu-trainers[open] {padding-bottom:5px;border-bottom:1px solid #2b4052}
.bahn-menu-trainers > a {margin-left:8px}
.bahn-menu-links :is(a,.bahn-menu-backup) > span {min-width:0;overflow-wrap:anywhere}
.bahn-menu-links :is(a,.bahn-menu-backup) {min-height:44px;padding-block:9px}
#bahn-link-notice {margin:8px 0 14px;padding:10px 12px;border:1px solid var(--ui-border,#304356);border-radius:10px;background:var(--ui-surface,#162331);color:var(--ui-text,#eef4fa);font-size:14px;line-height:1.5}
.bahn-menu-trainers > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; }
.bahn-menu-trainers > summary::-webkit-details-marker { display: none; }
.bahn-menu-trainers > summary .ui-icon { width: 17px; height: 17px; }
.bahn-menu-trainers[open] > summary .ui-icon { transform: rotate(180deg); }
