:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --panel-subtle: #f8fafb;
  --ink: #172126;
  --muted: #5f6f78;
  --line: #d8e0e4;
  --line-strong: #bdc9ce;
  --accent: #087f78;
  --accent-strong: #05645f;
  --accent-fill: #087f78;
  --accent-soft: #e8f6f4;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --manual: #8a5800;
  --manual-bg: #fff7df;
  --info-bg: #eaf6f5;
  --header: #17262c;
  --header-muted: #c9d8dc;
  --shadow: 0 8px 24px rgba(23, 33, 38, 0.07);
  --shadow-raised: 0 14px 36px rgba(23, 33, 38, 0.11);
}

body.dark {
  color-scheme: dark;
  --bg: #101619;
  --panel: #182126;
  --panel-subtle: #141c20;
  --ink: #edf3f4;
  --muted: #a7b5bb;
  --line: #314046;
  --line-strong: #45565d;
  --accent: #55c3ba;
  --accent-strong: #83d9d1;
  --accent-fill: #147f79;
  --accent-soft: #15312f;
  --danger: #ffb4ab;
  --danger-bg: #381a18;
  --manual: #f5c968;
  --manual-bg: #33280f;
  --info-bg: #15312f;
  --header: #0b1114;
  --header-muted: #b7c7cc;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-raised: 0 16px 40px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

.copy-toast {
  position: fixed;
  z-index: 1000;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 680px);
  border: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  font-weight: 900;
  line-height: 1.6;
}

.copy-toast.is-error {
  border-color: color-mix(in srgb, var(--danger) 62%, var(--line));
  background: var(--danger-bg);
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 148px;
  padding: 24px max(24px, calc((100vw - 1200px) / 2));
  background: var(--header);
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  color: #fff;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease;
}

.ghost-link:hover,
.ghost-button:hover {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.09);
}

.eyebrow,
.header-note,
h1,
h2,
h3,
p {
  margin-top: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: #72d1c8;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.25;
}

.header-note {
  margin-bottom: 0;
  max-width: 760px;
  color: var(--header-muted);
  line-height: 1.65;
  font-size: 0.9rem;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 440px) 1fr;
  gap: 22px;
  width: 100%;
  margin: 0;
}

.tab-nav {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  width: 100%;
  margin: 0;
  padding: 10px max(14px, calc((100vw - 1200px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 4px 14px rgba(23, 33, 38, 0.05);
  backdrop-filter: blur(14px);
}

.tab-button {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 15px;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.tab-button:hover {
  background: var(--panel-subtle);
  color: var(--ink);
}

.tab-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tab-shell {
  width: min(1200px, calc(100% - 28px));
  margin: 22px auto 40px;
}

.tab-panel[hidden] {
  display: none;
}

.panel,
.safety-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.diagnosis-form,
.result-area,
.result-content {
  display: grid;
  gap: 14px;
}

.diagnosis-form {
  grid-template-columns: 1fr 1fr;
}

.vehicle-selector {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 16px;
}

.vehicle-selector legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 900;
}

.vehicle-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.vehicle-note,
.vehicle-summary {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.vehicle-note {
  margin-bottom: 12px;
}

.vehicle-summary {
  margin: 12px 0 0;
  color: var(--ink);
  font-weight: 900;
}

select:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.questionnaire {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 4px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-subtle);
}

.questionnaire legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 900;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
}

textarea {
  line-height: 1.6;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.full-width {
  grid-column: 1 / -1;
}

.button-row,
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.button-row {
  flex-wrap: wrap;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h2 {
  margin-bottom: 0;
}

.result-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.view-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 3px;
}

.view-switch-button {
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0 15px;
}

.view-switch-button.is-active {
  background: var(--panel);
  color: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(23, 33, 38, 0.1);
}

button {
  min-height: 50px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
.ghost-link:focus-visible,
.import-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 0 18px;
}

.primary-button {
  border: 0;
  background: var(--accent-fill);
  color: #fff;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 24%, transparent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
}

.secondary-button:hover,
.import-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

#obdSetupPanel label:has(> #obdVehicleYearManual[hidden]) {
  display: none;
}

#obd-panel button:disabled {
  background: var(--panel-subtle);
  color: var(--muted);
  border-color: var(--line-strong);
  border-style: dashed;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.obd-preview-button.is-selected {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line-strong));
  background: color-mix(in srgb, var(--panel) 82%, var(--accent-soft));
}

.obd-preview-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #fff;
}

.data-status,
.final-note {
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--info-bg);
  color: var(--accent-strong);
  padding: 11px 13px;
  line-height: 1.6;
  font-weight: 800;
}

