:root {
  --vs-bg: #ffffff;
  --vs-fg: #1a2233;
  --vs-muted: #6b7688;
  --vs-border: #d8dee9;
  --vs-accent: #1f6feb;
  --vs-accent-hi: #3b86ff;
  --vs-accent-lo: #1858c9;
  --vs-accent-ring: rgba(31, 111, 235, 0.32);
  --vs-panel: #f6f8fb;
  --vs-error-bg: #fdecec;
  --vs-error-fg: #b3261e;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--vs-fg);
  background: #eef1f6;
}

.vs {
  max-width: 880px;
  margin: 48px auto;
  padding: 32px;
  background: var(--vs-bg);
  border: 1px solid var(--vs-border);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(20, 34, 60, 0.06);
}

.vs-title {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.vs-sub {
  margin: 0 0 24px;
  color: var(--vs-muted);
  font-size: 0.9rem;
}

.vs-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.vs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vs-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--vs-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vs-select {
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--vs-border);
  border-radius: 8px;
  background: var(--vs-bg);
  color: var(--vs-fg);
}

.vs-select:disabled {
  background: var(--vs-panel);
  color: var(--vs-muted);
  cursor: not-allowed;
}

.vs-select:focus {
  outline: 2px solid var(--vs-accent);
  outline-offset: 1px;
}

.vs-error {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--vs-error-bg);
  color: var(--vs-error-fg);
  font-size: 0.9rem;
}

.vs-details {
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--vs-panel);
  border-radius: 12px;
}

.vs-details h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.vs-details dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 24px;
}

.vs-detail dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vs-muted);
}

.vs-detail dd {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- Auth ---------- */
.app-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: var(--vs-bg); border-bottom: 1px solid var(--vs-border);
}
.app-bar-brand { font-weight: 700; color: var(--vs-fg); }
.app-bar-logout button, .app-bar-logout {
  border: 1px solid var(--vs-border); background: var(--vs-bg); color: var(--vs-fg);
  padding: 7px 16px; border-radius: 9px; cursor: pointer; font-size: 0.85rem; font-weight: 600;
  transition: border-color .15s ease, color .15s ease, background .15s ease,
              transform .12s ease, box-shadow .2s ease;
}
.app-bar-logout button:hover {
  border-color: var(--vs-accent); color: var(--vs-accent); background: #f3f7ff;
}
.app-bar-logout button:active { transform: translateY(0.5px); }
.app-bar-logout button:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--vs-accent-ring);
}
.app-flash {
  max-width: 880px; margin: 12px auto -8px; padding: 10px 16px;
  background: #e7f3ec; color: #1a7f43; border-radius: 8px; font-size: 0.9rem;
}

.auth { display: flex; justify-content: center; padding: 80px 20px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--vs-bg);
  border: 1px solid var(--vs-border); border-radius: 14px; padding: 32px;
  box-shadow: 0 6px 24px rgba(20, 34, 60, 0.06);
}
.auth-title { margin: 0 0 4px; font-size: 1.4rem; }
.auth-sub { margin: 0 0 20px; color: var(--vs-muted); font-size: 0.9rem; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-input { font-size: 1rem; }
.auth-btn { width: 100%; min-height: 46px; font-size: 0.98rem; margin-top: 2px; }

/* ---------- OEM search ---------- */
.oem-form { display: flex; gap: 10px; margin-bottom: 16px; }
.oem-input { flex: 1; font-size: 1rem; letter-spacing: 0.02em; }
.oem-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 22px;
  border: none; border-radius: 10px;
  background: linear-gradient(180deg, var(--vs-accent-hi), var(--vs-accent) 55%, var(--vs-accent-lo));
  color: #fff; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(16, 34, 60, 0.16),
              0 4px 12px -3px var(--vs-accent-ring),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.oem-btn:hover:not(:disabled) {
  transform: translateY(-1px); filter: saturate(1.05) brightness(1.04);
  box-shadow: 0 2px 4px rgba(16, 34, 60, 0.18),
              0 10px 22px -5px var(--vs-accent-ring),
              inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.oem-btn:active:not(:disabled) {
  transform: translateY(0); filter: brightness(0.97);
  box-shadow: 0 1px 2px rgba(16, 34, 60, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.16);
}
.oem-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--vs-accent-ring), 0 1px 2px rgba(16, 34, 60, 0.16);
}
.oem-btn:disabled {
  background: #b7cdf2; color: #eef3fc; cursor: not-allowed;
  box-shadow: none; transform: none; filter: none;
}
.oem-results { margin-top: 4px; }
.oem-row-name { color: var(--vs-fg); font-size: 0.88rem; }

