:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #5d6d7e;
  --line: #cfd8e3;
  --panel: #ffffff;
  --page: #edf2f7;
  --accent: #0066b1;
  --accent-deep: #003b73;
  --accent-soft: #d9ecff;
  --sky: #00a8e1;
  --sky-soft: #e1f6fd;
  --accent-2: #f5b800;
  --yellow-soft: #fff6cf;
  --danger: #d62839;
  --danger-soft: #ffe7ea;
  --good: #168568;
  --good-soft: #e2f6ef;
  --shadow: 0 18px 48px rgba(0, 39, 78, 0.14);
}

.home-screen .home-copy h1,
body.theme-simple-mobile .home-screen .home-copy h1,
body.theme-mobile-app .home-screen .home-copy h1,
body.theme-premium .home-screen .home-copy h1 {
  color: #f6c85f !important;
}

#homeLogConsentText {
  text-align: center;
  white-space: pre-line;
}

/* Laatste cascade: houd alle pulldownpijlen direct naast de titel. */
.measurement-settings > summary,
.capacity-guide > summary,
.battery-score-panel > summary,
.reliability-panel > summary,
.cell-index-details > summary,
.fold-details > summary {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.battery-score-panel > summary > h2,
.fold-details > summary > div,
.fold-details > summary > div > h2,
.fold-details > summary > div > p {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.fold-details > summary > div {
  min-width: 0;
}

.measurement-settings > summary::after,
.capacity-guide > summary::after,
.battery-score-panel > summary::after {
  content: none;
}

.measurement-settings > summary::before,
.capacity-guide > summary::before,
.battery-score-panel > summary::before,
.reliability-panel > summary::before,
.cell-index-details > summary::before,
.fold-details > summary::before {
  content: "\25BC";
  width: auto;
  height: auto;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  color: currentColor;
  background: transparent;
  box-shadow: none;
  font-size: 0.72rem;
}

.measurement-settings[open] > summary::before,
.capacity-guide[open] > summary::before,
.battery-score-panel[open] > summary::before,
.reliability-panel[open] > summary::before,
.cell-index-details[open] > summary::before,
.fold-details[open] > summary::before {
  content: "\25B2";
}

.measurement-settings .settings-summary-icon {
  display: inline-grid;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 1.15rem;
  place-items: center;
  color: currentColor;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.fold-details > summary > strong {
  margin-left: auto;
}

/* Houd de bediening van Ritgemeten capaciteit compact op kleinere schermen. */
@media (max-width: 820px) {
  #rideCapacityModal .ride-capacity-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    max-width: none;
  }

  #rideCapacityModal .ride-capacity-actions > * {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 34px;
    padding: 4px 6px;
    font-size: 0.76rem;
    line-height: 1.05;
    white-space: normal;
  }

  #rideCapacityModal .ride-capacity-actions > :nth-child(-n + 4) {
    grid-column: span 2;
  }
}

/* Vaste kop en zelfstandige scrollbar voor het lange adapteroverzicht. */
body #adapterModal .history-dialog {
  overflow: hidden;
}

#adapterModal .history-dialog-header {
  flex: 0 0 auto;
}

#adapterModal #adapterContent {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

#adapterModal #adapterContent > * {
  min-width: 0;
}

#adapterModal .adapter-practice-table-wrap {
  max-width: 100%;
}

/* Geef de secundaire functies een herkenbare, volledige actieregel. */
.actions > .more-actions {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  border-top: 0;
  padding-top: 0;
}

body:not(.home-visible) .actions .more-actions > summary {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 7px 11px;
  border: 1px solid #75b7d8;
  border-radius: 6px;
  color: #064c76 !important;
  background: #eaf6fc !important;
  background-image: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  list-style: none;
  cursor: pointer;
}

.more-actions > summary::-webkit-details-marker {
  display: none;
}

.more-actions-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: #fff;
  background: #0a77a8;
  font-size: 1rem;
  line-height: 1;
}

#moreActionsSummary {
  min-width: 0;
  font-weight: 900;
}

.more-actions-chevron {
  justify-self: end;
  color: #0a638d;
  font-size: 0.72rem;
  line-height: 1;
  transition: transform 160ms ease;
}

body:not(.home-visible) .actions .more-actions[open] > summary {
  border-color: #3b96c2;
  background: #dceff9 !important;
  box-shadow: inset 4px 0 0 #0a77a8;
}

.more-actions[open] > summary .more-actions-chevron {
  transform: rotate(180deg);
}

/* Modale vensters blijven boven de vaste werkbalk, ook na alle themaregels. */
body .history-modal {
  z-index: 100 !important;
}

body #improveModal {
  z-index: 110 !important;
}

/* Definitieve stapelvolgorde voor alle schermvullende vensters. */
body .history-modal {
  z-index: 100 !important;
}

body #improveModal {
  z-index: 110 !important;
}

/* BACH 2.23 workspace redesign. Functional IDs and data remain unchanged. */
:root {
  --workspace-navy: #082b49;
  --workspace-blue: #087fb9;
  --workspace-yellow: #f3c84b;
  --workspace-green: #15866c;
  --workspace-red: #c93d45;
  --workspace-line: #d8e3ea;
  --workspace-surface: #ffffff;
  --workspace-canvas: #eef4f6;
}

html { scroll-behavior: smooth; }

body:not(.home-visible) {
  background: var(--workspace-canvas);
}

.app-shell {
  width: min(1480px, 100%);
  gap: 14px;
}

.topbar {
  min-height: 104px;
  padding: 18px 22px;
  border-bottom: 4px solid var(--workspace-yellow);
  border-radius: 0;
  background: var(--workspace-navy);
}

.topbar h1 { font-size: 3rem; }
.topbar .eyebrow { color: var(--workspace-yellow); }
.topbar-status { align-self: center; }

.workspace-nav {
  position: sticky;
  top: 6px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #cbd9e2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(8, 43, 73, 0.12);
}

.workspace-nav-item {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-right: 1px solid var(--workspace-line);
  border-radius: 0;
  color: #29475c;
  background: #fff;
  box-shadow: none;
  font-weight: 800;
  text-decoration: none;
}

.workspace-nav-item:last-child { border-right: 0; }
.workspace-nav-item span {
  color: #678092;
  font-size: 0.7rem;
}
.workspace-nav-item:hover,
.workspace-nav-item:focus-visible,
.workspace-nav-item.active {
  color: #fff;
  background: var(--workspace-navy);
}
.workspace-nav-item:hover span,
.workspace-nav-item:focus-visible span,
.workspace-nav-item.active span { color: var(--workspace-yellow); }

.workspace-section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--workspace-line);
}
.workspace-section-heading h2 {
  margin: 2px 0 0;
  color: var(--workspace-navy);
  font-size: 1.35rem;
  letter-spacing: 0;
}
.workspace-section-heading p {
  max-width: 520px;
  margin: 0;
  color: #5a7080;
  text-align: right;
}
.section-kicker {
  color: var(--workspace-green);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
  background: var(--workspace-surface);
  box-shadow: 0 8px 24px rgba(8, 43, 73, 0.08);
}
.actions > .measurement-settings,
.actions > .measurement-progress,
.actions > .adapter-failure-help,
.actions > .more-actions { grid-column: 1 / -1; }
.measurement-overview {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid #c7dce4;
  border-left: 5px solid var(--workspace-green);
  border-radius: 8px;
  background: #f4fafb;
}
.measurement-overview .workspace-section-heading {
  display: grid;
  gap: 2px;
  padding: 0 0 4px;
  border-color: #d5e4e9;
}
.measurement-overview .workspace-section-heading h2 {
  color: var(--workspace-navy) !important;
  font-size: 0.95rem;
  line-height: 1.2;
}
.measurement-overview .workspace-section-heading p {
  max-width: none;
  color: #526b79;
  font-size: 0.7rem;
  line-height: 1.25;
  text-align: left;
}
.measurement-overview .section-kicker {
  color: var(--workspace-green);
}
.measurement-overview .measurement-obd-status {
  padding: 5px 7px;
}
.measurement-overview .measurement-obd-status-copy strong {
  font-size: 0.78rem;
}
.measurement-overview .measurement-obd-status-copy small {
  font-size: 0.64rem;
}
.measurement-obd-status {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d6b35a;
  border-radius: 7px;
  color: #4f4321;
  background: #fff9e8;
}
.measurement-obd-status-dot {
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #c99516;
  box-shadow: 0 0 0 3px rgba(201, 149, 22, 0.2);
}
.measurement-obd-status-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.measurement-obd-status-copy strong {
  color: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
}
.measurement-obd-status-copy small {
  color: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.3;
}
.measurement-obd-status[data-connected="true"] {
  border-color: #168568;
  color: #07533f;
  background: #e2f6ef;
  box-shadow: 0 0 0 3px rgba(22, 133, 104, 0.12);
}
.measurement-obd-status[data-connected="true"] .measurement-obd-status-dot {
  background: #168568;
  box-shadow: 0 0 0 4px rgba(22, 133, 104, 0.2);
}
.actions > #connectBleButton {
  min-height: 48px;
  background: var(--workspace-green);
}
.actions > #liveDashboardButton {
  min-height: 48px;
  background: var(--workspace-blue);
}
.actions > #homeButton,
.actions > #closeBachButton,
.actions > #topResetProfileButton { min-height: 40px; }

.measurement-steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  position: relative;
  overflow: visible;
  border: 1px solid var(--workspace-line);
  border-radius: 7px;
  list-style: none;
  background: var(--workspace-line);
}

.actions > .measurement-steps {
  flex: 1 1 100%;
  width: 100%;
}
.measurement-steps li {
  display: grid;
  grid-template-columns: 30px 1fr;
  padding: 10px 12px;
  background: #f8fbfc;
}
.measurement-steps li > span {
  grid-row: span 2;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  align-self: center;
  border-radius: 50%;
  color: #fff;
  background: var(--workspace-navy);
  font-size: 0.72rem;
  font-weight: 900;
}
.measurement-steps strong { color: var(--workspace-navy); }
.measurement-steps small { color: #69808f; }

.measurement-steps .measurement-settings-step {
  display: block;
  min-width: 0;
  padding: 0;
  position: static;
}

.measurement-settings-step .measurement-settings {
  position: static;
  height: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: #f8fbfc;
}

.measurement-settings-step .measurement-settings > summary {
  min-height: 100%;
  padding: 10px 12px;
  color: var(--workspace-navy);
  background: #f8fbfc;
}

.measurement-settings-step .settings-summary-icon {
  color: #0a77a8 !important;
}

.measurement-settings-step .measurement-settings-grid {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 30;
  max-height: min(70vh, 640px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--workspace-line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(8, 43, 73, 0.2);
}

.more-actions {
  border-top: 1px solid var(--workspace-line);
  padding-top: 6px;
}
.more-actions > summary {
  width: fit-content;
  padding: 8px 2px;
  color: var(--workspace-navy);
  font-weight: 900;
  cursor: pointer;
}
.more-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
}

.more-language-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

.more-language-switcher .more-language-button {
  min-width: 0;
  min-height: 40px;
  padding: 8px 3px;
  font-size: 0.78rem;
}

.more-actions-reminder {
  margin-top: 10px;
}

.dashboard {
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
  background: var(--workspace-surface);
  box-shadow: 0 8px 24px rgba(8, 43, 73, 0.08);
}
.dashboard > .results-heading { grid-column: 1 / -1; }
.meter-panel {
  border: 0;
  border-right: 1px solid var(--workspace-line);
  border-radius: 0;
  box-shadow: none;
}
.readout-grid {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
  background: var(--workspace-line);
}
.readout {
  min-height: 88px;
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.readout.vehicle-status-readout,
.readout.quality-readout {
  border-top: 3px solid var(--workspace-yellow);
  background: #fffdf3;
}
.readout.cell-voltage-readout {
  grid-column: 1 / -1;
  border-top: 3px solid var(--workspace-green);
  background: #f5fbf8;
}
.readout.module-readout,
.readout.pack-stats-readout { grid-column: span 2; }
.readout > span:first-child { color: #526b7c; }
.readout > strong { color: var(--workspace-navy); }

.capacity-guide,
.battery-score-panel,
.reliability-panel,
.report-download-panel,
.history-panel,
.reminder-panel,
.manual-band,
.measurement-tip.install-note {
  border-radius: 8px;
  box-shadow: none;
}

.report-download-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 18px;
  border-left: 5px solid var(--workspace-green);
  background: #fff;
}
.report-download-panel p { margin: 0; }

@media (max-width: 760px) {
  .app-shell { gap: 9px; }
  .topbar { min-height: 86px; padding: 14px; }
  .workspace-nav { top: 2px; }
  .workspace-nav-item { min-height: 46px; flex-direction: column; gap: 1px; font-size: 0.68rem; }
  .workspace-nav-item span { font-size: 0.58rem; }
  .workspace-section-heading { display: block; }
  .workspace-section-heading p { margin-top: 5px; text-align: left; font-size: 0.8rem; }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .measurement-steps li { grid-template-columns: 24px 1fr; padding: 8px 6px; }
  .measurement-steps li > span { width: 20px; height: 20px; }
  .measurement-steps small { font-size: 0.62rem; }
  .measurement-settings-step .measurement-settings > summary {
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    font-size: 0.72rem;
  }
  .more-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard { padding: 12px; }
  .meter-panel { border-right: 0; border-bottom: 1px solid var(--workspace-line); }
  .readout.module-readout,
  .readout.pack-stats-readout { grid-column: 1 / -1; }
  .report-download-panel { grid-template-columns: 1fr; }
}

/* Neutraliseer oudere themalagen binnen het nieuwe werkvlak. */
body:not(.home-visible) .actions,
body:not(.home-visible) .dashboard,
body:not(.home-visible) .reminder-panel,
body:not(.home-visible) .measurement-tip,
body:not(.home-visible) .manual-band,
body:not(.home-visible) .capacity-guide,
body:not(.home-visible) .battery-score-panel,
body:not(.home-visible) .reliability-panel,
body:not(.home-visible) .report-download-panel,
body:not(.home-visible) .history-panel {
  color: #18364a;
  border-color: var(--workspace-line);
  background: #fff;
  background-image: none;
}

body:not(.home-visible) .actions button:not(.help-button):not(.adapter-failure-close),
body:not(.home-visible) .more-actions button,
body:not(.home-visible) .manual-band button,
body:not(.home-visible) .report-download-button {
  color: #fff;
  border: 1px solid #0a638d;
  background: #0a77a8;
  background-image: none;
  box-shadow: none;
}

body:not(.home-visible) .actions #connectBleButton {
  border-color: #117159;
  background: var(--workspace-green);
}

body:not(.home-visible) .actions #closeBachButton {
  border-color: #a92f38;
  background: var(--workspace-red);
}

body:not(.home-visible) .actions #homeButton,
body:not(.home-visible) .actions #topResetProfileButton,
body:not(.home-visible) .actions #connectSerialButton {
  color: var(--workspace-navy);
  border-color: #b9ccd7;
  background: #f4f8fa;
}

body:not(.home-visible) .measurement-settings,
body:not(.home-visible) .more-actions,
body:not(.home-visible) .reminder-details,
body:not(.home-visible) .fold-details {
  color: #18364a;
  background: transparent;
  background-image: none;
}

body:not(.home-visible) .measurement-settings > summary,
body:not(.home-visible) .more-actions > summary,
body:not(.home-visible) .reminder-heading,
body:not(.home-visible) .fold-details > summary {
  color: var(--workspace-navy);
  background: #f7fafb;
  background-image: none;
}

body:not(.home-visible) .measurement-tip {
  border-left: 5px solid var(--workspace-blue);
  background: #f4fafc;
}

body:not(.home-visible) .manual-band {
  border-left: 5px solid var(--workspace-yellow);
}

body:not(.home-visible) .condition-item,
body:not(.home-visible) .readout,
body:not(.home-visible) .meter-panel {
  color: #18364a;
  background-color: #fff;
  background-image: none;
}

.report-download-panel {
  margin-top: 12px;
  border: 1px solid rgba(0, 102, 177, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(0, 102, 177, 0.1), rgba(255, 255, 255, 0.98) 56%, rgba(246, 200, 95, 0.16));
  box-shadow: var(--shadow);
}

.report-download-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(0, 70, 130, 0.35);
  border-radius: 7px;
  color: #ffffff;
  background: linear-gradient(180deg, #168bc4, #0069b4 58%, #00518c);
  box-shadow: 0 5px 12px rgba(0, 69, 122, 0.2);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.report-download-button:hover {
  filter: brightness(1.05);
}

.report-download-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.report-download-panel p {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

body .home-version-row button.home-about-help {
  display: inline-grid !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid rgba(255, 255, 255, 0.74) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #35b866, #11863c) !important;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  font-size: 1rem !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-align: center !important;
}

body .home-version-row button.home-about-help::before {
  content: none !important;
}

body button[id^="close"][id$="Button"],
body button[id*="Close"][id$="Button"],
body .small-button.close-button {
  border-color: rgba(255, 120, 120, 0.72) !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #f45a5a 0%, #d62839 52%, #8f1515 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 10px 22px rgba(143, 21, 21, 0.26) !important;
}

body button[id^="close"][id$="Button"]:hover,
body button[id^="close"][id$="Button"]:focus-visible,
body button[id*="Close"][id$="Button"]:hover,
body button[id*="Close"][id$="Button"]:focus-visible,
body .small-button.close-button:hover,
body .small-button.close-button:focus-visible {
  background: linear-gradient(180deg, #ff7070 0%, #e03143 52%, #a31616 100%) !important;
}

button[id^="close"][id$="Button"],
button[id*="Close"][id$="Button"],
.small-button.close-button {
  border-color: rgba(255, 120, 120, 0.72) !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #f45a5a 0%, #d62839 52%, #8f1515 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 10px 22px rgba(143, 21, 21, 0.26) !important;
}

button[id^="close"][id$="Button"]:hover,
button[id^="close"][id$="Button"]:focus-visible,
button[id*="Close"][id$="Button"]:hover,
button[id*="Close"][id$="Button"]:focus-visible,
.small-button.close-button:hover,
.small-button.close-button:focus-visible {
  background: linear-gradient(180deg, #ff7070 0%, #e03143 52%, #a31616 100%) !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 102, 177, 0.25), transparent 38%),
    linear-gradient(315deg, rgba(245, 184, 0, 0.22), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, rgba(0, 168, 225, 0.06) 48%, transparent 70%),
    var(--page);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.home-screen {
  display: none;
  min-height: calc(100vh - 48px);
}

body.home-active .home-screen {
  display: grid;
}

body.home-active .app-shell > :not(.home-screen) {
  display: none !important;
}

body.home-active .app-shell > .history-modal.open {
  display: block !important;
}

.bach-closed-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--page);
}

.bach-closed-screen[hidden] {
  display: none;
}

.bach-closed-panel {
  width: min(520px, 100%);
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 18px 50px rgba(6, 31, 56, 0.14);
}

.bach-closed-panel h1,
.bach-closed-panel h2,
.bach-closed-panel p {
  margin: 0 0 12px;
}

.bach-closed-panel .home-button {
  width: 100%;
  margin-top: 8px;
}

body.bach-closed {
  overflow: hidden;
}

body.bach-closed .app-shell > :not(.bach-closed-screen) {
  display: none !important;
}

body.bach-closed .bach-closed-screen {
  display: grid;
}

body:not(.home-active) .topbar {
  display: none;
}

.home-hero {
  position: relative;
  min-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(16, 24, 32, 0.22), rgba(0, 102, 177, 0.18)),
    url("home-bmw-i3.jpeg?v=2.20.74") center / cover no-repeat,
    #101820;
  box-shadow: 0 28px 78px rgba(0, 24, 48, 0.28);
}

.home-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 13, 20, 0.74) 0%, rgba(7, 13, 20, 0.34) 48%, rgba(7, 13, 20, 0.08) 100%),
    linear-gradient(0deg, rgba(7, 13, 20, 0.58) 0%, rgba(7, 13, 20, 0.1) 54%, rgba(7, 13, 20, 0.22) 100%);
}

.home-overlay {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(18px, 4vw, 46px);
  color: #ffffff;
}

.home-copy {
  max-width: 680px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}

.home-eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-copy h1 {
  max-width: 760px;
  color: #f6c85f;
  font-size: clamp(2rem, 7vw, 5.2rem);
  line-height: 0.95;
}

body .home-copy h1 {
  color: #f6c85f;
}

body.theme-premium .home-copy h1 {
  color: #f6c85f;
}


.home-subtitle,
.app-subtitle {
  margin: 8px 0 0;
  color: inherit;
  font-size: clamp(1rem, 2.8vw, 1.45rem);
  font-weight: 850;
  letter-spacing: 0;
}

.home-tagline,
.app-tagline {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.94rem;
  font-weight: 750;
}

.app-subtitle,
.app-tagline {
  color: var(--muted);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(216, 177, 90, 0.46);
  border-radius: 999px;
  padding: 5px 10px;
  color: #fff3bf;
  background: rgba(7, 21, 34, 0.42);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: none;
}

.home-copy .version-badge {
  position: absolute;
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
  margin: 0;
}

