:root {
  color-scheme: dark;
  --bg: #000;
  --card: #111827;
  --border: #1f2937;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #a78bfa;
  --green: #34d399;
  --park: #60a5fa;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

/* Accessible focus ring (keyboard / :focus-visible) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: calc(72px + var(--safe-bottom));
}

/* —— Sticky status header (v23) —— */
.status-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 8px;
  position: sticky;
  top: 0;
  background: rgba(0,0,0,.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 30;
  border-bottom: 1px solid var(--border);
}
.status-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.status-hero { flex: 1; min-width: 0; }
.status-hero-primary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.status-range {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #c4b5fd;
  line-height: 1.05;
}
.status-soc {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.05;
}
.status-secondary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.status-soh {
  margin-top: 1px;
  font-size: .78rem;
  font-weight: 600;
  color: #a78bfa;
  opacity: .9;
}
.status-meta {
  margin-top: 1px;
  font-size: .62rem;
  opacity: .55;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}
.status-meta .sep { opacity: .4; }
.status-meta .api-cost { color: #fbbf24; }
.status-meta .api-left { color: var(--green); }
.status-place {
  margin-top: 4px;
  font-size: .72rem;
  color: var(--muted);
  opacity: .85;
  line-height: 1.3;
  padding: 0 2px;
}
.dim { opacity: .45; font-size: .75rem; }

/* legacy class aliases (older templates) */
.soc-pct { font-size: 1.45rem; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.soc-range { font-size: .95rem; font-weight: 600; color: #c4b5fd; }

/* Overflow menu */
.menu { position: relative; }
.menu summary {
  list-style: none;
  cursor: pointer;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: #1f2937;
  display: grid; place-items: center;
  font-size: 1.3rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute;
  right: 0; top: 48px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  min-width: 180px;
  padding: 8px;
  display: grid;
  gap: 4px;
  z-index: 40;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.menu-panel a, .menu-panel button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text);
  padding: 10px 12px; border-radius: 8px;
  text-decoration: none; font: inherit; cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: #1f2937; }

/* Desktop top tabs — hidden on phone */
.top-tabs {
  display: none;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 210px;
  background: rgba(0,0,0,.94);
  z-index: 25;
  backdrop-filter: blur(10px);
}
.top-tabs a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
}
.top-tabs a.active, .top-tabs a:hover {
  background: #1f2937;
  color: var(--accent);
}

/* Mobile bottom nav */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: rgba(10,10,12,.96);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  z-index: 30;
  backdrop-filter: blur(10px);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 10px;
}
.bottom-nav a .nav-icon { font-size: 1.15rem; line-height: 1.2; }
.bottom-nav a.active { color: var(--accent); }

.page { max-width: 720px; margin: 0 auto; }
.page-title { font-size: 1.05rem; margin: 16px 16px 10px; opacity: .9; }
.page-footer, .empty, footer { padding: 16px; opacity: .45; font-size: .8rem; }
.sub-pad { padding: 0 16px 8px; opacity: .55; font-size: .85rem; }
.detail-back { padding: 10px 16px; }
.detail-back a { color: var(--accent); text-decoration: none; font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px 8px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}
.label {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .68rem;
  opacity: .55;
}
.value { font-size: 1.55rem; font-weight: 700; margin-top: 4px; }
.value.smallish { font-size: 1.15rem; }
.meta { opacity: .45; font-size: .72rem; margin-top: 5px; }

h2 { font-size: .95rem; margin: 18px 16px 10px; opacity: .8; }

.trip-list { display: grid; gap: 8px; padding: 0 16px 16px; }
.trip-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}
.charge-card { border-left: 3px solid var(--green); }
.park-card { border-left: 3px solid var(--park); }
.leg { margin-bottom: 10px; }
.leg-time { font-size: .78rem; opacity: .55; margin-bottom: 3px; }
.leg-addr { font-size: .92rem; line-height: 1.35; }
.leg-stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  opacity: .85;
}
.leg-stats .km { color: var(--accent); font-weight: 700; font-size: 1.05rem; opacity: 1; }

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}
.dot.start { background: #9ca3af; }
.dot.end { background: #ef4444; }
.dot.charge { background: var(--green); }
.dot.park { background: var(--park); }

/* Trip map preview + fullscreen overlay (v9) */
.map-preview-wrap {
  position: relative;
  width: 100%;
}
#map, .map-preview {
  height: 280px;
  width: 100%;
  cursor: pointer;
}
@media (max-width: 719px) {
  #map, .map-preview { height: 200px; }
}
.map-expand-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(17, 24, 39, .92);
  color: #f3f4f6;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
}
.map-expand-btn:active { transform: scale(0.98); }
.map-empty { padding: 40px 16px; text-align: center; opacity: .5; }

.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}
.map-overlay[hidden] { display: none !important; }
.map-overlay-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px calc(10px + env(safe-area-inset-top, 0px));
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(0,0,0,.92);
  border-bottom: 1px solid var(--border);
}
.map-overlay-hint {
  font-size: .78rem;
  opacity: .55;
  letter-spacing: .01em;
}
@media (min-width: 720px) {
  .map-overlay-hint { visibility: hidden; }
}
.map-overlay-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: #1f2937;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.map-fullscreen {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}
body.map-overlay-open {
  overflow: hidden;
  touch-action: none;
}
.addr-block { padding: 10px 16px; display: grid; gap: 12px; }
.addr-line { opacity: .65; font-size: .9rem; margin: 4px 0 0 16px; }
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 16px 24px;
}
.metric {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border);
}