.data-status.error {
  border-left-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

[data-obd-session-export-status]:empty {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.offline-cache-status {
  margin: -0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.offline-cache-status.error {
  color: var(--danger);
}

.safety-panel {
  padding: 18px 20px;
  border-color: color-mix(in srgb, var(--danger) 50%, var(--line));
  background: var(--danger-bg);
  color: var(--danger);
}

.safety-panel h2 {
  margin-bottom: 8px;
}

.safety-panel p {
  margin-bottom: 0;
  font-weight: 900;
  line-height: 1.7;
}

.confidence-badge {
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 7px 12px;
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
  line-height: 1.8;
}

.result-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
  background: var(--panel-subtle);
}

.diagnosis-flow {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.diagnosis-flow[hidden] {
  display: none;
}

.flow-intro {
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
}

.flow-intro h3 {
  margin-bottom: 6px;
  font-size: 1.16rem;
}

.flow-intro p {
  margin-bottom: 0;
  color: var(--muted);
}

.flow-intro .flow-kicker {
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.flow-chart {
  display: grid;
  justify-items: center;
  width: 100%;
}

.flow-node,
.flow-branch {
  width: min(100%, 720px);
}

.flow-node {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 5px 16px rgba(23, 33, 38, 0.06);
  transition: border-color 160ms ease, opacity 160ms ease;
}

.flow-step {
  display: grid;
  place-items: center;
  min-height: 112px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 900;
}

.flow-node-content {
  padding: 17px 18px;
}

.flow-node h4 {
  margin: 0 0 7px;
  font-size: 1rem;
}

.flow-node p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.flow-node.is-complete {
  border-color: var(--accent);
  opacity: 0.7;
}

.flow-node.is-complete .flow-node-content {
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--panel));
}

.flow-check {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.84rem;
}

.flow-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.flow-connector {
  position: relative;
  width: 2px;
  height: 30px;
  background: var(--line-strong);
}

.flow-connector::after {
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.flow-node-measure .flow-step {
  background: #e9f1ff;
  color: #2458a6;
}

body.dark .flow-node-measure .flow-step {
  background: #182a43;
  color: #a9c9ff;
}

.flow-node-verify .flow-step {
  background: var(--manual-bg);
  color: var(--manual);
}

.flow-node-safety {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.flow-node-safety .flow-step {
  background: var(--danger-bg);
  color: var(--danger);
}

.flow-branch {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 17px;
}

.flow-branch > h4 {
  margin-bottom: 13px;
  text-align: center;
}

.flow-branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flow-branch-path {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 15px;
}

.flow-branch-path h5 {
  margin: 0 0 9px;
  font-size: 0.94rem;
}

.flow-branch-path ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.65;
}

.flow-branch-normal {
  border-top: 4px solid var(--accent);
}

.flow-branch-abnormal {
  border-top: 4px solid var(--danger);
}

.priority-summary-block {
  order: 1;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--info-bg);
  box-shadow: inset 4px 0 0 var(--accent);
  padding: 16px 16px 16px 20px;
}

.priority-summary-block h3 {
  font-size: 1.18rem;
}

.priority-check-list {
  display: grid;
  gap: 8px;
  padding-left: 1.5rem;
  margin-bottom: 12px;
}

.priority-check-list li {
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 6px;
  background: var(--panel);
  padding: 10px 12px;
  font-size: 1.02rem;
  font-weight: 900;
}

.quick-next-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-next-grid div {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 6px;
  background: var(--panel);
  padding: 10px;
}

.quick-next-grid h4 {
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 0.88rem;
}

.quick-next-grid p {
  margin-bottom: 0;
  line-height: 1.55;
}

.quick-detail {
  margin-top: 12px;
}

.quick-detail summary {
  font-size: 0.92rem;
}

.check-order-block {
  order: 2;
}

.measurement-block {
  order: 3;
}

.caution-order-block {
  order: 4;
}

.safety-order-block {
  order: 5;
}

.ai-block {
  order: 6;
}

.facts-block,
.interview-block,
.guess-block,
.branch-block,
.parts-block,
.customer-block,
.modern-data-block,
.source-block,
.confidence-block {
  order: 10;
}

.result-block h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.result-block summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 900;
}

.result-block ul,
.result-block ol {
  margin: 0;
  padding-left: 1.35rem;
  line-height: 1.75;
}

.manual-check {
  border-color: color-mix(in srgb, var(--manual) 42%, var(--line));
  background: var(--manual-bg);
}

.caution-block {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

.ai-block {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: color-mix(in srgb, var(--panel) 88%, var(--info-bg));
}

.modern-data-block {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
}

.modern-data-block h4 {
  margin: 14px 0 8px;
  color: var(--accent-strong);
  font-size: 0.95rem;
}

@media (max-width: 560px) {
  .priority-summary-block {
    padding: 12px;
  }

  .priority-check-list li {
    padding: 10px;
    font-size: 1rem;
  }

  .quick-next-grid {
    grid-template-columns: 1fr;
  }
}

.case-panel {
  grid-column: 1 / -1;
}

.obd-eyebrow {
  color: var(--accent-strong);
}

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

.obd-safety-grid article {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 14px;
}

.obd-safety-grid strong {
  color: var(--ink);
}

.obd-safety-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.obd-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.obd-progress-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-strong);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 14px;
}

.obd-progress-grid strong {
  color: var(--ink);
}

.obd-progress-grid span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.obd-progress-score-card {
  border-left-color: var(--warning);
}

.obd-progress-breakdown-card {
  border-left-color: var(--accent);
}

.obd-progress-score {
  color: var(--ink) !important;
  font-size: 0.98rem !important;
  font-weight: 800;
}