.home-version-row {
  position: absolute;
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.home-version-row .version-badge {
  position: static;
  margin: 0;
}

.home-about-help {
  display: inline-grid;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(180deg, #35b866, #11863c);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

.home-about-help:hover,
.home-about-help:focus-visible {
  background: linear-gradient(180deg, #45c978, #0f7837);
  outline: 2px solid rgba(255, 255, 255, 0.82);
  outline-offset: 2px;
}

.topbar .version-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  margin: 0;
}

.topbar > div:first-child {
  padding-right: 86px;
}

.home-version,
.home-connection {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.9rem, 2vw, 1.08rem);
  font-weight: 800;
}

.home-connection {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(16, 24, 32, 0.28);
  backdrop-filter: blur(10px);
}

.home-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.home-status-row .home-connection,
.home-status-row .home-awake-status {
  margin: 0;
}

.bach-awake-status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.bach-awake-status.awake {
  color: var(--good);
}

.home-awake-status {
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.home-awake-status.awake {
  color: #bfffe1;
}

.home-install-panel {
  width: min(360px, 88vw);
  margin: auto auto 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-left: 5px solid var(--accent-2);
  border-radius: 8px;
  padding: 13px 14px 14px;
  color: #08243a;
  background: linear-gradient(135deg, rgba(255, 248, 214, 0.96), rgba(229, 247, 255, 0.94));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  text-align: center;
  text-shadow: none;
}

.home-install-panel.installed {
  order: 3;
  width: auto;
  margin: 4px auto 0;
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  color: #bff5dc;
  background: rgba(8, 45, 36, 0.48);
  box-shadow: none;
}

.home-install-panel strong {
  display: block;
  color: #06263e;
  font-size: 1rem;
  font-weight: 950;
}

.home-install-panel p {
  margin: 6px 0 10px;
  color: #183a50;
  font-size: 0.84rem;
  font-weight: 850;
  white-space: pre-line;
}

.home-install-panel #installButton {
  width: 100%;
  color: #ffffff;
  border-color: rgba(0, 102, 177, 0.62);
  background: linear-gradient(180deg, #0076c8, #004f91);
}

.home-install-panel.installed #installButton {
  display: none;
}

.home-install-panel.installed p {
  display: none;
}

.home-install-panel.installed strong {
  color: #bff5dc;
  font-size: 0.82rem;
  text-transform: lowercase;
}

.home-log-consent-panel {
  width: min(560px, 92vw);
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-left: 5px solid var(--accent-2);
  border-radius: 8px;
  padding: 13px 14px;
  color: #08243a;
  background: linear-gradient(135deg, rgba(255, 248, 214, 0.25), rgba(229, 247, 255, 0.25));
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  text-align: left;
  text-shadow: none;
}

.home-log-consent-panel.accepted {
  border-left-color: var(--good);
  width: min(420px, 92vw);
  padding: 7px 8px;
}

.home-log-consent-panel.accepted > strong {
  font-size: 0.78rem;
}

.home-log-consent-panel.accepted #homeLogConsentText,
.home-log-consent-panel.accepted .home-log-consent-actions {
  display: none;
}

.home-log-consent-panel.accepted .home-log-consent-status {
  min-height: 0;
  margin-top: 3px;
  font-size: 0.68rem;
  line-height: 1.2;
}

.home-log-consent-panel.accepted .home-obd-connection-banner {
  margin-top: 5px;
  padding: 6px 7px;
  gap: 7px;
}

.home-log-consent-panel.accepted .home-obd-connection-banner .home-obd-connection-copy strong {
  font-size: 0.8rem;
}

.home-log-consent-panel.accepted .home-obd-connection-banner .home-obd-connection-copy small {
  font-size: 0.65rem;
}

.home-log-consent-panel.declined {
  border-left-color: var(--danger);
}

.home-log-consent-panel.attention-pulse {
  animation: attentionPulse 0.85s ease-in-out 3;
}

.home-log-consent-panel strong {
  display: block;
  color: #f6c85f;
  font-size: 1rem;
  font-weight: 950;
}

.home-obd-connection-banner {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(246, 200, 95, 0.7);
  border-radius: 6px;
  background: rgba(10, 35, 52, 0.82);
}

.home-obd-connection-banner[hidden] {
  display: none;
}

.home-obd-connection-dot {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(245, 184, 0, 0.2);
}

.home-obd-connection-copy {
  min-width: 0;
}

.home-obd-connection-banner .home-obd-connection-copy strong {
  color: #ffffff;
  font-size: 1.02rem;
  line-height: 1.2;
}

.home-obd-connection-banner .home-obd-connection-copy small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
}

.home-obd-connection-banner[data-connected="true"] {
  border-color: #168568;
  background: #e2f6ef;
  box-shadow: 0 0 0 3px rgba(22, 133, 104, 0.18);
}

.home-obd-connection-banner[data-connected="true"] .home-obd-connection-dot {
  border-color: #ffffff;
  background: #168568;
  box-shadow: 0 0 0 4px rgba(22, 133, 104, 0.2);
}

.home-obd-connection-banner[data-connected="true"] .home-obd-connection-copy strong {
  color: #07533f;
  font-size: 1.12rem;
}

.home-obd-connection-banner[data-connected="true"] .home-obd-connection-copy small {
  color: #164b3d;
}

.home-obd-connection-banner[data-failed="true"] {
  border-color: #f28b82;
  background: #fff0ef;
  box-shadow: 0 0 0 3px rgba(184, 36, 36, 0.14);
}

.home-obd-connection-banner[data-failed="true"] .home-obd-connection-dot {
  background: #b82424;
  box-shadow: 0 0 0 4px rgba(184, 36, 36, 0.16);
}

.home-obd-connection-banner[data-failed="true"] .home-obd-connection-copy strong,
.home-obd-connection-banner[data-failed="true"] .home-obd-connection-copy small {
  color: #7e1717;
}

.home-log-consent-panel p {
  margin: 6px 0 0;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
}

.home-log-consent-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.home-log-consent-actions .home-button {
  width: 100%;
  color: #ffffff;
  background: linear-gradient(180deg, #0076c8, #004f91);
}

.home-log-consent-actions .home-button:not(.primary) {
  color: #08243a;
  background: rgba(255, 255, 255, 0.72);
}

.home-log-consent-status {
  min-height: 1.1em;
  color: #ffffff !important;
}

.home-log-consent-panel.declined .home-log-consent-status {
  color: #8f1515 !important;
}

.home-next-step-panel {
  display: none;
  width: min(560px, 92vw);
  margin: 0 auto;
  border: 1px solid rgba(31, 167, 127, 0.46);
  border-left: 5px solid var(--good);
  border-radius: 8px;
  padding: 11px 14px;
  color: #ffffff;
  background: rgba(6, 37, 57, 0.54);
  backdrop-filter: blur(9px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  text-align: left;
  text-shadow: none;
}

.home-next-step-panel.visible {
  display: block;
}

.home-next-step-panel strong {
  display: block;
  color: #bff5dc;
  font-size: 1rem;
  font-weight: 950;
}

.home-next-step-panel p {
  margin: 5px 0 0;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.32;
}

.home-next-step-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.home-next-step-actions .home-button {
  width: 100%;
}

.home-adapter-advice-panel {
  display: none;
  width: min(560px, 92vw);
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-left: 5px solid var(--accent-2);
  border-radius: 8px;
  padding: 11px 14px 12px;
  color: #ffffff;
  background: rgba(6, 37, 57, 0.62);
  backdrop-filter: blur(9px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  text-align: left;
  text-shadow: none;
}

.home-adapter-advice-panel.visible {
  display: block;
}

.home-adapter-advice-panel.suitable {
  border-left-color: var(--good);
}

.home-adapter-advice-panel.limited {
  border-left-color: var(--accent-2);
}

.home-adapter-advice-panel.unsuitable {
  border-left-color: var(--danger);
}

.home-adapter-advice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-adapter-advice-header strong {
  color: #bff5dc;
  font-size: 1rem;
  font-weight: 950;
}

.home-adapter-advice-header span {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  padding: 3px 8px;
  color: #08243a;
  background: rgba(255, 255, 255, 0.84);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.home-adapter-advice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.home-adapter-advice-list div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.12);
}

.home-adapter-advice-list dt {
  margin: 0 0 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.home-adapter-advice-list dd {
  margin: 0;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.home-adapter-advice-panel p {
  margin: 9px 0 0;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.34;
}

.home-button.consent-blocked {
  opacity: 0.55;
  cursor: not-allowed;
}

.home-button.consent-accepted {
  opacity: 0.78;
  cursor: default;
  color: #08243a;
  background: linear-gradient(180deg, rgba(221, 255, 239, 0.88), rgba(181, 238, 212, 0.88)) !important;
  border-color: rgba(22, 133, 104, 0.62) !important;
}

.home-actions {
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  padding-bottom: clamp(4px, 3vh, 28px);
}

.home-actions .home-button[hidden] {
  display: none;
}

.home-button {
  width: min(260px, 82vw);
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 7px 12px;
  color: #ffffff;
  background: rgba(16, 24, 32, 0.26);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  font-size: 0.82rem;
  font-weight: 850;
}

.home-obd-button {
  width: min(300px, 88vw);
  min-height: 46px;
  background: rgba(0, 102, 177, 0.58);
  box-shadow: 0 12px 28px rgba(0, 68, 119, 0.3);
  font-size: 0.94rem;
}

.home-obd-button,
.home-obd-button:hover,
.home-obd-button:focus-visible {
  color: #f6c85f;
  border-color: rgba(246, 200, 95, 0.68);
  font-weight: 950;
}

.home-obd-button.connection-failed {
  color: #ffffff;
  border-color: #f28b82;
  background: linear-gradient(180deg, rgba(202, 55, 55, 0.94), rgba(143, 21, 21, 0.94));
}

.home-secondary-action {
  width: min(220px, 74vw);
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.74rem;
  opacity: 0.9;
}

.close-bach-button {
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #d42f2f, #8f1515) !important;
  box-shadow: 0 10px 24px rgba(143, 21, 21, 0.28);
}

.close-bach-button:hover,
.close-bach-button:focus-visible {
  background: linear-gradient(135deg, #ef4444, #a31616) !important;
}

.home-language-select {
  width: min(260px, 82vw);
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 5px 8px 5px 12px;
  color: #ffffff;
  background: rgba(16, 24, 32, 0.26);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.home-language-select span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-language-select select {
  min-width: 0;
  max-width: 170px;
  border: 0;
  color: #ffffff;
  background: transparent;
  outline: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
}

.home-language-select option {
  color: #102235;
  background: #ffffff;
}

.home-button.attention-pulse,
.small-button.attention-pulse {
  animation: attentionPulse 0.85s ease-in-out 3;
}

@keyframes attentionPulse {
  0%, 100% {
    outline: 0 solid rgba(0, 168, 225, 0);
    box-shadow: 0 11px 22px rgba(0, 39, 78, 0.12);
  }
  50% {
    outline: 4px solid rgba(0, 168, 225, 0.28);
    box-shadow: 0 0 0 8px rgba(0, 168, 225, 0.12), 0 14px 28px rgba(0, 102, 177, 0.22);
  }
}
.primary {
  border-color: rgba(0, 168, 225, 0.72);
  background: rgba(0, 102, 177, 0.44);
}

#connectBleButton {
  color: #ffffff;
  border-color: rgba(31, 167, 127, 0.72);
  background: linear-gradient(180deg, #2bc892 0%, #168568 100%);
}

@media screen and (max-width: 640px) {
  .home-screen {
    min-height: calc(100vh - 28px);
  }

  .home-hero {
    min-height: calc(100vh - 28px);
  }

  .home-overlay {
    padding: 18px;
  }

  .home-actions {
    gap: 6px;
    padding-bottom: 10px;
  }

  .home-button {
    width: min(230px, 82vw);
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .home-obd-button {
    width: min(260px, 88vw);
    min-height: 42px;
    font-size: 0.88rem;
  }

  .home-secondary-action {
    width: min(205px, 72vw);
    min-height: 28px;
    padding: 4px 9px;
    font-size: 0.7rem;
  }

  .home-language-select {
    width: min(230px, 82vw);
    min-height: 32px;
    padding: 4px 7px 4px 10px;
  }

  .home-language-select select {
    max-width: 150px;
    font-size: 0.74rem;
  }

  .home-log-consent-actions {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
    gap: 6px;
  }

  .home-log-consent-actions .home-button {
    min-height: 36px;
    padding: 6px 7px;
    font-size: 0.72rem;
  }

  .home-next-step-panel {
    padding: 10px 12px;
  }

  .home-next-step-actions {
    grid-template-columns: 1fr;
  }

  .home-adapter-advice-panel {
    padding: 10px 12px;
  }

  .home-adapter-advice-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .home-adapter-advice-list {
    grid-template-columns: 1fr;
  }
}

.topbar,
.dashboard,
.control-band,
.actions,
.split,
.panel {
  width: 100%;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 24px;
}

.topbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(360px, 70vw);
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0066b1 0 28%, #ffffff 28% 45%, #003b73 45% 72%, #ffb000 72% 100%);
  box-shadow: 0 8px 24px rgba(0, 102, 177, 0.18);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-version {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 0.95;
  color: var(--accent-deep);
}

h2 {
  font-size: 1.05rem;
}

.connection-pill {
  min-width: 150px;
  border: 1px solid rgba(0, 102, 177, 0.22);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--accent-deep);
  background: var(--sky-soft);
  text-align: center;
  font-weight: 700;
}

.connection-pill.connected {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--good));
}

.measurement-adapter-advice-popup {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 75;
  width: min(430px, calc(100vw - 32px));
  border: 1px solid rgba(0, 59, 115, 0.16);
  border-left: 5px solid var(--accent-2);
  border-radius: 8px;
  padding: 13px 44px 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 54px rgba(0, 24, 48, 0.22);
}

.measurement-adapter-advice-popup.visible {
  display: block;
}

.measurement-adapter-advice-popup.suitable {
  border-left-color: var(--good);
}

.measurement-adapter-advice-popup.limited {
  border-left-color: var(--accent-2);
}

.measurement-adapter-advice-popup.unsuitable {
  border-left-color: var(--danger);
}

.measurement-adapter-advice-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 120, 120, 0.72);
  border-radius: 50%;
  padding: 0;
  color: #ffffff;
  background: linear-gradient(180deg, #f45a5a 0%, #d62839 52%, #8f1515 100%);
  box-shadow: 0 8px 18px rgba(143, 21, 21, 0.24);
  font-size: 1.2rem;
  font-weight: 950;
  line-height: 1;
}

.measurement-adapter-advice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.measurement-adapter-advice-header strong {
  color: var(--accent-deep);
  font-size: 0.98rem;
  font-weight: 950;
}

.measurement-adapter-advice-header span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  color: #ffffff;
  background: var(--accent-deep);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.measurement-adapter-advice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 9px 0 0;
}

.measurement-adapter-advice-list div {
  min-width: 0;
  border: 1px solid rgba(0, 59, 115, 0.12);
  border-radius: 8px;
  padding: 7px 8px;
  background: #f4f8fb;
}

.measurement-adapter-advice-list dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.measurement-adapter-advice-list dd {
  margin: 0;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.measurement-adapter-advice-popup p {
  margin: 9px 0 0;
  color: #314557;
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.35;
}

@media screen and (max-width: 640px) {
  .measurement-adapter-advice-popup {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 20px);
    overflow: auto;
    padding: 12px 42px 12px 12px;
  }

  .measurement-adapter-advice-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .measurement-adapter-advice-list {
    grid-template-columns: 1fr;
  }
}

.topbar-status {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.4fr);
  gap: 12px;
  align-items: stretch;
}

.meter-panel,
.panel,
.readout {
  border: 1px solid rgba(0, 59, 115, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.meter-panel {
  min-height: 390px;
  padding: 16px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  border-top: 5px solid var(--accent);
  background: linear-gradient(155deg, #ffffff 48%, var(--sky-soft));
}

canvas {
  width: 100%;
  height: min(32vw, 220px);
  min-height: 170px;
}

.battery-core-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.battery-core-strip span {
  min-width: 0;
  border: 1px solid rgba(0, 102, 177, 0.14);
  border-radius: 6px;
  padding: 6px 7px;
  background: rgba(255, 255, 255, 0.72);
}

.battery-core-strip small,
.battery-core-strip strong {
  display: block;
  min-width: 0;
}

.battery-core-strip small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.battery-core-strip strong {
  margin-top: 2px;
  color: var(--accent-deep);
  font-size: clamp(0.82rem, 1.8vw, 1.05rem);
  line-height: 1.05;
  white-space: nowrap;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 12px;
}

.score-row > div {
  border-top: 3px solid var(--sky);
  padding-top: 10px;
}

.label,
.readout span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.help-button {
  min-height: 20px;
  width: 20px;
  margin-left: 4px;
  border-radius: 999px;
  padding: 0;
  color: var(--accent-deep);
  border-color: rgba(0, 102, 177, 0.35);
  background: var(--sky-soft);
  font-size: 0.72rem;
  line-height: 1;
  vertical-align: middle;
}

.live-info-button {
  flex: 0 0 58px;
  width: 58px;
  min-height: 34px;
  margin-left: 0;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 900;
}

.score-row strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1;
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.capacity-comparison {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid rgba(0, 59, 115, 0.2);
  border-radius: 8px;
  background: #ffffff;
}

.capacity-comparison-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding: 12px 14px;
  color: #ffffff;
  background: var(--workspace-navy, #0b3555);
}

.capacity-comparison-heading > div {
  min-width: 0;
}

.capacity-comparison-heading span,
.capacity-comparison-heading h3 {
  display: block;
  margin: 0;
  color: inherit;
}

.capacity-comparison-heading span {
  display: none;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.capacity-comparison-heading h3 {
  margin-top: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.capacity-comparison-heading > strong {
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--workspace-yellow, #ffd447);
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: left;
}

.capacity-comparison-rows {
  display: grid;
}

.capacity-comparison-row {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) minmax(76px, auto);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 14px;
  border-left: 5px solid #8c9aa5;
}

.capacity-comparison-row + .capacity-comparison-row {
  border-top: 1px solid rgba(0, 59, 115, 0.12);
}

.capacity-comparison-row.primary { border-left-color: var(--workspace-green, #158468); background: #f4fbf8; }
.capacity-comparison-row.control { border-left-color: #7753a6; }
.capacity-comparison-row.diagnostic { border-left-color: var(--accent, #0066b1); }
.capacity-comparison-row.secondary { border-left-color: #8c9aa5; background: #f8fafb; }

.capacity-comparison-row .capacity-role {
  color: #526b7c;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.capacity-comparison-row div,
.capacity-comparison-row strong,
.capacity-comparison-row small {
  min-width: 0;
  display: block;
}

.capacity-comparison-row div > strong {
  color: var(--workspace-navy, #0b3555);
  font-size: 0.88rem;
}

.capacity-comparison-row .capacity-label-with-help {
  display: flex;
  align-items: center;
  gap: 6px;
}

.capacity-label-with-help > span {
  min-width: 0;
}

body .ride-capacity-help-button {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  color: #ffffff !important;
  border: 1px solid #0a684f !important;
  background: #158468 !important;
  box-shadow: 0 1px 2px rgba(7, 73, 55, 0.24);
  font-size: 0.82rem;
  font-weight: 900;
}

body .ride-capacity-help-button:hover,
body .ride-capacity-help-button:focus-visible {
  color: #ffffff !important;
  border-color: #064b39 !important;
  background: #0f6f57 !important;
}

.ride-capacity-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ride-capacity-title-row .ride-capacity-help-button {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  min-height: 26px;
}

.capacity-comparison-row small {
  margin-top: 2px;
  color: #627586;
  font-size: 0.7rem;
  line-height: 1.3;
}

.capacity-comparison-row output {
  color: var(--workspace-navy, #0b3555);
  font-size: 1rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.capacity-comparison > p {
  margin: 0;
  padding: 9px 14px;
  border-top: 1px solid rgba(0, 59, 115, 0.12);
  color: #405b6d;
  background: #fff9df;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.readout {
  min-width: 0;
  min-height: 92px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 3px solid var(--accent);
}

.readout:nth-child(1) {
  border-top-color: var(--accent-deep);
  background: var(--accent-soft);
}

.readout:nth-child(2) {
  border-top-color: var(--sky);
  background: var(--sky-soft);
}

.readout:nth-child(3) {
  border-top-color: var(--accent-2);
  background: var(--yellow-soft);
}

.readout:nth-child(5) {
  border-top-color: var(--good);
  background: var(--good-soft);
}

.readout:nth-child(6),
.readout:nth-child(9) {
  border-top-color: var(--danger);
  background: var(--danger-soft);
}

.readout:nth-child(7) {
  border-top-color: var(--sky);
  background: #edfaff;
}

.readout:nth-child(4),
.readout:nth-child(8) {
  border-top-color: var(--accent);
  background: #edf5fc;
}

.pack-stats-readout {
  border-top-color: var(--good);
  background: var(--good-soft);
}

.bms-window-readout {
  border-top-color: var(--accent-2);
  background: var(--yellow-soft);
}

.trip-consumption-readout,
.motor-temp-readout {
  border-top-color: var(--sky);
  background: var(--sky-soft);
}

.reference-readout {
  border-top-color: var(--good);
  background: var(--good-soft);
}

.outside-temp-readout {
  border-top-color: var(--sky);
  background: #edfaff;
}

.readout strong {
  margin-top: 8px;
  font-size: clamp(1rem, 2vw, 1.45rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.pack-stats-readout strong,
.bms-window-readout strong,
.trip-consumption-readout strong,
.motor-temp-readout strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.readout-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.25;
}

.source-badge {
  align-self: flex-start;
  margin-top: 7px;
  border: 1px solid rgba(0, 59, 115, 0.12);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.66rem;
  font-weight: 800;
}

.source-badge.measured {
  color: #075c49;
  border-color: rgba(29, 143, 102, 0.28);
  background: var(--good-soft);
}

.source-badge.calculated,
.source-badge.estimated {
  color: #6c4c00;
  border-color: rgba(255, 190, 11, 0.45);
  background: var(--yellow-soft);
}

.source-badge.partial {
  color: #7a4a00;
  border-color: rgba(207, 126, 0, 0.38);
  background: #fff1d6;
}

.source-badge.unavailable {
  color: var(--muted);
}

.derived-note {
  margin: -4px 0 14px;
  border: 1px solid rgba(255, 190, 11, 0.36);
  border-left: 5px solid var(--accent-2);
  border-radius: 8px;
  padding: 11px 14px;
  color: #003b73;
  background: var(--yellow-soft);
  font-weight: 750;
  line-height: 1.4;
}

.module-readout {
  gap: 8px;
}

.module-map-button {
  min-height: 22px;
  margin-left: 5px;
  border-radius: 999px;
  padding: 2px 8px;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(0, 168, 225, 0.95), rgba(0, 88, 150, 0.95));
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.module-capacity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
  color: var(--accent-deep);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.module-capacity-grid span {
  min-width: 0;
  padding: 5px 4px;
  border: 1px solid rgba(0, 102, 177, 0.2);
  border-radius: 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
}

.module-capacity-grid .weakest {
  border-color: rgba(181, 46, 46, 0.35);
  color: #8f2020;
  background: rgba(255, 230, 227, 0.9);
}

.module-csc-temperature {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.3;
}

.module-map-content {
  display: grid;
  gap: 14px;
  max-height: min(620px, calc(100dvh - 118px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.module-map-pack {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid rgba(0, 59, 115, 0.14);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(0, 102, 177, 0.07), transparent 26%, transparent 74%, rgba(0, 102, 177, 0.07)),
    #f7fafc;
}

.module-map-column {
  display: grid;
  gap: 8px;
}

.module-map-spine {
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(0, 59, 115, 0.12), rgba(255, 255, 255, 0.72));
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.module-map-cell {
  min-height: 74px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 9px;
  background: linear-gradient(180deg, #ffffff, #edf5fc);
}

.module-map-cell.weakest {
  border-color: rgba(203, 55, 55, 0.38);
  border-left-color: #cb3737;
  background: linear-gradient(180deg, #fff7e1, #ffe8e5);
  box-shadow: 0 10px 22px rgba(203, 55, 55, 0.12);
}

.module-map-cell small,
.module-map-note span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.module-map-cell strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.1rem;
}

.module-map-cell em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 750;
}

.module-map-csc {
  display: inline-block;
  margin-top: 7px;
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--accent-deep);
  background: rgba(0, 168, 225, 0.12);
  font-size: 0.68rem;
  font-weight: 900;
}

.module-map-note {
  border-left: 4px solid var(--accent-2);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--yellow-soft);
}

.module-map-note p {
  margin: 4px 0 0;
  color: #003b73;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.45;
}

.cell-voltage-readout {
  grid-column: 1 / -1;
  border-top-color: var(--danger);
  background: var(--danger-soft);
}

.cell-voltage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 4px;
  margin-top: 8px;
}

.cell-voltage-grid span {
  min-width: 0;
  padding: 5px 4px;
  border: 1px solid rgba(0, 59, 115, 0.12);
  border-radius: 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
}

.cell-voltage-stack {
  display: grid;
  gap: 4px;
}

.cell-voltage-grid > .delta {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
}

.cell-voltage-grid > .cell-voltage-consistency {
  grid-column: 1 / -1;
  padding: 7px 8px;
}

.cell-voltage-grid > .cell-voltage-context {
  grid-column: 1 / -1;
  padding: 7px 8px;
}

.cell-voltage-grid small,
.cell-voltage-grid strong {
  display: block;
}

.cell-voltage-grid small {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cell-voltage-grid strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.7rem;
  line-height: 1.05;
}

.cell-voltage-grid .delta strong {
  color: #8f2020;
}

.cell-index-details {
  margin-top: 9px;
  border-top: 1px solid rgba(0, 59, 115, 0.14);
  padding-top: 7px;
}

.cell-index-details > summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.cell-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 6px;
  max-height: 430px;
  overflow-y: auto;
}

.cell-index-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
}

.cell-index-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cell-index-legend i {
  width: 11px;
  height: 11px;
  border: 1px solid;
  border-radius: 2px;
}

.cell-index-legend i.lowest {
  border-color: #cf7b18;
  background: #fff2d9;
}

.cell-index-legend i.highest {
  border-color: #27885c;
  background: #e4f6ec;
}

.cell-module-block {
  min-width: 0;
  border-top: 3px solid #23698f;
  padding-top: 5px;
}

.cell-module-block > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.cell-module-block > header strong {
  color: var(--ink);
  font-size: 0.68rem;
}

.cell-module-block > header small {
  color: var(--muted);
  font-size: 0.53rem;
  text-align: right;
}

.cell-module-cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}

.cell-index-item {
  min-width: 0;
  border: 1px solid rgba(0, 59, 115, 0.13);
  border-radius: 4px;
  padding: 4px 3px;
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
}

.cell-index-item small,
.cell-index-item strong {
  display: block;
}

.cell-index-item small {
  color: var(--muted);
  font-size: 0.55rem;
}

.cell-index-item strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.63rem;
}

.cell-index-item.lowest {
  border-color: #cf7b18;
  background: #fff2d9;
}

.cell-index-item.highest {
  border-color: #27885c;
  background: #e4f6ec;
}

.cell-index-details > small {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .cell-index-grid {
    grid-template-columns: 1fr;
  }
}

.quality-readout {
  border-top-color: var(--accent-2);
  background: var(--yellow-soft);
}

#reliabilityValue {
  color: var(--ink);
}

.readout.status-good {
  border-top-color: var(--good);
  background: var(--good-soft);
}

.readout.status-warning {
  border-top-color: var(--accent-2);
  background: var(--yellow-soft);
}

.readout.status-danger {
  border-top-color: var(--danger);
  background: var(--danger-soft);
}

.measurement-conditions {
  margin-bottom: 12px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.conditions-heading,
.capacity-guide-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.fold-details > summary {
  list-style: none;
}

.fold-details > summary::-webkit-details-marker {
  display: none;
}

.fold-details > summary::before {
  content: "\25BC";
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 102, 177, 0.24);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 3px 8px rgba(0, 59, 115, 0.18);
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.fold-details[open] > summary::before {
  content: "\25B2";
}

.fold-details > summary {
  cursor: pointer;
}

.fold-details-body {
  padding: 0 16px 16px;
}

.conditions-details > summary {
  padding: 14px 16px;
}

.conditions-details > summary::before {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
}

.conditions-heading p,
.capacity-guide-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.vehicle-settings {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
}

.vehicle-settings label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.vehicle-settings select,
.vehicle-settings input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--ink);
  background: var(--page);
  font: inherit;
  font-weight: 700;
}

#conditionsSummary,
#capacityDifference {
  color: var(--accent-deep);
  font-size: 0.85rem;
  text-align: right;
}

.conditions-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.condition-item {
  min-width: 0;
  min-height: 58px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--page);
}

.condition-item input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--good);
}

.condition-item span,
.condition-item strong,
.condition-item small {
  min-width: 0;
  display: block;
}

.condition-item strong {
  font-size: 0.8rem;
}

.condition-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.condition-item.good {
  border-color: rgba(22, 133, 104, 0.5);
  background: var(--good-soft);
}

.condition-item.warning {
  border-color: rgba(245, 184, 0, 0.65);
  background: var(--yellow-soft);
}

.condition-item.danger {
  border-color: rgba(214, 40, 57, 0.5);
  background: var(--danger-soft);
}

.capacity-guide {
  margin-top: 12px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-radius: 8px;
  padding: 15px 16px;
  background: linear-gradient(90deg, var(--accent-soft), rgba(255, 255, 255, 0.94) 52%, var(--yellow-soft));
}

.capacity-guide > summary {
  min-height: 34px;
  cursor: pointer;
  list-style: none;
}

.capacity-guide > summary::-webkit-details-marker {
  display: none;
}

.capacity-guide > summary::after {
  content: "\25BC";
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: 0.8rem;
}

.capacity-guide[open] > summary::after {
  content: "\25B2";
}

.capacity-guide-heading h2 {
  margin: 0;
}

.capacity-guide-body {
  padding-top: 10px;
}

.capacity-guide-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.capacity-guide-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.capacity-guide-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(0, 59, 115, 0.14);
}

.capacity-guide-grid > div {
  min-width: 0;
  padding: 12px 14px 0 0;
}

.capacity-guide-grid > div + div {
  border-left: 1px solid rgba(0, 59, 115, 0.14);
  padding-left: 14px;
}

.capacity-guide-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.capacity-guide-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-deep);
  font-size: 0.96rem;
}

.capacity-guide-grid .secondary-formula {
  color: #566778;
  font-size: 0.82rem;
}

.capacity-guide-grid p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.primary-capacity-note {
  margin-top: 12px;
  border: 1px solid rgba(22, 133, 104, 0.24);
  border-left: 5px solid var(--good);
  border-radius: 8px;
  padding: 10px 12px;
  color: #0c5544;
  background: var(--good-soft);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.battery-score-panel {
  margin-top: 12px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(0, 102, 177, 0.12), rgba(255, 255, 255, 0.96) 52%, rgba(22, 133, 104, 0.13));
  box-shadow: var(--shadow);
}

.battery-score-panel > summary {
  min-height: 34px;
  cursor: pointer;
  list-style: none;
}

.battery-score-panel > summary::-webkit-details-marker {
  display: none;
}

.battery-score-panel > summary::after {
  content: "\25BC";
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: 0.8rem;
}

.battery-score-panel[open] > summary::after {
  content: "\25B2";
}

.battery-score-heading h2 {
  margin: 0;
}

.battery-score-body {
  padding-top: 10px;
}

.battery-score-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.battery-score-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.battery-score-intro > strong {
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: 1.2rem;
}

.battery-score-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.battery-score-heading h2 {
  margin: 0;
  color: var(--accent-deep);
}

.battery-score-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.battery-score-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.battery-score-actions > strong {
  flex: 0 0 auto;
  color: var(--good);
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  line-height: 1;
}

.battery-score-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.battery-score-grid > div {
  min-width: 0;
  border: 1px solid rgba(0, 59, 115, 0.13);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.88);
}

.battery-score-grid > div:nth-child(2),
.battery-score-grid > div:nth-child(4) {
  border-top-color: var(--sky);
}

.battery-score-grid > div:nth-child(3),
.battery-score-grid > div:nth-child(5) {
  border-top-color: var(--accent-2);
}

.battery-score-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.battery-score-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.2;
}

.battery-prognosis-content {
  display: grid;
  gap: 12px;
}

.prognosis-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.prognosis-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
}

.prognosis-card.good {
  border-top-color: var(--good);
  background: var(--good-soft);
}

.prognosis-card.warning {
  border-top-color: var(--accent-2);
  background: var(--yellow-soft);
}

.prognosis-card.danger {
  border-top-color: var(--danger);
  background: var(--danger-soft);
}

.prognosis-card span,
.prognosis-note span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.prognosis-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.2;
}