.flash {
  margin: 10px 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .9rem;
}
.flash.ok { background: #052e1a; color: #86efac; }
.flash.err { background: #3f0a0a; color: #fca5a5; }

.pwd-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  max-width: 420px;
}
.pwd-form label { display: grid; gap: 6px; font-size: .85rem; opacity: .8; }
.pwd-form input {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #111827;
  color: #fff;
}
.pwd-form button {
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  cursor: pointer;
}

.placeholder {
  padding: 48px 24px;
  text-align: center;
  opacity: .7;
}
.placeholder h2 { font-size: 1.3rem; margin: 0 0 8px; opacity: 1; }
.placeholder p { margin: 0; font-size: .95rem; }

/* Desktop: top tabs, hide bottom nav */
@media (min-width: 720px) {
  body { padding-bottom: 40px; }
  .bottom-nav { display: none; }
  .top-tabs { display: flex; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .page { max-width: 900px; }
}

.recent { padding: 0 16px 8px; display: grid; gap: 10px; }
.recent h2 { margin: 8px 0 2px; }
.card-kicker { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; opacity: .55; margin-bottom: 8px; }
.park-card { border-left: 3px solid #60a5fa; }
.dot.park { background: #60a5fa; }
.trip-card.muted { opacity: .7; }
.empty-inline { margin: 0; opacity: .5; font-size: .9rem; }

.wh-block { padding: 4px 16px 12px; }
.wh-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wh-cell { background: #111827; border: 1px solid #1f2937; border-radius: 14px; padding: 12px 8px; text-align: center; }
.wh-cell .value { font-size: 1.25rem; font-weight: 700; margin-top: 4px; color: #a78bfa; }
.wh-note { font-size: .72rem; opacity: .45; margin: 8px 0 0; line-height: 1.35; }
@media (max-width: 420px) {
  .wh-grid { grid-template-columns: 1fr 1fr; }
}

/* —— v5: 4-item bottom nav (no Reifen) —— */
.bottom-nav {
  grid-template-columns: repeat(4, 1fr);
}
.bottom-nav a {
  font-size: .68rem;
  padding: 6px 4px;
}
.bottom-nav a .nav-icon { font-size: 1.15rem; }

.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover { border-color: #374151; }

.badge-night {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #1e3a5f;
  color: #93c5fd;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.park-card.overnight { border-left-color: #f59e0b; }

.inline-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.inline-link:hover { text-decoration: underline; }

.tpms-dash { padding: 0 16px 8px; }
.tpms-card .tpms-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: .95rem;
  font-weight: 600;
  color: #c4b5fd;
}
.tpms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 16px 16px;
}
.tpms-corner .value { color: var(--accent); }
.tip { font-size: .78rem; opacity: .55; }
.tip code { font-size: .75rem; opacity: .85; }

.energy-form { margin-bottom: 8px; }
.form-hint { font-size: .72rem; opacity: .45; margin: 0; line-height: 1.35; }

.table-wrap { padding: 0 16px 24px; overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .55;
  font-weight: 600;
}
.data-table td:not(:first-child) { font-variant-numeric: tabular-nums; color: #c4b5fd; }
.muted-val { opacity: .4; }

@media (min-width: 720px) {
  .top-tabs a { padding: 8px 12px; font-size: .85rem; }
  .tpms-grid { grid-template-columns: repeat(4, 1fr); }
}

.api-warn {
  margin: 10px 16px 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .82rem;
  line-height: 1.35;
  color: #fcd34d;
  background: rgba(120, 53, 15, .35);
  border: 1px solid rgba(245, 158, 11, .25);
  opacity: .85;
}
.place-card { margin-bottom: 4px; }
.place-title { margin: 0 0 8px; font-size: 1rem; opacity: .95; }
.place-card label { margin-top: 6px; }

/* —— v6: SoC sparkline + fuel compare + week —— */
.soc-chart {
  margin: 4px 16px 16px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.soc-spark {
  width: 100%;
  height: 88px;
  display: block;
  margin-top: 8px;
}
.soc-chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .72rem;
  opacity: .55;
  margin-top: 6px;
}
.compare-block { padding: 0 16px 20px; }
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.compare-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.compare-cell.highlight { border-color: rgba(167, 139, 250, .45); }
@media (min-width: 720px) {
  .compare-grid { grid-template-columns: repeat(3, 1fr); }
  .metrics { grid-template-columns: repeat(3, 1fr); }
}

/* —— v8: flexible places —— */
.place-gps-hint { margin-top: -4px; }
.place-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
.place-inline-form { display: inline; margin: 0; }
.place-inline-form button,
.place-actions button {
  font: inherit;
  font-size: .82rem;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #1f2937;
  color: #e5e7eb;
  cursor: pointer;
}
.place-inline-form button:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.place-inline-form button.btn-secondary {
  background: #111827;
  color: #93c5fd;
  border-color: rgba(96, 165, 250, .35);
}
.place-inline-form button.btn-danger {
  background: #3f0a0a;
  color: #fca5a5;
  border-color: rgba(248, 113, 113, .35);
}
.place-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.place-check input { width: auto; margin: 0; }
.place-new { margin-top: 12px; border-left: 3px solid #a78bfa; }


/* —— v12: live location + dual charts + commute —— */
.live-block {
  padding: 4px 16px 16px;
}
.live-block h2 { margin: 8px 0 6px; font-size: 1.05rem; }
.live-meta {
  font-size: .82rem;
  opacity: .75;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.live-place { color: var(--accent); font-weight: 600; opacity: 1; }
.live-map-wrap { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.live-map { height: 180px !important; }
@media (max-width: 719px) {
  .live-map { height: 150px !important; }
}
.charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  margin: 0;
}
@media (min-width: 720px) {
  .charts-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px 8px;
  }
  .charts-row .soc-chart { margin-left: 0; margin-right: 0; }
}
.speed-chart .soc-spark polyline { /* stroke set inline */ }


/* —— v13: Heute strip + charge curves + month —— */
.heute-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 16px 6px;
}
.heute-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px 8px;
  min-width: 0;
}
a.heute-item, a.heute-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.heute-item .label {
  display: block; /* never hide — mini but readable */
  font-size: .71rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .8;
  margin-bottom: 2px;
  color: var(--muted, #9ca3af);
  font-weight: 600;
}
.heute-item .value.tiny {
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heute-item .value.tiny a {
  color: var(--accent);
  text-decoration: none;
}
.heute-item .meta {
  font-size: .65rem;
  opacity: .5;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 520px) {
  .heute-strip { grid-template-columns: repeat(2, 1fr); }
}
.amp-chart .soc-spark polyline { /* stroke set inline */ }

/* —— v14: Fahrtenbuch, Klima/Akku/Ladeplan, Export —— */
.value.tiny {
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.mini-table th, .mini-table td {
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}
.mini-table th {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .55;
}
.export-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.export-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.export-list a:hover { text-decoration: underline; }
.export-card .meta a { font-weight: 600; }
.menu-panel a strong { font-weight: 700; color: #ddd6fe; }


/* —— v15 Fahrzeugstatus —— */
.status-metrics .metric.ok .value { color: var(--green); }
.status-metrics .metric.warn .value { color: #fbbf24; }
.metric-wide { grid-column: span 2; }
.window-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.window-cell {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.window-cell .value { margin-top: 4px; }
.warn-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #fbbf24;
}
.warn-list li { margin: 4px 0; }
@media (max-width: 520px) {
  .metric-wide { grid-column: span 1; }
}


/* —— v16 Batterie & Verbrauch —— */
.analyse-section {
  margin: 8px 0 20px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.analyse-section h3 {
  margin: 12px 16px 6px;
  font-size: 1rem;
  font-weight: 600;
  color: #e9d5ff;
}
.analyse-sub {
  margin: 14px 16px 8px;
  font-size: .9rem;
  opacity: .75;
  font-weight: 500;
}
.trip-list.compact .trip-card { padding: 12px; }
.tag-form { margin: 6px 0 0; }
.tag-btn {
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .8rem;
  cursor: pointer;
}
.tag-btn.on {
  background: #4c1d95;
  border-color: #7c3aed;
  color: #f5f3ff;
}
.tag-btn:hover { border-color: #a78bfa; }
.dim { opacity: .45; font-size: .75rem; }


/* —— v23 header vehicle status card (two-column block) —— */
.status-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.veh-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 6px 10px;
  align-items: stretch;
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: #111827;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  transition: border-color .15s ease, opacity .15s ease;
}
.veh-card:hover { border-color: #4b5563; }
.veh-card:active { border-color: #6b7280; }
.veh-card.veh-busy { opacity: .65; pointer-events: none; }
.veh-card.veh-driving .veh-cmd:disabled { opacity: .45; }

.veh-card-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 4px 6px 4px 2px;
  border-right: 1px solid rgba(55, 65, 81, .55);
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  min-height: 44px;
}
.veh-card-left:hover { background: rgba(255,255,255,.03); }

.veh-motion {
  font-size: 1.28rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #e5e7eb;
}
.veh-motion.ok { color: var(--green, #34d399); }
.veh-motion.info { color: #93c5fd; }
.veh-motion.warn { color: #fbbf24; }
.veh-motion.unk { color: #9ca3af; }

.veh-place {
  font-size: .72rem;
  font-weight: 500;
  color: var(--muted);
  opacity: .9;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.veh-plug-badge {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 650;
  letter-spacing: .01em;
  border: 1px solid #374151;
  background: #0b1220;
  color: #d1d5db;
}
.veh-plug-badge.ok {
  color: var(--green, #34d399);
  border-color: rgba(52, 211, 153, .35);
  background: rgba(6, 78, 59, .35);
}
.veh-plug-badge.warn {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, .4);
  background: rgba(120, 53, 15, .35);
}
.veh-plug-badge.info {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, .4);
  background: rgba(30, 58, 95, .45);
}

.veh-card-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding-left: 0;
}

.veh-cmd {
  display: flex;
  align-items: center;
  min-height: 44px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.veh-cmd:hover:not(:disabled) { background: rgba(255,255,255,.05); }
.veh-cmd:active:not(:disabled) { background: rgba(255,255,255,.09); }
.veh-cmd:disabled { cursor: not-allowed; }

.veh-lock {
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.veh-lock.ok { color: var(--green, #34d399); }
.veh-lock.warn { color: #fca5a5; }
.veh-lock.unk { color: #9ca3af; }

.veh-line {
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.2;
  color: #d1d5db;
}
.veh-line.ok { color: var(--green, #34d399); }
.veh-line.warn { color: #fca5a5; }
.veh-line.unk { color: #9ca3af; opacity: .85; }

/* Status-class accent on card border (subtle) */
.veh-card.veh-status-ok { border-color: rgba(52, 211, 153, .28); }
.veh-card.veh-status-warn { border-color: rgba(239, 68, 68, .32); }
.veh-card.veh-status-unknown { border-color: var(--border); }

/* place line moved into veh-card-left */
.status-place { display: none; }

/* Compact /status detail cards */
.status-overview-compact .metric .value { font-size: 1.1rem; }
.status-overview-compact .metric {
  padding: 10px 12px;
}
.status-section-compact {
  margin: 10px 16px;
  padding: 10px 12px;
}
.status-section-compact h3 {
  margin: 0 0 8px;
  font-size: .88rem;
}
.status-section-compact .window-cell .value.tiny { font-size: .85rem; }

@media (max-width: 420px) {
  .status-range { font-size: 1.32rem; }
  .status-soc { font-size: 1.25rem; }
  .veh-card { padding: 6px 8px; gap: 4px 8px; }
  .veh-motion { font-size: 1.18rem; }
  .veh-lock { font-size: .82rem; }
  .veh-line { font-size: .72rem; }
  .veh-place { font-size: .7rem; }
  .veh-cmd { min-height: 44px; padding: 7px 8px; }
}

/* —— Dashboard period strip (v22; NOT in header) —— */
.period-strip {
  display: flex;
  gap: 6px;
  margin: 0 16px 12px;
  flex-wrap: wrap;
}
.period-strip a {
  flex: 1 1 0;
  min-width: 3.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: #111827;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px 8px;
}
.period-strip a:hover { border-color: #4b5563; }
.period-strip .label {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.period-strip .value {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}
.period-strip .meta {
  margin-top: 2px;
  font-size: .65rem;
  color: var(--muted);
  opacity: .85;
}


/* —— v17 granular Fahrzeugstatus —— */
.status-section {
  margin: 12px 16px;
}
.status-section h3 {
  margin: 0 0 10px;
  font-size: .95rem;
  font-weight: 600;
  color: #e9d5ff;
}
.status-overview .metric .value { font-size: 1.35rem; }
.status-metrics .metric.info .value { color: #93c5fd; }
.window-cell.ok .value { color: var(--green, #34d399); }
.window-cell.warn .value { color: #fca5a5; }
.window-cell.ok { border-color: rgba(52, 211, 153, .35); }
.window-cell.warn { border-color: rgba(239, 68, 68, .4); }
.status-overall {
  margin: 0;
  font-size: .95rem;
}
.status-overall.warn-txt { color: #fca5a5; }
.empty-inline { margin: 0; opacity: .65; font-size: .9rem; }


/* —— v18 Aktivität / Menü / Projektion / Software-Historie —— */
.menu-label {
  margin: 10px 12px 4px;
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
}
.activity-list { display: flex; flex-direction: column; gap: 8px; padding: 0 0 12px; }
.activity-preview { margin-bottom: 16px; }
.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0b1220;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.activity-item:hover { border-color: #4b5563; }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem;
  flex-shrink: 0;
  background: #1f2937;
}
.activity-trip .activity-icon { background: #312e81; color: #c4b5fd; }
.activity-charge .activity-icon { background: #064e3b; color: #6ee7b7; }
.activity-park .activity-icon { background: #1e3a5f; color: #93c5fd; }
.activity-trip { border-left: 3px solid #a78bfa; }
.activity-charge { border-left: 3px solid var(--green, #34d399); }
.activity-park { border-left: 3px solid #60a5fa; }
.activity-type {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #9ca3af;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
}
.activity-meta { text-transform: none; letter-spacing: 0; font-size: .72rem; opacity: .8; }
.activity-title { font-weight: 600; margin-top: 2px; }
.activity-sub { font-size: .85rem; color: #9ca3af; margin-top: 2px; }
.section-more {
  float: right;
  font-size: .8rem;
  font-weight: 500;
  color: #a78bfa;
  text-decoration: none;
}
.section-more:hover { text-decoration: underline; }
.sub-h2 { margin-top: 18px; font-size: 1rem; opacity: .85; }
.projection-block {
  margin: 8px 16px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0b1220;
  border: 1px solid #1f3a2e;
}
.projection-text { margin: 6px 0 0; font-size: .95rem; }
.projection-list {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  color: #9ca3af;
  font-size: .85rem;
}
.soft-hist-table-wrap { overflow-x: auto; margin-top: 8px; }
.soft-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.soft-hist-table th, .soft-hist-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.soft-hist-table th { color: #9ca3af; font-weight: 600; }
.status-section h3 { margin: 0 0 8px; font-size: .95rem; }

/* —— v21 wallbox —— */
.wallbox-remind a { color: #fcd34d; text-decoration: underline; text-underline-offset: 2px; }
.wallbox-remind a:hover { opacity: .9; }
.table-wrap { overflow-x: auto; margin: 8px 0; }
.inline-form { margin: 6px 0 0; }
.tag-btn.danger-ish {
  background: rgba(127, 29, 29, .35);
  border-color: rgba(248, 113, 113, .35);
  color: #fecaca;
}


/* —— v25 command sheet + flash —— */
.cmd-sheet {
  border: 1px solid #374151;
  border-radius: 16px;
  padding: 0;
  background: #0b1220;
  color: var(--text);
  max-width: min(92vw, 360px);
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.cmd-sheet::backdrop { background: rgba(0,0,0,.55); }
.cmd-sheet-inner { margin: 0; padding: 16px; }
.cmd-sheet-inner h3 { margin: 0 0 6px; font-size: 1.05rem; }
.cmd-sheet-hint { margin: 0 0 12px; font-size: .8rem; color: var(--muted); }
.cmd-sheet-actions { display: grid; gap: 8px; }
.cmd-sheet-btn {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid #374151;
  background: #111827;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}
.cmd-sheet-btn:hover { border-color: #a78bfa; }
.cmd-sheet-cancel { opacity: .75; font-weight: 500; }
.cmd-flash { position: sticky; top: 0; z-index: 35; }
.top-tabs { top: 190px; }

/* —— v26 dashboard redesign —— */
.heute-strip-compact {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 520px) {
  .heute-strip-compact { grid-template-columns: repeat(4, 1fr); }
}
.period-strip button.period-cell,
.period-strip .period-cell {
  flex: 1 1 0;
  min-width: 3.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: #111827;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px 8px;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.period-strip button.period-cell:hover,
.period-strip .period-cell:hover { border-color: #4b5563; }
.period-strip button.period-cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.period-strip .meta strong {
  color: #c4b5fd;
  font-weight: 700;
}
.live-block-top {
  padding-top: 2px;
  margin-top: 0;
}
.grid-slim {
  margin-top: 4px;
  margin-bottom: 4px;
}
.grid-slim .card .value.smallish { font-size: 1.15rem; }

body.period-sheet-open { overflow: hidden; }
.period-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.period-sheet[hidden] { display: none !important; }
.period-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.period-sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: min(78vh, 640px);
  background: #0b1220;
  border: 1px solid #1f2937;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}
.period-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}
.period-sheet-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  color: #e9d5ff;
}
.period-sheet-close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #111827;
  color: #e5e7eb;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.period-sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 24px;
  overscroll-behavior: contain;
}
.period-section-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .55;
  margin: 10px 4px 6px;
  font-weight: 650;
}
.period-list { display: grid; gap: 8px; }
.period-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}
.period-row:hover { border-color: #4b5563; }
.period-row-charge { border-left: 3px solid #34d399; }
.period-row-main { min-width: 0; flex: 1; }
.period-row-route {
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.period-row-meta {
  font-size: .72rem;
  opacity: .55;
  margin-top: 2px;
}
.period-row-stats {
  text-align: right;
  flex-shrink: 0;
}
.period-row-stats .km {
  font-weight: 700;
  color: var(--accent);
  font-size: .95rem;
}
.period-row-stats .wh {
  font-size: .7rem;
  opacity: .65;
  margin-top: 2px;
}


/* —— v27 Uschi polish —— */
.status-bar-compact {
  gap: 4px;
  padding: 6px 10px 6px;
}
.status-bar-compact .status-range { font-size: 1.38rem; }
.status-bar-compact .status-soc { font-size: 1.28rem; }
.status-bar-compact .status-soh { font-size: .72rem; margin-top: 0; }
.status-bar-compact .status-meta { font-size: .6rem; }
.status-bar-compact .veh-card { padding: 6px 8px; }
.status-meta.api-budget-warn .api-cost {
  color: #f87171;
  font-weight: 700;
}
.menu-panel a.menu-child {
  padding-left: 22px;
  font-size: .88rem;
  opacity: .92;
}
.menu-panel a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.commute-hero {
  margin: 0 16px 10px;
}
.commute-card {
  display: block;
  padding: 12px 14px;
  border-left: 3px solid #a78bfa;
  background: linear-gradient(135deg, #14102a 0%, #111827 70%);
  text-decoration: none;
  color: inherit;
}
.commute-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.commute-more {
  font-size: .78rem;
  color: #c4b5fd;
  font-weight: 600;
}
.commute-card .value.smallish { font-size: 1.15rem; margin-top: 4px; }
.commute-card .meta { margin-top: 2px; }
.commute-stats { opacity: .75; margin-top: 4px !important; }

/* Consistent card density on dashboard */
.grid-slim .card,
.commute-card,
.activity-item {
  padding: 12px 14px;
}
.grid-slim .card .label,
.commute-card .label {
  font-size: .72rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  opacity: .7;
}

/* Software history: sticky first column */
.soft-hist-table-wrap { overflow-x: auto; margin-top: 8px; }
.soft-hist-table {
  border-collapse: collapse;
  width: 100%;
  font-size: .85rem;
}
.soft-hist-table caption {
  caption-side: top;
  text-align: left;
  font-size: .78rem;
  opacity: .7;
  margin-bottom: 6px;
}
.soft-hist-table th,
.soft-hist-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.soft-hist-table thead th { color: #9ca3af; font-weight: 600; }
.soft-hist-table th:first-child,
.soft-hist-table td:first-child,
.soft-hist-table th[scope="row"],
.soft-hist-table tbody th {
  position: sticky;
  left: 0;
  background: #0b1220;
  z-index: 1;
}
.soft-hist-table th[scope="row"],
.soft-hist-table tbody th {
  font-weight: 600;
  box-shadow: 2px 0 0 var(--border);
}
.soft-hist-table thead th:first-child {
  z-index: 2;
  box-shadow: 2px 0 0 var(--border);
}
.top-tabs { top: 170px; }

@media (max-width: 420px) {
  .status-bar-compact .status-range { font-size: 1.55rem; }
  .status-bar-compact .status-soc { font-size: 1.45rem; }
  .status-bar-compact .status-secondary { gap: 6px; }
  .status-bar-compact .status-soh,
  .status-bar-compact .status-meta { font-size: .68rem; opacity: .55; }
  .status-bar-compact .status-meta .dim { display: none; }
  .heute-strip-compact .meta { display: none; }
  /* Heute mini-labels stay visible on narrow screens */
  .heute-strip-compact .heute-item .label,
  .heute-item .label {
    display: block !important;
    font-size: .7rem;
    opacity: .78;
  }
  .top-tabs { top: 156px; }
}


/* —— v28 themes + period pills + glanceability —— */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000;
  --card: #111827;
  --border: #1f2937;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #a78bfa;
  --green: #34d399;
  --park: #60a5fa;
  --map-filter: none;
}
html[data-theme="purple"] {
  color-scheme: dark;
  --bg: #0b0614;
  --card: #1a1028;
  --border: #2e1f45;
  --text: #f5f3ff;
  --muted: #c4b5fd;
  --accent: #c084fc;
  --green: #34d399;
  --park: #a78bfa;
  --map-filter: none;
}
html[data-theme="green"] {
  color-scheme: dark;
  --bg: #04110c;
  --card: #0f1f18;
  --border: #1e3a2f;
  --text: #ecfdf5;
  --muted: #86efac;
  --accent: #34d399;
  --green: #6ee7b7;
  --park: #2dd4bf;
  --map-filter: none;
}
html[data-theme="blue"] {
  color-scheme: dark;
  --bg: #050b14;
  --card: #0f172a;
  --border: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --green: #34d399;
  --park: #38bdf8;
  --map-filter: none;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #d1d5db;
  --text: #111827;
  --muted: #4b5563;
  --accent: #7c3aed;
  --green: #059669;
  --park: #2563eb;
  --map-filter: none;
}
html[data-theme="high-contrast"] {
  color-scheme: dark;
  --bg: #000;
  --card: #000;
  --border: #fff;
  --text: #fff;
  --muted: #e5e5e5;
  --accent: #ffff00;
  --green: #00ff66;
  --park: #00ccff;
  --map-filter: none;
}

html[data-theme="light"] body { background: var(--bg); color: var(--text); }
html[data-theme="light"] .status-bar,
html[data-theme="light"] .menu-panel,
html[data-theme="light"] .top-tabs,
html[data-theme="light"] .bottom-nav,
html[data-theme="light"] .card,
html[data-theme="light"] .trip-card,
html[data-theme="light"] .period-cell,
html[data-theme="light"] .period-pill,
html[data-theme="light"] .heute-strip,
html[data-theme="light"] .veh-card {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="light"] .status-range { color: #6d28d9; }
html[data-theme="light"] .status-soh { color: #7c3aed; }
html[data-theme="light"] .period-strip .value,
html[data-theme="light"] .leg-stats .km { color: var(--accent); }
html[data-theme="light"] .commute-card {
  background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 70%);
  border-left-color: var(--accent);
}
html[data-theme="light"] .menu summary { background: #e5e7eb; color: #111; }
html[data-theme="light"] .flash.ok { background: #d1fae5; color: #065f46; }
html[data-theme="light"] .flash.err { background: #fee2e2; color: #991b1b; }
html[data-theme="light"] .api-warn { background: #fef3c7; color: #92400e; }
html[data-theme="light"] .map-preview-wrap,
html[data-theme="light"] .live-map-wrap {
  border-color: var(--border);
  filter: var(--map-filter);
}
html[data-theme="light"] .soft-hist-table th:first-child,
html[data-theme="light"] .soft-hist-table td:first-child,
html[data-theme="light"] .soft-hist-table th[scope="row"],
html[data-theme="light"] .soft-hist-table tbody th {
  background: #f9fafb;
}

html[data-theme="high-contrast"] .card,
html[data-theme="high-contrast"] .trip-card,
html[data-theme="high-contrast"] .period-cell,
html[data-theme="high-contrast"] .veh-card {
  border-width: 2px;
}
html[data-theme="high-contrast"] .status-range,
html[data-theme="high-contrast"] .status-soc {
  color: var(--accent);
  text-shadow: 0 0 1px #000;
}

/* Tessie-like period pills */
.period-strip.period-pills {
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.period-strip.period-pills::-webkit-scrollbar { display: none; }
.period-strip.period-pills .period-cell {
  flex: 0 0 auto;
  min-width: 4.6rem;
  border-radius: 999px;
  padding: 8px 12px 7px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.period-strip.period-pills .period-cell.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--card));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.period-strip.period-pills .period-cell.is-active .label {
  color: var(--accent);
}
.period-strip.period-pills .label {
  text-transform: none;
  letter-spacing: 0;
  font-size: .72rem;
}

.period-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 16px 12px;
}
.period-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
}
.period-pill.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
}
.period-place-hint {
  margin-top: -4px;
  margin-bottom: 8px;
  font-size: .82rem;
}

.commute-places-link {
  margin: 6px 2px 0;
  font-size: .78rem;
}

/* Theme picker in settings */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
@media (min-width: 480px) {
  .theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
  font-size: .88rem;
}
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option.is-active,
.theme-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.theme-swatch {
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  flex: 0 0 auto;
}
.theme-dark .theme-swatch { background: #111; }
.theme-light .theme-swatch { background: #f3f4f6; border-color: #9ca3af; }
.theme-purple .theme-swatch { background: #c084fc; }
.theme-green .theme-swatch { background: #34d399; }
.theme-blue .theme-swatch { background: #60a5fa; }
.theme-high-contrast .theme-swatch { background: #ffff00; border-color: #fff; }

/* Keep map tiles readable across themes */
.leaflet-container { background: #1a1a1a; }
html[data-theme="light"] .leaflet-container { background: #e5e7eb; }

/* —— v29 flatten header + action bar —— */
.status-bar-flat {
  gap: 3px;
  padding: 4px 10px 4px;
}
.status-bar-flat .status-range { font-size: 1.18rem; font-weight: 750; }
.status-bar-flat .status-soc { font-size: 1.1rem; font-weight: 750; }
.status-bar-flat .status-soh { font-size: .62rem; opacity: .75; }
.status-bar-flat .status-meta { font-size: .55rem; }
.status-bar-flat .status-secondary { margin-top: 0; gap: 6px; }
.status-bar-flat .menu summary {
  width: 34px; height: 34px;
  font-size: 1.1rem;
}

.hdr-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 4px;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #111827;
  color: var(--accent);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
  align-self: center;
  -webkit-tap-highlight-color: transparent;
}
.hdr-plus:hover { border-color: var(--accent); background: #1f2937; }

.veh-card-flat {
  padding: 4px 6px;
  gap: 2px 8px;
  border-radius: 10px;
  min-height: 0;
}
.veh-card-flat .veh-card-left {
  min-height: 0;
  padding: 2px 4px 2px 2px;
  gap: 1px;
}
.veh-card-flat .veh-motion {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
  opacity: .82;
  color: #9ca3af;
}
.veh-card-flat .veh-motion.ok { color: #6ee7b7; opacity: .9; }
.veh-card-flat .veh-motion.info { color: #93c5fd; opacity: .9; }
.veh-card-flat .veh-motion.warn { color: #fbbf24; opacity: .9; }
.veh-card-flat .veh-place {
  font-size: .62rem;
  opacity: .75;
}
.veh-card-flat .veh-plug-badge {
  font-size: .58rem;
  padding: 0 6px;
  margin-top: 1px;
}
.veh-card-flat .veh-cmd {
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 8px;
}
.veh-card-flat .veh-lock { font-size: .78rem; }
.veh-card-flat .veh-line { font-size: .68rem; }
.veh-card-flat .veh-card-right { gap: 0; }

.action-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 4px 0 2px;
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
}
.action-bar::-webkit-scrollbar { display: none; }
.action-bar.action-busy { opacity: .65; pointer-events: none; }
.action-bar-driving .action-btn:disabled { opacity: .45; }

.action-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #111827;
  color: #d1d5db;
  font: inherit;
  font-size: .72rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.action-btn:hover:not(:disabled) { border-color: #6b7280; }
.action-btn:disabled { cursor: not-allowed; }
.action-btn.is-on {
  border-color: color-mix(in srgb, var(--accent) 55%, #374151);
  background: color-mix(in srgb, var(--accent) 16%, #111827);
  color: #f5f3ff;
}
.action-ico { font-size: .9rem; line-height: 1; }
.action-lbl {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.15;
}
.action-sub {
  font-size: .58rem;
  font-weight: 500;
  opacity: .7;
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.action-badge {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green, #34d399);
  box-shadow: 0 0 0 2px #111827;
}
.action-link.has-badge { padding-right: 14px; }

html[data-theme="light"] .action-bar {
  background: rgba(243,244,246,.96);
}
html[data-theme="light"] .action-btn {
  background: #fff;
  border-color: #d1d5db;
  color: #111827;
}
html[data-theme="light"] .action-btn.is-on {
  background: color-mix(in srgb, var(--accent) 12%, #fff);
}
html[data-theme="light"] .hdr-plus {
  background: #fff;
  border-color: #d1d5db;
}
html[data-theme="light"] .veh-card-flat .veh-motion { color: #6b7280; }

/* Sticky offset: flatter header + action bar */
.top-tabs { top: 168px; }
@media (max-width: 420px) {
  .status-bar-flat .status-range { font-size: 1.22rem; }
  .status-bar-flat .status-soc { font-size: 1.12rem; }
  .veh-card-flat .veh-motion { font-size: .72rem; }
  .veh-card-flat .veh-cmd { min-height: 30px; padding: 3px 5px; }
  .top-tabs { top: 158px; }
}

/* —— v30: unified action grid, nav center, climate sheet, schedule —— */
.status-bar-v30 { gap: 4px; }

.hdr-plus-subtle {
  opacity: .55;
  width: 22px;
  height: 22px;
  font-size: .9rem;
}
.hdr-plus-subtle:hover { opacity: 1; }

.motion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 2px;
  min-height: 0;
}
.motion-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  font-size: .72rem;
  font-weight: 600;
  color: #9ca3af;
  opacity: .9;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
}
.motion-chip.ok { color: #6ee7b7; }
.motion-chip.info { color: #93c5fd; }
.motion-chip.warn { color: #fbbf24; }
.motion-place {
  font-weight: 500;
  opacity: .75;
  font-size: .66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-bar.action-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
  flex-wrap: nowrap;
  width: 100%;
  padding: 2px 0 4px;
}
.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.action-group-label {
  flex: 0 0 100%;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .7;
  margin: 2px 0 0;
}
.action-bar.action-grid .action-btn {
  flex: 1 1 auto;
  min-width: 5.6rem;
  justify-content: flex-start;
}
.action-btn.warn-on {
  border-color: rgba(248, 113, 113, .55);
  background: color-mix(in srgb, #ef4444 14%, #111827);
  color: #fecaca;
}

.cmd-sheet-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--muted);
}
.climate-temp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.climate-temp-input {
  width: 4.5rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #0b1220;
  color: inherit;
}
.climate-temp-unit { font-weight: 600; opacity: .7; }
.climate-temp-adj { min-width: 2.6rem; padding: 8px 10px; font-size: 1.1rem; }

/* Nav centering — equal flex, center */
.top-tabs {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.top-tabs a {
  flex: 1 1 0;
  text-align: center;
  max-width: 9rem;
}
.bottom-nav {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  grid-template-columns: unset;
}
.bottom-nav a {
  flex: 1 1 0;
  max-width: 7.5rem;
}

@media (min-width: 720px) {
  .top-tabs { display: flex; justify-content: center; }
}

.period-strip.period-pills .period-cell.period-service {
  text-decoration: none;
  color: inherit;
  border-style: dashed;
}
.period-strip.period-pills .period-cell.period-service .label {
  color: var(--accent);
}

.schedule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.schedule-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.schedule-item:last-child { border-bottom: 0; }
.schedule-item.is-off { opacity: .65; }
.schedule-time { font-size: 1.15rem; font-weight: 700; }
.schedule-meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.schedule-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-on {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  color: #6ee7b7;
  background: rgba(6, 78, 59, .35);
  padding: 1px 6px;
  border-radius: 999px;
}
.badge-off {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  color: #9ca3af;
  background: #1f2937;
  padding: 1px 6px;
  border-radius: 999px;
}
.schedule-form { display: grid; gap: 10px; }
.schedule-form input[type="time"] {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #0b1220;
  color: inherit;
  font: inherit;
}
.check-row { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.days-fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.days-fieldset legend { padding: 0 4px; font-size: .72rem; color: var(--muted); }
.day-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #111827;
}
.schedule-vk-note { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

html[data-theme="light"] .climate-temp-input,
html[data-theme="light"] .schedule-form input[type="time"],
html[data-theme="light"] .day-chip {
  background: #fff;
  border-color: #d1d5db;
  color: #111827;
}
html[data-theme="light"] .motion-chip { color: #6b7280; }
html[data-theme="light"] .action-btn.warn-on {
  background: color-mix(in srgb, #ef4444 10%, #fff);
  color: #991b1b;
}

/* Sticky offset: motion + multi-row action grid */
.top-tabs { top: 210px; }
@media (max-width: 420px) {
  .top-tabs { top: 200px; }
  .action-bar.action-grid .action-btn { min-width: 5.2rem; font-size: .68rem; }
}


/* —— v31: compact actions next to SoC, nav exclusive, refresh btn —— */
.status-bar-v31 { gap: 2px; padding-bottom: 4px; }
.hdr-refresh { display: inline-flex; margin: 0; padding: 0; }
.hdr-refresh-btn {
  width: 26px; height: 26px;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #111827;
  color: #d1d5db;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.hdr-refresh-btn:hover { border-color: #6b7280; color: #fff; }
html[data-theme="light"] .hdr-refresh-btn {
  background: #fff; border-color: #d1d5db; color: #111827;
}

.hdr-compact-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  min-width: 0;
}
.hdr-compact-row .motion-row {
  padding: 0;
  min-height: 0;
}

/* Single horizontal compact action strip (no multi-row groups) */
.action-bar.action-grid.action-grid-compact {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  padding: 0 0 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.action-bar.action-grid.action-grid-compact::-webkit-scrollbar { display: none; }
.action-bar.action-grid.action-grid-compact .action-btn {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 28px;
  padding: 3px 7px;
  gap: 3px;
  font-size: .62rem;
  justify-content: center;
}
.action-bar.action-grid.action-grid-compact .action-ico {
  font-size: .78rem;
}
.action-bar.action-grid.action-grid-compact .action-lbl {
  flex-direction: row;
  align-items: center;
  font-size: .62rem;
  line-height: 1.1;
}
.action-bar.action-grid.action-grid-compact .action-sub { display: none; }
.action-bar.action-grid.action-grid-compact .action-badge {
  top: 3px; right: 4px; width: 5px; height: 5px;
}
.action-bar.action-grid.action-grid-compact .action-group-label { display: none; }

/* Nav: desktop = top-tabs only; mobile = bottom-nav only (fix v30 override leak) */
.top-tabs { display: none !important; }
.bottom-nav { display: flex !important; }
@media (min-width: 720px) {
  .top-tabs { display: flex !important; justify-content: center; }
  .bottom-nav { display: none !important; }
  body { padding-bottom: 40px; }
}

/* Sticky offset shrinks with compact header */
.top-tabs { top: 118px; }
@media (max-width: 420px) {
  .top-tabs { top: 112px; }
  .action-bar.action-grid.action-grid-compact .action-btn {
    min-height: 26px;
    padding: 2px 6px;
    font-size: .58rem;
  }
}

/* —— v32: actions centered beside range/SoC; status colors —— */
/* —— v33: period strip strom (electricity) instead of sprit —— */
.status-bar-v32 { gap: 2px; padding-bottom: 3px; }
.status-top-v32 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr) auto;
  align-items: center;
  gap: 6px 8px;
  width: 100%;
}
.status-hero-v32 {
  flex: unset;
  min-width: 0;
  align-self: start;
}
.status-hero-v32 .status-hero-primary {
  flex-wrap: nowrap;
  gap: 8px;
}
.status-hero-v32 .status-range { font-size: 1.35rem; }
.status-hero-v32 .status-soc { font-size: 1.25rem; }

.status-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  align-self: start;
}

/* Inline action strip: centered in the middle band */
.action-bar.action-bar-inline {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.action-bar.action-bar-inline::-webkit-scrollbar { display: none; }
.action-bar.action-grid.action-grid-compact.action-bar-inline .action-btn {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 30px;
  padding: 3px 6px;
  gap: 2px;
  font-size: .58rem;
  justify-content: center;
  border-radius: 8px;
}
.action-bar.action-grid.action-grid-compact.action-bar-inline .action-ico {
  font-size: .72rem;
}
.action-bar.action-grid.action-grid-compact.action-bar-inline .action-lbl {
  font-size: .58rem;
  line-height: 1.05;
}

/* Status colors: ok=green, warn=red, active=accent, muted=dim */
.action-btn.state-ok {
  border-color: rgba(52, 211, 153, .55);
  background: color-mix(in srgb, #34d399 16%, #111827);
  color: #a7f3d0;
}
.action-btn.state-warn {
  border-color: rgba(248, 113, 113, .55);
  background: color-mix(in srgb, #ef4444 16%, #111827);
  color: #fecaca;
}
.action-btn.state-active,
.action-btn.state-active.is-on {
  border-color: color-mix(in srgb, var(--accent) 60%, #374151);
  background: color-mix(in srgb, var(--accent) 22%, #111827);
  color: #f5f3ff;
}
.action-btn.state-muted {
  opacity: .55;
  border-color: #374151;
  background: #111827;
  color: #9ca3af;
}

html[data-theme="light"] .action-btn.state-ok {
  background: color-mix(in srgb, #34d399 14%, #fff);
  color: #065f46;
  border-color: rgba(16, 185, 129, .45);
}
html[data-theme="light"] .action-btn.state-warn {
  background: color-mix(in srgb, #ef4444 12%, #fff);
  color: #991b1b;
}
html[data-theme="light"] .action-btn.state-active,
html[data-theme="light"] .action-btn.state-active.is-on {
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  color: #1f2937;
}
html[data-theme="light"] .action-btn.state-muted {
  opacity: .5;
  background: #f9fafb;
  color: #6b7280;
}

.hdr-motion-only {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 0;
  padding: 0;
}
.hdr-motion-only .motion-row { padding: 0; }

.period-strip .meta .strom {
  display: block;
  margin-top: 1px;
  font-size: .6rem;
  font-weight: 600;
  color: #5eead4;
  opacity: .92;
}
html[data-theme="light"] .period-strip .meta .strom { color: #0f766e; }

/* Sticky offset: single-row header */
.status-bar-v32 + .top-tabs,
.top-tabs { top: 96px; }
@media (max-width: 560px) {
  .status-top-v32 {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "hero tools"
      "actions actions";
  }
  .status-hero-v32 { grid-area: hero; }
  .status-tools { grid-area: tools; }
  .action-bar.action-bar-inline {
    grid-area: actions;
    justify-content: center;
    padding-top: 2px;
  }
  .status-hero-v32 .status-range { font-size: 1.2rem; }
  .status-hero-v32 .status-soc { font-size: 1.1rem; }
  .top-tabs { top: 118px; }
}
@media (max-width: 420px) {
  .action-bar.action-grid.action-grid-compact.action-bar-inline .action-btn {
    min-height: 28px;
    padding: 2px 5px;
    font-size: .54rem;
  }
  .top-tabs { top: 112px; }
}


/* —— v34: Lock status-only, Ladeplan chip, Klima temp label —— */
.action-btn.action-status {
  cursor: default;
  pointer-events: none;
  opacity: 1;
}
.action-btn.action-status:disabled {
  cursor: default;
  opacity: 1;
}
a.action-btn.action-schedule {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: inherit;
  box-sizing: border-box;
  max-width: 9.5rem;
}
a.action-btn.action-schedule .action-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 7.5rem;
}
a.action-btn.action-schedule:hover {
  border-color: #6b7280;
}
.action-btn .action-lbl.action-temp,
.action-btn .action-lbl {
  /* temp in Klima label may be shorter; keep compact */
  font-variant-numeric: tabular-nums;
}
html[data-theme="light"] a.action-btn.action-schedule.state-muted {
  opacity: .55;
}


/* —— v35: chart scrubbing + Verbrauch nach Tempo —— */
.chart-scrub {
  position: relative;
  margin-top: 8px;
  touch-action: pan-y;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}
.chart-scrub .soc-spark {
  margin-top: 0;
}
.chart-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  z-index: 2;
}
html[data-theme="light"] .chart-crosshair {
  background: rgba(17, 24, 39, 0.45);
}
.chart-tip {
  position: absolute;
  top: 6px;
  z-index: 3;
  pointer-events: none;
  transform: translate(-50%, 0);
  background: rgba(17, 24, 39, 0.92);
  color: #f3f4f6;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  max-width: min(92vw, 280px);
}
html[data-theme="light"] .chart-tip {
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  border-color: rgba(109, 40, 217, 0.25);
}
.speed-wh-bins {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.speed-wh-bins > .label {
  margin-bottom: 6px;
  opacity: .8;
}
.speed-wh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.speed-wh-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 5.5rem;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.22);
  font-size: .72rem;
}
.speed-wh-lab { opacity: .7; }
.speed-wh-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.speed-wh-meta { opacity: .55; font-size: .65rem; }
.speed-wh-bins .wh-note { margin: 8px 0 0; padding: 0; }


/* === v36: activity day groups, charge forecast, commute glance === */
.activity-day { margin: 0 0 8px; }
.activity-day-header {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0;
  padding: 8px 16px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #c4b5fd;
  background: rgba(8, 12, 22, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border, #1f2937);
}
.activity-filter-pills { margin: 0 16px 12px; }
.activity-preview-dense { gap: 6px; }
.activity-dense {
  padding: 8px 12px !important;
  gap: 10px;
}
.activity-dense .activity-icon {
  width: 28px; height: 28px;
  font-size: .85rem;
  border-radius: 8px;
}
.activity-dense .activity-title { font-size: .92rem; margin-top: 1px; }
.activity-dense .activity-sub {
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.charge-forecast-hero { margin: 0 16px 10px; }
.charge-forecast-card {
  display: block;
  padding: 12px 14px;
  border-left: 3px solid #34d399;
  background: linear-gradient(135deg, #06281f 0%, #111827 75%);
  text-decoration: none;
  color: inherit;
}
.charge-forecast-card .label {
  font-size: .72rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  opacity: .75;
  color: #6ee7b7;
}
.charge-forecast-card .value.smallish { font-size: 1.05rem; margin-top: 4px; }
.charge-forecast-card .meta { margin-top: 4px; opacity: .8; }

.commute-glance { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.commute-glance-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: .95rem;
}
.commute-glance-k { opacity: .7; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.commute-glance-v { font-weight: 600; text-align: right; }
.commute-today { color: #c4b5fd; font-weight: 600; margin-top: 6px !important; }

.place-costs { margin: 12px 0; }
.place-costs h2 { margin: 0 16px 8px; font-size: 1rem; }
.place-cost-card { border-left: 3px solid #34d399; }

html[data-theme="light"] .activity-day-header {
  background: rgba(255,255,255,.92);
  color: #5b21b6;
}
html[data-theme="light"] .charge-forecast-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fafc 75%);
}


/* === v37: low-SoC banner, month glance, trip badges, firmware chip === */
.low-soc-banner {
  display: block;
  margin: 8px 16px 0;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  color: #fde68a;
  background: rgba(120, 53, 15, .28);
  border: 1px solid rgba(245, 158, 11, .28);
}
.low-soc-banner:hover { opacity: .92; }
html[data-theme="light"] .low-soc-banner {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

.firmware-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 650;
  text-decoration: none;
  color: #c4b5fd;
  background: rgba(109, 40, 217, .22);
  border: 1px solid rgba(167, 139, 250, .35);
  white-space: nowrap;
}
.firmware-chip:hover { opacity: .9; }
html[data-theme="light"] .firmware-chip {
  color: #5b21b6;
  background: #ede9fe;
  border-color: #c4b5fd;
}

.month-glance-hero { margin: 0 16px 10px; }
.month-glance-card {
  display: block;
  padding: 12px 14px;
  border-left: 3px solid var(--accent, #a78bfa);
  text-decoration: none;
  color: inherit;
}
.month-glance-card .label {
  font-size: .72rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  opacity: .8;
}
.month-glance-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.month-glance-cell .mg-k {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  opacity: .7;
}
.month-glance-cell .mg-v {
  font-size: .95rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 420px) {
  .month-glance-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.trip-card .leg-stats .wh-km {
  font-weight: 700;
  color: var(--accent, #a78bfa);
}
.trip-kat-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .02em;
  vertical-align: middle;
  background: rgba(55, 65, 81, .55);
  border: 1px solid rgba(107, 114, 128, .45);
  color: #e5e7eb;
}
.trip-kat-badge.kat-privat { background: rgba(59, 130, 246, .2); border-color: rgba(96, 165, 250, .4); color: #93c5fd; }
.trip-kat-badge.kat-beruf { background: rgba(16, 185, 129, .18); border-color: rgba(52, 211, 153, .4); color: #6ee7b7; }
.trip-kat-badge.kat-wohnung_arbeit { background: rgba(167, 139, 250, .2); border-color: rgba(196, 181, 253, .4); color: #c4b5fd; }

.fi-soft-hist {
  margin: 0 12px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card, #0b1220);
  border: 1px solid var(--border, #1f2937);
}
.fi-soft-hist .label { font-size: .72rem; text-transform: uppercase; opacity: .75; margin-bottom: 6px; }
.fi-soft-hist-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .86rem;
  padding: 4px 0;
  border-top: 1px solid rgba(55,65,81,.4);
}
.fi-soft-hist-row:first-of-type { border-top: none; }
.fi-soft-hist-row .v { font-weight: 650; }
.fi-soft-hist-row .t { opacity: .65; font-size: .78rem; }

/* —— v38: Wh/km leading on trip cards —— */
.leg-stats-main { min-width: 0; }
.wh-km-lead {
  color: #c4b5fd;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}
html[data-theme="light"] .wh-km-lead { color: #6d28d9; }
.trip-card .leg-stats .wh-km-lead { opacity: 1; }

/* —— v39: Wh/km lead in Monat-Glance —— */
.month-glance-cell.month-glance-wh .mg-v-lead {
  font-size: 1.25rem;
  font-weight: 750;
  color: #c4b5fd;
  letter-spacing: -0.02em;
}
html[data-theme="light"] .month-glance-cell.month-glance-wh .mg-v-lead { color: #6d28d9; }
@media (max-width: 420px) {
  .month-glance-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .month-glance-cell.month-glance-wh { grid-column: 1 / -1; }
  .month-glance-cell.month-glance-wh .mg-v-lead { font-size: 1.4rem; }
}


/* —— v40: Effizienz / Seit-Laden / Pendler-Woche / Ladeverlust / Kälte-Bars / SoH —— */
.since-story-hero,
.efficiency-hero,
.wallbox-loss-hero {
  margin: 0 16px 10px;
}
.since-story-card .since-story-line {
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.efficiency-card {
  display: block;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}
.efficiency-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.efficiency-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.efficiency-cell {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(55, 65, 81, .55);
  text-decoration: none;
  color: inherit;
}
.efficiency-cell.best { border-color: rgba(52, 211, 153, .35); }
.efficiency-cell.worst { border-color: rgba(251, 146, 60, .35); }
.efficiency-cell .eff-k {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .7;
}
.efficiency-cell .eff-v {
  font-size: 1.35rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  color: #c4b5fd;
}
.efficiency-cell.best .eff-v { color: #6ee7b7; }
.efficiency-cell.worst .eff-v { color: #fdba74; }
.efficiency-cell .eff-meta {
  font-size: .78rem;
  opacity: .75;
  margin-top: 2px;
}
html[data-theme="light"] .efficiency-cell {
  background: #f8fafc;
  border-color: #d1d5db;
}
html[data-theme="light"] .efficiency-cell .eff-v { color: #6d28d9; }
html[data-theme="light"] .efficiency-cell.best .eff-v { color: #047857; }
html[data-theme="light"] .efficiency-cell.worst .eff-v { color: #c2410c; }

.wallbox-loss-card.is-warn {
  border-color: rgba(251, 146, 60, .55);
  box-shadow: 0 0 0 1px rgba(251, 146, 60, .15);
}
.wallbox-loss-card .value { color: #fdba74; }

.commute-week {
  color: #c4b5fd;
  font-weight: 600;
  margin-top: 4px !important;
}
.commute-week-banner {
  margin: 0 16px 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(167, 139, 250, .12);
  border: 1px solid rgba(196, 181, 253, .28);
  font-weight: 600;
  font-size: .9rem;
}

.eff-rank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .eff-rank-grid { grid-template-columns: 1fr; }
}
.analyse-subh {
  margin: 12px 0 6px;
  font-size: .92rem;
  font-weight: 700;
}
.eff-tip {
  color: #c4b5fd;
  font-weight: 600;
}

.temp-bars {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.temp-bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 3rem;
  gap: 8px;
  align-items: center;
  font-size: .82rem;
}
.temp-bar-label { opacity: .8; }
.temp-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(55, 65, 81, .45);
  overflow: hidden;
}
.temp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #67e8f9, #a78bfa);
  min-width: 2px;
}
.temp-bar-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
html[data-theme="light"] .temp-bar-track { background: #e5e7eb; }

.soh-spark-card .soh-spark {
  width: 100%;
  height: 40px;
  margin-top: 6px;
  display: block;
}
tr.loss-high td { color: #fdba74; }
tr.loss-high td:last-child { font-weight: 700; }


/* —— v41: Wochenrückblick / Ort-Heatmap —— */
.week-digest-hero {
  margin: 0 16px 10px;
}
.week-digest-card.is-sunday,
.week-digest-hero.is-sunday .week-digest-card {
  border-color: rgba(167, 139, 250, .55);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, .18);
  background: linear-gradient(135deg, rgba(167, 139, 250, .10), transparent 60%);
}
.week-digest-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.week-digest-line {
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.week-digest-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}
.week-digest-cell {
  padding: 8px 6px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .45);
  border: 1px solid rgba(55, 65, 81, .45);
  text-align: center;
}
.week-digest-cell .wd-k {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .7;
}
.week-digest-cell .wd-v {
  font-size: 1.05rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  color: #c4b5fd;
}
.week-digest-best { margin-top: 4px !important; }
.week-digest-cold {
  color: #67e8f9 !important;
  font-weight: 600;
  margin-top: 2px !important;
}
html[data-theme="light"] .week-digest-cell {
  background: #f8fafc;
  border-color: #d1d5db;
}
html[data-theme="light"] .week-digest-cell .wd-v { color: #6d28d9; }
html[data-theme="light"] .week-digest-cold { color: #0e7490 !important; }
@media (max-width: 480px) {
  .week-digest-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.place-heatmap { margin-bottom: 14px; }
.place-heat-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.place-heat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.place-heat-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(167, 139, 250, .18);
  border: 1px solid rgba(196, 181, 253, .35);
  color: #e9d5ff;
}
.place-heat-chip.size-lg { font-size: 1.05rem; padding: 6px 14px; }
.place-heat-chip.size-md { font-size: .95rem; }
.place-heat-chip.size-sm { font-size: .82rem; opacity: .9; }
.place-heat-summary { font-size: .82rem; opacity: .8; }
.place-heat-bars { display: flex; flex-direction: column; gap: 4px; }
.place-heat-bar-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr 2.2rem;
  gap: 8px;
  align-items: center;
  font-size: .8rem;
}
.place-heat-bar-row .phb-label { opacity: .7; }
.place-heat-bar-row .phb-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(55, 65, 81, .45);
  overflow: hidden;
}
.place-heat-bar-row .phb-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a78bfa, #67e8f9);
  min-width: 2px;
}
.place-heat-bar-row .phb-fill.all {
  background: linear-gradient(90deg, #6366f1, #a78bfa);
}
.place-heat-bar-row .phb-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.place-heat-meta { font-size: .78rem; margin-top: 4px; }
html[data-theme="light"] .place-heat-chip {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #6b21a8;
}
html[data-theme="light"] .place-heat-bar-row .phb-track { background: #e5e7eb; }


/* —— v44 Außen heute-strip 2×2/4; v43 density + soft-hist sticky col —— */
.recent { gap: 8px; }
.trip-list.compact { gap: 8px; }

/* —— v45: manuelles Zusammenführen von Fahrten —— */
.trips-merge-hint { line-height: 1.4; }
.trip-select-list { padding-bottom: 8px; }
.trip-merge-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}
.trip-merge-row .trip-card { min-width: 0; }
.trip-select {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.trip-select input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.trip-merge-bar {
  position: sticky;
  bottom: calc(65px + var(--safe-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 16px 8px 54px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 24, 39, .96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.trip-merge-count { color: var(--muted); font-size: .78rem; }
.trip-merge-bar button {
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  background: var(--accent);
  color: #08080a;
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
}
.trip-merge-bar button:disabled { opacity: .38; cursor: not-allowed; }
html[data-theme="light"] .trip-merge-bar { background: rgba(255, 255, 255, .96); }
@media (min-width: 720px) {
  .trip-merge-bar { bottom: 12px; }
}
@media (max-width: 380px) {
  .trip-merge-bar { margin-left: 46px; }
  .trip-merge-count { font-size: .72rem; }
  .trip-merge-bar button { padding-inline: 10px; }
}

/* —— v46 Ops monitoring —— */
.ops-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .ops-grid { grid-template-columns: 1fr 1fr; }
}
.ops-card { padding: 14px 16px; }
.ops-card.ops-ok { border-left: 3px solid var(--green, #34d399); }
.ops-card.ops-warn { border-left: 3px solid #fbbf24; }
.ops-card.ops-bad { border-left: 3px solid #f87171; }
.ops-card.ops-unk { border-left: 3px solid #6b7280; }
.ops-h {
  margin: 0 0 10px;
  font-size: .95rem;
  font-weight: 700;
}
.ops-dl {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: .88rem;
}
.ops-dl dt { opacity: .55; margin: 0; }
.ops-dl dd { margin: 0; word-break: break-word; }
.ops-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .88rem;
}
.ops-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ops-list li:last-child { border-bottom: 0; }
.ops-svc { flex: 1; min-width: 0; font-weight: 600; }
.ops-st { opacity: .7; font-size: .82rem; text-align: right; }
.ops-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  background: #6b7280;
  display: inline-block;
}
.ops-dot.ops-ok { background: var(--green, #34d399); }
.ops-dot.ops-warn { background: #fbbf24; }
.ops-dot.ops-bad { background: #f87171; }
.ops-dot.ops-unk { background: #6b7280; }
.ops-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
}
.ops-pill.ops-ok { background: #052e1a; color: #86efac; }
.ops-pill.ops-warn { background: #422006; color: #fcd34d; }
.ops-pill.ops-bad { background: #450a0a; color: #fca5a5; }
.ops-pill.ops-unk { background: #1f2937; color: #9ca3af; }
.ops-list li.ops-ok .ops-st { color: var(--green, #34d399); }
.ops-list li.ops-warn .ops-st { color: #fbbf24; }
.ops-list li.ops-bad .ops-st { color: #f87171; }


/* —— v49: ODO hero, Wächter, temps, wake/refresh —— */
.status-hero-v49 .odo-hero {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #e5e7eb;
  line-height: 1.05;
}
.status-hero-v49 .status-secondary-v49 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
  font-size: .72rem;
}
.status-hero-v49 .status-soc-sm,
.status-hero-v49 .status-range-sm {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.status-hero-v49 .status-soc-sm { color: var(--accent); }
.status-hero-v49 .status-range-sm { color: #c4b5fd; }
.status-hero-v49 .status-soh {
  margin-top: 0;
  font-size: .7rem;
  opacity: .85;
}
.status-hero-v49 .status-secondary-v49 .sep { opacity: .35; font-size: .7rem; }

.status-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.sentry-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #374151;
  line-height: 1.3;
}
.sentry-chip.ok {
  background: color-mix(in srgb, #34d399 18%, #111827);
  border-color: rgba(52, 211, 153, .5);
  color: #86efac;
}
.sentry-chip.off {
  background: #111827;
  border-color: #374151;
  color: #9ca3af;
  opacity: .75;
}
.temp-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 600;
  background: #111827;
  border: 1px solid #374151;
  color: #d1d5db;
  line-height: 1.3;
  white-space: nowrap;
}

.status-tools-v49 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  align-self: start;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 11rem;
}
.hdr-wake { display: inline-flex; margin: 0; padding: 0; }
.hdr-wake-btn,
.status-tools-v49 .hdr-refresh-btn {
  min-height: 40px;
  min-width: 44px;
  height: auto;
  width: auto;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #111827;
  color: #e5e7eb;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.hdr-wake-btn:hover,
.status-tools-v49 .hdr-refresh-btn:hover {
  border-color: #6b7280;
  color: #fff;
}
.hdr-wake-btn {
  border-color: rgba(96, 165, 250, .45);
  background: color-mix(in srgb, #3b82f6 16%, #111827);
  color: #bfdbfe;
}
.hdr-wake-btn:hover {
  border-color: rgba(147, 197, 253, .7);
  color: #eff6ff;
}
.menu-warn {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 700;
  background: #422006;
  color: #fcd34d;
}

html[data-theme="light"] .status-hero-v49 .odo-hero { color: #111827; }
html[data-theme="light"] .status-hero-v49 .status-range-sm { color: #6d28d9; }
html[data-theme="light"] .sentry-chip.ok {
  background: color-mix(in srgb, #34d399 14%, #fff);
  color: #065f46;
  border-color: rgba(16, 185, 129, .45);
}
html[data-theme="light"] .sentry-chip.off {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #6b7280;
}
html[data-theme="light"] .temp-chip {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}
html[data-theme="light"] .hdr-wake-btn,
html[data-theme="light"] .status-tools-v49 .hdr-refresh-btn {
  background: #fff;
  border-color: #d1d5db;
  color: #111827;
}
html[data-theme="light"] .hdr-wake-btn {
  background: color-mix(in srgb, #3b82f6 10%, #fff);
  border-color: rgba(59, 130, 246, .4);
  color: #1e40af;
}

@media (max-width: 560px) {
  .status-hero-v49 .odo-hero { font-size: 1.35rem; }
  .status-tools-v49 { max-width: 9.5rem; gap: 4px; }
  .hdr-wake-btn,
  .status-tools-v49 .hdr-refresh-btn {
    min-height: 38px;
    padding: 5px 8px;
    font-size: .66rem;
  }
  .status-top-v49.status-top-v32 {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "hero tools"
      "actions actions";
  }
}

/* —— v50: Abfahrt, Wächter-Rechnung, Vergleich, Reifen-Kapitel —— */
.departure-hero,
.sentry-bill-hero,
.compare-hero {
  margin: 10px 16px 0;
}
.departure-card,
.sentry-bill-card,
.compare-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.departure-line { margin: 4px 0 8px; line-height: 1.35; }
.departure-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.departure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.departure-actions .tag-btn,
.departure-actions button.tag-btn {
  appearance: none;
  border: 1px solid var(--border, #374151);
  background: var(--card-2, #1f2937);
  color: inherit;
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  text-decoration: none;
}
.departure-actions .tag-btn:hover,
.departure-actions button.tag-btn:hover {
  border-color: var(--accent);
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 16px 12px;
}
.compare-col { margin: 0; }
.code-block {
  background: var(--card-2, #111827);
  border: 1px solid var(--border, #374151);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
}
@media (max-width: 640px) {
  .departure-stats { grid-template-columns: repeat(2, 1fr); }
  .compare-grid { grid-template-columns: 1fr; }
}
html[data-theme="light"] .departure-actions .tag-btn,
html[data-theme="light"] .departure-actions button.tag-btn {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* v50 header: SoC/Rest primary; ODO secondary */
.status-hero-v49 .odo-hero-sm {
  font-size: 0.95rem;
  font-weight: 650;
  color: #9ca3af;
}
.status-hero-v49 .status-soc {
  font-size: 1.45rem;
  font-weight: 800;
}
.status-hero-v49 .status-range {
  font-size: 1.35rem;
  font-weight: 750;
}
html[data-theme="light"] .status-hero-v49 .odo-hero-sm { color: #6b7280; }


/* === v50c header: one main row + left SoC/Rest / ODO === */
.status-top-v51 {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: nowrap;
  width: 100%;
}
.status-left-stack {
  flex: 0 0 auto;
  min-width: 9.5rem;
  max-width: 14rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.status-top-v51 .status-hero-primary {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.status-top-v51 .status-soc {
  font-size: 1.45rem;
  font-weight: 800;
}
.status-top-v51 .status-range {
  font-size: 1.28rem;
  font-weight: 750;
}
.status-secondary-v51 {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 11rem;
}
.status-top-v51 .odo-hero-end {
  font-size: 1.12rem;
  font-weight: 750;
  color: #e5e7eb;
  margin-left: auto;
}
.status-top-v51 .status-soh {
  font-size: 0.78rem;
  color: #9ca3af;
  order: -1;
  margin-right: auto;
}
.status-main-row {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.status-main-row .action-btn {
  flex: 0 0 auto;
}
.status-tools-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px solid rgba(148,163,184,.35);
}
.action-lbl-temps {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.15;
  font-size: 0.68rem;
  text-transform: none;
}
.action-lbl-temps .temp-k {
  color: #9ca3af;
  font-weight: 500;
  margin-right: 3px;
}
.action-btn.action-temps {
  min-width: 4.2rem;
}
html[data-theme="light"] .status-top-v51 .odo-hero-end { color: #111827; }
html[data-theme="light"] .action-lbl-temps .temp-k { color: #6b7280; }
html[data-theme="light"] .status-tools-inline {
  border-left-color: #d1d5db;
}
@media (max-width: 900px) {
  .status-top-v51 { flex-wrap: wrap; }
  .status-main-row { width: 100%; }
}


/* === v50d header: centered, spaced, wrap to 2 rows; wake/refresh readable === */
.status-top-v51 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  flex-wrap: wrap;
  width: 100%;
}
.status-left-stack {
  flex: 0 1 auto;
  min-width: 8.5rem;
  max-width: none;
}
.status-secondary-v51 {
  justify-content: flex-start;
  min-width: 0;
}
.status-top-v51 .odo-hero-end {
  margin-left: 0;
}
.status-main-row {
  display: flex;
  flex: 1 1 100%;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
  overflow: visible;
  row-gap: 10px;
}
.status-main-row .action-btn {
  flex: 0 0 auto;
}
.status-tools-inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid rgba(148,163,184,.35);
}
.status-tools-inline .hdr-wake,
.status-tools-inline .hdr-refresh {
  display: inline-flex;
  margin: 0;
  padding: 0;
  position: static;
}
.status-tools-inline .hdr-wake-btn,
.status-tools-inline .hdr-refresh-btn {
  width: auto !important;
  height: auto !important;
  min-width: 6.2rem;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #111827;
  color: #e5e7eb;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: visible;
  text-indent: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.status-tools-inline .hdr-wake-btn {
  border-color: rgba(96, 165, 250, .45);
  background: color-mix(in srgb, #3b82f6 16%, #111827);
  color: #bfdbfe;
}
.status-tools-inline .hdr-refresh-btn:hover,
.status-tools-inline .hdr-wake-btn:hover {
  border-color: #6b7280;
  color: #fff;
}
html[data-theme="light"] .status-tools-inline .hdr-wake-btn,
html[data-theme="light"] .status-tools-inline .hdr-refresh-btn {
  background: #fff;
  border-color: #d1d5db;
  color: #111827;
}
html[data-theme="light"] .status-tools-inline .hdr-wake-btn {
  background: color-mix(in srgb, #3b82f6 10%, #fff);
  border-color: rgba(59, 130, 246, .4);
  color: #1e40af;
}
@media (min-width: 1100px) {
  .status-main-row {
    flex: 1 1 auto;
  }
  .status-left-stack {
    flex: 0 0 auto;
  }
}
@media (max-width: 900px) {
  .status-top-v51 {
    flex-direction: column;
    align-items: center;
  }
  .status-left-stack {
    width: 100%;
    align-items: center;
    text-align: center;
  }
  .status-secondary-v51 {
    justify-content: center;
  }
  .status-main-row {
    width: 100%;
    justify-content: center;
  }
  .status-tools-inline {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}


/* === v50e header: left vitals nudged toward centered action row === */
.status-top-v51 {
  justify-content: center;
  gap: 14px 28px;
}
@media (min-width: 1100px) {
  .status-top-v51 {
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
  }
  .status-left-stack {
    flex: 0 0 auto;
    margin: 0;
    padding-right: 6px;
  }
  .status-main-row {
    flex: 0 1 auto;
    width: auto;
    max-width: calc(100% - 12rem);
    justify-content: center;
  }
}
@media (max-width: 1099px) and (min-width: 901px) {
  .status-top-v51 {
    justify-content: center;
    gap: 12px 22px;
  }
  .status-left-stack {
    flex: 0 0 auto;
  }
  .status-main-row {
    flex: 0 1 auto;
    width: auto;
    justify-content: center;
  }
}


/* === v50g: Parkt under left vitals, left-aligned === */
.status-left-stack {
  align-items: flex-start;
  text-align: left;
}
.status-motion-under {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}
.status-motion-under .motion-chip {
  display: inline-flex;
}
@media (max-width: 900px) {
  .status-left-stack {
    align-items: flex-start;
    text-align: left;
  }
  .status-secondary-v51 {
    justify-content: flex-start;
  }
}


/* === v50h charge summary === */
.charge-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.28);
  background: rgba(17,24,39,.55);
}
.charge-summary-item { display: flex; flex-direction: column; gap: 2px; min-width: 5.5rem; }
.charge-summary .csk { font-size: .68rem; color: #9ca3af; text-transform: uppercase; letter-spacing: .02em; }
.charge-summary .csv { font-size: 1.05rem; font-weight: 750; color: #e5e7eb; }
html[data-theme="light"] .charge-summary { background: #f8fafc; border-color: #e5e7eb; }
html[data-theme="light"] .charge-summary .csv { color: #111827; }
/* —— v50k: nav pills (header restored) + subtle glow (not kitschy) —— */
.nav-pills.top-tabs {
  gap: 8px;
  padding: 10px 16px 12px;
}
.nav-pills .nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  background: linear-gradient(180deg, #121a2a 0%, #0b1220 100%);
  border: 1px solid rgba(55, 65, 81, .9);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: .88rem;
  font-weight: 650;
  letter-spacing: .01em;
  line-height: 1.1;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .15s ease;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 1px 2px rgba(0,0,0,.25);
}
.nav-pills .nav-btn .nav-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: .9;
}
.nav-pills .nav-btn:hover {
  color: var(--text);
  border-color: rgba(167, 139, 250, .35);
  background: linear-gradient(180deg, #1a2438 0%, #121a2a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 0 0 1px rgba(167, 139, 250, .12),
    0 0 14px rgba(167, 139, 250, .12);
}
.nav-pills .nav-btn.active {
  color: #f5f3ff;
  background: linear-gradient(180deg, rgba(167,139,250,.28) 0%, rgba(124,92,220,.18) 100%);
  border-color: rgba(196, 181, 253, .55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 0 0 1px rgba(167, 139, 250, .22),
    0 0 18px rgba(167, 139, 250, .28),
    0 0 36px rgba(167, 139, 250, .12);
}
.nav-pills .nav-btn.active .nav-icon { opacity: 1; }

.nav-pills.bottom-nav {
  gap: 6px;
  padding: 8px 8px calc(8px + var(--safe-bottom));
}
.nav-pills.bottom-nav .nav-btn {
  flex-direction: column;
  gap: 3px;
  border-radius: 14px;
  padding: 8px 4px 7px;
  font-size: .66rem;
  max-width: none;
  min-height: 52px;
}
.nav-pills.bottom-nav .nav-btn .nav-icon {
  font-size: 1.2rem;
}
.nav-pills.bottom-nav .nav-btn.active {
  color: #f5f3ff;
  background: linear-gradient(180deg, rgba(167,139,250,.28) 0%, rgba(124,92,220,.18) 100%);
  border-color: rgba(196, 181, 253, .55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 0 0 1px rgba(167, 139, 250, .22),
    0 0 16px rgba(167, 139, 250, .26);
}

html[data-theme="light"] .nav-pills .nav-btn {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #4b5563;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
html[data-theme="light"] .nav-pills .nav-btn:hover {
  background: #ebe4ff;
  border-color: #c4b5fd;
  color: #111827;
  box-shadow: 0 0 12px rgba(167, 139, 250, .18);
}
html[data-theme="light"] .nav-pills .nav-btn.active {
  color: #1f1635;
  background: #ddd6fe;
  border-color: #a78bfa;
  box-shadow: 0 0 14px rgba(167, 139, 250, .22);
}


/* —— v50l: compact overflow menu —— */
.menu-panel {
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  gap: 2px;
  min-width: 168px;
}
.menu-panel a, .menu-panel button {
  padding: 7px 10px;
  font-size: .88rem;
  line-height: 1.2;
}
.menu-label {
  margin: 6px 10px 2px;
  font-size: .62rem;
}

/* === v50m: Banner zentriert (Warn-/Info-Banner einheitlich) === */
.low-soc-banner {
  width: min(868px, calc(100% - 32px));
  margin: 8px auto 0;
}
.low-soc-banner,
.api-warn,
.fb-warn,
.commute-week-banner,
.flash {
  text-align: center;
  text-wrap: balance;
}

/* === v50n: Mobile-Overflow behoben (Ursache statt overflow-x:hidden) ===
   .recent ist ein Grid mit impliziter auto-Spalte: die wuchs auf die
   min-content-Breite der Aktivitaets-Vorschau (nowrap-Unterzeile), ~47 px
   breiter als das iPhone. Spalte darf jetzt schrumpfen, der Textblock in
   den Aktivitaets-Zeilen ebenso (dann greift die vorhandene Ellipsis). */
.recent { grid-template-columns: minmax(0, 1fr); }
.activity-body { flex: 1 1 auto; min-width: 0; }
.activity-title,
.leg-addr { overflow-wrap: anywhere; }


/* ===== v57 Paket B (03.10.2026): Touch-Ziele >= 44 px (Apple HIG 44 pt / Material 48 dp), Kontrast ===== */
@media (pointer: coarse), (max-width: 760px) {
  .action-btn, .hdr-wake-btn, .hdr-refresh-btn, .nav-btn, .btn, button, select, .seg-btn,
  input[type=text], input[type=number], input[type=date], input[type=time], input[type=datetime-local],
  input[type=search], input[type=password], input[type=email], input[type=submit], input[type=button], textarea {
    min-height: 44px;
  }
  .action-btn, .hdr-wake-btn, .hdr-refresh-btn { display: inline-flex; align-items: center; justify-content: center; }
  .motion-chip, .hdr-plus, .chip, .pill-link { position: relative; }
  .motion-chip::after, .hdr-plus::after, .chip::after, .pill-link::after {
    content: ""; position: absolute; inset: -15px -8px;   /* vergrößert nur die Trefferfläche, nicht die Optik */
  }
}
.v.missing, .tco-missing { color: #9ca3af; }
html[data-theme="light"] .v.missing, html[data-theme="light"] .tco-missing { color: #4b5563; }
.leaflet-container .leaflet-control-attribution a { color: #00557a; }

@media (pointer: coarse), (max-width: 760px) {
  html body .hdr-wake-btn, html body .hdr-refresh-btn,
  html body .status-tools-inline .hdr-wake-btn, html body .status-tools-inline .hdr-refresh-btn { min-height: 44px; height: auto; }
  html body .menu summary { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
  html body .menu a { min-height: 44px; display: flex; align-items: center; box-sizing: border-box; }
}
@media (pointer: coarse), (max-width: 760px) {
  html body table.fahrtenbuch .zweck-quick button, html body .zweck-quick button,
  html body .tag-btn, html body .departure-actions button.tag-btn { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
  html body input[type=checkbox], html body input[type=radio] { width: 22px; height: 22px; }
  html body label.day-chip { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; }
}

/* ===== v57 Paket C (03.10.2026): Dashboard-Layout, Wallbox-Karten mobil ===== */
.dash-now, .dash-cols, .dash-col, .dash-now-main, .dash-now-map { min-width: 0; }
.dash-more { margin: 12px 16px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.dash-more > summary { list-style: none; cursor: pointer; min-height: 44px; box-sizing: border-box; padding: 10px 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-weight: 600; }
.dash-more > summary::-webkit-details-marker { display: none; }
.dash-more > summary::before { content: "▸"; display: inline-block; transition: transform .15s; opacity: .7; }
.dash-more[open] > summary::before { transform: rotate(90deg); }
.dash-more-hint { font-weight: 400; font-size: .78rem; color: #9ca3af; }
.dash-more-grid { padding-bottom: 8px; }
@media (min-width: 1024px) {
  main.page:has(> .dash-cols) { max-width: 1240px; }
  .dash-now { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; align-items: start; }
  .dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; align-items: start; }
  .dash-more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; align-items: start; }
}
@media (max-width: 760px) {
  table.cards-sm { background: none; border: 0; }
  table.cards-sm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cards-sm, table.cards-sm tbody { display: block; width: 100%; }
  table.cards-sm tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px; margin: 0 0 10px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
  table.cards-sm td { display: block; padding: 0; border: 0; }
  table.cards-sm td:first-child, table.cards-sm td.full { grid-column: 1 / -1; }
  table.cards-sm td:first-child { font-weight: 600; }
  table.cards-sm td[data-label]::before { content: attr(data-label); display: block; font-size: .68rem; text-transform: uppercase;
    letter-spacing: .04em; color: #9ca3af; margin-bottom: 2px; font-weight: 600; }
  .table-wrap:has(> table.cards-sm) { overflow-x: visible; }
}

/* ===== v57 Paket D (03.10.2026): Abmelden als POST-Formular im Menü ===== */
.menu-panel form.menu-logout { margin: 0; }
.menu-panel form.menu-logout button { color: var(--text); }

/* ===== v58 (04.10.2026): Energie-Aufteilung (Schätzung) ===== */
.est-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: .66rem; font-weight: 600;
  letter-spacing: .02em; text-transform: none; color: #fde68a; background: rgba(217, 119, 6, .18); border: 1px solid rgba(251, 191, 36, .45); vertical-align: middle; }
.energy-split { margin: 12px 0; }
.energy-split .es-h { margin: 0 16px 8px; font-size: .95rem; opacity: .9; }
.es-note { margin: 8px 16px 0; font-size: .78rem; line-height: 1.4; color: #9ca3af; }
.energy-live-hero { margin: 10px 16px 0; }
.energy-live-card .es-meta { color: #9ca3af; }
html[data-theme="light"] .es-note, html[data-theme="light"] .energy-live-card .es-meta { color: #4b5563; }
html[data-theme="light"] .est-badge { color: #92400e; background: #fef3c7; border-color: #f59e0b; }

/* ===== v58d (05.10.2026): Energie-Aufteilung in kWh/100 km + %, Rückgewinn ohne Minus ===== */
.meas-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: .66rem; font-weight: 600;
  color: #a7f3d0; background: rgba(16, 185, 129, .16); border: 1px solid rgba(52, 211, 153, .45); vertical-align: middle; }
.energy-split .es-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.es-card { margin: 0 16px; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.es-lead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.es-lead-txt { font-size: .95rem; opacity: .8; }
.es-lead-num { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.es-lead-unit { font-size: .9rem; opacity: .7; }
.es-regen .es-lead-num { color: var(--green); }
.es-lead-sub { margin-top: 4px; font-size: .74rem; color: var(--muted); }
.es-bar { display: flex; height: 8px; margin: 12px 0 4px; border-radius: 999px; overflow: hidden; background: var(--border); }
.es-bar span { display: block; height: 100%; min-width: 2px; }
.es-bar-drive, .es-row-drive .es-dot { background: var(--accent); }
.es-bar-aux, .es-row-aux .es-dot { background: #f59e0b; }
.es-row.is-regen .es-dot { background: var(--green); }
.es-davon { margin-top: 10px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.es-rows { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.es-row { padding-top: 8px; border-top: 1px solid var(--border); }
.es-row:first-child { border-top: 0; padding-top: 2px; }
.es-row-main { display: flex; align-items: baseline; gap: 8px; }
.es-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; align-self: center; }
.es-row-label { flex: 1 1 auto; min-width: 0; font-size: .92rem; overflow-wrap: break-word; }
.es-row-val { flex: 0 0 auto; font-weight: 700; font-size: 1.05rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.es-row-val small { font-weight: 500; font-size: .72rem; opacity: .7; }
.es-row.is-regen .es-row-val { color: var(--green); }
.es-pct { font-weight: 500; font-size: .85rem; opacity: .75; }
.es-row-meta { margin: 2px 0 0 17px; font-size: .72rem; color: var(--muted); }
.metric .es-soc { opacity: .6; margin-top: 3px; }
@media (max-width: 380px) {
  .es-row-main { flex-wrap: wrap; }
  .es-row-val { margin-left: 17px; }
}
html[data-theme="light"] .meas-badge { color: #065f46; background: #d1fae5; border-color: #10b981; }
html .wh-km.wh-km-lead.wh-regen { color: var(--green); }

/* ===== v59 (06.10.2026): Tesla-News (Dashboard-Kachel + /news) ===== */
.news-hero { margin: 10px 16px 0; }
.news-card { padding: 14px; }
.news-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.news-card-all { font-size: .82rem; white-space: nowrap; }
.news-mini { list-style: none; margin: 0; padding: 0; }
.news-mini-item { border-top: 1px solid var(--border); }
.news-mini-item:first-child { border-top: 0; }
.news-mini-item a { display: block; padding: 9px 0; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.news-mini-item a:hover .news-mini-title, .news-mini-item a:focus-visible .news-mini-title { color: var(--accent); }
.news-mini-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: .92rem; line-height: 1.32; font-weight: 600; overflow-wrap: break-word; }
.news-mini-meta { display: block; margin-top: 3px; font-size: .72rem; color: var(--muted); }
.news-sw-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .68rem; font-weight: 700;
  color: #dcfce7; background: #14532d; border: 1px solid #22c55e; vertical-align: 1px; }
.news-mini-item.is-sw .news-mini-title, .news-item.is-sw .news-title { color: var(--green); }
.news-filter { flex-wrap: wrap; }
.news-lang { font-size: .8rem; }
.news-sw-note { opacity: .85; }
.news-day { margin: 6px 16px 4px; }
.news-day-h { margin: 14px 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.news-item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.news-item.is-sw { border-color: rgba(34, 197, 94, .6); box-shadow: inset 3px 0 0 #22c55e; }
.news-item.is-x { border-style: dashed; }
.news-link { display: block; padding: 11px 13px 10px; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.news-link:hover .news-title, .news-link:focus-visible .news-title { color: var(--accent); }
.news-meta { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 4px; }
.news-src { font-weight: 600; color: var(--text); opacity: .85; }
.news-tr { font-style: italic; }
.news-link .news-sw-badge { margin-bottom: 4px; }
.news-title { display: block; font-size: .98rem; line-height: 1.35; font-weight: 600; overflow-wrap: break-word; }
.news-teaser { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px; font-size: .84rem; line-height: 1.4; color: var(--muted); overflow-wrap: break-word; }
.news-orig { padding: 0 13px 9px; font-size: .76rem; color: var(--muted); }
.news-orig summary { cursor: pointer; }
.news-orig p { margin: 4px 0 0; }
.news-status { margin-top: 14px; font-size: .76rem; line-height: 1.45; }
.news-status p { margin: 0 0 6px; }
.news-src-off { opacity: .5; text-decoration: line-through; }
@media (min-width: 900px) {
  .news-day { max-width: 860px; }
}
html[data-theme="light"] .news-sw-badge { color: #065f46; background: #d1fae5; border-color: #10b981; }
html[data-theme="light"] .news-item.is-sw { border-color: #10b981; box-shadow: inset 3px 0 0 #10b981; }
.news-item.is-x .news-title { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  font-size: .9rem; font-weight: 500; line-height: 1.4; }

/* v59e: Wächter-Detailstatus gut lesbar, Chip-Größe unverändert: gleiche Zeile, line-height 1,
   kein Trennpunkt mehr (spart Breite), schmaleres Gewicht */
.action-lbl .sentry-detail { font-size: .6rem; line-height: 1; opacity: .85; margin-left: 3px; font-weight: 400;
  white-space: nowrap; letter-spacing: -.01em; }
.action-bar.action-grid.action-grid-compact.action-bar-inline .action-lbl .sentry-detail,
.status-main-row .action-lbl .sentry-detail { font-size: .6rem; line-height: 1; }
@media (max-width: 420px) { .action-lbl .sentry-detail { margin-left: 2px; font-size: .58rem; } }

/* v60: Demo-Banner (nur demo.telemy.de) */
.demo-banner { font-size: .72rem; line-height: 1.3; text-align: center; padding: 4px 10px;
  background: color-mix(in srgb, var(--accent, #7c3aed) 22%, #111827); color: #e5e7eb;
  border-bottom: 1px solid color-mix(in srgb, var(--accent, #7c3aed) 40%, #1f2937); }
html[data-theme="light"] .demo-banner { background: #ede9fe; color: #3b0764; border-bottom-color: #ddd6fe; }