.obd-import-label {
  margin-top: 18px;
}

.diagnosis-import {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 14px;
}

.diagnosis-import > summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}

.obd-connection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 16px;
}

.obd-connection-bar > div {
  display: grid;
  gap: 5px;
}

.obd-connection-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.obd-connection-bar button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.obd-dev-panel {
  border: 1px solid var(--line);
  border-left: 4px solid var(--warning);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 16px;
}

.obd-dev-gate,
.obd-dev-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

#obdAccessGatePanel:has(#obdAccessLockButton:enabled) .obd-dev-gate:has(> #obdAccessUnlockButton:disabled) {
  display: none;
}

#obdDeveloperGatePanel:has(#obdDevLockButton:enabled) .obd-dev-gate:has(> #obdDevUnlockButton:disabled) {
  display: none;
}

#obdAccessGatePanel .obd-result-heading,
#obdDeveloperGatePanel .obd-result-heading {
  flex-wrap: wrap;
}

#obdDevControls .obd-dev-routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  align-items: stretch;
  gap: 16px;
  margin-top: 12px;
}

.obd-dev-route {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.obd-dev-route > legend {
  max-width: 100%;
  padding: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.obd-dev-route > .obd-dev-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

#obdDevControls .obd-dev-controls > button {
  min-width: 0;
  min-height: 48px;
  height: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.obd-dev-group-label {
  flex-basis: 100%;
  margin-top: 6px;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
}

.obd-dev-task {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding: 12px 0;
  min-width: 0;
}

.obd-dev-task > summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 0;
  overflow-wrap: anywhere;
}

.obd-dev-task > summary:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.obd-dev-gate label {
  display: grid;
  gap: 5px;
  min-width: min(180px, 100%);
  max-width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.obd-dev-gate input,
.obd-dev-gate select {
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 0.95rem;
}

.obd-dev-controls button,
.obd-dev-gate button {
  min-height: 42px;
}

#obdMeasurementConditions > .obd-dev-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

#obdMeasurementConditions .obd-dev-group-label {
  margin: 0;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

#obdMeasurementConditions select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
}

.obd-condition-summary {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

#obdMeasurementConditions label:has(input[type="checkbox"]) {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
}

#obdSameVehicleConfirmed {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  margin: 0;
}

.obd-operation-panel {
  margin: 18px 0;
}

.obd-home-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  margin: 16px 0;
}

.obd-home-actions button {
  min-height: 88px;
  border-radius: 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

#obdStageBackButton {
  width: 48px;
  height: 48px;
  padding: 0;
  flex-shrink: 0;
  font-size: 24px;
}

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

.obd-ui-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 4px;
}

.obd-ui-mode-button {
  min-height: 40px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.obd-ui-mode-button.is-active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}

#obd-panel[data-obd-ui-mode="simple"] .obd-expert-only {
  display: none !important;
}

#obd-panel[data-obd-ui-mode="simple"] .obd-eyebrow {
  display: none;
}

#obd-panel[data-obd-ui-mode="simple"] .obd-scan-context strong {
  white-space: normal;
  overflow-wrap: anywhere;
}

#obd-panel[data-obd-ui-mode="details"] .obd-simple-only {
  display: none !important;
}

#obd-panel[data-obd-ui-mode="simple"] .obd-stage-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="home"] #obdStagePanel > .obd-result-heading,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="home"] #obdStageTabs {
  display: none;
}

#obd-panel[data-obd-ui-mode="simple"] .obd-safety-grid {
  display: none;
}

.obd-stage-tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.obd-stage-tab.is-active {
  border-color: var(--accent);
  background: var(--panel-subtle);
  color: var(--ink);
}

.obd-stage-view[hidden] {
  display: none;
}

.obd-scan-context,
.obd-simple-connect-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.obd-scan-context span,
.obd-simple-connect-summary span {
  display: grid;
  gap: 4px;
  min-width: 0;
  background: var(--panel);
  padding: 12px 14px;
}

.obd-scan-context small,
.obd-simple-connect-summary small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.obd-scan-context strong,
.obd-simple-connect-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.obd-simple-connect-panel {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--panel);
  padding: 18px;
}

.obd-simple-connect-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.obd-simple-connect-instruction {
  margin: 16px 0 0;
  color: var(--ink);
  font-weight: 700;
}

#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="results"] .obd-results-nav,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="results"] #obdDiagnosticFlowPanelResults,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="results"] #obdReadoutResultsHost,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="results"] #obdReadoutDetails {
  display: none !important;
}

#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"] #obdSimpleResultSummary,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"] #obdSimpleSystemSummary,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"] .obd-simple-result-actions,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"] #obdSimpleResultStatus,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"] .obd-results-file-actions {
  display: none !important;
}

#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"][data-obd-readout-view="dtc"] .obd-monitor-result,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"][data-obd-readout-view="dtc"] #obdReadoutDetails,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"][data-obd-readout-view="live"] .obd-import-result,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"][data-obd-readout-view="live"] #obdReadoutDetails,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"][data-obd-readout-view="details"] #obdReadoutResultsHost {
  display: none !important;
}

.obd-results-nav .is-active,
.obd-readout-detail-menu .is-active {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.obd-readout-detail-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 16px 0;
}