.prognosis-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.prognosis-note {
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.prognosis-note p,
.prognosis-note ul {
  margin: 6px 0 0;
}

.insight-band {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.reliability-panel {
  margin-top: 12px;
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.reliability-panel > summary {
  min-height: 48px;
  padding: 10px 14px;
  color: var(--accent-deep);
  font-size: 1rem;
  font-weight: 950;
  cursor: pointer;
}

.reliability-panel .insight-band {
  border: 0;
  border-top: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 0;
}

/* Eén rustige pijlstijl voor alle uitklapblokken. */
.measurement-settings > summary,
.capacity-guide > summary,
.battery-score-panel > summary,
.reliability-panel > summary,
.cell-index-details > summary,
.fold-details > summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  list-style: none;
}

.measurement-settings > summary::-webkit-details-marker,
.capacity-guide > summary::-webkit-details-marker,
.battery-score-panel > summary::-webkit-details-marker,
.reliability-panel > summary::-webkit-details-marker,
.cell-index-details > summary::-webkit-details-marker,
.fold-details > summary::-webkit-details-marker {
  display: none;
}

.measurement-settings > summary::after,
.capacity-guide > summary::after,
.battery-score-panel > summary::after {
  content: none;
}

.measurement-settings > summary::before,
.capacity-guide > summary::before,
.battery-score-panel > summary::before,
.reliability-panel > summary::before,
.cell-index-details > summary::before,
.fold-details > summary::before {
  content: "\25BC";
  width: auto;
  height: auto;
  flex: 0 0 auto;
  display: inline-block;
  border: 0;
  border-radius: 0;
  color: currentColor;
  background: transparent;
  box-shadow: none;
  font-size: 0.72rem;
  line-height: 1;
}

.measurement-settings[open] > summary::before,
.capacity-guide[open] > summary::before,
.battery-score-panel[open] > summary::before,
.reliability-panel[open] > summary::before,
.cell-index-details[open] > summary::before,
.fold-details[open] > summary::before {
  content: "\25B2";
}

.fold-details > summary > strong {
  margin-left: auto;
}

/* Laatste ontwerpvergrendeling: oudere themaregels mogen het werkvlak niet overschrijven. */
body:not(.home-visible) .actions,
body:not(.home-visible) .dashboard,
body:not(.home-visible) .reminder-panel,
body:not(.home-visible) .measurement-tip,
body:not(.home-visible) .manual-band {
  color: #18364a !important;
  border-color: var(--workspace-line) !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: 0 8px 24px rgba(8, 43, 73, 0.08) !important;
}

body:not(.home-visible) .actions .measurement-settings,
body:not(.home-visible) .actions .more-actions,
body:not(.home-visible) .actions .measurement-progress,
body:not(.home-visible) .actions .adapter-failure-help {
  color: #18364a !important;
  border-color: var(--workspace-line) !important;
  background: transparent !important;
  background-image: none !important;
}

body:not(.home-visible) .actions .measurement-settings > summary,
body:not(.home-visible) .actions .more-actions > summary,
body:not(.home-visible) .reminder-panel summary {
  color: var(--workspace-navy) !important;
  background: #f7fafb !important;
  background-image: none !important;
}

body:not(.home-visible) .actions .more-actions > summary {
  color: #064c76 !important;
  background: #eaf6fc !important;
}

body:not(.home-visible) .measurement-tip,
body:not(.home-visible) .measurement-tip * {
  color: #29475c !important;
}

body:not(.home-visible) .condition-item,
body:not(.home-visible) .readout,
body:not(.home-visible) .meter-panel {
  color: #18364a !important;
  background-color: #fff !important;
  background-image: none !important;
}

body:not(.home-visible) .readout.vehicle-status-readout,
body:not(.home-visible) .readout.quality-readout {
  background: #fffdf3 !important;
}

body:not(.home-visible) .readout.cell-voltage-readout {
  background: #f5fbf8 !important;
}

@media (max-width: 760px) {
  .topbar h1 { font-size: 2.2rem; }
}

body:not(.home-visible) .workspace-section-heading h2 {
  color: var(--workspace-navy) !important;
  text-shadow: none !important;
}

body:not(.home-visible) .manual-band,
body:not(.home-visible) .manual-band label,
body:not(.home-visible) .manual-band h2,
body:not(.home-visible) .reminder-panel,
body:not(.home-visible) .reminder-panel * {
  color: #29475c !important;
  text-shadow: none !important;
}

body:not(.home-visible) .workspace-nav .workspace-nav-item {
  color: #29475c !important;
  border: 0 !important;
  border-right: 1px solid var(--workspace-line) !important;
  border-radius: 0 !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
}

body:not(.home-visible) .workspace-nav .workspace-nav-item.active,
body:not(.home-visible) .workspace-nav .workspace-nav-item:hover,
body:not(.home-visible) .workspace-nav .workspace-nav-item:focus-visible {
  color: #fff !important;
  background: var(--workspace-navy) !important;
}

body:not(.home-visible) .workspace-nav .workspace-nav-item.active span,
body:not(.home-visible) .workspace-nav .workspace-nav-item:hover span,
body:not(.home-visible) .workspace-nav .workspace-nav-item:focus-visible span {
  color: var(--workspace-yellow) !important;
}

/* Popups moeten altijd boven de vaste werkbalk liggen. */
.history-modal {
  z-index: 100;
}

#improveModal {
  z-index: 110;
}

.insight-band > div {
  min-width: 0;
  padding: 14px 16px;
}

.insight-band > div:nth-child(1) {
  border-top: 4px solid var(--sky);
  background: var(--sky-soft);
}

.insight-band > div:nth-child(2) {
  border-top: 4px solid var(--good);
  background: var(--good-soft);
}

.insight-band > div:nth-child(3) {
  border-top: 4px solid var(--accent-2);
  background: var(--yellow-soft);
}

.insight-band > div + div {
  border-left: 1px solid var(--line);
}

.insight-band span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.insight-band strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-deep);
  font-size: 1rem;
}

.insight-band p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.category-status-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.category-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 5px solid var(--muted);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.category-card span,
.category-card small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.category-card span {
  text-transform: uppercase;
}

.category-card strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: 1.05rem;
}

.category-card small {
  line-height: 1.25;
}

.category-card.good {
  border-top-color: var(--good);
  background: var(--good-soft);
}

.category-card.warning {
  border-top-color: var(--accent-2);
  background: var(--yellow-soft);
}

.category-card.danger {
  border-top-color: var(--danger);
  background: var(--danger-soft);
}

#comparisonDetails span {
  display: inline-block;
  margin: 3px 5px 0 0;
  border-radius: 4px;
  padding: 3px 5px;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
}

.insight-band .comparison-label,
body.theme-premium .insight-band .comparison-label {
  color: #003b73;
}

.condition-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.condition-chip {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 5px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: #eef3f8;
  font-size: 0.75rem;
}

.condition-chip.good {
  color: #075c49;
  background: var(--good-soft);
}

.condition-chip.warning {
  color: #6a4c00;
  background: var(--yellow-soft);
}

.condition-chip.danger {
  color: #8f1523;
  background: var(--danger-soft);
}

.condition-chip strong,
.condition-chip small {
  font-size: inherit;
}

.control-band {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(217, 236, 255, 0.9), rgba(255, 255, 255, 0.9) 55%, rgba(255, 246, 207, 0.85));
}

.history-panel {
  margin-top: 12px;
  border-top: 5px solid var(--sky);
  padding: 0;
  overflow: hidden;
}

.history-details-panel > summary {
  margin-bottom: 0;
  padding: 14px 18px;
}

.history-details-panel > summary::before {
  background: linear-gradient(180deg, var(--sky), var(--accent));
}

.metric-buttons {
  flex-wrap: nowrap;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--page);
}

.metric-button {
  min-height: 30px;
  border: 0;
  background: transparent;
}

.metric-button.active {
  color: #ffffff;
  background: var(--accent-deep);
  box-shadow: none;
}

.history-chart-wrap {
  position: relative;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #ffffff;
}

#historyChart {
  display: block;
  width: 100%;
  height: 210px;
  min-height: 210px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.chart-empty.hidden {
  display: none;
}

.history-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 7px;
}

.history-item {
  min-width: 0;
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  background: var(--sky-soft);
}

.history-item:nth-child(3n + 2) {
  border-left-color: var(--good);
  background: var(--good-soft);
}

.history-item:nth-child(3n) {
  border-left-color: var(--accent-2);
  background: var(--yellow-soft);
}

.history-item.history-item--ride-capacity {
  border-left-color: #d6a300;
  background: linear-gradient(180deg, #fffbea, #fff6cf);
}

.history-item.history-item--pack-conflict {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.history-item--ride-capacity .history-source,
.history-item--ride-capacity .history-values strong {
  color: #725500;
}

.history-item-head,
.history-values {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.history-item time,
.history-source {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.history-values {
  margin-top: 5px;
  font-size: 0.78rem;
}

.history-values strong {
  font-size: 0.92rem;
}

.history-details {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-top: 7px;
  border-top: 1px solid rgba(0, 59, 115, 0.14);
}

.history-details span {
  min-width: 0;
}

.history-details small,
.history-details strong {
  display: block;
}

.history-ride-result {
  min-width: 138px;
  line-height: 1.45;
}

.history-ride-result strong {
  color: var(--ink);
}

.history-details small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.history-details strong {
  margin-top: 2px;
  font-size: 0.76rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.history-details .history-pack-conflict {
  grid-column: 1 / -1;
  border: 1px solid rgba(177, 60, 60, 0.35);
  border-radius: 6px;
  padding: 6px 7px;
  background: rgba(255, 255, 255, 0.64);
}

.history-details .history-pack-conflict strong {
  color: #8d2020;
}

.history-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

body.modal-open {
  overflow: hidden;
}

.history-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#improveModal {
  z-index: 40;
}

.history-modal.open {
  display: block;
}

.history-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 24, 36, 0.62);
}

.history-dialog {
  position: relative;
  width: min(1320px, calc(100vw - 24px));
  height: min(900px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  margin: 12px auto;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: var(--page);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

.history-dialog-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(0, 102, 177, 0.12), rgba(255, 176, 0, 0.12));
}

.history-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 18px;
}

.history-dialog-header h2 {
  margin: 0;
}

#historyDialogTitle {
  color: #ffd43b;
}

#aboutDialogTitle,
#aboutButton {
  color: #ffd43b !important;
}

#aboutButton {
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.history-dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.route-export-dialog {
  width: min(560px, calc(100vw - 24px));
  height: auto;
  max-height: calc(100dvh - 24px);
}

.route-export-content {
  display: grid;
  gap: 12px;
  padding: 16px 18px 20px;
}

.route-export-choice {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.route-export-choice strong {
  font-size: 1rem;
}

.route-export-choice span,
.route-export-privacy {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.route-export-online {
  border-color: #0c6f9d;
  background: linear-gradient(135deg, #075e8a, #0b84b7);
  color: #fff;
}

.route-export-online span {
  color: rgba(255, 255, 255, 0.9);
}

.route-export-privacy {
  margin: 2px 0 0;
}

.saved-routes-dialog {
  width: min(650px, calc(100vw - 24px));
  height: auto;
  max-height: calc(100dvh - 24px);
}

.saved-routes-content {
  display: grid;
  gap: 10px;
  padding: 16px 18px 20px;
}

.saved-route-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.saved-route-entry strong,
.saved-route-entry span {
  display: block;
}

.saved-route-entry span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.saved-route-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.saved-route-actions .small-button {
  min-height: 36px;
  padding: 7px 10px;
}

.saved-route-delete {
  color: #a6222a;
}

.saved-routes-empty {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 560px) {
  .saved-route-entry {
    grid-template-columns: 1fr;
  }

  .saved-route-actions {
    justify-content: stretch;
  }

  .saved-route-actions .small-button {
    flex: 1 1 120px;
  }
}

.history-modal-charts {
  flex: 0 0 auto;
  padding: 8px 18px 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.history-chart-section-title {
  padding: 12px 18px 0;
  color: var(--accent-deep);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-usable-summary {
  margin: 12px 18px 6px;
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(231, 242, 250, 0.96), rgba(255, 255, 255, 0.96));
}

.history-usable-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-usable-summary h3 {
  margin: 0;
  color: var(--accent-deep);
  font-size: 1rem;
}

.history-usable-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.history-usable-heading > strong {
  flex: 0 0 auto;
  border: 1px solid rgba(29, 143, 102, 0.26);
  border-radius: 999px;
  padding: 5px 10px;
  color: #075c49;
  background: var(--good-soft);
  font-size: 0.76rem;
}

.history-usable-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.history-usable-grid div {
  min-width: 0;
  border: 1px solid rgba(0, 59, 115, 0.10);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.78);
}

.history-usable-grid span,
.history-usable-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.history-usable-grid span {
  text-transform: uppercase;
}

.history-usable-grid strong {
  display: block;
  margin: 4px 0 3px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.history-usable-summary .history-usable-advice {
  margin-top: 12px;
  border-left: 4px solid var(--accent-2);
  padding: 8px 10px;
  border-radius: 6px;
  color: #003b73;
  background: var(--yellow-soft);
  font-weight: 750;
}

.modal-chart-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.modal-chart-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
}

.modal-chart-card canvas {
  width: 100%;
  height: 160px;
  min-height: 130px;
  display: block;
}

.modal-chart-card .chart-empty {
  inset: 38px 10px 10px;
}

.live-dialog {
  width: min(1120px, calc(100vw - 24px));
}

.ride-capacity-dialog {
  width: min(1120px, calc(100vw - 24px));
}

#rideCapacityTitle {
  color: #ffd43b !important;
}

.ride-capacity-content {
  display: grid;
  gap: 12px;
  padding: 0 18px 20px;
}

.ride-capacity-actions {
  max-width: 690px;
  justify-content: flex-end;
}

.ride-capacity-actions > * {
  min-height: 32px;
}

.ride-capacity-status {
  display: grid;
  grid-template-columns: minmax(190px, 0.35fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid #6d7f90;
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
}

.ride-capacity-status[data-level="active"] { border-left-color: #168568; background: rgba(232, 248, 241, 0.94); }
.ride-capacity-status[data-level="paused"] { border-left-color: #c58b00; background: rgba(255, 249, 232, 0.96); }
.ride-capacity-status[data-level="insufficient"] { border-left-color: #c58b00; background: rgba(255, 249, 232, 0.96); }
.ride-capacity-status[data-level="invalid"] { border-left-color: #b13c3c; background: rgba(255, 242, 242, 0.96); }
.ride-capacity-status[data-level="complete"] { border-left-color: #0066b1; background: rgba(232, 244, 252, 0.96); }

.ride-capacity-status span,
.ride-capacity-grid span,
.ride-capacity-now span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ride-capacity-status strong {
  display: block;
  margin-top: 3px;
  color: var(--accent-deep);
  font-size: 1.02rem;
}

.ride-capacity-status p {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
}

.ride-capacity-progress {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
}

.ride-capacity-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.ride-capacity-progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 59, 115, 0.18);
  border-radius: 999px;
  background: rgba(0, 59, 115, 0.08);
}

.ride-capacity-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #168568;
  transition: width 0.2s ease;
}

.ride-capacity-progress small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.ride-capacity-grid,
.ride-capacity-now {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.ride-capacity-grid > div,
.ride-capacity-now > div {
  min-width: 0;
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.ride-capacity-grid strong,
.ride-capacity-now strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.ride-capacity-grid > div:nth-child(4) { border-top: 4px solid #0066b1; }
.ride-capacity-grid > div:nth-child(5) { border-top: 4px solid #168568; }
.ride-capacity-grid > div:nth-child(6) { border-top: 4px solid #c58b00; }

.ride-capacity-bms-trend {
  border: 1px solid rgba(102, 88, 180, 0.24);
  border-left: 5px solid #6e62c4;
  border-radius: 8px;
  padding: 10px 12px 8px;
  background: rgba(248, 247, 255, 0.92);
}

.ride-capacity-bms-trend-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ride-capacity-bms-trend-heading strong,
.ride-capacity-bms-trend-heading small {
  display: block;
}

.ride-capacity-bms-trend-heading strong {
  color: var(--accent-deep);
  font-size: 0.86rem;
}

.ride-capacity-bms-trend-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
}

#rideCapacityBmsTrendStatus {
  flex: 0 1 auto;
  color: #536274;
  font-size: 0.73rem;
  font-weight: 850;
  line-height: 1.3;
  text-align: right;
}

#rideCapacityBmsTrendStatus[data-level="stable"] { color: #087058; }
#rideCapacityBmsTrendStatus[data-level="changed"] { color: #a53737; }

.ride-capacity-bms-trend canvas {
  display: block;
  width: 100%;
  height: 170px;
  min-height: 0;
  margin-top: 7px;
}

.ride-capacity-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ride-capacity-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 0.8rem;
}

.ride-capacity-table th,
.ride-capacity-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ride-capacity-table th {
  color: var(--accent-deep);
  background: rgba(0, 102, 177, 0.08);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.ride-capacity-table tr:last-child td {
  border-bottom: 0;
}

.ride-capacity-analysis {
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--ink);
  background: rgba(232, 244, 252, 0.9);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.ride-capacity-analysis ul {
  margin: 7px 0 0;
  padding-left: 20px;
}

.danger-subtle {
  border-color: rgba(177, 60, 60, 0.36) !important;
  color: #8f2525 !important;
  background: #fff2f2 !important;
}

@media (max-width: 820px) {
  .ride-capacity-dialog .history-dialog-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .ride-capacity-dialog .history-dialog-header h2 {
    font-size: 1.15rem;
    line-height: 1.1;
  }

  .ride-capacity-dialog .history-dialog-header p {
    margin-top: 3px;
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .ride-capacity-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    max-width: none;
    width: 100%;
  }

  .ride-capacity-actions > * {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 4px 6px;
    font-size: 0.76rem;
    line-height: 1.05;
    white-space: normal;
  }

  .ride-capacity-actions > :nth-child(-n + 4) {
    grid-column: span 2;
  }

  .ride-capacity-actions #rideCapacityIntervalSelect,
  .ride-capacity-actions #rideCapacityStartButton {
    font-size: 0.8rem;
  }

  .ride-capacity-status {
    grid-template-columns: 1fr;
  }

  .ride-capacity-grid,
  .ride-capacity-now {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ride-capacity-bms-trend-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #rideCapacityBmsTrendStatus { text-align: left; }
}

.live-safety-note {
  margin: 12px 18px 0;
  border: 1px solid rgba(245, 184, 0, 0.35);
  border-left: 5px solid var(--accent-2);
  border-radius: 8px;
  padding: 10px 12px;
  color: #003b73;
  background: var(--yellow-soft);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.4;
}
.charge-monitor-panel {
  margin: 12px 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(22, 133, 104, 0.24);
  border-left: 5px solid #168568;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(232, 248, 241, 0.92);
}

.charge-monitor-panel.target-reached {
  border-color: rgba(203, 55, 55, 0.34);
  border-left-color: #cb3737;
  background: linear-gradient(135deg, rgba(255, 232, 229, 0.98), rgba(255, 246, 214, 0.96));
  box-shadow: 0 12px 28px rgba(203, 55, 55, 0.14);
}

.charge-monitor-panel.target-reached strong {
  color: #9b1c1c;
}

.charge-monitor-panel strong,
.charge-monitor-panel span,
.charge-target-control span {
  display: block;
}

.charge-monitor-panel strong {
  color: #0c6f55;
  font-size: 0.9rem;
}

.charge-monitor-panel span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.charge-target-control {
  min-width: 132px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.charging-live-dialog {
  width: min(920px, calc(100vw - 16px));
  height: auto;
  max-height: calc(100dvh - 16px);
  margin: 8px auto;
  overflow: hidden;
}

.charging-live-dialog .history-dialog-header {
  align-items: center;
  padding: 10px 12px;
  gap: 10px;
}

.charging-live-dialog .history-dialog-header h2 {
  color: #ffffff;
  font-size: 1.12rem;
  line-height: 1.1;
}

.charging-live-dialog .history-dialog-header p {
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
  font-size: 0.76rem;
  line-height: 1.2;
}

.charging-live-dialog .history-dialog-header .small-button {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 8px 14px;
}

.charging-live-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.charging-live-header-actions #stopChargingLiveButton {
  border-color: rgba(245, 184, 0, 0.72);
  color: #624900;
  background: #fff7d8;
}

.charging-live-header-actions #saveChargingLivePdfButton {
  border-color: rgba(22, 133, 104, 0.55);
  color: #075c49;
  background: #e9f8f2;
}

.charging-live-content {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  max-height: calc(100dvh - 116px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.charging-live-note,
.charging-live-current {
  border: 1px solid rgba(245, 184, 0, 0.34);
  border-left: 4px solid var(--accent-2);
  border-radius: 8px;
  padding: 7px 9px;
  color: #003b73;
  background: var(--yellow-soft);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.28;
}

.charging-live-target {
  display: grid;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(0, 102, 177, 0.22);
  border-left: 4px solid #0066b1;
  border-radius: 8px;
  background: #eef8fc;
}

.charging-live-target-heading,
.charging-live-target-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.charging-live-target-heading span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.charging-live-target-heading strong,
.charging-live-target-meta strong {
  color: var(--accent-deep);
  font-size: 0.9rem;
}

.charging-live-target input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: #168568;
}

.charging-live-target-meta {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.charging-live-target-meta small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
}

.charging-live-target-safety {
  display: block;
  border-top: 1px solid rgba(197, 139, 0, 0.24);
  padding-top: 6px;
  color: #6a4c00;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.3;
}

.charging-live-target.target-armed { border-left-color: #c58b00; background: #fff9e8; }
.charging-live-target.target-reached { border-left-color: #168568; background: #eefaf6; }

.charging-live-session-summary {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(22, 133, 104, 0.34);
  border-left: 4px solid #168568;
  border-radius: 8px;
  padding: 9px 10px;
  background: #eefaf6;
}

.charging-live-session-summary[hidden] {
  display: none;
}

.charging-live-summary-heading span,
.charging-live-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.charging-live-summary-heading strong {
  display: block;
  margin-top: 2px;
  color: #075c49;
  font-size: 0.9rem;
}

.charging-live-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.charging-live-summary-grid > div {
  min-width: 0;
  border: 1px solid rgba(22, 133, 104, 0.18);
  border-radius: 6px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.82);
}

.charging-live-summary-grid strong,
.charging-live-session-summary small {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.25;
}

.charging-live-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.charging-live-card {
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 8px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(0, 49, 84, 0.08);
}

.charging-live-card span,
.charging-live-current span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.charging-live-card strong,
.charging-live-current strong {
  display: block;
  margin-top: 2px;
  color: var(--accent-deep);
  font-size: 0.94rem;
  line-height: 1.16;
}

.charging-live-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  line-height: 1.3;
}

.charging-live-mini-progress {
  position: relative;
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d7e4eb;
}

.charging-live-mini-progress > span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: #168568;
  transition: width 260ms ease-out;
}

#chargingLiveSpeedProgress > span { background: #0066b1; }
#chargingLiveSocProgress > span { background: #6e65c7; }

.charging-live-end-check {
  grid-column: span 2;
}

.charging-live-end-check[data-status="good"] {
  border-color: rgba(22, 133, 104, 0.42);
  border-left: 4px solid #168568;
  background: #eefaf6;
}

.charging-live-end-check[data-status="warning"] {
  border-color: rgba(214, 181, 95, 0.52);
  border-left: 4px solid var(--accent-2);
  background: var(--yellow-soft);
}

.charging-live-advice {
  border-color: rgba(22, 133, 104, 0.32);
  border-left-color: #168568;
  background: #eefaf6;
}

.eps-live-primary {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.35fr);
  gap: 10px;
  align-items: stretch;
}

.eps-steering-dial-panel {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(0, 102, 177, 0.2);
  border-radius: 8px;
  background: #f7fbfd;
  box-shadow: 0 10px 24px rgba(0, 49, 84, 0.1);
}

.eps-steering-dial-panel canvas {
  display: block;
  width: min(100%, 360px);
  aspect-ratio: 1;
}

.eps-steering-dial-legend {
  position: absolute;
  inset: auto 22px 13px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: #5d6d7e;
  font-size: 0.64rem;
  font-weight: 900;
}

.eps-steering-dial-legend span:last-child {
  text-align: right;
}

.eps-steering-dial-legend strong {
  color: var(--accent-deep);
}

.eps-live-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
}

.eps-live-summary-grid .charging-live-card {
  min-height: 58px;
}

.eps-live-dialog .charging-live-chart-grid {
  grid-template-columns: 1fr;
}

.eps-live-dialog .charging-live-chart-grid canvas {
  height: 132px;
}

.charging-live-chart-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.charging-live-chart-grid canvas {
  width: 100%;
  height: 96px;
  display: block;
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(0, 49, 84, 0.08);
}

.charging-live-output {
  min-height: 48px;
  max-height: min(12vh, 92px);
  font-size: 0.72rem;
  line-height: 1.22;
  padding: 8px;
}

.rex-live-dialog {
  max-width: 980px;
}

.rex-live-actions {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.rex-live-actions > * {
  min-width: 0;
  min-height: 38px;
}

.rex-live-current[data-active="true"] {
  border-left-color: #168568;
  color: #07533f;
  background: #e2f6ef;
}

.rex-live-current[data-active="false"] {
  border-left-color: #c58b00;
  color: #5f4700;
  background: #fff9e8;
}

.rex-live-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.rex-live-analysis {
  margin: 0;
}

.rex-live-table-wrap {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--workspace-line);
  border-radius: 7px;
  background: #ffffff;
}

.rex-live-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.rex-live-table th,
.rex-live-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--workspace-line);
  text-align: left;
  white-space: nowrap;
}

.rex-live-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--workspace-navy);
  background: #eaf3f8;
}

.rex-live-table tr.rex-active td {
  background: #edf9f4;
}

@media (max-width: 760px) {
  .charging-live-dialog .history-dialog-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .charging-live-header-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .charging-live-header-actions .small-button {
    min-width: 0 !important;
    padding: 7px 5px !important;
    font-size: 0.68rem;
  }

  .charging-live-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .charging-live-dialog .history-dialog-header {
    grid-template-columns: 1fr auto;
  }

  .charging-live-dialog .history-dialog-header .small-button {
    align-self: start;
    min-width: 72px;
    width: auto;
    padding: 7px 12px;
  }

  .charging-live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eps-live-primary {
    grid-template-columns: 1fr;
  }

  .eps-steering-dial-panel {
    min-height: 270px;
  }

  .eps-steering-dial-panel canvas {
    width: min(100%, 310px);
  }

  .eps-live-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .charging-live-card strong,
  .charging-live-current strong {
    font-size: 0.86rem;
  }

  .charging-live-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .charging-live-chart-grid canvas {
    height: 74px;
  }

  .eps-live-dialog .charging-live-chart-grid canvas {
    height: 108px;
  }

  .charging-live-note,
  .charging-live-current {
    font-size: 0.72rem;
  }

  .charging-live-output {
    min-height: 36px;
    max-height: 120px;
  }

  .rex-live-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rex-live-actions #rexLiveIntervalSelect {
    grid-column: 1 / -1;
  }

  .rex-live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rex-live-table {
    min-width: 680px;
  }
}

.live-status-row {
  margin: 12px 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
}

.live-status-row strong {
  color: var(--accent-deep);
}