/* ---------- Bulk replacements ---------- */
.br-form { align-items: center; }
.br-file {
  flex: 1; padding: 7px 10px; border: 1px dashed var(--vs-border);
  border-radius: 10px; background: var(--vs-panel); font-size: 0.9rem; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.br-file:hover { border-color: var(--vs-accent); background: #f3f7ff; }
.br-file::file-selector-button {
  margin-right: 12px; padding: 8px 16px; border: none; border-radius: 8px;
  background: var(--vs-fg); color: #fff; font-weight: 600; font-size: 0.85rem;
  cursor: pointer; transition: filter .15s ease, transform .12s ease;
}
.br-file::file-selector-button:hover { filter: brightness(1.35); }
.br-file::file-selector-button:active { transform: translateY(0.5px); }
.br-file-name { margin-top: 8px; }
.br-note { display: inline-block; margin-top: 8px; font-style: italic; }
.br-results { margin-top: 16px; }
.br-dl { margin-left: auto; }
.br-table-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--vs-border); border-radius: 10px; }
.br-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.br-table thead th {
  position: sticky; top: 0; background: var(--vs-panel); text-align: left;
  padding: 9px 12px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--vs-muted); border-bottom: 1px solid var(--vs-border);
}
.br-table td { padding: 8px 12px; border-bottom: 1px solid var(--vs-border); }
.br-table tbody tr:hover { background: var(--vs-panel); }
.br-mono { font-variant-numeric: tabular-nums; }
.br-row-empty td { color: var(--vs-muted); font-style: italic; }
.oem .pf-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 12px; align-items: center; }

/* ---------- Brand stats ---------- */
.bs { margin-bottom: 22px; }
.bs-load { padding: 0 20px; }
.bs-hint, .bs-note { margin-left: 10px; }
.bs-head { margin-bottom: 12px; font-size: 0.95rem; }
.bs-head strong { color: var(--vs-accent); }
.bs-note { display: inline-block; font-style: italic; }
.bs-list {
  list-style: none; margin: 0; padding: 0;
  max-height: 360px; overflow: auto;
  border: 1px solid var(--vs-border); border-radius: 10px;
}
.bs-brand { border-bottom: 1px solid var(--vs-border); }
.bs-brand:last-child { border-bottom: none; }
.bs-row {
  display: grid; grid-template-columns: 18px minmax(120px, 180px) 1fr 56px;
  gap: 10px; align-items: center; width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 8px 12px; font-size: 0.9rem; color: var(--vs-fg);
}
.bs-row:hover { background: var(--vs-panel); }
.bs-twisty { color: var(--vs-muted); }
.bs-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-bar { background: var(--vs-panel); border-radius: 4px; height: 10px; overflow: hidden; }
.bs-bar-fill { display: block; height: 100%; background: var(--vs-accent); }
.bs-total { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bs-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 12px 40px; }
.bs-cat { background: var(--vs-panel); border-radius: 6px; padding: 3px 9px; font-size: 0.82rem; }
.bs-cat-n { color: var(--vs-accent); font-weight: 700; margin-left: 3px; }

/* ---------- Part finder ---------- */
.pf { margin-top: 36px; border-top: 1px solid var(--vs-border); padding-top: 24px; }
.pf-title { margin: 0 0 2px; font-size: 1.25rem; }
.pf-sub { margin: 0 0 18px; color: var(--vs-muted); font-size: 0.9rem; }