#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"] .obd-detail-excluded,
#obd-panel[data-obd-ui-mode="simple"][data-obd-active-stage="readout"]:not([data-obd-readout-detail="all"]) .obd-readout-details-empty {
  display: none !important;
}

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

.obd-operation-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 14px;
}

.obd-operation-state-changing {
  border-left-color: var(--manual);
  background: var(--manual-bg);
}

.obd-operation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.obd-operation-head strong {
  color: var(--ink);
}

.obd-operation-state {
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: right;
}

.obd-operation-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.obd-operation-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.obd-operation-card button {
  min-height: 40px;
}

.obd-operation-card button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

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

.obd-profile-strip span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.obd-profile-strip strong {
  color: var(--ink);
  font-size: 0.75rem;
}

.obd-operation-journal-viewer {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  min-width: 0;
}

#obdOperationJournalViewer {
  scroll-margin-top: 150px;
}

.obd-operation-journal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.obd-operation-journal-action-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.obd-operation-journal-action-group > legend {
  max-width: 100%;
  padding: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.obd-operation-journal-action-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.obd-operation-journal-action-group-list .obd-operation-journal-action-buttons {
  grid-template-columns: minmax(0, 1fr) 42px 42px;
}

.obd-operation-journal-action-buttons button {
  min-width: 0;
  min-height: 42px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.obd-operation-journal-action-buttons #obdOperationJournalPrevious,
.obd-operation-journal-action-buttons #obdOperationJournalNext {
  padding: 0;
}

.obd-operation-journal-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.obd-operation-journal-status.error {
  color: var(--danger);
}

.obd-operation-journal-comparison {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
  min-width: 0;
}

.obd-operation-journal-comparison div {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 5px;
}

.obd-operation-journal-comparison dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.obd-operation-journal-comparison dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.obd-operation-journal-save-ack {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.obd-operation-journal-save-ack[hidden] {
  display: none;
}

.obd-operation-journal-save-ack input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 3px 0 0;
}

.obd-operation-journal-list {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.obd-operation-journal-id {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  overflow-wrap: anywhere;
}

.obd-operation-journal-id:hover,
.obd-operation-journal-id:focus-visible {
  border-color: var(--accent);
}

.obd-operation-journal-id.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.obd-operation-journal-record {
  display: grid;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.obd-operation-journal-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.obd-operation-journal-meta div {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 6px;
}

.obd-operation-journal-meta dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.obd-operation-journal-meta dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.obd-operation-journal-json-details > summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.obd-operation-journal-json-details > summary:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.obd-operation-journal-json {
  max-height: 280px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 10px;
  color: var(--ink);
  font: 0.76rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.obd-session-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.obd-session-details[hidden] {
  display: none;
}

.obd-timeline-chart-card {
  grid-column: 1 / -1;
}

.obd-timeline-chart {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.obd-timeline-chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.obd-timeline-chart-label {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.obd-timeline-chart-bars {
  display: flex;
  align-items: end;
  gap: 1px;
  height: 56px;
  border-bottom: 1px solid var(--line-strong);
}

.obd-timeline-chart-bar {
  flex: 1 1 0;
  min-width: 0;
  height: var(--obd-timeline-height);
  background: var(--accent-strong);
}

.obd-timeline-records {
  grid-column: 1 / -1;
  min-width: 0;
}

.obd-timeline-position {
  grid-column: 1 / -1;
  min-width: 0;
  gap: 4px;
}

.obd-timeline-controls {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.obd-timeline-step[aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
}

.obd-timeline-step,
.obd-timeline-playback {
  grid-column: 1 / -1;
  justify-self: start;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  font-size: 1.25rem;
}

.obd-timeline-playback:disabled {
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 48px;
  padding: 8px 12px;
  font-size: 0.875rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.obd-timeline-position > input[type="range"] {
  min-width: 0;
  min-height: 48px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent-strong);
}

.obd-timeline-selected-value {
  min-height: 3em;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.obd-timeline-chart-bar.is-selected {
  background: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.obd-timeline-records > summary {
  padding: 12px 0;
  min-height: 48px;
  cursor: pointer;
}

.obd-timeline-records > ol {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow: auto;
}

.obd-timeline-records li {
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.obd-timeline-record-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 0.5fr);
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
}

.obd-timeline-record-select > :last-child {
  text-align: right;
}

.obd-timeline-records li[aria-current="true"] {
  box-shadow: inset 0 -3px var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 700;
}

.obd-timeline-records :is(summary, ol, button):focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: -2px;
}

@media (max-width: 600px) {
  .obd-timeline-chart-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.obd-simple-result-summary {
  margin: 14px 0;
  border-block: 1px solid var(--line-strong);
  padding: 14px 0;
}

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

@media (max-width: 900px) {
  .obd-simple-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 359px) {
  .obd-simple-result-grid { grid-template-columns: minmax(0, 1fr); }
}

.obd-results-empty {
  margin: 14px 0;
  padding: 24px 0;
  border-block: 1px solid var(--line-strong);
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}

#obdSimpleResultSummary:not([hidden]) + #obdResultsEmptyState {
  display: none;
}

.obd-simple-result-item {
  position: relative;
  min-width: 0;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--ink);
  padding: 10px 34px 10px 12px;
  text-align: left;
}

.obd-simple-result-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.obd-simple-result-item:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 2px;
}

.obd-simple-result-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.obd-simple-result-value {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-size: 1.125rem;
  font-weight: 900;
}

.obd-simple-result-detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.obd-simple-result-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--accent-strong);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
}

.obd-simple-result-state {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.obd-simple-result-state.is-reading,
.obd-simple-result-state.is-captured {
  color: var(--accent-strong);
}

.obd-simple-result-state.is-empty {
  color: var(--manual);
}

.obd-simple-result-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.obd-simple-system-summary {
  margin: 14px 0;
  border-block: 1px solid var(--line-strong);
  padding: 14px 0;
}

.obd-simple-system-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.obd-simple-system-filters button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  padding: 7px 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

.obd-simple-system-filters button strong {
  min-width: 1.5em;
  color: inherit;
  font-size: 0.72rem;
  text-align: center;
}

.obd-simple-system-filters button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.obd-simple-system-filters button:disabled {
  opacity: 0.46;
}

.obd-simple-system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.obd-simple-system-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 14px 38px 14px 14px;
  text-align: left;
}

.obd-simple-system-item.is-fault {
  border-left-color: var(--danger);
}

.obd-simple-system-item.is-no-response {
  border-left-color: var(--muted);
}

.obd-simple-system-item.is-expected {
  border-left-color: var(--manual);
  background: var(--panel-subtle);
  cursor: default;
}

.obd-simple-system-item:hover {
  border-color: var(--accent);
  background: var(--panel-subtle);
}

.obd-simple-system-item.is-expected:hover {
  border-color: var(--line);
  border-left-color: var(--manual);
}

.obd-simple-system-item:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 2px;
}

.obd-simple-system-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  gap: 10px;
}

.obd-simple-system-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.obd-simple-system-name {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 800;
}

.obd-simple-system-dtc {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.obd-simple-system-detail {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.obd-simple-system-item .obd-simple-result-arrow {
  right: 13px;
}

.obd-simple-result-summary .confidence-badge.is-ready,
.obd-simple-system-summary .confidence-badge.is-ready {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.obd-simple-result-summary .confidence-badge.is-partial,
.obd-simple-system-summary .confidence-badge.is-partial {
  border-color: var(--manual);
  background: var(--manual-bg);
  color: var(--manual);
}

.obd-simple-result-summary .confidence-badge.is-empty,
.obd-simple-system-summary .confidence-badge.is-empty {
  border-color: var(--line-strong);
  background: var(--panel-subtle);
  color: var(--muted);
}

#obd-panel[data-obd-ui-mode="simple"] #obdDiagnosticFlowPanelResults {
  display: none !important;
}

.obd-diagnostic-flow-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-strong);
  border-radius: 7px;
  background: var(--panel);
  padding: 14px;
}

.obd-diagnostic-flow-panel[hidden] {
  display: none;
}

.obd-diagnostic-flow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.obd-diagnostic-flow-head h4 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1rem;
}

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