.live-status-row strong.live-status-active {
  color: #7ff0c2 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.live-status-row strong.live-status-inactive {
  color: #ff7474 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.live-status-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.live-grid {
  margin: 12px 18px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.live-tile {
  min-width: 0;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.live-tile.wide {
  grid-column: span 2;
}

.live-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-tile strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

#liveCscValue,
#liveChargeAddedValue,
#liveTripValue,
#liveWheelSpeedsValue {
  font-size: 0.9rem;
  line-height: 1.18;
}

.live-chart-grid {
  padding: 12px 18px 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.live-chart-grid canvas {
  width: 100%;
  height: 150px;
  display: block;
}

.live-cell-peak-card {
  grid-column: span 2;
}

.live-cell-peak-inline {
  margin: 12px 18px 0;
}

.live-cell-peak-inline canvas {
  width: 100%;
  height: 150px;
  display: block;
}

.live-cell-peak-info {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.history-table-wrap {
  flex: 1 1 auto;
  margin: 4px 18px 8px;
  overflow: auto;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.history-table-top-scroll {
  display: none;
  margin: 12px 18px 0;
  overflow-x: auto;
  overflow-y: hidden;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-overflow-scrolling: touch;
}

.history-table-top-scroll.visible {
  display: block;
}

.history-table-top-scroll > div {
  height: 1px;
}

.history-table {
  width: 100%;
  min-width: 1580px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.history-table th,
.history-table td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(0, 59, 115, 0.1);
  text-align: left;
  white-space: nowrap;
}

.history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--accent-deep);
  background: #eef6fc;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.history-table tbody tr:nth-child(even) {
  background: rgba(0, 102, 177, 0.04);
}

.history-delete-button {
  border: 1px solid rgba(214, 40, 57, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.history-delete-button:hover {
  border-color: var(--danger);
}

.experimental-dialog {
  max-width: 760px;
  overflow: hidden;
}

.about-dialog {
  max-width: 920px;
}

.about-content {
  padding: 16px 20px 22px;
  display: grid;
  gap: 14px;
  color: var(--ink);
  line-height: 1.5;
}

.about-content section {
  border: 1px solid rgba(0, 102, 177, 0.14);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.88);
}

.about-content h3 {
  margin: 0 0 7px;
  color: var(--accent-deep);
  font-size: 0.98rem;
}

.about-content p,
.about-content ul,
.about-content ol,
.about-content dl {
  margin: 0;
}

.about-content ul,
.about-content ol {
  padding-left: 18px;
}

.about-content li + li {
  margin-top: 4px;
}

.ride-capacity-help-dialog {
  max-width: 760px;
}

.ride-capacity-help-content {
  overflow: auto;
}

.ride-capacity-help-content .ride-capacity-help-steps li {
  padding-left: 3px;
}

.ride-capacity-help-content .ride-capacity-help-steps strong {
  color: var(--accent-deep);
}

.ride-capacity-help-content .ride-capacity-help-coverage {
  display: grid;
  grid-template-columns: minmax(105px, auto) minmax(0, 1fr);
  gap: 6px 12px;
}

.ride-capacity-help-content .ride-capacity-help-coverage dt {
  font-weight: 900;
}

.ride-capacity-help-content .ride-capacity-help-coverage dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 560px) {
  .ride-capacity-help-content .ride-capacity-help-coverage {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .ride-capacity-help-content .ride-capacity-help-coverage dd + dt {
    margin-top: 7px;
  }
}

.about-content dl {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
  gap: 8px 12px;
}

.about-content dt {
  color: var(--accent-deep);
  font-weight: 900;
}

.about-content dd {
  margin: 0;
  color: var(--muted);
}

.about-content .about-credit {
  border-color: rgba(214, 181, 95, 0.32);
  background: rgba(223, 244, 255, 0.08);
  text-align: center;
}

.about-content .about-credit p {
  margin: 0;
}

.about-content .about-credit p + p {
  margin-top: 6px;
  color: #d6b55f;
}

.battery-history-research-dialog {
  max-width: 1040px;
}

.battery-history-research-content {
  max-height: min(72dvh, 760px);
  padding: 14px 16px 20px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.battery-history-research-intro {
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(0, 102, 177, 0.2);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(224, 248, 255, 0.72);
}

.battery-history-research-intro strong {
  color: var(--accent-deep);
}

.battery-history-research-intro p {
  margin: 5px 0;
  color: var(--ink);
  line-height: 1.4;
}

.battery-history-research-intro small {
  color: var(--muted);
  font-weight: 750;
}

.battery-history-evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
}

.battery-history-evidence-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(0, 59, 115, 0.18);
  border-left: 4px solid #d87f4a;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.battery-history-evidence-card.candidate { border-left-color: #d6a300; }
.battery-history-evidence-card.structure { border-left-color: #168a68; }
.battery-history-evidence-card.software { border-left-color: #147cb5; }
.battery-history-evidence-card.unavailable { border-left-color: #c43745; }

.battery-history-evidence-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.battery-history-evidence-card-header strong {
  color: var(--accent-deep);
  font-size: 0.9rem;
}

.battery-history-evidence-card-header span {
  max-width: 58%;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 850;
  text-align: right;
}

.battery-history-evidence-card h3 {
  margin: 7px 0 9px;
  color: var(--ink);
  font-size: 0.92rem;
}

.battery-history-evidence-card dl {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 4px 7px;
  margin: 0;
  font-size: 0.75rem;
}

.battery-history-evidence-card dt {
  color: var(--muted);
  font-weight: 850;
}

.battery-history-evidence-card dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.battery-history-evidence-card .battery-history-candidate-text {
  white-space: pre-line;
  color: var(--accent-deep);
  font-weight: 700;
  line-height: 1.42;
}

.battery-history-evidence-note {
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

.battery-history-evidence-card code {
  display: block;
  max-height: 78px;
  padding: 7px;
  overflow: auto;
  border-radius: 5px;
  background: rgba(0, 30, 54, 0.92);
  color: #e8f7ff;
  font-size: 0.66rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 560px) {
  .battery-history-research-content { padding: 10px; }
  .battery-history-evidence-grid { grid-template-columns: 1fr; }
}

.experimental-form {
  flex: 0 1 auto;
  max-height: clamp(150px, 24dvh, 230px);
  margin: 10px 18px 4px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(231, 242, 250, 0.9), rgba(255, 255, 255, 0.96));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.experimental-progress {
  display: none;
  position: sticky;
  top: 0;
  z-index: 8;
  margin: 6px 18px 0;
  padding: 7px 10px;
  border: 1px solid rgba(0, 102, 177, 0.22);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(224, 248, 255, 0.98);
  color: #06233f;
  box-shadow: 0 8px 22px rgba(0, 29, 55, 0.12);
}

.experimental-workbench-help {
  margin: 8px 18px 0;
  padding: 9px 11px;
  border: 1px solid rgba(214, 181, 95, 0.42);
  border-left: 4px solid #d6b55f;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 246, 200, 0.96), rgba(224, 248, 255, 0.92));
  color: #07131c;
}

.experimental-workbench-help strong {
  display: block;
  margin-bottom: 4px;
  color: #07131c;
  font-size: 0.86rem;
  font-weight: 900;
}

.experimental-workbench-help > strong {
  margin-bottom: 8px;
}

.experimental-workbench-help p {
  margin: 0;
  color: #12324d;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.experimental-workbench-help p strong {
  margin-top: 5px;
  margin-bottom: 2px;
}

.experimental-workbench-help p span {
  display: block;
  margin-bottom: 2px;
}

.experimental-progress.visible {
  display: block;
}

.experimental-progress.done {
  border-left-color: #1d9a71;
}

.experimental-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.experimental-progress-header strong,
.experimental-progress-header span {
  color: #061d34;
  font-weight: 900;
}

.experimental-progress-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 59, 115, 0.16);
}

.experimental-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #1d9a71);
  transition: width 0.18s ease;
}

.experimental-progress p {
  margin: 5px 0 0;
  color: #0d2d48;
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.22;
}

.experimental-warning,
.experimental-form .button-row {
  grid-column: 1 / -1;
}

.experimental-warning {
  padding: 9px 10px;
  border-left: 4px solid var(--accent-2);
  color: var(--ink);
  background: rgba(255, 176, 0, 0.14);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.experimental-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.experimental-form input,
.experimental-form select {
  min-height: 38px;
  border: 1px solid rgba(0, 59, 115, 0.18);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.experimental-pid-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 6px;
  max-height: clamp(70px, 10dvh, 96px);
  margin: 8px 18px 0;
  padding-right: 4px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.pid-overview-card {
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid rgba(0, 59, 115, 0.16);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: rgba(235, 248, 255, 0.96);
  color: #061d34;
  box-shadow: 0 8px 18px rgba(0, 29, 55, 0.08);
}

.pid-overview-card strong {
  display: block;
  color: #061d34;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pid-overview-card p {
  margin: 3px 0 0;
  color: #0d2d48;
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.18;
}

.pid-overview-card.confirmed {
  border-left-color: #1d9a71;
}

.pid-overview-card.candidate {
  border-left-color: #d6b55f;
}

.pid-overview-card.software {
  border-left-color: #55bdf4;
}

.pid-overview-card.placeholder {
  border-left-color: #d87f4a;
}

.experimental-list {
  flex: 1 1 auto;
  min-height: 112px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-content: start;
  gap: 8px;
  padding: 10px 18px 4px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.experimental-dialog #experimentalOutput {
  flex: 0 0 clamp(128px, 24dvh, 245px);
  height: auto;
  min-height: 112px;
  max-height: 245px;
  margin: 10px 18px 18px;
  overflow: auto;
}

.experimental-section-title {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}


.experimental-group-info {
  grid-column: 1 / -1;
  margin: -2px 0 6px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(224, 248, 255, 0.94);
  color: #06233f;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
}

body.theme-premium .experimental-group-info {
  background: linear-gradient(135deg, rgba(226, 250, 255, 0.96), rgba(255, 245, 204, 0.88));
  color: #061d34;
  border-left-color: var(--gold);
}
.experimental-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.experimental-item.custom {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.experimental-list button[data-experimental-index] {
  min-height: 46px;
  justify-content: flex-start;
  text-align: left;
}

.experimental-list button span,
.experimental-list button small {
  display: block;
}

.experimental-list button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.experimental-pending-route {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px dashed rgba(216, 177, 90, 0.72);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: rgba(255, 247, 201, 0.9);
  color: #08243a;
  line-height: 1.3;
}

.experimental-pending-route strong {
  font-size: 0.86rem;
  font-weight: 900;
}

.experimental-pending-route small {
  color: rgba(8, 36, 58, 0.7);
  font-size: 0.68rem;
  font-weight: 900;
}

.experimental-pending-route p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 750;
}

.icon-button {
  min-height: 34px;
  width: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
}

.icon-button.danger {
  color: var(--danger);
  border-color: rgba(214, 40, 57, 0.28);
  background: var(--danger-soft);
}

.history-modules {
  min-width: 220px;
  white-space: normal;
}

.history-modules span {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 6px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-radius: 999px;
  color: var(--accent-deep);
  background: rgba(231, 242, 250, 0.85);
  font-size: 0.72rem;
  font-weight: 700;
}

.manual-band {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 14px;
  row-gap: 16px;
  align-items: end;
  padding: 16px;
  border: 1px solid rgba(0, 102, 177, 0.26);
  border-radius: 8px;
  border-left: 5px solid var(--accent-2);
  background: linear-gradient(110deg, var(--yellow-soft), rgba(255, 255, 255, 0.94) 38%, var(--accent-soft));
}

.manual-intro {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(170px, 0.32fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(0, 102, 177, 0.2);
}

.manual-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.manual-intro-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.manual-intro-title h2 {
  margin: 0;
}

.manual-band label {
  min-width: 0;
}

.manual-capacity-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(190px, auto);
  gap: 12px;
  align-items: end;
}

.manual-capacity-row .primary {
  min-height: 52px;
}

.cell-overview-panel {
  margin-top: 12px;
  border-top: 5px solid var(--good);
  padding: 0;
  overflow: hidden;
}

.cell-details summary {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.cell-details summary::-webkit-details-marker {
  display: none;
}

.cell-details summary::before {
  content: "\25BC";
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(22, 133, 104, 0.24);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--good), #075c49);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 3px 8px rgba(0, 59, 115, 0.16);
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.cell-details[open] summary::before {
  content: "\25B2";
}

.cell-details-body {
  padding: 0 18px 18px;
}

.compact-hint {
  margin-bottom: 0;
}

.cell-summary {
  border: 1px solid rgba(0, 102, 177, 0.2);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--accent-deep);
  background: linear-gradient(90deg, var(--accent-soft), var(--good-soft));
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.cell-input {
  min-height: 96px;
}

.cell-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
}

.cell-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px;
  background: #ffffff;
}

.cell-item {
  display: grid;
  gap: 2px;
}

.cell-item span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.cell-item strong {
  font-size: 0.82rem;
  white-space: nowrap;
}

.cell-item.low {
  border-color: rgba(200, 61, 49, 0.5);
  background: rgba(200, 61, 49, 0.08);
}

.cell-item.high {
  border-color: rgba(0, 102, 177, 0.5);
  background: rgba(0, 102, 177, 0.09);
}

.empty-state {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 102, 177, 0.16);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: 16px 0 18px;
}

.measurement-settings {
  flex: 1 1 100%;
  min-width: 0;
  border: 1px solid rgba(0, 102, 177, 0.24);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.measurement-settings > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  color: var(--accent-deep);
  font-size: 0.86rem;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}

.measurement-settings > summary::-webkit-details-marker {
  display: none;
}

.measurement-settings > summary::after {
  content: "\25BC";
  font-size: 0.78rem;
}

.measurement-settings[open] > summary::after {
  content: "\25B2";
}

.measurement-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.measurement-settings-grid .adapter-profile-control {
  min-width: 0;
}

.measurement-settings-grid .adapter-profile-with-reset {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
}

.adapter-profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.adapter-profile-heading label {
  min-width: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
}

.measurement-settings-grid .adapter-profile-with-reset > select {
  width: 100%;
  min-width: 0;
}

.measurement-settings-grid .vehicle-platform-note {
  grid-column: 1 / -1;
}

.measurement-settings-grid .pack-candidate-status {
  grid-column: 1 / -1;
}

.measurement-settings-grid .settings-reset-button {
  flex: 0 0 auto !important;
  min-width: 0;
  min-height: 30px;
  width: fit-content !important;
  max-width: min(58%, 190px);
  height: auto;
  padding: 5px 10px;
  font-size: 0.7rem;
  line-height: 1.15;
}

@media (max-width: 760px) {
  .measurement-settings-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .measurement-settings-grid .settings-reset-button {
    width: fit-content !important;
    max-width: min(62%, 190px);
  }
}

.adapter-profile-control {
  flex: 1 1 260px;
  min-width: min(100%, 240px);
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.adapter-profile-control select,
.adapter-profile-control input {
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid rgba(0, 102, 177, 0.24);
  padding: 8px 10px;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  text-transform: none;
}

.vehicle-platform-note {
  flex: 1 1 100%;
  margin: -2px 0 2px;
  padding: 9px 11px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(230, 244, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.pack-candidate-status {
  margin: -2px 0 2px;
  padding: 9px 11px;
  border-left: 4px solid #6d7f90;
  border-radius: 6px;
  color: var(--ink);
  background: rgba(241, 246, 250, 0.94);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.4;
}

.pack-candidate-status[data-confidence="high"] { border-left-color: #168568; background: rgba(229, 247, 239, 0.94); }
.pack-candidate-status[data-confidence="medium"] { border-left-color: #c58b00; background: rgba(255, 247, 220, 0.94); }
.pack-candidate-status[data-confidence="low"] { border-left-color: #b13c3c; background: rgba(255, 235, 235, 0.94); }

.measurement-tip.install-note {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) minmax(310px, 0.9fr);
  align-items: center;
  gap: 6px 12px;
  padding: 9px 12px;
  line-height: 1.25;
}

.measurement-tip > strong {
  display: block;
  margin: 0;
  white-space: nowrap;
}

.measurement-tip > span {
  display: block;
  margin-top: 0;
}

#conditionsIntroText {
  font-size: 0.76rem;
  line-height: 1.25;
}

@media (max-width: 560px) {
  .measurement-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.18fr);
  }

  .measurement-steps li {
    grid-template-columns: 19px minmax(0, 1fr);
    column-gap: 3px;
    padding: 7px 3px;
  }

  .measurement-steps li > span {
    width: 18px;
    height: 18px;
    font-size: 0.62rem;
  }

  .measurement-steps strong {
    font-size: 0.73rem;
    line-height: 1.08;
  }

  .measurement-steps small {
    font-size: 0.54rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .measurement-settings-step .measurement-settings > summary {
    gap: 3px;
    padding: 7px 3px;
    font-size: 0.68rem;
    line-height: 1.08;
    white-space: nowrap;
  }

  .measurement-settings-step .settings-summary-icon {
    font-size: 0.78rem;
  }
}

.measurement-tip .compact-conditions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.measurement-tip .compact-conditions-grid .condition-item {
  min-height: 0;
  padding: 6px 8px;
}

.measurement-tip .condition-item strong {
  font-size: 0.76rem;
}

.measurement-tip .condition-item small {
  margin-top: 1px;
  font-size: 0.64rem;
  line-height: 1.18;
}

@media (max-width: 760px) {
  .measurement-tip.install-note {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 8px;
    padding: 8px 10px;
  }

  .measurement-tip .compact-conditions-grid {
    grid-column: 1 / -1;
  }
}

@media (max-width: 340px) {
  .measurement-tip .compact-conditions-grid {
    grid-template-columns: 1fr;
  }
}

.live-pdf-gps-option {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid #c8d8e3;
  border-radius: 7px;
  padding: 7px 10px;
  color: #18364a;
  background: #f7fafb;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.live-pdf-gps-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.cell-monitor-actions {
  margin: 0 0 12px;
}

.bach-interpretation {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid #cbdbe5;
  border-left: 5px solid #6d7f90;
  border-radius: 8px;
  padding: 14px 16px;
  color: #18364a;
  background: #f7fafb;
  box-shadow: none;
}

.bach-interpretation[data-confidence="reliable"] {
  border-left-color: #168568;
  background: #f0faf5;
}

.bach-interpretation[data-confidence="indicative"] {
  border-left-color: #c58b00;
  background: #fff9e8;
}

.bach-interpretation[data-confidence="not_assessable"] {
  border-left-color: #b13c3c;
  background: #fff2f2;
}

.bach-interpretation > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 8px;
}

.bach-interpretation > header span {
  display: block;
  margin-bottom: 3px;
  color: #526b7c;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bach-interpretation h3 {
  margin: 0;
  color: #0a2a44;
  font-size: 1.05rem;
  line-height: 1.25;
}

.bach-interpretation > header > strong {
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 5px 9px;
  color: #526b7c;
  background: #fff;
  font-size: 0.72rem;
  line-height: 1.1;
}

.bach-interpretation[data-confidence="reliable"] > header > strong { color: #12603a; }
.bach-interpretation[data-confidence="indicative"] > header > strong { color: #844c00; }
.bach-interpretation[data-confidence="not_assessable"] > header > strong { color: #910f0f; }

.bach-interpretation p {
  margin: 0;
  line-height: 1.45;
}

.temperature-recheck-reference {
  display: grid;
  gap: 4px;
  margin-top: 11px;
  padding: 9px 11px;
  border: 1px solid #dec56d;
  border-left: 4px solid #bd8200;
  border-radius: 6px;
  color: #583b00;
  background: #fff8df;
  line-height: 1.35;
}
.temperature-recheck-reference[hidden] { display: none; }
.temperature-recheck-reference strong { font-size: 0.82rem; }
.temperature-recheck-reference span { font-size: 0.76rem; }
.temperature-recheck-reference[data-status="repeated"] { border-color: #d79b9b; border-left-color: #ad3e3e; color: #7c1b1b; background: #fff1f1; }
.temperature-recheck-reference[data-status="cleared"] { border-color: #a9d6c5; border-left-color: #168568; color: #15553f; background: #f0faf5; }

.measurement-conclusion-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px 0 0;
  border-top: 1px solid rgba(82, 107, 124, 0.24);
}

.measurement-conclusion-metrics[hidden] {
  display: none;
}

.measurement-conclusion-metrics > div {
  min-width: 0;
  padding: 9px 10px 8px 0;
  border-bottom: 1px solid rgba(82, 107, 124, 0.18);
}

.measurement-conclusion-metrics > div:nth-child(even) {
  padding-left: 12px;
  border-left: 1px solid rgba(82, 107, 124, 0.18);
}

.measurement-conclusion-metrics > div.warning {
  padding-left: 12px;
  background: rgba(255, 232, 128, 0.2);
  box-shadow: inset 4px 0 0 #c58b00;
}

.measurement-conclusion-metrics > div.warning dt,
.measurement-conclusion-metrics > div.warning small {
  color: #744500;
}

.measurement-conclusion-metrics dt {
  margin: 0 0 2px;
  color: #526b7c;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.measurement-conclusion-metrics dd {
  margin: 0;
  color: #0a2a44;
  font-weight: 800;
  line-height: 1.3;
}

.measurement-conclusion-metrics small {
  display: block;
  margin-top: 2px;
  color: #526b7c;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.3;
}

.bach-interpretation ul {
  margin: 9px 0 0;
  padding-left: 20px;
}

.bach-interpretation li {
  margin: 4px 0;
  line-height: 1.4;
}

.bach-interpretation > small {
  display: block;
  margin-top: 10px;
  color: #526b7c;
  line-height: 1.35;
}

.cell-monitor-interpretation {
  margin: 12px 0;
}

.cell-monitor-comparison {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #b8d6e5;
  border-left: 4px solid #168568;
  border-radius: 6px;
  color: #18364a;
  background: #eef8fc;
}

.cell-monitor-comparison strong { display: block; font-size: 0.86rem; }
.cell-monitor-comparison p { margin: 4px 0 0; font-size: 0.8rem; line-height: 1.35; }

.cell-monitor-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.cell-monitor-module {
  border: 1px solid #cbdbe5;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.cell-monitor-module h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.cell-monitor-cell-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.cell-monitor-cell {
  min-width: 0;
  border-radius: 4px;
  background: #eef4f7;
  padding: 5px 3px;
  text-align: center;
  font-size: 0.72rem;
}

.cell-monitor-cell.low {
  background: #dbeeff;
  color: #104c7d;
  font-weight: 700;
}

.cell-monitor-cell.high {
  background: #dcf3e6;
  color: #12603a;
  font-weight: 700;
}

.cell-monitor-cell.warning {
  background: #ffebc4;
  color: #844c00;
  font-weight: 700;
}

.cell-monitor-cell.danger {
  background: #ffcdcd;
  color: #910f0f;
  font-weight: 700;
}

.cell-monitor-cell small {
  display: block;
  margin-top: 2px;
  font-size: 0.62rem;
  line-height: 1.1;
  text-transform: uppercase;
}

@media (max-width: 620px) {
  .bach-interpretation > header {
    flex-direction: column;
    gap: 8px;
  }

  .measurement-conclusion-metrics {
    grid-template-columns: 1fr;
  }

  .measurement-conclusion-metrics > div:nth-child(even) {
    padding-left: 0;
    border-left: 0;
  }

  .measurement-conclusion-metrics > div.warning {
    padding-left: 12px;
  }

  .cell-monitor-modules {
    grid-template-columns: 1fr;
  }
}

.measurement-progress {
  order: -1;
  position: sticky;
  top: 0;
  z-index: 7;
  flex: 1 1 100%;
  width: 100%;
  display: none;
  margin: 0 0 2px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-left: 5px solid var(--accent-2);
  border-radius: 8px;
  padding: 9px 12px;
  color: #08243a;
  background: linear-gradient(90deg, rgba(255, 246, 207, 0.95), rgba(230, 244, 255, 0.92));
  box-shadow: 0 10px 26px rgba(0, 39, 78, 0.12);
  text-shadow: none;
}

.measurement-progress.visible {
  display: block;
}

.measurement-progress.done {
  border-left-color: var(--good);
}

.measurement-progress.error {
  border-left-color: var(--danger);
}

.measurement-progress-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #08243a;
}

.measurement-progress-header strong {
  font-size: 0.92rem;
  color: #08243a;
  text-shadow: none;
}

.measurement-progress-header span {
  color: #244960;
  font-size: 0.82rem;
  font-weight: 800;
  text-shadow: none;
}

.measurement-progress-bar {
  overflow: hidden;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(0, 59, 115, 0.13);
}

.measurement-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--good));
  transition: width 180ms ease;
}

.measurement-progress.error .measurement-progress-bar span {
  background: linear-gradient(90deg, var(--danger), #ffb36b);
}

.measurement-progress p {
  margin: 6px 0 0;
  color: #183a50;
  font-size: 0.82rem;
  font-weight: 800;
  text-shadow: none;
}

.adapter-failure-help {
  flex: 1 1 100%;
  width: 100%;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid rgba(188, 42, 42, 0.35);
  border-left: 6px solid var(--danger);
  border-radius: 8px;
  color: #10283a;
  background: linear-gradient(90deg, rgba(255, 244, 198, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: 0 12px 26px rgba(95, 32, 13, 0.12);
  text-shadow: none;
}

.adapter-failure-help[hidden] {
  display: none;
}

.live-adapter-failure-help {
  margin-top: 10px;
}

.adapter-failure-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.adapter-failure-header strong {
  color: #8a1d1d;
  font-size: 1rem;
  font-weight: 950;
}

.adapter-failure-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(188, 42, 42, 0.5);
  color: #ffffff;
  background: #c73535;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 950;
}

.adapter-failure-help p {
  margin: 8px 0 0;
  color: #183a50;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.adapter-failure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.adapter-failure-actions .small-button {
  min-height: 36px;
  border-color: rgba(0, 102, 177, 0.28);
  color: #063351;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.adapter-failure-steps {
  margin: 12px 0 0;
  padding-left: 22px;
  color: #10283a;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.35;
}

.adapter-failure-steps li + li {
  margin-top: 5px;
}

.adapter-failure-topic {
  border-top: 1px solid rgba(0, 59, 115, 0.12);
  padding-top: 9px;
}

.adapter-failure-technical {
  margin-top: 10px;
  border-top: 1px solid rgba(0, 59, 115, 0.12);
  padding-top: 8px;
}

.adapter-failure-technical summary {
  cursor: pointer;
  color: #244960;
  font-size: 0.82rem;
  font-weight: 900;
}

.adapter-failure-technical pre {
  overflow: auto;
  max-height: 160px;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 6px;
  color: #0d2638;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.compact-conditions-grid {
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-conditions-grid .condition-item {
  min-height: 0;
  padding: 10px 11px;
}

.secondary-action {
  align-self: end;
  min-height: 44px;
  height: 44px;
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--accent-deep);
  border-color: rgba(0, 102, 177, 0.34);
  background: rgba(255, 255, 255, 0.92);
}

#installButton {
  color: var(--accent-deep);
  border-color: var(--sky);
  background: var(--sky-soft);
}

#reportButton {
  color: #061929;
  border-color: #f2c75f;
  background: linear-gradient(180deg, #fff6cf 0%, #f2c75f 55%, #b98924 100%);
}

#purchaseReportButton {
  color: #06251f;
  border-color: #7ee7c5;
  background: linear-gradient(180deg, #e8fff7 0%, #7ee7c5 55%, #1a9c7a 100%);
}

#demoButton {
  color: #075c49;
  border-color: var(--good);
  background: var(--good-soft);
}

.install-note {
  margin: -4px 0 18px;
  border: 1px solid rgba(0, 102, 177, 0.14);
  border-radius: 8px;
  padding: 13px 15px;
  color: var(--muted);
  border-left: 5px solid var(--sky);
  background: linear-gradient(90deg, var(--sky-soft), rgba(255, 255, 255, 0.9));
  line-height: 1.45;
}

.install-note strong {
  color: var(--ink);
}

.reminder-panel {
  margin: 12px 0 18px;
  border: 1px solid rgba(0, 59, 115, 0.14);
  border-radius: 8px;
  padding: 0;
  background: linear-gradient(135deg, #ffffff, var(--yellow-soft));
  box-shadow: 0 12px 34px rgba(0, 39, 78, 0.1);
  overflow: hidden;
}

.reminder-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.reminder-details > summary::before {
  background: linear-gradient(180deg, var(--accent-2), #9b7100);
}

.reminder-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

#reminderBadge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--accent-deep);
  background: var(--sky-soft);
  font-size: 0.78rem;
}

#reminderBadge.active {
  color: #ffffff;
  background: var(--good);
}

#reminderBadge.due {
  color: #101820;
  background: var(--accent-2);
}

.reminder-controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(170px, 0.75fr) minmax(280px, 1.5fr);
  gap: 10px;
  align-items: end;
}

.reminder-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.reminder-controls select,
.reminder-controls input {
  min-height: 40px;
  border: 1px solid rgba(0, 59, 115, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
}

.reminder-actions {
  align-items: end;
}

button {
  position: relative;
  min-height: 44px;
  border: 1px solid rgba(0, 59, 115, 0.16);
  border-bottom-color: rgba(0, 59, 115, 0.32);
  border-radius: 6px;
  padding: 0 16px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -2px 0 rgba(0, 59, 115, 0.08),
    0 4px 0 rgba(0, 59, 115, 0.12),
    0 11px 22px rgba(0, 39, 78, 0.12);
  cursor: pointer;
  font-weight: 800;
  overflow: hidden;
  transform: translateY(0);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}

button:not(.help-button):not(.icon-button):not(.home-button)::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 45%;
  border-radius: 5px 5px 12px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  pointer-events: none;
}

button:hover {
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -2px 0 rgba(0, 59, 115, 0.1),
    0 4px 0 rgba(0, 102, 177, 0.2),
    0 13px 24px rgba(0, 102, 177, 0.18);
}

.home-button:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(16, 24, 32, 0.34);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.home-button.primary:hover {
  border-color: rgba(0, 168, 225, 0.85);
  background: rgba(0, 102, 177, 0.54);
}

button:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 5px rgba(0, 39, 78, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.7),
    0 1px 0 rgba(0, 59, 115, 0.18),
    0 5px 12px rgba(0, 39, 78, 0.12);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}


.primary {
  color: #ffffff;
  border-color: var(--accent);
  border-bottom-color: rgba(0, 31, 63, 0.58);
  background: linear-gradient(180deg, #1686d9 0%, var(--accent) 48%, var(--accent-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 0 rgba(0, 31, 63, 0.28),
    0 4px 0 rgba(0, 39, 78, 0.36),
    0 13px 25px rgba(0, 102, 177, 0.28);
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.improve-button {
  color: #08243a;
  border-color: rgba(216, 177, 90, 0.65);
  background: linear-gradient(180deg, #fff7c9, #e6c55d);
}

.hidden {
  display: none !important;
}

.secret-trigger {
  cursor: default;
  user-select: none;
}

.private-log-pdf-button {
  color: #07131c;
  border-color: rgba(255, 214, 102, 0.72);
  background: linear-gradient(180deg, #fff6c8 0%, #e7bd39 58%, #c99719 100%);
}

.experimental-dialog .history-dialog-header,
.adapter-test-dialog .history-dialog-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.experimental-dialog .history-dialog-header .button-row,
.adapter-test-dialog .history-dialog-header .button-row {
  justify-content: flex-start;
  width: 100%;
}

.experimental-dialog .history-dialog-header .small-button,
.adapter-test-dialog .history-dialog-header .small-button {
  flex: 1 1 128px;
  min-width: 0;
}

.experimental-dialog .history-dialog-header .improve-button,
.adapter-test-dialog .history-dialog-header .improve-button {
  flex-basis: 190px;
}

.improve-inline-action {
  flex: 0 0 auto;
  padding: 10px 18px 0;
}

.improve-inline-action .improve-button {
  width: 100%;
  min-height: 42px;
  white-space: normal;
}

#shareAnonymousImproveButton.primary {
  border-color: rgba(112, 73, 0, 0.65);
  color: #071724;
  background: linear-gradient(180deg, #fff4b0 0%, #f1c85a 52%, #c99521 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 8px 18px rgba(0, 0, 0, 0.24);
  text-shadow: none;
}

#shareAnonymousImproveButton.primary:hover,
#shareAnonymousImproveButton.primary:focus-visible {
  color: #071724;
  background: linear-gradient(180deg, #fff8c9 0%, #ffd86a 52%, #d9a32a 100%);
}

.small-select {
  min-height: 34px;
  max-width: 190px;
  border: 1px solid rgba(0, 102, 177, 0.22);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.86rem;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  color: var(--accent-deep);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-status {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.profile-panel {
  padding: 0;
  overflow: hidden;
}

.profile-details summary {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  color: var(--accent-deep);
  background: linear-gradient(90deg, var(--accent-soft), rgba(255, 255, 255, 0.94));
  cursor: pointer;
  font-weight: 900;
  list-style-position: inside;
}

.profile-details summary::before {
  content: "\25BC";
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 102, 177, 0.24);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 3px 8px rgba(0, 59, 115, 0.18);
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.profile-details[open] summary::before {
  content: "\25B2";
}

.profile-details summary span {
  font-size: 1.05rem;
}

.profile-details summary .profile-status {
  margin: 0;
  justify-self: end;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  text-align: right;
}

.profile-details-body {
  padding: 14px 18px 18px;
}

.profile-actions {
  margin-bottom: 10px;
}

.hint {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-rows {
  display: grid;
  gap: 10px;
}

.profile-row {
  display: grid;
  grid-template-columns: 1.1fr 0.85fr 0.85fr;
  gap: 8px;
  align-items: end;
}

.profile-row label {
  min-width: 0;
}

.log-output {
  height: 285px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: #dbeaff;
  background: #07121f;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.report-panel {
  margin-top: 18px;
  border-top: 5px solid var(--accent-2);
}

.print-report {
  display: none;
}

.notification-toast {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 50%;
  width: min(420px, calc(100vw - 28px));
  border: 1px solid #0c6f55;
  border-left: 6px solid var(--accent-2);
  border-radius: 7px;
  padding: 13px 40px 13px 16px;
  color: #ffffff;
  background: var(--good);
  box-shadow: 0 14px 36px rgba(0, 39, 78, 0.24);
  font-weight: 800;
  text-align: center;
  transform: translate(-50%, calc(-100% - 32px));
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.notification-toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.notification-toast-close {
  display: none;
  position: absolute;
  top: 5px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: #bc2d25;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.notification-toast[data-persistent="true"] .notification-toast-close { display: block; }

textarea {
  min-height: 210px;
  resize: vertical;
  line-height: 1.45;
}

@media (max-width: 840px) {
  .topbar,
  .dashboard,
  .manual-band,
  .split {
    grid-template-columns: 1fr;
  }

  .reminder-controls {
    grid-template-columns: 1fr 1fr;
  }

  .reminder-actions {
    grid-column: 1 / -1;
  }

  .topbar {
    display: grid;
  }

  .connection-pill {
    width: 100%;
  }

  .measurement-overview .workspace-section-heading {
    display: grid;
    gap: 2px;
  }

  .measurement-overview .workspace-section-heading p {
    text-align: left;
  }

  .readout-grid,
  .score-row {
    grid-template-columns: 1fr 1fr;
  }

  .control-band {
    grid-template-columns: 1fr 1fr;
  }

  .vehicle-settings {
    grid-template-columns: 1fr 1fr;
  }

  .insight-band {
    grid-template-columns: 1fr;
  }

  .battery-score-grid {
    grid-template-columns: 1fr;
  }

  .prognosis-summary {
    grid-template-columns: 1fr;
  }

  .category-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conditions-grid,
  .capacity-guide-grid {
    grid-template-columns: 1fr 1fr;
  }

  .capacity-guide-grid > div + div {
    border-left: 0;
    padding-left: 0;
  }

  .capacity-guide-grid > div:nth-child(even) {
    border-left: 1px solid rgba(0, 59, 115, 0.14);
    padding-left: 14px;
  }

  .insight-band > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-buttons {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .history-dialog {
    width: calc(100vw - 14px);
    height: calc(100dvh - 14px);
    max-height: calc(100vh - 14px);
    margin: 7px auto;
  }

  .experimental-form {
    grid-template-columns: 1fr;
  }

  .about-content dl {
    grid-template-columns: 1fr;
  }

  .history-modal-charts {
    grid-template-columns: 1fr 1fr;
  }

  .history-usable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-chart-card canvas {
    height: 145px;
    min-height: 120px;
  }

  .control-band label:last-child {
    grid-column: 1 / -1;
  }

  .manual-intro {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .manual-capacity-row {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  }
}

@media (max-width: 560px) {
  .battery-score-heading {
    flex-direction: column;
  }

  .battery-score-actions {
    width: 100%;
    justify-content: space-between;
  }

  .reminder-heading {
    display: grid;
  }

  .reminder-controls {
    grid-template-columns: 1fr;
  }

  .reminder-actions {
    grid-column: auto;
  }

  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .meter-panel,
  .panel,
  .control-band {
    padding: 12px;
  }

  .profile-row {
    grid-template-columns: 1fr;
  }

  .profile-details summary {
    grid-template-columns: auto 1fr;
  }

  .profile-details summary .profile-status {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .cell-details summary {
    grid-template-columns: auto 1fr;
  }

  .cell-details .cell-summary {
    grid-column: 2;
    justify-self: start;
    white-space: normal;
  }

  .meter-panel {
    min-height: 310px;
  }

  canvas {
    height: 180px;
    min-height: 150px;
  }

  .readout {
    min-height: 84px;
    padding: 9px 10px;
  }

  .label,
  .readout span {
    font-size: 0.72rem;
  }

  .readout strong {
    font-size: 1rem;
  }

  .actions button {
    flex: 1 1 160px;
  }

  .conditions-heading,
  .history-dialog-header,
  .capacity-guide-heading {
    display: grid;
  }

  .history-modal-charts {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .history-usable-grid {
    grid-template-columns: 1fr;
  }

  .category-status-grid {
    grid-template-columns: 1fr;
  }

  .history-dialog-header {
    padding: 12px;
  }

  .history-table-wrap {
    margin: 4px 10px 10px;
    min-height: 320px;
  }

  .history-table-top-scroll {
    margin: 8px 10px 0;
  }

  #conditionsSummary,
  #capacityDifference {
    text-align: left;
  }

  .conditions-grid,
  .vehicle-settings,
  .capacity-guide-grid {
    grid-template-columns: 1fr;
  }

  .conditions-grid,
  .vehicle-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manual-band {
    gap: 8px;
    padding: 12px;
  }

  .manual-capacity-row {
    grid-template-columns: 1fr;
  }

  .manual-band input {
    padding: 9px 8px;
    font-size: 0.86rem;
  }

  .capacity-guide-grid > div:nth-child(even) {
    border-left: 0;
    padding-left: 0;
  }

  .history-list {
    grid-template-columns: 1fr 1fr;
  }

  .history-item {
    padding: 7px 8px;
  }

  .history-values {
    display: grid;
    gap: 2px;
  }
}

body.is-landscape .app-shell {
  width: min(100% - 18px, 1180px);
  padding-top: 10px;
}

body.is-landscape .topbar {
  padding: 14px 0 12px;
}

body.is-landscape .actions {
  gap: 8px;
}

body.is-landscape .actions button {
  flex: 1 1 150px;
  min-height: 40px;
}

body.is-landscape .measurement-conditions,
body.is-landscape .meter-panel,
body.is-landscape .panel,
body.is-landscape .manual-band {
  padding: 10px;
}

body.is-landscape .dashboard {
  grid-template-columns: minmax(240px, 0.75fr) minmax(430px, 1.25fr);
}

body.is-landscape .meter-panel {
  min-height: 300px;
}

body.is-landscape canvas {
  height: 170px;
  min-height: 140px;
}

body.is-landscape .readout-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.is-landscape .readout {
  min-height: 78px;
  padding: 8px 9px;
}

body.is-landscape .readout strong {
  font-size: 0.95rem;
}

body.is-landscape .conditions-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.is-landscape .category-status-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.is-landscape .vehicle-settings {
  grid-template-columns: 0.8fr 1.2fr;
}

body.is-landscape .history-dialog {
  width: calc(100vw - 10px);
  height: calc(100dvh - 10px);
  max-height: calc(100dvh - 10px);
  margin: 5px auto;
}

body.is-landscape .history-dialog-header {
  padding: 10px 12px;
}

body.is-landscape .history-modal-charts {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  padding: 10px 12px 6px;
}

body.is-landscape .modal-chart-card {
  padding: 8px;
}

body.is-landscape .modal-chart-card canvas {
  height: 120px;
  min-height: 100px;
}

body.is-landscape .history-table-wrap {
  margin: 4px 12px 12px;
  min-height: 230px;
}

@media (orientation: landscape) and (max-height: 560px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .topbar {
    padding: 14px 0 12px;
  }

  .actions {
    gap: 8px;
  }

  .actions button {
    flex: 1 1 150px;
    min-height: 40px;
  }

  .measurement-conditions,
  .meter-panel,
  .panel,
  .manual-band {
    padding: 10px;
  }

  .dashboard {
    grid-template-columns: minmax(240px, 0.75fr) minmax(430px, 1.25fr);
  }

  .meter-panel {
    min-height: 300px;
  }

  canvas {
    height: 170px;
    min-height: 140px;
  }

  .readout-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .readout {
    min-height: 78px;
    padding: 8px 9px;
  }

  .readout strong {
    font-size: 0.95rem;
  }

  .conditions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .vehicle-settings {
    grid-template-columns: 0.8fr 1.2fr 1fr;
  }

  .history-dialog {
    width: calc(100vw - 10px);
    height: calc(100dvh - 10px);
    max-height: calc(100dvh - 10px);
    margin: 5px auto;
  }

  .history-dialog-header {
    padding: 10px 12px;
  }

  .history-modal-charts {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    padding: 10px 12px 6px;
  }

  .modal-chart-card {
    padding: 8px;
  }

  .modal-chart-card canvas {
    height: 120px;
    min-height: 100px;
  }

  .history-table-wrap {
    margin: 4px 12px 12px;
    min-height: 240px;
  }
}

@media (max-width: 840px) {
  .live-dialog .history-dialog-header {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  .live-dialog .history-dialog-header h2 {
    font-size: 1.1rem;
  }

  .live-dialog .history-dialog-header p {
    font-size: 0.78rem;
  }

  .live-dialog .button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .live-dialog .button-row select {
    grid-column: 1 / 2;
  }

  .live-dialog .button-row .live-info-button {
    grid-column: 2 / 3;
    width: 100%;
  }

  .live-dialog .button-row button {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
  }

  .live-safety-note,
  .charge-monitor-panel,
  .live-status-row {
    margin: 10px 12px 0;
    padding: 9px 10px;
  }

  .charge-monitor-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .charge-target-control {
    min-width: 0;
  }

  .live-safety-note {
    font-size: 0.76rem;
    line-height: 1.32;
  }

  .live-status-row {
    align-items: flex-start;
  }

  .live-status-row strong {
    font-size: 0.9rem;
  }

  .live-status-row span {
    font-size: 0.76rem;
  }

  .live-grid,
  .live-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-grid {
    margin: 10px 12px 0;
    gap: 8px;
  }

  .live-cell-peak-inline {
    margin: 10px 12px 0;
  }

  .live-tile {
    padding: 8px;
  }

  .live-tile span {
    font-size: 0.58rem;
  }

  .live-tile strong {
    font-size: 0.86rem;
  }

  #liveCscValue,
  #liveChargeAddedValue,
  #liveTripValue,
  #liveWheelSpeedsValue,
  #liveRangeValue {
    font-size: 0.78rem;
  }

  .live-chart-grid {
    padding: 10px 12px 14px;
    gap: 8px;
  }

  .live-chart-grid canvas {
    height: 125px;
    min-height: 105px;
  }

  .live-tile.wide {
    grid-column: 1 / -1;
  }
}

body.is-landscape .live-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.is-landscape .live-chart-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.is-landscape .live-chart-grid canvas {
  height: 120px;
  min-height: 100px;
}

@media (orientation: landscape) and (max-height: 560px) {
  .live-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .live-chart-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .live-chart-grid canvas {
    height: 120px;
    min-height: 100px;
  }
}

@media screen {
  :root {
    --ink: #0b1420;
    --muted: #526173;
    --line: #d9e2ec;
    --page: #eef3f8;
    --panel: #ffffff;
    --accent: #0069b4;
    --accent-deep: #052f5f;
    --accent-soft: #e8f3ff;
    --sky-soft: #eef9fd;
    --shadow: 0 10px 28px rgba(5, 38, 76, 0.1);
    --premium-shadow: 0 8px 22px rgba(5, 38, 76, 0.09);
    --premium-border: rgba(5, 47, 95, 0.1);
  }

  body {
    background:
      linear-gradient(145deg, rgba(0, 105, 180, 0.13), transparent 34%),
      linear-gradient(315deg, rgba(245, 184, 0, 0.1), transparent 30%),
      linear-gradient(180deg, #fbfdff 0%, #eef3f8 100%);
  }

  .app-shell {
    width: min(1160px, calc(100vw - 24px));
    padding-top: 16px;
  }

  .topbar {
    padding: 20px 0 18px;
  }

  .topbar::before {
    height: 4px;
    width: min(280px, 64vw);
    box-shadow: 0 6px 18px rgba(0, 102, 177, 0.12);
  }

  h1 {
    font-size: clamp(1.85rem, 4.2vw, 3.55rem);
  }

  h2 {
    font-size: 1rem;
  }

  .app-version,
  .eyebrow {
    font-size: 0.75rem;
  }

  .connection-pill {
    min-height: 34px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--premium-shadow);
  }

  .dashboard {
    gap: 10px;
  }

  .meter-panel,
  .panel,
  .readout,
  .battery-score-panel,
  .history-panel,
  .reminder-panel,
  .modal-chart-card,
  .live-tile,
  .charge-monitor-panel,
  .live-status-row {
    border-color: var(--premium-border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--premium-shadow);
  }

  .meter-panel,
  .history-panel,
  .report-panel,
  .cell-overview-panel,
  .profile-panel,
  .battery-score-panel {
    border-top-width: 3px;
  }

  .meter-panel {
    min-height: 354px;
    padding: 13px;
    background: linear-gradient(155deg, #ffffff 56%, #f0f8ff 100%);
  }

  canvas {
    height: min(28vw, 205px);
    min-height: 154px;
  }

  .score-row {
    gap: 8px;
    padding-top: 10px;
  }

  .score-row > div {
    border-top-width: 2px;
    padding-top: 8px;
  }

  .readout-grid {
    gap: 7px;
  }

  .readout {
    min-height: 78px;
    padding: 9px 10px;
    border-top-width: 2px;
  }

  .label,
  .readout span,
  .live-tile span {
    color: #536274;
    font-size: 0.72rem;
    font-weight: 850;
  }

  .readout strong {
    margin-top: 5px;
    font-size: clamp(1.02rem, 2vw, 1.38rem);
  }

  .readout-hint {
    margin-top: 5px;
    font-size: 0.68rem;
  }

  .control-band,
  .manual-band,
  .conditions-grid,
  .vehicle-settings,
  .battery-score-grid,
  .category-status-grid,
  .history-modal-charts,
  .live-grid,
  .live-chart-grid {
    gap: 8px;
  }

  .control-band,
  .panel,
  .battery-score-panel,
  .reminder-panel {
    padding: 12px;
  }

  .actions {
    gap: 8px;
  }

  button {
    min-height: 38px;
    border-radius: 7px;
    padding: 0 14px;
    border-color: rgba(5, 47, 95, 0.12);
    border-bottom-color: rgba(5, 47, 95, 0.22);
    background: linear-gradient(180deg, #ffffff 0%, #f5f8fb 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      0 2px 0 rgba(5, 47, 95, 0.1),
      0 8px 18px rgba(5, 38, 76, 0.1);
  }

  button:not(.help-button):not(.icon-button):not(.home-button)::before {
    height: 36%;
    border-radius: 6px 6px 10px 10px;
  }

  button:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.96),
      0 2px 0 rgba(0, 102, 177, 0.16),
      0 9px 18px rgba(0, 102, 177, 0.14);
  }

  button:active {
    transform: translateY(2px);
  }

  
.primary {
    background: linear-gradient(180deg, #1484d3 0%, #0069b4 54%, #052f5f 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 2px 0 rgba(5, 47, 95, 0.34),
      0 10px 20px rgba(0, 102, 177, 0.22);
  }

  .small-button,
  .small-select {
    min-height: 32px;
    font-size: 0.82rem;
  }

  .history-dialog {
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(5, 38, 76, 0.24);
  }

  .history-dialog-header {
    padding: 14px 16px;
  }

  .modal-chart-card {
    padding: 10px;
  }

  .modal-chart-card canvas {
    height: 155px;
    min-height: 125px;
  }

  .live-grid {
    margin: 10px 16px 0;
    gap: 8px;
  }

  .live-tile {
    min-height: 70px;
    padding: 8px 9px;
    border-top-width: 3px;
  }

  .live-tile strong {
    font-size: 0.94rem;
  }

  .live-chart-grid {
    padding: 10px 16px 16px;
  }

  .live-safety-note,
  .charge-monitor-panel,
  .live-status-row {
    margin: 10px 16px 0;
  }

  .charge-monitor-panel {
    padding: 9px 11px;
  }

  .charge-monitor-panel strong {
    font-size: 0.82rem;
  }

  .charge-monitor-panel span {
    font-size: 0.76rem;
  }
}

@media screen and (max-width: 560px) {
  .app-shell {
    width: min(100% - 18px, 1160px);
    padding-top: 12px;
  }

  .topbar {
    padding: 16px 0 14px;
  }

  .meter-panel,
  .panel,
  .control-band,
  .battery-score-panel,
  .reminder-panel {
    padding: 10px;
  }

  .meter-panel {
    min-height: 300px;
  }

  canvas {
    height: 170px;
    min-height: 145px;
  }

  .readout {
    min-height: 72px;
    padding: 8px 9px;
  }

  .readout strong {
    font-size: 1rem;
  }

  .live-grid {
    margin: 10px 12px 0;
  }

  .live-tile {
    min-height: 64px;
    padding: 8px;
  }
}

@media screen {
  .topbar {
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 18px 20px;
    color: #ffffff;
    background:
      linear-gradient(120deg, rgba(0, 105, 180, 0.34), transparent 46%),
      linear-gradient(300deg, rgba(245, 184, 0, 0.18), transparent 38%),
      linear-gradient(135deg, #07111f 0%, #0b2440 52%, #052f5f 100%);
    box-shadow: 0 18px 42px rgba(5, 38, 76, 0.26);
    overflow: hidden;
  }

  .topbar::before {
    top: auto;
    bottom: 0;
    left: 20px;
    width: min(420px, calc(100% - 40px));
    height: 3px;
    background: linear-gradient(90deg, #0069b4 0 34%, #ffffff 34% 50%, #00a8e1 50% 76%, #f5b800 76% 100%);
    box-shadow: none;
  }

  .topbar h1,
  .topbar .eyebrow {
    color: #ffffff;
  }

  .topbar h1 {
    max-width: 820px;
    font-weight: 900;
  }

  .topbar .app-version {
    color: rgba(255, 255, 255, 0.72);
  }

  .connection-pill {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  }

  .connection-pill.connected {
    border-color: rgba(22, 133, 104, 0.42);
    background: linear-gradient(135deg, #168568, #0069b4);
  }

  .actions {
    margin-bottom: 12px;
    border: 1px solid rgba(5, 47, 95, 0.12);
    border-radius: 9px;
    padding: 9px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 248, 252, 0.94)),
      #ffffff;
    box-shadow: 0 10px 26px rgba(5, 38, 76, 0.12);
  }

  .adapter-profile-control {
    min-height: 38px;
    border: 1px solid rgba(5, 47, 95, 0.12);
    border-radius: 8px;
    padding: 6px 8px;
    background: #ffffff;
  }

  .adapter-profile-control span {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }

  .adapter-profile-control select,
  .adapter-profile-control input {
    min-height: 24px;
  }

  .install-note,
  .derived-note,
  .primary-capacity-note {
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(5, 38, 76, 0.08);
  }

  .measurement-conditions,
  .manual-band,
  .capacity-guide,
  .cell-overview-panel,
  .profile-panel,
  .report-panel,
  .history-panel,
  .battery-score-panel,
  .reminder-panel {
    border-radius: 9px;
  }

  .dashboard {
    grid-template-columns: minmax(270px, 0.8fr) minmax(420px, 1.55fr);
    gap: 10px;
  }

  .meter-panel {
    color: var(--ink);
    border: 1px solid rgba(5, 47, 95, 0.1);
    border-top: 4px solid #00a8e1;
    background:
      linear-gradient(145deg, rgba(0, 168, 225, 0.14), transparent 48%),
      linear-gradient(320deg, rgba(245, 184, 0, 0.1), transparent 36%),
      linear-gradient(180deg, #ffffff 0%, #edf7ff 100%);
    box-shadow: 0 14px 34px rgba(5, 38, 76, 0.14);
  }

  .meter-panel .label,
  .meter-panel .score-row span {
    color: #536274;
  }

  .meter-panel strong {
    color: var(--ink);
  }

  .meter-panel canvas {
    filter: saturate(1.1) contrast(1.02);
  }

  .score-row > div {
    border-top-color: rgba(0, 105, 180, 0.24);
  }

  .readout-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .readout {
    min-height: 72px;
    border-top: 0;
    border-left: 3px solid rgba(0, 105, 180, 0.72);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 254, 0.98));
  }

  .readout:nth-child(1),
  .readout:nth-child(2),
  .readout:nth-child(3),
  .readout:nth-child(4) {
    color: var(--ink);
    border-left-color: #00a8e1;
    background:
      linear-gradient(145deg, rgba(0, 168, 225, 0.12), transparent 48%),
      linear-gradient(180deg, #ffffff 0%, #eef7ff 100%);
    box-shadow: 0 12px 26px rgba(5, 38, 76, 0.12);
  }

  .readout:nth-child(1) span,
  .readout:nth-child(2) span,
  .readout:nth-child(3) span,
  .readout:nth-child(4) span,
  .readout:nth-child(1) small,
  .readout:nth-child(2) small,
  .readout:nth-child(3) small,
  .readout:nth-child(4) small {
    color: #526173;
  }

  .readout:nth-child(1) strong,
  .readout:nth-child(2) strong,
  .readout:nth-child(3) strong,
  .readout:nth-child(4) strong,
  .readout:nth-child(3) .module-capacity-grid,
  .readout:nth-child(4) .cell-voltage-grid {
    color: var(--ink);
  }

  .readout strong {
    font-weight: 900;
  }

  .battery-score-panel {
    border: 1px solid rgba(5, 47, 95, 0.1);
    border-top: 0;
    background:
      linear-gradient(90deg, rgba(0, 105, 180, 0.08), transparent 45%),
      #ffffff;
  }

  .battery-score-heading {
    border-bottom: 1px solid rgba(5, 47, 95, 0.1);
    padding-bottom: 8px;
  }

  .battery-score-actions > strong {
    border-radius: 999px;
    padding: 6px 10px;
    color: #ffffff;
    background: linear-gradient(135deg, #168568, #0069b4);
  }

  .fold-details > summary,
  .profile-details summary,
  .cell-details summary {
    border-radius: 8px;
  }

  .history-dialog-header,
  .live-dialog .history-dialog-header {
    color: #ffffff;
    background:
      linear-gradient(120deg, rgba(0, 105, 180, 0.32), transparent 42%),
      linear-gradient(135deg, #07111f, #0b2440 58%, #052f5f);
  }

  .history-dialog-header h2,
  .history-dialog-header p,
  .live-dialog .history-dialog-header h2,
  .live-dialog .history-dialog-header p {
    color: #ffffff;
  }

  .live-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .live-tile {
    min-height: 62px;
    border-top: 0;
    border-left: 3px solid #0069b4;
  }

  .live-tile.wide {
    grid-column: span 2;
  }

  .live-tile strong {
    font-weight: 900;
  }

  .modal-chart-card {
    border-radius: 8px;
  }

  .modal-chart-card strong {
    color: #0b2440;
  }
}

@media screen and (max-width: 860px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .readout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 560px) {
  .topbar {
    padding: 16px 14px;
  }

  .actions {
    padding: 8px;
  }

  .readout-grid {
    gap: 6px;
  }

  .readout {
    min-height: 68px;
    border-left-width: 2px;
  }

  .live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-tile.wide {
    grid-column: 1 / -1;
  }
}

@media screen {
  body.theme-simple-mobile {
    --ink: #101820;
    --muted: #526173;
    --line: #d8e1ea;
    --page: #f3f6f9;
    --panel: #ffffff;
    --accent: #0069b4;
    --accent-deep: #094067;
    --accent-soft: #edf6ff;
    --sky-soft: #f4fbff;
    --shadow: 0 6px 18px rgba(16, 24, 32, 0.08);
    --premium-shadow: 0 4px 14px rgba(16, 24, 32, 0.07);
    --premium-border: rgba(16, 24, 32, 0.1);
    color: var(--ink);
    background: var(--page);
  }

  body.theme-simple-mobile .app-shell {
    width: min(1040px, calc(100vw - 18px));
    padding-top: 10px;
  }

  body.theme-simple-mobile .topbar {
    align-items: flex-start;
    margin-bottom: 8px;
    border: 1px solid var(--premium-border);
    border-radius: 8px;
    padding: 14px;
    color: var(--ink);
    background: #ffffff;
    box-shadow: var(--premium-shadow);
  }

  body.theme-simple-mobile .topbar::before {
    left: 14px;
    bottom: 0;
    width: min(260px, calc(100% - 28px));
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #00a8e1, var(--accent-2));
  }

  body.theme-simple-mobile .topbar h1,
  body.theme-simple-mobile .topbar .eyebrow {
    color: var(--ink);
  }

  body.theme-simple-mobile .topbar h1 {
    font-size: clamp(1.45rem, 5vw, 2.25rem);
    line-height: 1.05;
  }

  body.theme-simple-mobile .topbar .app-version {
    color: var(--muted);
  }

  body.theme-simple-mobile .connection-pill {
    color: var(--accent-deep);
    border-color: rgba(0, 105, 180, 0.18);
    background: var(--accent-soft);
    box-shadow: none;
  }

  body.theme-simple-mobile .actions {
    gap: 6px;
    margin-bottom: 8px;
    border-radius: 8px;
    padding: 7px;
    background: #ffffff;
    box-shadow: var(--premium-shadow);
  }

  body.theme-simple-mobile .adapter-profile-control,
  body.theme-simple-mobile .theme-profile-control {
    border-color: var(--premium-border);
    border-radius: 7px;
    background: #ffffff;
  }

  body.theme-simple-mobile .dashboard {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.theme-simple-mobile .meter-panel,
  body.theme-simple-mobile .panel,
  body.theme-simple-mobile .readout,
  body.theme-simple-mobile .battery-score-panel,
  body.theme-simple-mobile .history-panel,
  body.theme-simple-mobile .reminder-panel,
  body.theme-simple-mobile .live-tile,
  body.theme-simple-mobile .charge-monitor-panel,
  body.theme-simple-mobile .live-status-row {
    border: 1px solid var(--premium-border);
    border-left: 0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--premium-shadow);
  }

  body.theme-simple-mobile .meter-panel {
    min-height: 300px;
    border-top: 4px solid var(--accent);
    padding: 12px;
  }

  body.theme-simple-mobile .meter-panel,
  body.theme-simple-mobile .meter-panel .label,
  body.theme-simple-mobile .meter-panel .score-row span,
  body.theme-simple-mobile .meter-panel strong {
    color: var(--ink);
  }

  body.theme-simple-mobile .readout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.theme-simple-mobile .readout,
  body.theme-simple-mobile .readout:nth-child(1),
  body.theme-simple-mobile .readout:nth-child(2),
  body.theme-simple-mobile .readout:nth-child(3),
  body.theme-simple-mobile .readout:nth-child(4) {
    min-height: 74px;
    border-top: 4px solid var(--accent);
    border-left: 0;
    padding: 9px;
    color: var(--ink);
    background: #ffffff;
  }

  body.theme-simple-mobile .readout span,
  body.theme-simple-mobile .readout small,
  body.theme-simple-mobile .readout:nth-child(1) span,
  body.theme-simple-mobile .readout:nth-child(2) span,
  body.theme-simple-mobile .readout:nth-child(3) span,
  body.theme-simple-mobile .readout:nth-child(4) span,
  body.theme-simple-mobile .readout:nth-child(1) small,
  body.theme-simple-mobile .readout:nth-child(2) small,
  body.theme-simple-mobile .readout:nth-child(3) small,
  body.theme-simple-mobile .readout:nth-child(4) small {
    color: var(--muted);
  }

  body.theme-simple-mobile .readout strong,
  body.theme-simple-mobile .readout:nth-child(1) strong,
  body.theme-simple-mobile .readout:nth-child(2) strong,
  body.theme-simple-mobile .readout:nth-child(3) strong,
  body.theme-simple-mobile .readout:nth-child(4) strong {
    color: var(--ink);
  }

  body.theme-simple-mobile .module-capacity-grid span,
  body.theme-simple-mobile .cell-voltage-grid span,
  body.theme-simple-mobile .cell-voltage-grid strong {
    color: var(--ink);
    background: #eef3f8;
  }

  body.theme-simple-mobile button {
    border-radius: 8px;
    box-shadow: 0 2px 0 rgba(16, 24, 32, 0.08), 0 6px 14px rgba(16, 24, 32, 0.08);
  }
}

@media screen and (max-width: 560px) {
  body.theme-simple-mobile .app-shell {
    width: min(100% - 12px, 1040px);
  }

  body.theme-simple-mobile .topbar {
    padding: 12px;
  }

  body.theme-simple-mobile .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.theme-simple-mobile .adapter-profile-control,
  body.theme-simple-mobile .theme-profile-control {
    grid-column: 1 / -1;
  }
}

@media screen {
  body.theme-mobile-app {
    --ink: #102334;
    --muted: #607184;
    --line: #d8e5ee;
    --page: #eef6f8;
    --panel: #ffffff;
    --accent: #0879bd;
    --accent-deep: #0b4b73;
    --accent-soft: #e8f5fc;
    --accent-2: #13a37b;
    --warning: #d79b21;
    --shadow: 0 10px 26px rgba(26, 55, 79, 0.11);
    --premium-shadow: 0 8px 22px rgba(26, 55, 79, 0.1);
    --premium-border: rgba(20, 60, 88, 0.12);
    color: var(--ink);
    background:
      radial-gradient(circle at 18% 0%, rgba(19, 163, 123, 0.13), transparent 28%),
      linear-gradient(180deg, #f8fcfd 0%, #eef6f8 45%, #e8f1f5 100%);
  }

  body.theme-mobile-app .app-shell {
    width: min(1120px, calc(100vw - 18px));
    padding: 10px 0 18px;
  }

  body.theme-mobile-app .topbar,
  body.theme-mobile-app .actions,
  body.theme-mobile-app .meter-panel,
  body.theme-mobile-app .panel,
  body.theme-mobile-app .readout,
  body.theme-mobile-app .battery-score-panel,
  body.theme-mobile-app .history-panel,
  body.theme-mobile-app .reminder-panel,
  body.theme-mobile-app .charge-monitor-panel,
  body.theme-mobile-app .live-status-row,
  body.theme-mobile-app .live-tile,
  body.theme-mobile-app .history-dialog,
  body.theme-mobile-app .live-connect-dialog,
  body.theme-mobile-app .modal-chart-card {
    color: var(--ink);
    border: 1px solid var(--premium-border);
    border-left: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--premium-shadow);
  }

  body.theme-mobile-app .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    align-items: center;
    margin-bottom: 8px;
    padding: 12px 14px;
  }

  body.theme-mobile-app .topbar::before {
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
  }

  body.theme-mobile-app .topbar h1,
  body.theme-mobile-app h1,
  body.theme-mobile-app h2,
  body.theme-mobile-app .eyebrow {
    color: var(--ink);
  }

  body.theme-mobile-app .topbar h1 {
    font-size: clamp(1.35rem, 4vw, 2.05rem);
    line-height: 1.1;
  }

  body.theme-mobile-app .app-subtitle,
  body.theme-mobile-app .app-tagline,
  body.theme-mobile-app .app-version,
  body.theme-mobile-app .label,
  body.theme-mobile-app .readout span,
  body.theme-mobile-app .readout small,
  body.theme-mobile-app .readout-hint,
  body.theme-mobile-app .live-tile span,
  body.theme-mobile-app .panel-heading p,
  body.theme-mobile-app .help-text,
  body.theme-mobile-app .status-line,
  body.theme-mobile-app .small-muted {
    color: var(--muted);
  }

  body.theme-mobile-app .connection-pill {
    color: #064466;
    border-color: rgba(8, 121, 189, 0.2);
    background: var(--accent-soft);
    box-shadow: none;
  }

  body.theme-mobile-app .connection-pill.connected {
    color: #07553f;
    border-color: rgba(19, 163, 123, 0.24);
    background: #e6f7f1;
  }

  body.theme-mobile-app .actions {
    gap: 7px;
    margin-bottom: 8px;
    padding: 8px;
  }

  body.theme-mobile-app .adapter-profile-control,
  body.theme-mobile-app .theme-profile-control,
  body.theme-mobile-app input,
  body.theme-mobile-app select,
  body.theme-mobile-app textarea {
    color: var(--ink);
    border-color: var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
  }

  body.theme-mobile-app option {
    color: var(--ink);
    background: #ffffff;
  }

  body.theme-mobile-app button:not(.home-button):not(.icon-button):not(.help-button) {
    color: #ffffff;
    border-color: #0a527c;
    border-radius: 8px;
    background: linear-gradient(180deg, #168dd1 0%, #0879bd 100%);
    box-shadow: 0 2px 0 rgba(7, 51, 80, 0.18), 0 8px 16px rgba(8, 121, 189, 0.16);
  }

  body.theme-mobile-app button.primary,
  body.theme-mobile-app .small-button.primary,
  body.theme-mobile-app #connectBleButton {
    color: #ffffff;
    border-color: #08785d;
    background: linear-gradient(180deg, #20c191 0%, #10966f 100%);
  }

  body.theme-mobile-app #reportButton,
  body.theme-mobile-app #purchaseReportButton,
  body.theme-mobile-app .improve-button,
  body.theme-mobile-app .private-log-pdf-button {
    color: #102334;
    border-color: rgba(207, 158, 34, 0.6);
    background: linear-gradient(180deg, #fff5c4 0%, #e7bd39 100%);
  }

  body.theme-mobile-app .dashboard {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.theme-mobile-app .meter-panel {
    min-height: 280px;
    padding: 12px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
      url("i3-battery-cutaway.jpg") center / cover;
  }

  body.theme-mobile-app .meter-panel::before,
  body.theme-mobile-app .meter-panel::after {
    display: none;
  }

  body.theme-mobile-app .meter-panel,
  body.theme-mobile-app .meter-panel .label,
  body.theme-mobile-app .meter-panel .score-row span,
  body.theme-mobile-app .meter-panel strong {
    color: var(--ink);
  }

  body.theme-mobile-app .readout-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body.theme-mobile-app .readout,
  body.theme-mobile-app .readout:nth-child(n) {
    min-height: 82px;
    padding: 10px;
    border-top: 4px solid var(--accent);
    border-left: 0;
    background: #ffffff;
  }

  body.theme-mobile-app .readout strong,
  body.theme-mobile-app .live-tile strong,
  body.theme-mobile-app .score-row strong,
  body.theme-mobile-app .battery-score-grid strong,
  body.theme-mobile-app .category-card strong,
  body.theme-mobile-app .metric-value,
  body.theme-mobile-app .result-value {
    color: var(--ink);
  }

  body.theme-mobile-app .readout.status-good {
    border-top-color: #13a37b;
    background: #f3fbf7;
  }

  body.theme-mobile-app .readout.status-warning {
    border-top-color: #d79b21;
    background: #fff9e9;
  }

  body.theme-mobile-app .readout.status-danger {
    border-top-color: #d94b4b;
    background: #fff2f2;
  }

  body.theme-mobile-app .module-capacity-grid span,
  body.theme-mobile-app .cell-voltage-grid span,
  body.theme-mobile-app .cell-voltage-grid strong,
  body.theme-mobile-app .tag,
  body.theme-mobile-app .badge,
  body.theme-mobile-app .pill,
  body.theme-mobile-app .source-pill {
    color: var(--ink);
    border-color: var(--line);
    background: #edf5f8;
  }

  body.theme-mobile-app .history-table-wrap,
  body.theme-mobile-app .experimental-output,
  body.theme-mobile-app .log-output,
  body.theme-mobile-app pre {
    color: var(--ink);
    border-color: var(--line);
    background: #f7fbfd;
  }

  body.theme-mobile-app .notice,
  body.theme-mobile-app .warning-box,
  body.theme-mobile-app .live-safety-note {
    color: var(--ink);
    border-color: rgba(8, 121, 189, 0.22);
    background: #eaf6fc;
  }

  body.theme-mobile-app .manual-band,
  body.theme-mobile-app .battery-score-grid > div,
  body.theme-mobile-app .category-card,
  body.theme-mobile-app .about-content section,
  body.theme-mobile-app .cell-item,
  body.theme-mobile-app .empty-state,
  body.theme-mobile-app .cell-summary,
  body.theme-mobile-app #comparisonDetails span,
  body.theme-mobile-app .condition-chip {
    color: var(--ink);
    border-color: var(--line);
    background: #ffffff;
  }
}

@media screen and (max-width: 760px) {
  body.theme-mobile-app .readout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 560px) {
  body.theme-mobile-app .app-shell {
    width: min(100% - 12px, 1120px);
  }

  body.theme-mobile-app .topbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  body.theme-mobile-app .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.theme-mobile-app .adapter-profile-control,
  body.theme-mobile-app .theme-profile-control {
    grid-column: 1 / -1;
  }

  body.theme-mobile-app .readout-grid {
    gap: 7px;
  }

  body.theme-mobile-app .readout,
  body.theme-mobile-app .readout:nth-child(n) {
    min-height: 76px;
    padding: 9px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .app-shell > :not(.report-panel),
  .report-panel .panel-heading,
  .report-panel textarea {
    display: none !important;
  }

  .app-shell,
  .report-panel {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .print-report {
    display: block;
    white-space: pre-wrap;
    font: 11pt/1.45 Arial, sans-serif;
  }

  body.printing-history .app-shell > :not(.history-modal),
  body.printing-history .notification-toast {
    display: none !important;
  }

  body.printing-history .history-modal,
  body.printing-history .history-modal.open {
    position: static;
    display: block !important;
    overflow: visible;
  }

  body.printing-history .history-modal-backdrop {
    display: none !important;
  }

  body.printing-history .history-dialog {
    width: 100%;
    height: auto;
    max-height: none;
    margin: 0;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  body.printing-history .history-dialog-header {
    padding: 0 0 10px;
    border-bottom: 2px solid #101820;
    background: #ffffff;
  }

  body.printing-history .history-dialog-header .button-row {
    display: none !important;
  }

  body.printing-history .history-table-wrap {
    margin: 12px 0;
    overflow: visible;
    border: 1px solid #333;
  }

  body.printing-history .history-table {
    min-width: 0;
    font-size: 8.5pt;
  }

  body.printing-history .history-table th,
  body.printing-history .history-table td {
    padding: 5px 4px;
    white-space: normal;
  }

  body.printing-history .history-action-column {
    display: none;
  }

  body.printing-history .history-table th {
    position: static;
    color: #101820;
    background: #edf2f7;
  }

  body.printing-history .history-modal-charts {
    page-break-inside: avoid;
    break-inside: avoid;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 8px 0 0;
  }

  body.printing-history .modal-chart-card {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 1px solid #333;
    box-shadow: none;
    background: #ffffff;
  }

  body.printing-history .modal-chart-card canvas {
    height: 170px;
    min-height: 170px;
  }

  body.printing-history .chart-empty.hidden {
    display: none !important;
  }
}




.live-connect-dialog {
  max-width: 560px;
}

.live-connect-content {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.live-connect-profile-control {
  width: 100%;
  min-height: 0;
}

.live-connect-status {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(0, 102, 177, 0.08);
  border: 1px solid rgba(0, 102, 177, 0.18);
  color: var(--muted);
  font-weight: 800;
}

.live-connect-actions {
  justify-content: flex-start;
}
@media screen {
  body.theme-premium {
    --ink: #f4f7fb;
    --muted: rgba(232, 239, 248, 0.76);
    --line: rgba(219, 181, 98, 0.28);
    --panel: rgba(8, 24, 42, 0.92);
    --page: #071522;
    --accent: #1a8fd6;
    --accent-deep: #071522;
    --accent-soft: rgba(17, 54, 88, 0.82);
    --sky-soft: rgba(20, 65, 102, 0.72);
    --accent-2: #d8b15a;
    --yellow-soft: rgba(216, 177, 90, 0.15);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    --premium-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    --premium-border: rgba(216, 177, 90, 0.24);
    color: var(--ink);
    background:
      radial-gradient(circle at 18% 0%, rgba(216, 177, 90, 0.24), transparent 34%),
      radial-gradient(circle at 88% 10%, rgba(0, 144, 210, 0.20), transparent 30%),
      linear-gradient(180deg, #071522 0%, #0b2136 45%, #071522 100%);
  }

  body.theme-premium .app-shell {
    width: min(1160px, calc(100vw - 22px));
  }

  body.theme-premium .topbar,
  body.theme-premium .actions,
  body.theme-premium .meter-panel,
  body.theme-premium .panel,
  body.theme-premium .readout,
  body.theme-premium .battery-score-panel,
  body.theme-premium .history-panel,
  body.theme-premium .reminder-panel,
  body.theme-premium .charge-monitor-panel,
  body.theme-premium .live-status-row,
  body.theme-premium .live-tile,
  body.theme-premium .modal-chart-card,
  body.theme-premium .history-dialog,
  body.theme-premium .live-connect-dialog {
    color: var(--ink);
    border-color: var(--premium-border);
    background:
      linear-gradient(180deg, rgba(14, 38, 62, 0.96), rgba(7, 21, 34, 0.96));
    box-shadow: var(--premium-shadow);
  }

  body.theme-premium .topbar {
    margin-bottom: 12px;
    border: 1px solid var(--premium-border);
    border-radius: 10px;
    padding: 18px;
  }

  body.theme-premium .topbar::before {
    left: 18px;
    top: auto;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, #d8b15a, #fff3bf, #1a8fd6, #d8b15a);
    box-shadow: 0 10px 26px rgba(216, 177, 90, 0.22);
  }

  body.theme-premium .topbar h1,
  body.theme-premium h1,
  body.theme-premium h2,
  body.theme-premium .eyebrow {
    color: #f8fbff;
  }

  body.theme-premium .app-subtitle,
  body.theme-premium .app-tagline,
  body.theme-premium .app-version,
  body.theme-premium .label,
  body.theme-premium .readout span,
  body.theme-premium .readout small,
  body.theme-premium .readout-hint,
  body.theme-premium .live-tile span,
  body.theme-premium .history-dialog-header p,
  body.theme-premium .panel-heading p,
  body.theme-premium .help-text,
  body.theme-premium .status-line,
  body.theme-premium .small-muted {
    color: rgba(232, 239, 248, 0.76);
  }

  body.theme-premium .connection-pill {
    color: #fff3bf;
    border-color: rgba(216, 177, 90, 0.42);
    background: rgba(216, 177, 90, 0.12);
  }

  body.theme-premium .connection-pill.connected {
    color: #003b73;
    background: linear-gradient(135deg, #fff3bf, #d8b15a);
  }

  body.theme-premium .actions {
    border: 1px solid rgba(216, 177, 90, 0.20);
    border-radius: 10px;
    padding: 10px;
    background: rgba(7, 21, 34, 0.74);
    backdrop-filter: blur(12px);
  }

  body.theme-premium .adapter-profile-control,
  body.theme-premium .theme-profile-control,
  body.theme-premium input,
  body.theme-premium select,
  body.theme-premium textarea {
    color: #f8fbff;
    border-color: rgba(216, 177, 90, 0.28);
    background: rgba(255, 255, 255, 0.08);
  }

  body.theme-premium option {
    color: #101820;
    background: #ffffff;
  }

  body.theme-premium button:not(.home-button):not(.icon-button):not(.help-button) {
    color: #f8fbff;
    border-color: rgba(216, 177, 90, 0.30);
    border-bottom-color: rgba(216, 177, 90, 0.50);
    background: linear-gradient(180deg, rgba(27, 76, 116, 0.96), rgba(10, 34, 56, 0.96));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 2px 0 rgba(0, 0, 0, 0.22),
      0 12px 24px rgba(0, 0, 0, 0.24);
  }

  body.theme-premium button.primary,
  body.theme-premium .small-button.primary {
    color: #003b73;
    border-color: rgba(255, 243, 191, 0.76);
    background: linear-gradient(180deg, #fff3bf 0%, #d8b15a 52%, #a9812a 100%);
  }

  body.theme-premium #connectBleButton {
    color: #ffffff;
    border-color: rgba(89, 230, 178, 0.58);
    background: linear-gradient(180deg, #2bc892 0%, #168568 56%, #0c6f55 100%);
  }

  body.theme-premium #reportButton {
    color: #061929;
    border-color: rgba(255, 230, 141, 0.92);
    border-bottom-color: rgba(158, 113, 29, 0.90);
    background: linear-gradient(180deg, #fff6cf 0%, #f2c75f 50%, #b98924 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.55),
      0 2px 0 rgba(86, 56, 8, 0.34),
      0 12px 24px rgba(242, 199, 95, 0.18);
  }

  body.theme-premium #purchaseReportButton {
    color: #06251f;
    border-color: rgba(126, 231, 197, 0.88);
    border-bottom-color: rgba(20, 109, 88, 0.86);
    background: linear-gradient(180deg, #e8fff7 0%, #7ee7c5 52%, #1a9c7a 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.48),
      0 2px 0 rgba(4, 54, 43, 0.32),
      0 12px 24px rgba(126, 231, 197, 0.14);
  }

  body.theme-premium .help-button,
  body.theme-premium .module-map-button {
    color: #003b73;
    border-color: rgba(255, 243, 191, 0.72);
    background: linear-gradient(180deg, #fff3bf, #d8b15a);
  }

  body.theme-premium .meter-panel {
    background:
      linear-gradient(160deg, rgba(8, 24, 42, 0.96) 0%, rgba(14, 50, 78, 0.92) 58%, rgba(216, 177, 90, 0.16) 100%);
    border-top-color: #d8b15a;
  }

  body.theme-premium .readout,
  body.theme-premium .readout:nth-child(1),
  body.theme-premium .readout:nth-child(2),
  body.theme-premium .readout:nth-child(3),
  body.theme-premium .readout:nth-child(4),
  body.theme-premium .readout:nth-child(5),
  body.theme-premium .readout:nth-child(6),
  body.theme-premium .readout:nth-child(7),
  body.theme-premium .readout:nth-child(8),
  body.theme-premium .readout:nth-child(9) {
    border-top-color: #d8b15a;
    background: linear-gradient(180deg, rgba(14, 42, 68, 0.96), rgba(7, 21, 34, 0.96));
  }

  body.theme-premium .readout strong,
  body.theme-premium .live-tile strong,
  body.theme-premium .score-row strong,
  body.theme-premium .battery-score-grid strong,
  body.theme-premium .category-card strong,
  body.theme-premium .metric-value,
  body.theme-premium .result-value {
    color: #ffffff;
  }

  body.theme-premium .status-good {
    border-color: rgba(82, 208, 162, 0.36);
  }

  body.theme-premium .status-warning {
    border-color: rgba(216, 177, 90, 0.50);
  }

  body.theme-premium .status-danger {
    border-color: rgba(255, 100, 120, 0.44);
  }

  body.theme-premium .module-capacity-grid span,
  body.theme-premium .cell-voltage-grid span,
  body.theme-premium .cell-voltage-grid strong,
  body.theme-premium .history-table-wrap,
  body.theme-premium .history-table-top-scroll,
  body.theme-premium .experimental-output,
  body.theme-premium .log-output,
  body.theme-premium pre {
    color: #f8fbff;
    border-color: rgba(216, 177, 90, 0.20);
    background: rgba(255, 255, 255, 0.08);
  }

  body.theme-premium .history-table th {
    color: #fff3bf;
    background: #0d2944;
  }

  body.theme-premium .history-table td {
    color: #f8fbff;
    border-bottom-color: rgba(216, 177, 90, 0.14);
  }

  body.theme-premium .history-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.04);
  }

  body.theme-premium .history-usable-summary {
    color: #f8fbff;
    border-color: rgba(216, 177, 90, 0.26);
    border-left-color: #d8b15a;
    background: linear-gradient(180deg, rgba(18, 48, 76, 0.96), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .history-usable-summary h3,
  body.theme-premium .history-usable-grid strong {
    color: #ffffff;
  }

  body.theme-premium .history-usable-summary p,
  body.theme-premium .history-usable-grid span,
  body.theme-premium .history-usable-grid small {
    color: #dff4ff;
  }

  body.theme-premium .history-usable-grid div {
    border-color: rgba(216, 177, 90, 0.18);
    background: rgba(255, 255, 255, 0.08);
  }

  body.theme-premium .history-usable-summary .history-usable-advice {
    color: #003b73;
    background: linear-gradient(180deg, rgba(255, 243, 191, 0.96), rgba(216, 177, 90, 0.90));
  }

  body.theme-premium .live-connect-status,
  body.theme-premium .notice,
  body.theme-premium .warning-box {
    color: #fff3bf;
    border-color: rgba(216, 177, 90, 0.30);
    background: rgba(216, 177, 90, 0.11);
  }

  body.theme-premium .capacity-guide {
    color: #f8fbff;
    border-color: rgba(216, 177, 90, 0.30);
    background:
      radial-gradient(circle at 14% 0%, rgba(26, 143, 214, 0.22), transparent 36%),
      linear-gradient(180deg, rgba(13, 38, 62, 0.98), rgba(7, 21, 34, 0.98));
    box-shadow: var(--premium-shadow);
  }

  body.theme-premium .capacity-guide-heading h2,
  body.theme-premium #capacityDifference,
  body.theme-premium .capacity-guide-grid strong {
    color: #ffffff;
  }

  body.theme-premium .capacity-guide-heading p,
  body.theme-premium .capacity-guide-grid p,
  body.theme-premium .capacity-guide-grid .secondary-formula {
    color: rgba(232, 239, 248, 0.86);
  }

  body.theme-premium .capacity-guide-grid {
    gap: 10px;
    border-top-color: rgba(216, 177, 90, 0.20);
  }

  body.theme-premium .capacity-guide-grid > div {
    border: 1px solid rgba(216, 177, 90, 0.18);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.07);
  }

  body.theme-premium .capacity-guide-grid > div + div {
    border-left: 1px solid rgba(216, 177, 90, 0.18);
    padding-left: 12px;
  }

  body.theme-premium .capacity-guide-grid span {
    color: #fff3bf;
  }

  body.theme-premium .primary-capacity-note {
    color: #dffff6;
    border-color: rgba(82, 208, 162, 0.32);
    border-left-color: #52d0a2;
    background: rgba(22, 133, 104, 0.22);
  }

  body.theme-premium .derived-note {
    color: #dff4ff;
    border-color: rgba(26, 143, 214, 0.42);
    border-left-color: #1a8fd6;
    background: rgba(26, 143, 214, 0.16);
    text-shadow: none;
  }
}
@media screen {
  body.theme-premium .manual-band,
  body.theme-premium .battery-score-grid > div,
  body.theme-premium .category-card,
  body.theme-premium .about-content section,
  body.theme-premium .cell-item,
  body.theme-premium .empty-state,
  body.theme-premium .cell-summary,
  body.theme-premium #comparisonDetails span,
  body.theme-premium .condition-chip {
    color: #f8fbff;
    border-color: rgba(216, 177, 90, 0.24);
    background: linear-gradient(180deg, rgba(18, 48, 76, 0.96), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .manual-band {
    border-top-color: #d8b15a;
  }

  body.theme-premium .manual-band p,
  body.theme-premium .manual-band label,
  body.theme-premium .manual-band label span,
  body.theme-premium .about-content p,
  body.theme-premium .about-content li,
  body.theme-premium .about-content dd,
  body.theme-premium .cell-item span,
  body.theme-premium .empty-state,
  body.theme-premium .battery-score-grid span,
  body.theme-premium .category-card span,
  body.theme-premium .category-card small,
  body.theme-premium .condition-chip {
    color: rgba(232, 239, 248, 0.82);
  }

  body.theme-premium .about-content h3,
  body.theme-premium .about-content dt,
  body.theme-premium .manual-intro-title h2,
  body.theme-premium .battery-score-heading h2,
  body.theme-premium .battery-score-grid strong,
  body.theme-premium .category-card strong,
  body.theme-premium .cell-item strong,
  body.theme-premium .cell-summary,
  body.theme-premium #comparisonDetails span {
    color: #ffffff;
  }

  body.theme-premium .about-content h3,
  body.theme-premium .about-content dt {
    color: #fff3bf;
  }

  body.theme-premium .battery-score-grid > div:nth-child(2),
  body.theme-premium .battery-score-grid > div:nth-child(4),
  body.theme-premium .category-card.good,
  body.theme-premium .condition-chip.good {
    border-top-color: #1fa77f;
    background: linear-gradient(180deg, rgba(13, 70, 62, 0.95), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .battery-score-grid > div:nth-child(3),
  body.theme-premium .battery-score-grid > div:nth-child(5),
  body.theme-premium .category-card.warning {
    border-top-color: #d8b15a;
    background: linear-gradient(180deg, rgba(86, 66, 24, 0.94), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .category-card.danger,
  body.theme-premium .condition-chip.bad {
    border-top-color: #ff6478;
    background: linear-gradient(180deg, rgba(88, 31, 42, 0.94), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .cell-item.low {
    border-color: rgba(255, 100, 120, 0.58);
    background: linear-gradient(180deg, rgba(88, 31, 42, 0.92), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .cell-item.high {
    border-color: rgba(26, 143, 214, 0.58);
    background: linear-gradient(180deg, rgba(18, 67, 100, 0.94), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium input::placeholder,
  body.theme-premium textarea::placeholder {
    color: rgba(232, 239, 248, 0.52);
  }

  body.theme-premium button:disabled,
  body.theme-premium button[disabled] {
    color: rgba(248, 251, 255, 0.82) !important;
    border-color: rgba(216, 177, 90, 0.20) !important;
    background: linear-gradient(180deg, rgba(52, 74, 92, 0.92), rgba(20, 35, 50, 0.92)) !important;
    opacity: 0.78;
    text-shadow: none;
  }

  body.theme-premium .tag,
  body.theme-premium .badge,
  body.theme-premium .pill,
  body.theme-premium .source-pill {
    color: #003b73;
    background: linear-gradient(180deg, #fff3bf, #d8b15a);
  }
}
@media screen {
  body.theme-premium .prognosis-card,
  body.theme-premium .category-card.pending,
  body.theme-premium .experimental-form {
    color: #f8fbff;
    border-color: rgba(216, 177, 90, 0.24);
    background: linear-gradient(180deg, rgba(18, 48, 76, 0.96), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .prognosis-card.good,
  body.theme-premium .condition-chip.good {
    border-top-color: #1fa77f;
    background: linear-gradient(180deg, rgba(13, 70, 62, 0.95), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .prognosis-card.warning,
  body.theme-premium .condition-chip.warning,
  body.theme-premium .category-card.warning {
    border-top-color: #d8b15a;
    background: linear-gradient(180deg, rgba(86, 66, 24, 0.94), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .prognosis-card.danger,
  body.theme-premium .condition-chip.danger,
  body.theme-premium .category-card.danger {
    border-top-color: #ff6478;
    background: linear-gradient(180deg, rgba(88, 31, 42, 0.94), rgba(8, 24, 42, 0.96));
  }

  body.theme-premium .prognosis-card span,
  body.theme-premium .prognosis-card small,
  body.theme-premium .prognosis-note span,
  body.theme-premium .experimental-form label,
  body.theme-premium .experimental-form label span,
  body.theme-premium .experimental-form small {
    color: rgba(232, 239, 248, 0.82);
  }

  body.theme-premium .prognosis-card strong,
  body.theme-premium .experimental-form strong,
  body.theme-premium .experimental-form h3 {
    color: #ffffff;
  }

  body.theme-premium .experimental-form input,
  body.theme-premium .experimental-form select {
    color: #ffffff;
    border-color: rgba(216, 177, 90, 0.30);
    background: rgba(255, 255, 255, 0.10);
  }

  body.theme-premium .experimental-form input::placeholder {
    color: rgba(232, 239, 248, 0.54);
  }

  body.theme-premium .experimental-output,
  body.theme-premium .log-output {
    color: #f8fbff;
    background: rgba(3, 13, 22, 0.72);
  }
}
@media screen {
  body.theme-premium .measurement-conditions {
    color: #003b73;
    border-color: rgba(216, 177, 90, 0.34);
    border-left-color: #d8b15a;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(226, 235, 242, 0.94));
  }

  body.theme-premium .measurement-conditions h2,
  body.theme-premium .measurement-conditions p,
  body.theme-premium .measurement-conditions label,
  body.theme-premium .measurement-conditions label span,
  body.theme-premium .measurement-conditions strong,
  body.theme-premium .measurement-conditions small,
  body.theme-premium #conditionsSummary {
    color: #003b73;
  }

  body.theme-premium .measurement-conditions select,
  body.theme-premium .measurement-conditions input {
    color: #003b73;
    border-color: rgba(7, 21, 34, 0.18);
    background: rgba(255, 255, 255, 0.88);
  }

  body.theme-premium .condition-item,
  body.theme-premium .condition-item.good,
  body.theme-premium .condition-item.warning,
  body.theme-premium .condition-item.danger {
    color: #003b73;
    background: rgba(255, 255, 255, 0.72);
  }

  body.theme-premium .condition-item small {
    color: #243448;
  }

  body.theme-premium .live-safety-note {
    color: #bfe9ff;
    border-color: rgba(122, 209, 255, 0.44);
    border-left-color: #7ad1ff;
    background: rgba(8, 41, 65, 0.86);
  }

  body.theme-premium .insight-band > div:nth-child(1),
  body.theme-premium .quality-readout {
    border-color: rgba(135, 240, 191, 0.42);
    border-top-color: #87f0bf;
  }

  body.theme-premium .insight-band > div:nth-child(1) span,
  body.theme-premium .insight-band > div:nth-child(1) strong,
  body.theme-premium .insight-band > div:nth-child(1) p,
  body.theme-premium .quality-readout span,
  body.theme-premium .quality-readout strong,
  body.theme-premium #qualityTitle,
  body.theme-premium #qualityDetails,
  body.theme-premium #reliabilityValue {
    color: #a8f5cf;
  }

  body.theme-premium #reliabilityValue {
    color: #101820;
  }
}
@media screen {
  body.theme-premium .history-item,
  body.theme-premium .history-item:nth-child(3n + 2),
  body.theme-premium .history-item:nth-child(3n) {
    color: #f8fbff;
    border-left-color: #1a8fd6;
    border-top: 1px solid rgba(216, 177, 90, 0.18);
    border-right: 1px solid rgba(216, 177, 90, 0.12);
    border-bottom: 1px solid rgba(216, 177, 90, 0.12);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(18, 48, 76, 0.98), rgba(8, 24, 42, 0.98));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.20);
  }

  body.theme-premium .history-item:nth-child(3n + 2) {
    border-left-color: #1fa77f;
  }

  body.theme-premium .history-item:nth-child(3n) {
    border-left-color: #d8b15a;
  }

  body.theme-premium .history-item time,
  body.theme-premium .history-source,
  body.theme-premium .history-details small,
  body.theme-premium .history-values span {
    color: rgba(232, 239, 248, 0.78);
  }

  body.theme-premium .history-values strong,
  body.theme-premium .history-details strong {
    color: #ffffff;
  }

  body.theme-premium .history-details {
    border-top-color: rgba(216, 177, 90, 0.20);
  }

  body.theme-premium .history-item.history-item--ride-capacity {
    border-left-color: #ffd54a;
    background: linear-gradient(180deg, rgba(45, 55, 62, 0.98), rgba(24, 31, 38, 0.98));
  }

  body.theme-premium .history-item--ride-capacity .history-source,
  body.theme-premium .history-item--ride-capacity .history-values strong {
    color: #ffd54a;
  }
}
@media screen {
  .meter-panel {
    min-height: 300px;
    padding: 12px;
    grid-template-rows: auto auto;
  }

  #batteryCanvas {
    height: min(24vw, 168px);
    min-height: 136px;
  }

  .score-row {
    gap: 10px;
    padding-top: 8px;
  }

  .score-row > div {
    padding-top: 7px;
  }

  .score-row strong {
    font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  }
}

@media screen {
  .meter-panel {
    min-height: 218px;
    padding: 10px;
    gap: 6px;
  }

  #batteryCanvas {
    height: clamp(112px, 18vw, 132px);
    min-height: 112px;
  }

  .score-row {
    gap: 6px;
    padding-top: 4px;
  }

  .score-row > div {
    border-top-width: 2px;
    padding-top: 5px;
  }

  .score-row .label {
    font-size: 0.72rem;
  }

  .score-row strong {
    margin-top: 2px;
    font-size: clamp(0.9rem, 1.7vw, 1.12rem);
  }
}
@media screen {
  body.theme-premium .source-badge {
    min-width: 0;
    color: #0f2538;
    border-color: rgba(216, 177, 90, 0.55);
    background: linear-gradient(180deg, #fff7d8, #d8b15a);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 5px 13px rgba(0, 0, 0, 0.18);
    text-shadow: none;
  }

  body.theme-premium .source-badge.measured {
    color: #063f34;
    border-color: rgba(87, 204, 153, 0.62);
    background: linear-gradient(180deg, #ecfff6, #80d8b2);
  }

  body.theme-premium .source-badge.calculated,
  body.theme-premium .source-badge.estimated {
    color: #382900;
    border-color: rgba(216, 177, 90, 0.70);
    background: linear-gradient(180deg, #fff3bf, #d8b15a);
  }

  body.theme-premium .source-badge.partial {
    color: #4d3000;
    border-color: rgba(218, 151, 45, 0.72);
    background: linear-gradient(180deg, #fff4d6, #e8bd72);
  }

  body.theme-premium .source-badge.unavailable {
    color: #27313d;
    border-color: rgba(220, 228, 238, 0.70);
    background: linear-gradient(180deg, #f6f9fd, #c8d2dd);
  }
}
@media screen {
  body.theme-premium .insight-band > div:nth-child(2) {
    color: #003b73;
    background: linear-gradient(180deg, rgba(236, 255, 246, 0.96), rgba(196, 244, 220, 0.92));
  }

  body.theme-premium .insight-band > div:nth-child(2) span,
  body.theme-premium .insight-band > div:nth-child(2) strong,
  body.theme-premium .insight-band > div:nth-child(2) p,
  body.theme-premium #adviceTitle,
  body.theme-premium #adviceDetails {
    color: #003b73;
    text-shadow: none;
  }
}
@media screen {
  body.theme-premium .dashboard {
    gap: 8px;
  }

  body.theme-premium .readout,
  body.theme-premium .readout:nth-child(1),
  body.theme-premium .readout:nth-child(2),
  body.theme-premium .readout:nth-child(3),
  body.theme-premium .readout:nth-child(4),
  body.theme-premium .readout:nth-child(5),
  body.theme-premium .readout:nth-child(6),
  body.theme-premium .readout:nth-child(7),
  body.theme-premium .readout:nth-child(8),
  body.theme-premium .readout:nth-child(9),
  body.theme-premium .readout:nth-child(10),
  body.theme-premium .readout:nth-child(11),
  body.theme-premium .readout:nth-child(12),
  body.theme-premium .readout:nth-child(13),
  body.theme-premium .readout:nth-child(14),
  body.theme-premium .readout:nth-child(15) {
    min-height: 66px;
    padding: 9px 10px;
    color: #003b73;
    border: 1px solid rgba(216, 177, 90, 0.34);
    border-left: 3px solid #d8b15a;
    border-top: 0;
    background:
      linear-gradient(145deg, rgba(255, 243, 191, 0.18), transparent 42%),
      linear-gradient(180deg, rgba(248, 251, 255, 0.97), rgba(218, 231, 242, 0.94));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  }

  body.theme-premium .readout span,
  body.theme-premium .readout small,
  body.theme-premium .readout-hint {
    color: #354558;
  }

  body.theme-premium .readout strong,
  body.theme-premium .readout .metric-value,
  body.theme-premium .readout .result-value,
  body.theme-premium .module-capacity-grid,
  body.theme-premium .cell-voltage-grid {
    color: #003b73;
  }

  body.theme-premium .readout.status-good {
    border-left-color: #1fa77f;
    background:
      linear-gradient(145deg, rgba(31, 167, 127, 0.18), transparent 44%),
      linear-gradient(180deg, rgba(242, 255, 249, 0.98), rgba(213, 240, 228, 0.95));
  }

  body.theme-premium .readout.status-warning {
    border-left-color: #d8b15a;
    background:
      linear-gradient(145deg, rgba(216, 177, 90, 0.24), transparent 44%),
      linear-gradient(180deg, rgba(255, 249, 223, 0.98), rgba(236, 225, 188, 0.95));
  }

  body.theme-premium .readout.status-danger {
    border-left-color: #d85b6b;
    background:
      linear-gradient(145deg, rgba(216, 91, 107, 0.20), transparent 44%),
      linear-gradient(180deg, rgba(255, 244, 246, 0.98), rgba(241, 216, 221, 0.95));
  }

  body.theme-premium .module-capacity-grid span,
  body.theme-premium .cell-voltage-grid span,
  body.theme-premium .cell-voltage-grid strong {
    color: #003b73;
    border-color: rgba(7, 21, 34, 0.16);
    background: rgba(255, 255, 255, 0.58);
  }

  body.theme-premium button:not(.home-button):not(.icon-button):not(.help-button) {
    border-radius: 7px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.20),
      0 1px 0 rgba(0, 0, 0, 0.24),
      0 8px 18px rgba(0, 0, 0, 0.20);
  }

  body.theme-premium .actions {
    gap: 8px;
  }
}
@media screen {
  body.theme-premium .module-map-pack {
    border-color: rgba(216, 177, 90, 0.28);
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 50%, rgba(255, 255, 255, 0.05)),
      rgba(4, 16, 27, 0.42);
  }

  body.theme-premium .module-map-cell {
    color: #003b73;
    border-color: rgba(26, 143, 214, 0.50);
    border-left-color: #1a8fd6;
    background:
      linear-gradient(145deg, rgba(255, 243, 191, 0.15), transparent 44%),
      linear-gradient(180deg, #ffffff 0%, #dfeaf3 100%);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  }

  body.theme-premium .module-map-cell small,
  body.theme-premium .module-map-cell em {
    color: #34475a;
  }

  body.theme-premium .module-map-cell strong {
    color: #003b73;
  }

  body.theme-premium .module-map-cell.weakest {
    border-color: rgba(216, 91, 107, 0.56);
    border-left-color: #d85b6b;
    background:
      linear-gradient(145deg, rgba(216, 91, 107, 0.16), transparent 44%),
      linear-gradient(180deg, #fff8f9 0%, #eadde1 100%);
  }

  body.theme-premium .module-map-csc {
    color: #003b73;
    background: linear-gradient(180deg, #e7f7ff, #c5eefa);
    border: 1px solid rgba(26, 143, 214, 0.18);
  }

  body.theme-premium .module-map-note {
    color: #bfeeff;
    border-color: rgba(98, 207, 255, 0.38);
    background: linear-gradient(180deg, rgba(7, 31, 51, 0.96), rgba(8, 45, 70, 0.94));
  }

  body.theme-premium .module-map-note span,
  body.theme-premium .module-map-note p {
    color: #bfeeff;
  }
}
@media screen {
  body.theme-premium .meter-panel {
    position: relative;
    overflow: hidden;
  }

  body.theme-premium .meter-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(90deg, rgba(7, 21, 34, 0.92), rgba(7, 21, 34, 0.62) 50%, rgba(7, 21, 34, 0.90)),
      url("i3-battery-cutaway.jpg?v=2.20.74") right center / auto 100% no-repeat;
    opacity: 0.34;
    pointer-events: none;
  }

  body.theme-premium .meter-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 18% 18%, rgba(98, 207, 255, 0.18), transparent 30%),
      linear-gradient(180deg, transparent, rgba(216, 177, 90, 0.08));
    pointer-events: none;
  }

  body.theme-premium .meter-panel > * {
    position: relative;
    z-index: 1;
  }
}
@media screen {
  .manual-intro {
    grid-template-columns: 1fr;
  }

  .manual-intro-title h2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
}

.gps-trip-panel {
  margin: 12px 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(214, 181, 95, 0.32);
  border-left: 5px solid var(--gold, #d6b55f);
  border-radius: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(7, 24, 41, 0.94), rgba(18, 55, 90, 0.88));
  color: #eaf8ff;
}

.gps-trip-panel strong,
.gps-trip-panel span {
  display: block;
}

.gps-trip-panel strong {
  font-size: 0.95rem;
  color: #dff4ff;
}

.gps-trip-panel span {
  margin-top: 3px;
  color: #bfe7ff;
  font-size: 0.82rem;
  font-weight: 750;
}

.gps-trip-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(214, 181, 95, 0.36);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.gps-trip-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #20c997;
}

.bach-routecheck-card {
  margin: 12px 18px 0;
  border: 1px solid rgba(214, 181, 95, 0.32);
  border-left: 5px solid #d6b55f;
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(7, 24, 41, 0.92), rgba(16, 54, 82, 0.82));
  color: #eaf8ff;
}

.bach-routecheck-card.good {
  border-left-color: #20c997;
}

.bach-routecheck-card.warning {
  border-left-color: #d6b55f;
}

.bach-routecheck-card.danger {
  border-left-color: #d94b4b;
}

.bach-routecheck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bach-routecheck-header span {
  color: #d6b55f;
  font-size: 1rem;
  font-weight: 950;
}

.bach-routecheck-header strong {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
}

.bach-routecheck-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.bach-routecheck-grid span {
  min-width: 0;
  border: 1px solid rgba(223, 244, 255, 0.15);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.bach-routecheck-grid small {
  display: block;
  color: #bfe7ff;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bach-routecheck-grid strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 950;
  word-break: break-word;
}

.bach-routecheck-card p {
  margin: 10px 0 0;
  color: #dff4ff;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.gps-route-card {
  margin: 12px 18px 0;
  border: 1px solid rgba(214, 181, 95, 0.28);
  border-radius: 8px;
  padding: 12px;
  background: rgba(7, 24, 41, 0.88);
}

@media (max-width: 720px) {
  .bach-routecheck-card {
    margin: 10px 12px 0;
  }

  .bach-routecheck-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gps-route-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.gps-route-header strong {
  color: #dff4ff;
  font-size: 0.95rem;
}

.gps-route-header span {
  color: #bfe7ff;
  font-size: 0.78rem;
  font-weight: 750;
  text-align: right;
}

.gps-osm-map {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border: 1px solid rgba(223, 244, 255, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, #071829, #12375a);
}

.gps-osm-tiles,
#gpsRouteCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.gps-osm-tiles img {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
}

#gpsRouteCanvas {
  pointer-events: none;
  background: transparent;
}

.gps-osm-attribution {
  position: absolute;
  right: 7px;
  bottom: 6px;
  z-index: 3;
  border-radius: 4px;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.82);
  color: #0b2135;
  font-size: 0.56rem;
  font-weight: 800;
}

.gps-route-measurement-info {
  margin-top: 10px;
  border: 1px solid rgba(99, 216, 255, 0.34);
  border-left: 4px solid #63d8ff;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(223, 244, 255, 0.94);
  color: #092238;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.gps-route-measurement-info strong,
.gps-route-measurement-info span {
  display: block;
}

.gps-route-measurement-info strong {
  margin-bottom: 3px;
  color: #082136;
  font-size: 0.88rem;
}

.gps-route-measurement-info span {
  color: #123754;
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.3;
}

.gps-route-measurement-info dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  margin: 9px 0 0;
}

.gps-route-measurement-info div {
  min-width: 0;
}

.gps-route-measurement-info dt {
  color: #426174;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gps-route-measurement-info dd {
  margin: 1px 0 0;
  color: #061a2b;
  font-size: 0.78rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.live-route-map-dialog {
  width: min(1120px, calc(100vw - 24px));
  height: min(840px, calc(100dvh - 24px));
}

.live-route-map-frame {
  flex: 1 1 auto;
  width: calc(100% - 36px);
  min-height: 620px;
  margin: 16px 18px 18px;
  border: 1px solid rgba(223, 244, 255, 0.18);
  border-radius: 8px;
  background: #071829;
}

#liveGpsTripValue {
  font-size: 0.9rem;
  line-height: 1.18;
}

@media (max-width: 680px) {
  .gps-trip-panel,
  .gps-route-header {
    align-items: stretch;
    flex-direction: column;
  }

  .gps-trip-toggle {
    justify-content: center;
    width: 100%;
  }

  .gps-route-header span {
    text-align: left;
  }

  .gps-osm-map {
    height: 180px;
  }

  .gps-route-measurement-info dl {
    grid-template-columns: 1fr;
  }

  .live-route-map-dialog {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    margin: 6px auto;
  }

  .live-route-map-frame {
    width: calc(100% - 20px);
    min-height: 520px;
    margin: 10px;
  }
}

.gps-trip-button {
  border-color: rgba(214, 181, 95, 0.5);
  color: #dff4ff;
}

.gps-trip-button.gps-pending {
  border-color: rgba(214, 181, 95, 0.8);
  background: linear-gradient(180deg, #6f5b1e 0%, #2c240e 100%);
  color: #fff3c4;
}

.gps-trip-button.gps-active {
  border-color: rgba(127, 240, 194, 0.85);
  background: linear-gradient(180deg, #26c987 0%, #0d6f4d 100%);
  color: #f3fff9;
  box-shadow: 0 0 0 1px rgba(127, 240, 194, 0.25), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.small-button.gps-trip-button.gps-ready {
  border-color: rgba(214, 181, 95, 0.95);
  background: linear-gradient(180deg, #b99135 0%, #5f4714 100%);
  color: #fff8d8;
  box-shadow: 0 0 0 1px rgba(214, 181, 95, 0.28), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.small-button.gps-trip-button.gps-pending {
  border-color: rgba(255, 193, 7, 0.95);
  background: linear-gradient(180deg, #d59b20 0%, #7b5400 100%);
  color: #fffbe8;
  box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.26), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.small-button.gps-trip-button.gps-active {
  border-color: rgba(127, 240, 194, 0.95);
  background: linear-gradient(180deg, #2ee39b 0%, #0a7f55 100%);
  color: #f3fff9;
  box-shadow: 0 0 0 1px rgba(127, 240, 194, 0.35), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.small-button.gps-trip-button.gps-error {
  border-color: rgba(255, 117, 117, 0.9);
  background: linear-gradient(180deg, #9b2f2f 0%, #561818 100%);
  color: #fff0f0;
}

/* GPS status colors: keep every state visibly distinct on the 3D button. */
.gps-trip-button,
.small-button.gps-trip-button {
  border-color: rgba(214, 181, 95, 0.5);
  color: #dff4ff;
}

.gps-trip-button.gps-off,
.small-button.gps-trip-button.gps-off {
  border-color: rgba(160, 183, 197, 0.5);
  background: linear-gradient(180deg, #173a5a 0%, #061e34 100%);
  color: #dff4ff !important;
}

.gps-trip-button.gps-ready,
.small-button.gps-trip-button.gps-ready {
  border-color: rgba(214, 181, 95, 0.95);
  background: linear-gradient(180deg, #b99135 0%, #5f4714 100%);
  color: #fff2a8 !important;
  box-shadow: 0 0 0 1px rgba(214, 181, 95, 0.28), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.gps-trip-button.gps-pending,
.small-button.gps-trip-button.gps-pending {
  border-color: rgba(255, 193, 7, 0.95);
  background: linear-gradient(180deg, #d59b20 0%, #7b5400 100%);
  color: #ffe16a !important;
  box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.26), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.gps-trip-button.gps-active,
.small-button.gps-trip-button.gps-active {
  border-color: rgba(127, 240, 194, 0.95);
  background: linear-gradient(180deg, #2ee39b 0%, #0a7f55 100%);
  color: #bfffe1 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  box-shadow: 0 0 0 1px rgba(127, 240, 194, 0.35), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.gps-trip-button.gps-error,
.small-button.gps-trip-button.gps-error {
  border-color: rgba(255, 117, 117, 0.9);
  background: linear-gradient(180deg, #9b2f2f 0%, #561818 100%);
  color: #ffd6d6 !important;
}

.smartcar-dialog {
  width: min(900px, calc(100vw - 24px));
}

.smartcar-content {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.smartcar-intro,
.smartcar-next-steps,
.smartcar-card,
.smartcar-status-card {
  border: 1px solid rgba(0, 105, 170, 0.16);
  border-left: 4px solid #00a3d7;
  border-radius: 8px;
  padding: 14px;
  color: #06233b;
  background: rgba(235, 248, 255, 0.96);
}

.smartcar-intro strong,
.smartcar-next-steps strong,
.smartcar-card h3,
.smartcar-status-card span {
  color: #003b73;
}

.smartcar-card h3 {
  margin: 0;
  font-size: 1rem;
}

.smartcar-intro p,
.smartcar-next-steps p,
.smartcar-card p {
  margin: 6px 0 0;
  color: #06233b;
  font-weight: 650;
  line-height: 1.45;
}

.smartcar-split,
.smartcar-status-grid {
  display: grid;
  gap: 12px;
}

.smartcar-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.smartcar-status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.smartcar-status-card span,
.smartcar-status-card strong {
  display: block;
}

.smartcar-status-card span {
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.smartcar-status-card strong {
  margin-top: 4px;
  color: #061b2f;
  font-size: 1.05rem;
}

body.theme-premium .smartcar-intro,
body.theme-premium .smartcar-next-steps,
body.theme-premium .smartcar-card,
body.theme-premium .smartcar-status-card {
  color: #06233b;
  background: linear-gradient(180deg, rgba(242, 251, 255, 0.98), rgba(220, 239, 249, 0.96));
  text-shadow: none;
}

body.theme-premium .smartcar-intro strong,
body.theme-premium .smartcar-next-steps strong,
body.theme-premium .smartcar-card h3,
body.theme-premium .smartcar-status-card span,
body.theme-premium .smartcar-status-card strong,
body.theme-premium .smartcar-intro p,
body.theme-premium .smartcar-next-steps p,
body.theme-premium .smartcar-card p {
  color: #06233b;
  text-shadow: none;
}

@media (max-width: 720px) {
  .smartcar-split,
  .smartcar-status-grid {
    grid-template-columns: 1fr;
  }
}


.smartcar-plan-card {
  padding: 16px;
  border: 1px solid rgba(239, 208, 116, 0.4);
  border-radius: 14px;
  background: rgba(226, 240, 245, 0.92);
  color: #061b2d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.smartcar-plan-card > strong {
  display: block;
  margin-bottom: 10px;
  color: #06314e;
  font-size: 1.05rem;
}

.smartcar-steps {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}

.smartcar-steps li {
  padding-left: 4px;
}

.smartcar-steps span,
.smartcar-steps small {
  display: block;
}

.smartcar-steps span {
  font-weight: 800;
  color: #06263f;
}

.smartcar-steps small {
  margin-top: 2px;
  color: #274a5e;
  line-height: 1.35;
}

.smartcar-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.smartcar-action-row .small-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  filter: grayscale(0.2);
}

body.theme-simple-mobile .smartcar-plan-card {
  background: #eef8f8;
  color: #0a1b26;
}

body.theme-simple-mobile .smartcar-steps span {
  color: #0a1b26;
}

body.theme-simple-mobile .smartcar-steps small {
  color: #315163;
}

@media (max-width: 720px) {
  .smartcar-action-row {
    grid-template-columns: 1fr;
  }
}

.smartcar-vin-card p {
  margin: 8px 0 0;
  color: #17384c;
  line-height: 1.45;
}

.smartcar-vin-card #smartcarVinEndpoint {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9rem;
  color: #07506d;
}

/* Ruimer en overzichtelijker invoerblok voor eigen experimentele PID's. */
.experimental-dialog {
  max-width: min(980px, calc(100vw - 18px));
}

.experimental-form {
  max-height: none;
  margin: 16px 18px 10px;
  padding: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  overflow: visible;
}

.custom-pid-header {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  padding-bottom: 2px;
}

.custom-pid-header strong {
  color: var(--accent-deep);
  font-size: 1.05rem;
  font-weight: 900;
}

.custom-pid-header span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.experimental-form label:nth-of-type(2) {
  grid-column: 1 / -1;
}

.experimental-form label {
  gap: 7px;
  font-size: 0.84rem;
}

.experimental-form input,
.experimental-form select {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 13px;
  font-size: 1rem;
}

.experimental-form .button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.experimental-form .button-row .small-button {
  min-height: 48px;
}

body.theme-premium .custom-pid-header strong {
  color: #f8fbff;
}

body.theme-premium .custom-pid-header span {
  color: #cfe9ff;
}

@media (max-width: 720px) {
  .experimental-form {
    margin: 12px 12px 8px;
    padding: 14px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .experimental-form .button-row {
    grid-template-columns: 1fr;
  }

  .experimental-list {
    padding: 12px 12px 4px;
  }

  .experimental-dialog #experimentalOutput {
    margin: 10px 12px 14px;
  }
}

/* Correctie: Experimentele PID's moet op mobiel volledig bereikbaar blijven. */
.experimental-dialog {
  overflow: auto;
}

.experimental-dialog .history-dialog-header {
  flex: 0 0 auto;
}

.experimental-form {
  flex: 0 0 auto;
  max-height: clamp(220px, 38dvh, 330px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.experimental-list {
  flex: 1 1 220px;
  min-height: 180px;
  max-height: none;
}

.experimental-dialog #experimentalOutput {
  flex: 0 0 clamp(112px, 20dvh, 190px);
  min-height: 104px;
  max-height: 190px;
}

@media (max-width: 720px) {
  .experimental-dialog {
    height: calc(100dvh - 10px);
    max-height: calc(100dvh - 10px);
    overflow: auto;
  }

  .experimental-form {
    max-height: 32dvh;
    padding: 12px;
    gap: 9px;
  }

  .custom-pid-header span {
    font-size: 0.82rem;
  }

  .experimental-form input,
  .experimental-form select {
    min-height: 42px;
    font-size: 0.94rem;
  }

  .experimental-form .button-row .small-button {
    min-height: 42px;
  }

  .experimental-list {
    flex-basis: 260px;
    min-height: 230px;
    grid-template-columns: 1fr;
  }
}

/* Compacte experimentele PID-indeling: vaste testknoppen moeten snel bereikbaar blijven. */
.experimental-form {
  max-height: clamp(150px, 24dvh, 230px);
  margin: 10px 18px 4px;
  padding: 10px;
  gap: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.experimental-pid-overview {
  max-height: clamp(92px, 13dvh, 124px);
}

.experimental-list {
  flex: 1 1 260px;
  min-height: 240px;
}

@media (max-width: 720px) {
  .experimental-form {
    max-height: 22dvh;
    margin: 8px 12px 4px;
    padding: 9px;
    gap: 8px;
  }

  .experimental-pid-overview {
    max-height: 118px;
    margin: 6px 12px 0;
    grid-template-columns: 1fr;
  }

  .pid-overview-card {
    min-height: auto;
    padding: 7px 9px;
  }

  .pid-overview-card strong {
    font-size: 0.76rem;
  }

  .pid-overview-card p {
    font-size: 0.7rem;
    line-height: 1.22;
  }

  .experimental-list {
    flex-basis: 300px;
    min-height: 270px;
    padding-top: 8px;
  }
}

/* Premium thema: maak experimentele PID-sectiekoppen beter leesbaar. */
body.theme-premium .experimental-section-title {
  color: #ffd966;
  font-weight: 900;
  background: rgba(216, 177, 90, 0.12);
  border-left: 4px solid #d8b15a;
  border-radius: 6px;
  padding: 6px 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}







.rest12v-dialog {
  width: min(760px, calc(100vw - 24px));
  height: auto;
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.rest12v-content {
  padding: 16px 18px 20px;
  display: grid;
  gap: 14px;
}

.rest12v-measured-card,
.rest12v-info-card,
.rest12v-guide-card,
.rest12v-history-card {
  border-radius: 8px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  background: linear-gradient(135deg, rgba(231, 242, 250, 0.98), rgba(255, 255, 255, 0.98));
  color: #061f38;
  padding: 14px 16px;
}

.rest12v-measured-card {
  border-left: 6px solid #1f9d67;
  background: linear-gradient(135deg, #e4fff3, #f7fffb);
}

.rest12v-measured-card span,
.rest12v-info-card span,
.rest12v-guide-card span,
.rest12v-history-card span {
  display: block;
  color: #315066;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rest12v-measured-card strong {
  display: block;
  margin-top: 5px;
  color: #042033;
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 1;
}

.rest12v-storage-status {
  display: inline-flex;
  align-self: flex-start;
  margin: 3px 0 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1.2;
}

.rest12v-storage-status.stored {
  color: #075c49;
  border-color: rgba(29, 143, 102, 0.32);
  background: var(--good-soft);
}

.rest12v-storage-status.logged-only {
  color: #744600;
  border-color: rgba(207, 126, 0, 0.38);
  background: #fff1d6;
}

.rest12v-measured-card small,
.rest12v-info-card p,
.rest12v-guide-card p,
.rest12v-history-card p {
  display: block;
  margin: 8px 0 0;
  color: #16364f;
  font-weight: 700;
  line-height: 1.45;
}

.rest12v-replacement-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
  margin-top: 10px;
}

.rest12v-replacement-form label {
  color: #315066;
  font-size: 0.78rem;
  font-weight: 850;
}

.rest12v-replacement-form input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(0, 102, 177, 0.28);
  border-radius: 6px;
  padding: 7px 8px;
  color: #061f38;
  font: inherit;
}

.rest12v-replacement-actions,
.rest12v-replacement-form p {
  grid-column: 1 / -1;
}

.rest12v-replacement-form p {
  margin-top: 2px;
}

.rest12v-context-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.rest12v-context-form label {
  grid-column: 1 / -1;
  color: #315066;
  font-size: 0.78rem;
  font-weight: 850;
}

.rest12v-context-form select {
  min-width: 0;
  min-height: 38px;
}

.rest12v-trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.rest12v-trend-grid > div {
  min-width: 0;
  border: 1px solid rgba(0, 102, 177, 0.16);
  border-radius: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.rest12v-trend-grid span,
.rest12v-trend-grid strong,
.rest12v-trend-grid small {
  display: block;
}

.rest12v-trend-grid span,
.rest12v-trend-grid small {
  color: #315066;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.25;
}

.rest12v-trend-grid strong {
  margin: 3px 0;
  color: #061f38;
  font-size: 1.05rem;
}

.rest12v-alert-card {
  border-left: 5px solid #c33b2f;
  background: #fff5f2;
}

.rest12v-guide-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #061f38;
  font-weight: 800;
  line-height: 1.45;
}

.rest12v-dialog .history-dialog-header {
  align-items: center;
  padding: 12px 16px;
}

.rest12v-dialog .history-dialog-header h2 {
  font-size: clamp(1.35rem, 5vw, 1.9rem);
  line-height: 1.05;
  color: #f6c85f;
}

#adapterDialogTitle {
  color: #f6c85f;
}

.adapter-practice-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 10px;
}

.adapter-practice-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.adapter-practice-table th,
.adapter-practice-table td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.adapter-practice-table th {
  color: var(--ink);
  background: rgba(10, 82, 124, 0.08);
}

.adapter-practice-table td.confirmed {
  color: #075c49;
  font-weight: 800;
  background: var(--good-soft);
}

.adapter-practice-table td.pending {
  color: #744600;
  font-weight: 800;
  background: #fff7e7;
}

#experimentalDialogTitle {
  color: #f6c85f;
}

.rest12v-dialog .history-dialog-header p {
  font-size: clamp(0.92rem, 3.5vw, 1.05rem);
  line-height: 1.25;
}

.rest12v-info-card p,
.rest12v-guide-card p,
.rest12v-guide-list {
  font-size: clamp(0.95rem, 3.6vw, 1.08rem);
}

.rest12v-info-card p,
.rest12v-guide-card p {
  font-weight: 650;
}

.rest12v-guide-list {
  font-weight: 750;
}

.rest12v-guide-card .rest12v-important-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 4px solid #d0a63f;
  border-radius: 6px;
  background: #fff6d8;
  color: #09243a;
  font-weight: 800;
}

.rest12v-history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.rest12v-history-item {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr) 30px;
  gap: 2px 10px;
  align-items: center;
  border-radius: 7px;
  border: 1px solid rgba(0, 102, 177, 0.12);
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 10px;
}

.rest12v-history-item strong {
  color: #042033;
  font-size: 1.15rem;
}

.rest12v-history-item span {
  color: #24465e;
  font-size: 0.86rem;
  text-align: right;
  text-transform: none;
  letter-spacing: 0;
}

.rest12v-history-item small {
  grid-column: 1 / 3;
  color: #0f5c46;
  font-weight: 850;
}

.rest12v-delete-button {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid #9c1f2d;
  border-radius: 50%;
  background: #c6283d;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 2px 5px rgba(122, 35, 35, 0.24);
}

.rest12v-delete-button:active {
  transform: translateY(1px);
}

.rest12v-measured-card small {
  font-size: clamp(0.9rem, 3.4vw, 1rem);
}

@media (max-width: 560px) {
  .rest12v-dialog {
    width: min(94vw, calc(100vw - 18px));
    max-height: calc(100dvh - 18px);
    margin: 9px auto;
  }

  .rest12v-content {
    padding: 12px;
    gap: 10px;
  }

  .rest12v-measured-card,
  .rest12v-info-card,
  .rest12v-guide-card,
  .rest12v-history-card {
    padding: 12px;
  }

  .rest12v-history-item {
    grid-template-columns: minmax(72px, auto) minmax(0, 1fr) 30px;
  }

  .rest12v-history-item span {
    text-align: right;
  }
}

.ai-explanation-dialog {
  width: min(820px, calc(100vw - 24px));
  height: min(760px, calc(100dvh - 24px));
}

.ai-explanation-content {
  flex: 1 1 auto;
  min-height: 0;
  margin: 16px 18px 18px;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid rgba(0, 102, 177, 0.18);
  border-left: 5px solid var(--gold);
  background: linear-gradient(135deg, rgba(231, 242, 250, 0.98), rgba(255, 255, 255, 0.98));
  color: #061f38;
  white-space: pre-wrap;
  line-height: 1.55;
  font-weight: 700;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.theme-premium .ai-explanation-content {
  background: linear-gradient(135deg, rgba(224, 247, 239, 0.98), rgba(245, 250, 255, 0.98));
  color: #061f38;
  box-shadow: inset 5px 0 0 rgba(255, 205, 92, 0.9), 0 12px 34px rgba(0, 0, 0, 0.18);
}

.report-understand-card {
  margin: 12px 0 14px;
  border: 1px solid rgba(0, 116, 191, 0.22);
  border-left: 5px solid var(--accent);
  border-radius: 7px;
  padding: 12px 14px;
  color: #073258;
  background: linear-gradient(135deg, #eaf8ff, #f7fbff);
}

.report-disabled-note {
  margin: 12px 0 14px;
  border: 1px solid rgba(210, 160, 40, 0.28);
  border-left: 5px solid #d2a028;
  border-radius: 7px;
  padding: 12px 14px;
  color: #11283b;
  background: linear-gradient(135deg, #fff8d8, #f3fbff);
  font-weight: 900;
}

.report-understand-card strong {
  display: block;
  margin-bottom: 6px;
  color: #052842;
  font-size: 1rem;
}

.report-understand-card p,
.report-understand-card ul {
  margin: 0;
}

.report-understand-card ul {
  margin-top: 8px;
  padding-left: 20px;
}

.report-understand-card li + li {
  margin-top: 4px;
}

.adapter-test-dialog {
  max-width: min(920px, calc(100vw - 24px));
}

#adapterTestModal .history-dialog {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#adapterTestModal .history-dialog > :last-child {
  padding-bottom: 18px;
}

#adapterTestDialogTitle {
  color: #f6c85f !important;
}

.adapter-test-content {
  display: grid;
  gap: 12px;
}

.adapter-test-card {
  border-left: 5px solid var(--accent-2);
}

.adapter-test-output {
  min-height: 220px;
  max-height: min(44dvh, 380px);
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  color: #eaf4ff;
  background: #06121f;
  line-height: 1.5;
  white-space: pre-wrap;
}

body.theme-premium .report-understand-card {
  color: #06263e;
  border-color: rgba(216, 177, 90, 0.46);
  border-left-color: #d8b15a;
  background: linear-gradient(135deg, #e8fff6, #fff9dc);
}

body.theme-premium .report-understand-card strong {
  color: #041d32;
}

body.theme-premium .adapter-test-card {
  color: #08223a;
  background: linear-gradient(135deg, #eef8ff, #e7fff6);
}

body.theme-premium .adapter-test-card h3,
body.theme-premium .adapter-test-card p {
  color: #08223a;
}

/* Adapterdiagnose leesbaarheid override */
body.theme-premium .adapter-test-content .adapter-test-card,
body.theme-premium .about-content.adapter-test-content .adapter-test-card {
  color: #06263e;
  border-color: rgba(0, 116, 191, 0.18);
  border-left-color: #69d4ff;
  background: linear-gradient(135deg, #f2fbff 0%, #e7fff6 100%);
  text-shadow: none;
}

body.theme-premium .adapter-test-content .adapter-test-card h3,
body.theme-premium .adapter-test-content .adapter-test-card p,
body.theme-premium .about-content.adapter-test-content .adapter-test-card h3,
body.theme-premium .about-content.adapter-test-content .adapter-test-card p {
  color: #06263e;
  text-shadow: none;
}

body.theme-premium .measurement-progress {
  color: #08243a;
  background: linear-gradient(90deg, rgba(255, 248, 214, 0.98), rgba(226, 244, 252, 0.98));
  text-shadow: none;
}

body.theme-premium .measurement-progress-header,
body.theme-premium .measurement-progress-header strong,
body.theme-premium .measurement-progress p {
  color: #08243a;
  text-shadow: none;
}

body.theme-premium .measurement-progress-header span {
  color: #244960;
  text-shadow: none;
}

/* Compacte app-weergave */
.app-shell {
  width: min(1120px, calc(100vw - 18px));
  padding: 14px 0 24px;
}

.topbar,
.dashboard,
.control-band,
.battery-score-card,
.capacity-guide,
.measurement-conditions,
.derived-note,
.cell-overview-panel,
.manual-band,
.report-panel,
.history-summary-card,
.live-card,
.about-card,
.adapter-test-card,
.rest12v-card,
.smartcar-card {
  border-radius: 7px;
}

.topbar,
.battery-score-card,
.capacity-guide,
.measurement-conditions,
.manual-band,
.report-panel,
.history-summary-card,
.live-card,
.about-card,
.rest12v-card,
.smartcar-card {
  padding: 10px 12px;
}

.dashboard,
.control-band,
.split,
.readout-grid,
.capacity-guide-grid,
.conditions-grid,
.history-usable-grid,
.live-grid,
.about-grid,
.rest12v-grid,
.smartcar-grid {
  gap: 7px;
}

.dashboard {
  padding: 0;
}

.readout {
  min-height: 74px;
  padding: 8px 9px;
}

.readout span,
.readout small,
.readout-hint {
  font-size: 0.7rem;
  line-height: 1.22;
}

.readout strong {
  margin-top: 4px;
  font-size: clamp(0.98rem, 1.8vw, 1.28rem);
  line-height: 1.15;
}

.control-band {
  margin-top: 10px;
  padding: 10px;
}

select,
input,
textarea,
.adapter-profile-control select,
.adapter-profile-control input,
.vehicle-settings select,
.vehicle-settings input,
.experimental-form input,
.experimental-form select,
.reminder-controls select,
.reminder-controls input {
  min-height: 42px;
  padding: 7px 9px;
  border-radius: 6px;
}

button:not(.help-button):not(.icon-button):not(.home-button),
.small-button {
  min-height: 40px;
  padding: 0 11px;
  border-radius: 6px;
}

.button-row {
  gap: 6px;
}

.manual-band {
  margin-top: 8px;
  row-gap: 8px;
  padding: 10px 12px;
}

.manual-intro {
  gap: 8px;
  padding-bottom: 8px;
}

.manual-intro-title {
  margin-bottom: 0;
}

.manual-capacity-row {
  grid-template-columns: minmax(120px, 160px) minmax(180px, max-content);
  gap: 8px;
  justify-content: start;
}

.manual-capacity-row label,
.manual-capacity-row input {
  width: 100%;
}

.manual-capacity-row .primary {
  min-height: 42px;
}

.conditions-tip {
  margin-top: 8px;
  padding: 10px 12px;
}

.condition-item {
  padding: 7px 8px;
}

.capacity-guide-heading,
.battery-score-heading,
.history-usable-heading,
.rest12v-heading,
.smartcar-heading {
  gap: 8px;
}

.capacity-guide-grid > div,
.battery-score-grid > div,
.history-usable-grid > div,
.rest12v-history-item,
.smartcar-card {
  padding: 8px 9px;
}

.cell-details summary {
  min-height: 58px;
  padding: 10px 12px;
}

.cell-details-body {
  padding: 0 12px 12px;
}

textarea {
  min-height: 150px;
}

.log,
.adapter-test-output {
  min-height: 170px;
  padding: 10px;
  line-height: 1.38;
}

.about-dialog,
.experimental-dialog,
.adapter-test-dialog,
.live-dialog {
  max-width: min(980px, calc(100vw - 16px));
}

#liveModal .history-dialog,
#aboutModal .history-dialog,
#adapterModal .history-dialog,
#adapterTestModal .history-dialog,
#batteryPrognosisModal .history-dialog,
#moduleMapModal .history-dialog,
#battKapaModal .history-dialog,
#rest12vModal .history-dialog {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#liveModal .history-dialog > :last-child,
#aboutModal .history-dialog > :last-child,
#adapterModal .history-dialog > :last-child,
#adapterTestModal .history-dialog > :last-child,
#batteryPrognosisModal .history-dialog > :last-child,
#moduleMapModal .history-dialog > :last-child,
#battKapaModal .history-dialog > :last-child,
#rest12vModal .history-dialog > :last-child {
  padding-bottom: 18px;
}

.history-dialog {
  max-width: min(1320px, calc(100vw - 16px));
}

.history-dialog-header,
.about-header,
.live-header {
  padding: 10px 12px;
}

.history-dialog-body,
.about-content,
.live-content,
.experimental-content {
  padding: 10px 12px 14px;
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 10px, 100%);
    padding: 8px 0 16px;
  }

  .topbar,
  .battery-score-card,
  .capacity-guide,
  .measurement-conditions,
  .manual-band,
  .report-panel,
  .history-summary-card,
  .live-card,
  .about-card,
  .rest12v-card,
  .smartcar-card {
    padding: 8px;
  }

  .readout-grid,
  .conditions-grid,
  .vehicle-settings {
    gap: 6px;
  }

  .readout {
    min-height: 66px;
    padding: 7px 8px;
  }

  .manual-capacity-row {
    grid-template-columns: minmax(105px, 0.7fr) minmax(0, 1.3fr);
  }

  .manual-capacity-row .primary {
    width: 100%;
    padding-inline: 8px;
    font-size: 0.82rem;
    line-height: 1.15;
    white-space: normal;
  }

  button:not(.help-button):not(.icon-button):not(.home-button),
  .small-button,
  select,
  input {
    min-height: 38px;
  }
}

.home-screen .home-copy h1,
body.theme-simple-mobile .home-screen .home-copy h1,
body.theme-mobile-app .home-screen .home-copy h1,
body.theme-premium .home-screen .home-copy h1 {
  color: #f6c85f !important;
}

/* Laat de gekozen taal in alle thema's duidelijk afwijken van de twee alternatieven. */
body:not(.home-visible) .more-actions .more-language-button.is-active {
  color: #17364a !important;
  border-color: #d7a800 !important;
  background: #f6c85f !important;
  background-image: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 3px 0 rgba(150, 111, 0, 0.22) !important;
}

/* Houd iedere pulldown op één compacte pijl direct naast de titel. */
.measurement-settings > summary,
.capacity-guide > summary,
.battery-score-panel > summary,
.reliability-panel > summary,
.cell-index-details > summary,
.fold-details > summary {
  justify-content: flex-start;
  gap: 8px;
}

.measurement-settings > summary::after,
.capacity-guide > summary::after,
.battery-score-panel > summary::after {
  content: none !important;
  display: none !important;
}

.measurement-settings > summary::before,
.capacity-guide > summary::before,
.battery-score-panel > summary::before,
.reliability-panel > summary::before,
.cell-index-details > summary::before,
.fold-details > summary::before {
  content: "\25BC";
  width: auto;
  height: auto;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  color: currentColor;
  background: transparent;
  box-shadow: none;
  font-size: 0.72rem;
}

.measurement-settings[open] > summary::before,
.capacity-guide[open] > summary::before,
.battery-score-panel[open] > summary::before,
.reliability-panel[open] > summary::before,
.cell-index-details[open] > summary::before,
.fold-details[open] > summary::before {
  content: "\25B2";
}

.fold-details > summary > strong {
  margin-left: auto;
}

@media (max-width: 760px) {
  .capacity-comparison-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
    padding: 9px 10px;
  }

  .capacity-comparison-row .capacity-role {
    grid-column: 1 / -1;
  }

  .capacity-comparison-row output {
    grid-column: 2;
    grid-row: 2;
  }
}

/* Starttaken en resultaat-hiërarchie. */
.home-connect-button {
  width: min(300px, 88vw);
  min-height: 42px;
  color: #f6c85f;
  border-color: rgba(246, 200, 95, 0.7);
  background: rgba(0, 102, 177, 0.62);
  font-size: 0.9rem;
}

.home-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(520px, 92vw);
}

.home-task-button {
  width: 100%;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  background: rgba(10, 42, 68, 0.66);
}

.home-task-button strong {
  color: #ffffff;
  font-size: 0.92rem;
  line-height: 1.15;
}

.home-task-button small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
  line-height: 1.25;
}

.home-task-primary {
  border-color: rgba(246, 200, 95, 0.7);
  background: rgba(0, 102, 177, 0.72);
}

.results-overview {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.65fr);
  gap: 10px;
  align-items: stretch;
}

.results-overview .bach-interpretation {
  min-width: 0;
}

.result-quality-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border: 1px solid #bfd8e7;
  border-left: 5px solid #168568;
  border-radius: 8px;
  padding: 13px;
  color: #18364a;
  background: #eef8fc;
}

.result-quality-summary > span {
  color: #526b7c;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.result-quality-summary > strong {
  color: #0a2a44;
  font-size: 1rem;
  line-height: 1.2;
}

.result-quality-summary > p {
  margin: 0;
  color: #526b7c;
  font-size: 0.78rem;
  line-height: 1.35;
}

.result-quality-context { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.result-quality-context[hidden] { display: none; }
.measurement-quality-chip { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; padding: 4px 6px; border: 1px solid #c9d7df; border-radius: 4px; color: #425d70; background: #fff; line-height: 1; }
.measurement-quality-chip small { font-size: 0.62rem; font-weight: 800; }
.measurement-quality-chip strong { color: #173f58; font-size: 0.68rem; }
.measurement-quality-chip.good { border-color: #9ccfbf; background: #f1faf6; }
.measurement-quality-chip.warning { border-color: #e1c76f; background: #fff9e7; }
.measurement-quality-chip.danger { border-color: #dfaaaa; background: #fff2f2; }
.measurement-quality-chip.pending { color: #667b8a; background: #f7fafb; }

.result-details {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
  background: #fff;
}

.result-details > summary {
  display: flex;
  align-items: baseline;
  gap: 9px;
  cursor: pointer;
  padding: 12px 14px;
  color: #0a2a44;
  list-style: none;
}

.result-details > summary::-webkit-details-marker { display: none; }
.result-details > summary::before { content: "\25BC"; color: #168568; font-size: 0.72rem; }
.result-details[open] > summary::before { content: "\25B2"; }
.result-details > summary > span { font-weight: 800; }
.result-details > summary > small { color: #526b7c; font-size: 0.76rem; }
.result-details .readout-grid { border-width: 1px 0 0; border-radius: 0; }

@media (max-width: 760px) {
  .home-task-grid { width: min(360px, 90vw); gap: 7px; }
  .home-task-button { min-height: 64px; padding: 9px 10px; }
  .home-task-button strong { font-size: 0.82rem; }
  .home-task-button small { font-size: 0.64rem; }
  .results-overview { grid-template-columns: 1fr; }
  .result-details > summary { align-items: flex-start; flex-direction: column; gap: 2px; }
  .result-details > summary::before { position: absolute; margin-top: 4px; }
  .result-details > summary > span,
  .result-details > summary > small { padding-left: 18px; }
}

.guide-dialog {
  width: min(960px, calc(100vw - 24px));
  max-height: min(860px, calc(100vh - 24px));
}

.guide-content {
  display: grid;
  gap: 12px;
  color: #26475b;
}

.guide-content section {
  margin: 0;
  padding: 14px;
  border: 1px solid #d2e0e7;
  border-radius: 8px;
  background: #ffffff;
}

.guide-content h3 {
  margin: 0 0 8px;
  color: #0a2a44;
  font-size: 1rem;
}

.guide-content p,
.guide-content ul,
.guide-content ol,
.guide-content dl {
  margin: 0;
}

.guide-content li + li { margin-top: 5px; }

.guide-content dl {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
  gap: 7px 14px;
}

.guide-content dt {
  color: #0a2a44;
  font-weight: 800;
}

.guide-content dd { margin: 0; }

.guide-note {
  margin-top: 11px !important;
  padding: 9px 10px;
  border-left: 4px solid #c58b00;
  border-radius: 4px;
  background: #fff9e8;
  color: #6f5111;
}

.guide-choice-grid,
.guide-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.guide-choice-grid > div,
.guide-status-grid > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border-left: 4px solid #168568;
  border-radius: 5px;
  background: #f1f8fb;
}

.guide-choice-grid strong,
.guide-status-grid strong { color: #0a2a44; }

.guide-choice-grid span,
.guide-status-grid span {
  font-size: 0.82rem;
  line-height: 1.35;
}

.guide-choice-grid small {
  color: #526b7c;
  font-size: 0.74rem;
  line-height: 1.3;
}

.guide-status-grid > .candidate { border-left-color: #c58b00; background: #fff9e8; }
.guide-status-grid > .research { border-left-color: #6e65c7; background: #f5f3ff; }

@media (max-width: 760px) {
  .guide-dialog { width: calc(100vw - 12px); max-height: calc(100vh - 12px); }
  .guide-content section { padding: 12px; }
  .guide-content dl,
  .guide-choice-grid,
  .guide-status-grid { grid-template-columns: 1fr; }
}
