:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d9e0e7;
  --text: #1e2933;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #9a3412;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 700;
}

h2 {
  font-size: 15px;
  margin-bottom: 12px;
}

.topbar p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

button, input {
  font: inherit;
}

input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  min-width: 0;
  background: #fff;
}

button {
  height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

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

button:disabled {
  opacity: .5;
  cursor: default;
}

.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}

.ghost:hover {
  background: #ecfdf5;
}

.vin-form {
  display: grid;
  grid-template-columns: minmax(220px, 340px) auto;
  gap: 8px;
  width: min(520px, 100%);
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  padding: 16px;
  height: calc(100vh - 76px);
}

.sidebar,
.content,
.split {
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.split {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  height: 100%;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 0;
  overflow: auto;
}

.grow {
  flex: 1;
}

.muted {
  color: var(--muted);
}

.vehicle {
  display: grid;
  gap: 7px;
  font-size: 13px;
}

.vehicle-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 8px;
}

.label {
  color: var(--muted);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.list,
.units,
.search-results {
  display: grid;
  gap: 6px;
}

.item {
  width: 100%;
  text-align: left;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  min-height: 36px;
  height: auto;
  padding: 9px 10px;
  white-space: normal;
}

.item:hover,
.item.active {
  background: #ecfdf5;
  border-color: #99f6e4;
  color: #134e4a;
}

.unit-code {
  color: var(--accent);
  font-weight: 700;
}

.scheme-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scheme {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  min-height: 260px;
  display: block;
  overflow: auto;
  margin-bottom: 12px;
}

.scheme-canvas {
  position: relative;
  width: max-content;
  min-width: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scheme img {
  max-width: 100%;
  height: auto;
  display: block;
}

.map-hit {
  position: absolute;
  border: 2px solid rgba(15, 118, 110, 0);
  background: rgba(20, 184, 166, 0);
  cursor: pointer;
  transform-origin: top left;
}

.map-hit:hover,
.map-hit.active {
  border-color: rgba(15, 118, 110, .85);
  background: rgba(20, 184, 166, .18);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f0fdfa;
}

.part-number {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

tr.active-part {
  background: #ccfbf1;
  outline: 2px solid #14b8a6;
  outline-offset: -2px;
}

.note {
  color: var(--muted);
}

.replacement {
  color: var(--warn);
  font-weight: 600;
}

.status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 420px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}

.status.show {
  opacity: 1;
}

@media (max-width: 1100px) {
  .layout,
  .split {
    grid-template-columns: 1fr;
    height: auto;
  }

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