.obd-diagnostic-flow-card {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 10px;
}

.obd-diagnostic-flow-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.obd-diagnostic-flow-card strong {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

.obd-diagnostic-flow-ready {
  border-color: var(--success);
}

.obd-diagnostic-flow-blocked {
  border-color: var(--warning);
}

.obd-diagnostic-flow-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.obd-diagnostic-flow-actions {
  margin-top: 0;
}

.obd-readiness-review { grid-column: 1 / -1; }
.obd-freeze-review-card { grid-column: 1 / -1; }
.obd-freeze-review-card li[hidden] { display: none; }
.obd-freeze-review { overflow-wrap: anywhere; }
.obd-mode06-review-card { grid-column: 1 / -1; overflow-wrap: anywhere; }
.obd-mode06-review-card li[hidden] { display: none; }
.obd-reference-search-card { grid-column: 1 / -1; overflow-wrap: anywhere; }
.obd-reference-search-card li[hidden] { display: none; }
.obd-readiness-review h3, .obd-readiness-review h4 { margin: 0 0 10px; }
.obd-readiness-note { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.obd-readiness-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 16px 0; }
.obd-readiness-controls[hidden] { display: none; }
.obd-readiness-controls label { flex: 1 1 190px; min-width: 0; }
.obd-readiness-controls input, .obd-readiness-controls select { width: 100%; min-height: 44px; }
.obd-readiness-controls button { min-height: 44px; }
.obd-readiness-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.obd-readiness-ecu { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.obd-readiness-rows { list-style: none; padding: 0 !important; margin: 0; }
.obd-readiness-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.obd-readiness-rows li[hidden], .obd-readiness-ecu[hidden] { display: none; }
.obd-readiness-name { font-weight: 700; }
.obd-readiness-guide { grid-column: 1 / -1; font-size: 0.9rem; }
.obd-readiness-guide summary { cursor: pointer; padding: 12px 0; min-height: 44px; }
.obd-readiness-guide p { margin: 8px 0; line-height: 1.6; }
.obd-readiness-rows small { grid-column: 1 / -1; color: var(--muted); }
.obd-readiness-badge { align-self: start; border: 1px solid currentColor; border-radius: 6px; padding: 2px 8px; font-size: 0.85rem; }
.obd-readiness-rows [data-readiness-state="incomplete"] .obd-readiness-badge,
.obd-readiness-rows [data-readiness-state="unknown"] .obd-readiness-badge,
.obd-readiness-rows [data-readiness-state="missing"] .obd-readiness-badge { color: var(--manual); background: var(--manual-bg); }

.obd-session-detail-card {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 12px;
}

.obd-session-detail-card strong {
  color: var(--ink);
}

.obd-session-detail-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.obd-ecu-response-card { min-width: 0; }
.obd-ecu-response-card .obd-monitor-filter { margin-top: 0; }
.obd-ecu-response-record { overflow-wrap: anywhere; }
.obd-ecu-response-record + .obd-ecu-response-record { margin-top: 8px; }
.obd-ecu-response-record[hidden] { display: none; }

.obd-request-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.obd-request-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 14px;
}

.obd-request-state-changing {
  border-left-color: var(--manual);
  background: var(--manual-bg);
}

.obd-request-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.obd-request-card button {
  min-height: 38px;
}

.obd-request-card button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.obd-interface-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.obd-interface-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 14px;
}