.pf-body {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 720px) { .pf-body { grid-template-columns: 1fr; } }

.pf-tree {
  border: 1px solid var(--vs-border);
  border-radius: 10px;
  padding: 10px;
  max-height: 520px;
  overflow: auto;
  background: var(--vs-bg);
}
.pf-muted { color: var(--vs-muted); font-size: 0.88rem; padding: 6px 4px; }
.pf-empty { color: var(--vs-muted); padding: 24px; text-align: center; }

.pf-treelist { list-style: none; margin: 0; padding: 0; }
.pf-node { display: flex; align-items: center; gap: 4px; }
.pf-twisty {
  border: none; background: none; cursor: pointer; color: var(--vs-muted);
  width: 20px; font-size: 0.85rem; padding: 2px;
}
.pf-twisty:disabled { cursor: default; opacity: 0.4; }
.pf-nodelabel {
  border: none; background: none; cursor: pointer; text-align: left;
  padding: 5px 6px; border-radius: 6px; color: var(--vs-fg); font-size: 0.9rem; flex: 1;
}
.pf-nodelabel:hover { background: var(--vs-panel); }
.pf-nodelabel.is-selected { background: var(--vs-accent); color: #fff; font-weight: 600; }

.pf-list {
  border: 1px solid var(--vs-border);
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 200px;
  background: var(--vs-bg);
}
.pf-parts-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pf-count { color: var(--vs-muted); font-size: 0.82rem; }
.pf-brand { margin-left: auto; min-width: 160px; padding: 6px 10px; }

.pf-cat { margin-bottom: 16px; }
.pf-cat-head { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--vs-muted); margin-bottom: 6px; }
.pf-rows { list-style: none; margin: 0; padding: 0; }
.pf-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent;
}
.pf-row:hover { background: var(--vs-panel); }
.pf-row.is-active { border-color: var(--vs-accent); background: var(--vs-panel); }
.pf-row-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-row-brand { color: var(--vs-muted); font-size: 0.85rem; }
.pf-row-cta { margin-left: auto; color: var(--vs-accent); font-size: 0.82rem; }

/* Detail slide-over */
.pf-overlay {
  position: fixed; inset: 0; background: rgba(20, 34, 60, 0.4);
  display: flex; justify-content: flex-end; z-index: 50;
}
.pf-panel {
  width: min(460px, 92vw); height: 100%; background: var(--vs-bg);
  padding: 24px 26px; overflow: auto; box-shadow: -8px 0 28px rgba(0,0,0,0.18);
}
.pf-close { position: absolute; top: 14px; right: 18px; border: none; background: none; font-size: 1.6rem; cursor: pointer; color: var(--vs-muted); }
.pf-panel-head { border-bottom: 1px solid var(--vs-border); padding-bottom: 14px; margin-bottom: 14px; }
.pf-panel-brand { font-size: 0.8rem; color: var(--vs-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pf-panel-no { margin: 2px 0; font-size: 1.4rem; }
.pf-panel-name { color: var(--vs-fg); font-weight: 600; }

.pf-section { margin-bottom: 18px; }
.pf-section-title { margin: 0 0 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--vs-muted); }
.pf-attrs { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.pf-attr dt { font-size: 0.74rem; color: var(--vs-muted); }
.pf-attr dd { margin: 1px 0 0; font-weight: 600; font-size: 0.92rem; }
.pf-oe { list-style: none; margin: 0; padding: 0; }
.pf-oe li { padding: 4px 0; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--vs-border); }
.pf-oe-brand { color: var(--vs-muted); font-size: 0.8rem; margin-right: 8px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip { background: var(--vs-panel); border-radius: 6px; padding: 3px 8px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.pf-docs { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.pf-docs code { background: var(--vs-panel); padding: 1px 5px; border-radius: 4px; }
.pf-meta { color: var(--vs-muted); font-size: 0.82rem; margin-top: 8px; }
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