.obd-interface-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.obd-interface-card button {
  min-height: 38px;
}

.obd-interface-card button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

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

.obd-bridge-grid span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.obd-bridge-grid strong {
  color: var(--ink);
  font-size: 0.75rem;
}

.obd-bridge-schema-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.obd-bridge-schema-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 10px;
}

.obd-bridge-schema-card strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.obd-bridge-schema-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.obd-interlock-panel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.obd-interlock-summary-title {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  list-style-position: inside;
}

.obd-interlock-panel[open] .obd-interlock-summary-title {
  margin-bottom: 12px;
}

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

.obd-interlock-summary span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--manual);
  border-radius: 7px;
  background: var(--manual-bg);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.obd-interlock-summary strong {
  color: var(--ink);
  font-size: 0.75rem;
}

.obd-interlock-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 12px 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.obd-import-result {
  margin-top: 18px;
}

.obd-import-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.obd-import-hint-oem {
  border-left-color: var(--manual);
  background: var(--manual-bg);
}

.obd-code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.obd-dtc-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 14px;
}

.obd-dtc-head,
.obd-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.obd-dtc-head strong {
  font-size: 1.1rem;
}

.obd-dtc-readout-state {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.obd-dtc-status,
.obd-monitor-category {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.obd-dtc-description,
.obd-dtc-check {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.obd-dtc-check {
  font-size: 0.88rem;
}

.obd-code-button {
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0 15px;
}

.obd-code-button:hover {
  background: var(--accent);
  color: #fff;
}

.obd-monitor-result {
  margin-top: 18px;
}

.obd-result-heading h3 {
  margin: 2px 0 0;
}

.obd-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  margin-top: 14px;
}

.obd-monitor-card {
  display: grid;
  gap: 7px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 14px;
}

.obd-monitor-card.is-caution {
  border-left-color: #d97706;
  background: color-mix(in srgb, var(--panel-subtle) 88%, #f59e0b 12%);
}

.obd-monitor-view-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  cursor: pointer;
}

.obd-monitor-selection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.obd-monitor-selection[hidden] { display: none; }

.obd-monitor-selection > button { min-height: 48px; }

.obd-monitor-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 4px 12px;
}

.obd-monitor-options > .obd-monitor-selection:not([hidden]) { display: contents; }
.obd-monitor-options .obd-monitor-view-toggle { width: 100%; }
.obd-monitor-options > .obd-monitor-selection > button { padding: 8px; }
#obdMonitorSelectionCount { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
#obdMonitorFilterCount,
#obdDtcFilterCount {
  margin: 6px 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
}

.obd-monitor-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.obd-monitor-pick > input,
.obd-monitor-view-toggle > input {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  margin: 0;
}

.obd-monitor-pick > strong { min-width: 0; }

.obd-monitor-result:has(#obdMonitorCompact:checked) #obdMonitorGrid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.obd-monitor-result:has(#obdMonitorCompact:checked) #obdMonitorGrid > .obd-monitor-card {
  grid-template-columns: minmax(0, 1fr) minmax(80px, 0.6fr);
  gap: 4px 12px;
  min-height: 0;
  border-radius: 0;
  padding: 10px;
  overflow-wrap: anywhere;
}

.obd-monitor-result:has(#obdMonitorCompact:checked) .obd-monitor-category {
  grid-column: 1 / -1;
}

.obd-monitor-result:has(#obdMonitorCompact:checked) .obd-monitor-reading {
  margin: 0;
  text-align: right;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.obd-monitor-result:has(#obdMonitorCompact:checked) .obd-monitor-note {
  grid-column: 1 / -1;
}

.obd-monitor-filter {
  max-width: 540px;
  margin-top: 14px;
}

.obd-monitor-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  margin-top: 6px;
}

.obd-monitor-search-row input { min-width: 0; }
.obd-monitor-search-row input::-webkit-search-cancel-button { -webkit-appearance: none; }
.obd-monitor-search-row button { padding: 0; min-height: 48px; font-size: 1.5rem; }
.obd-monitor-filter[hidden],
.obd-dtc-card[hidden],
.obd-monitor-card[hidden] { display: none; }

.obd-monitor-card.is-raw {
  border-left-color: #2563eb;
}

.obd-monitor-reading {
  margin: auto 0 0;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.obd-monitor-note {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.obd-monitor-insights {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--panel);
  padding: 14px;
}

.obd-monitor-insights h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.obd-monitor-insights ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.obd-monitor-insights li {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
  padding: 10px;
}

.obd-monitor-insights li.is-caution {
  border-color: color-mix(in srgb, var(--manual) 46%, var(--line));
  background: var(--manual-bg);
}

.obd-monitor-insights strong {
  color: var(--ink);
}

.obd-monitor-insights span,
.obd-monitor-insights em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.5;
}

.obd-monitor-caution {
  margin: 14px 0 0;
  border-left: 4px solid var(--manual);
  background: var(--manual-bg);
  color: var(--ink);
  padding: 11px 13px;
  line-height: 1.6;
}

#obdStageDetailsView > .obd-import-result,
#obdStageDetailsView > .obd-monitor-result {
  display: none;
}

.obd-readout-vehicle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 12px 20px;
  margin: 0 0 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.obd-readout-vehicle[hidden] { display: none; }
.obd-readout-vehicle > div { min-width: 0; }
.obd-readout-vehicle dt { color: var(--muted); font-size: 0.82rem; margin-bottom: 5px; }
.obd-readout-vehicle dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

.obd-technical-notes { display: block; margin-top: 8px; }
.obd-technical-notes label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.obd-technical-notes input { width: auto; margin: 0; }
.obd-technical-notes-body { display: none; overflow-wrap: anywhere; }
.obd-technical-notes:has(input:checked) .obd-technical-notes-body { display: block; }

.obd-status-body {
  max-height: 12rem;
  overflow-y: auto;
  overflow-wrap: anywhere;
  padding: 0 8px;
  scrollbar-gutter: stable;
}

.obd-status-expand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.obd-status-expand input {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.obd-status-details:has(.obd-status-expand input:checked) .obd-status-body {
  max-height: none;
}

.obd-status-body:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#obdPrintSourceWarning { display: none; }

@media print {
  body.obd-print-readout #obdPrintSourceWarning:not([hidden]) {
    display: block;
    font-weight: 700;
  }
  body.obd-print-readout .obd-print-ancestor > :not(.obd-print-ancestor):not(#obdStageResultsView):not(#staticDataWarning),
  body.obd-print-readout > :not(.obd-print-ancestor),
  body.obd-print-readout #obdStageResultsView button:not(.obd-simple-result-item),
  body.obd-print-readout .obd-simple-result-arrow,
  body.obd-print-readout #obdStageResultsView input,
  body.obd-print-readout #obdStageResultsView select,
  body.obd-print-readout #obdStageResultsView textarea,
  body.obd-print-readout #obdStageResultsView nav,
  body.obd-print-readout .obd-results-file-actions,
  body.obd-print-readout .obd-readout-print-actions,
  body.obd-print-readout .obd-simple-result-actions,
  body.obd-print-readout [data-obd-session-export-status] { display: none !important; }
  body.obd-print-readout,
  body.obd-print-readout #staticDataWarning,
  body.obd-print-readout .obd-print-ancestor,
  body.obd-print-readout #obdStageResultsView,
  body.obd-print-readout #obdStageResultsView * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  body.obd-print-readout .obd-print-ancestor {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: auto !important;
  }
  .obd-technical-notes-body { display: block; }
  .obd-technical-notes label { display: none; }
  .obd-status-body { max-height: none; overflow: visible; }
  .obd-status-expand { display: none; }
}

.obd-status-details {
  margin: 8px 0 16px;
  border-bottom: 1px solid var(--line);
}

.obd-status-details > summary {
  padding: 12px 0;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.obd-status-details > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.obd-results-nav {
  position: sticky;
  top: 70px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 0;
  margin-bottom: 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.obd-results-nav button {
  min-width: 0;
  min-height: 52px;
  padding: 6px;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.obd-stage-focus-target,
#obdDetectedCodes,
#obdDtcFilter,
#obdMonitorGrid,
#obdMonitorFilter,
#obdImportStatus,
#obdMonitorStatus,
#obdReadoutDetails,
#obdDevSessionDetails {
  scroll-margin-top: 150px;
}

.obd-readout-details {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.obd-readout-details > summary {
  padding: 14px 0;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
  overflow-wrap: anywhere;
}

#obdDevSessionDetails:not([hidden]) + .obd-readout-details-empty {
  display: none;
}

.obd-policy-list {
  line-height: 1.8;
}

.case-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.case-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.case-tools {
  margin: 18px 0;
}

.case-list {
  display: grid;
  gap: 12px;
}

.case-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 3px 12px rgba(23, 33, 38, 0.04);
}

.case-saved-details > summary {
  cursor: pointer;
  min-height: 48px;
  padding: 12px 0;
}

.case-saved-details > summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.case-saved-details p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.case-card h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.case-card p {
  margin-bottom: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.case-card strong {
  color: var(--ink);
}

.case-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.small-danger-button {
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--line));
  background: var(--danger-bg);
  color: var(--danger);
  padding: 0 12px;
}

.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.live-data-guide-block {
  border-left: 4px solid var(--accent);
}

.live-data-guide-note {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.live-data-guide-block li::marker {
  color: var(--accent);
}

.import-button input {
  display: none;
}

.notice-modal {
  width: min(560px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 24px;
  box-shadow: var(--shadow-raised);
}

.notice-modal::backdrop {
  background: rgba(5, 12, 15, 0.64);
  backdrop-filter: blur(3px);
}

.notice-modal p {
  line-height: 1.7;
}

.obd-sample-dialog {
  width: min(760px, calc(100% - 24px));
  height: min(720px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}

.obd-sample-dialog[open] {
  display: flex;
  flex-direction: column;
}

.obd-sample-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.obd-sample-header h2 { font-size: 1.1rem; margin-bottom: 6px; }
.obd-sample-header p { margin-bottom: 0; color: var(--manual); }
.obd-sample-header form { flex-shrink: 0; }
.obd-sample-body { min-height: 0; overflow: auto; padding: 0 16px 16px; }
.obd-sample-section { padding-top: 16px; }
.obd-sample-section + .obd-sample-section { border-top: 1px solid var(--line); }
.obd-sample-section h3 { font-size: 1rem; }
.obd-sample-section li { line-height: 1.8; overflow-wrap: anywhere; }

.mobile-gpt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 18px;
}

.mobile-gpt-overlay[hidden] {
  display: none !important;
}

.mobile-gpt-popup {
  width: min(92vw, 440px);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow-raised);
}

.mobile-gpt-popup h2 {
  margin-bottom: 12px;
  font-size: 1.35rem;
}

.mobile-gpt-popup p {
  margin-bottom: 18px;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.7;
}

.mobile-gpt-modal-button {
  width: 100%;
  min-height: 60px;
  margin-top: 10px;
  font-size: 1.08rem;
}

@media (min-width: 769px) {
  .mobile-gpt-overlay {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

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

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

  .obd-operation-grid,
  .obd-stage-tabs,
  .obd-profile-strip,
  .obd-operation-journal-meta,
  .obd-operation-journal-comparison,
  .obd-session-details,
  .obd-diagnostic-flow-grid,
  .obd-request-grid,
  .obd-interface-grid,
  .obd-bridge-grid,
  .obd-bridge-schema-grid,
  .obd-interlock-summary,
  .obd-interlock-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .obd-operation-journal-actions {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (max-width: 560px) {
  .app-header,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header {
    gap: 20px;
    padding: 20px 16px;
  }

  .header-note {
    font-size: 0.84rem;
  }

  .panel {
    padding: 16px;
  }

  .result-head-actions {
    align-items: stretch;
    flex-direction: column-reverse;
    width: 100%;
  }

  .view-switcher {
    width: 100%;
  }

  .flow-node {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .flow-step {
    min-height: 126px;
    font-size: 0.68rem;
  }

  .flow-node-content {
    padding: 14px;
  }

  .flow-branch-grid {
    grid-template-columns: 1fr;
  }

  .diagnosis-form {
    grid-template-columns: 1fr;
  }

  .vehicle-selector-grid {
    grid-template-columns: 1fr;
  }

  .questionnaire {
    grid-template-columns: 1fr;
  }

  .case-form {
    grid-template-columns: 1fr;
  }

  .obd-safety-grid {
    grid-template-columns: 1fr;
  }

  .obd-operation-grid,
  .obd-stage-tabs,
  .obd-profile-strip,
  .obd-operation-journal-meta,
  .obd-operation-journal-comparison,
  .obd-session-details,
  .obd-diagnostic-flow-grid,
  .obd-request-grid,
  .obd-interface-grid,
  .obd-bridge-grid,
  .obd-bridge-schema-grid,
  .obd-interlock-summary,
  .obd-interlock-checklist {
    grid-template-columns: 1fr;
  }

  .obd-connection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .obd-stage-tabs {
    grid-template-columns: 1fr;
  }

  #obd-panel[data-obd-ui-mode="simple"] .obd-stage-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .obd-simple-system-filters {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .obd-simple-system-filters button {
    flex: 0 0 auto;
    min-width: 108px;
  }

  .obd-scan-context,
  .obd-simple-connect-summary,
  .obd-simple-system-grid {
    grid-template-columns: 1fr;
  }

  .obd-ui-mode-switch {
    width: 100%;
  }

  .obd-code-list,
  .obd-monitor-grid {
    grid-template-columns: 1fr;
  }

  .button-row button {
    width: 100%;
  }

  .tab-nav {
    width: 100%;
    padding: 8px;
  }

  .tab-button {
    min-width: 136px;
    min-height: 46px;
    padding: 0 12px;
  }

  .tab-shell {
    width: calc(100% - 16px);
    margin-top: 12px;
  }

  input,
  select,
  textarea,
  button,
  .ghost-link,
  .import-button {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
