/* ==================== LOOKUP (Year / Make / Model -> series -> code) ====================
 * Mobile-first. Uses the app's theme variables (--accent, --bg-surface, ...) so body.dark works.
 * Desktop (>= 960px): finder pinned left, results right.
 */

.lk {
  --lk-radius: 16px;
  --lk-radius-sm: 10px;
  --lk-mono: ui-monospace, 'SF Mono', 'Menlo', 'Roboto Mono', monospace;
  --lk-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
  --lk-accent-soft: rgba(0, 82, 163, 0.08);
  --lk-accent-line: rgba(0, 82, 163, 0.22);
  --lk-ok-soft: rgba(22, 163, 74, 0.12);
  --lk-muted-soft: rgba(100, 116, 139, 0.12);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  color: var(--text-primary);
}
body.dark .lk {
  --lk-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
  --lk-accent-soft: rgba(77, 148, 217, 0.14);
  --lk-accent-line: rgba(77, 148, 217, 0.35);
}

/* the home screen's own padding is replaced by ours (the app gives .screen side padding on phones) */
.screen.screen-home { padding: 0; }
.screen-home .screen-content.lk-host { padding: 0; }

.lk-finder, .lk-main { padding: 16px 16px 96px; }
.lk-main { display: none; }
.lk.has-view .lk-finder { display: none; }
.lk.has-view .lk-main { display: block; }

/* ---------- hero ---------- */
.lk-hero {
  margin: -16px -16px 0;
  padding: 28px 20px 64px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(77, 148, 217, 0.45) 0%, transparent 60%),
    linear-gradient(160deg, #0052A3 0%, #003D7A 100%);
  color: #fff;
}
.lk-hero h2 { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; }
.lk-hero p { margin-top: 6px; opacity: 0.82; font-size: 15px; }

/* ---------- vehicle picker card ---------- */
.lk-picker {
  position: relative;
  margin: -44px 0 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--lk-radius);
  box-shadow: var(--lk-shadow);
  overflow: hidden;
}
.lk-pick {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 10px 16px;
  background: none; border: 0;
  border-bottom: 1px solid var(--border);
  color: inherit; font: inherit; text-align: left;
  cursor: pointer;
}
.lk-pick:last-of-type { border-bottom: 0; }
.lk-pick:active { background: var(--bg-secondary); }
.lk-pick:disabled { cursor: default; }
.lk-pick:disabled .lk-pick-value { color: var(--text-secondary); opacity: 0.55; }
.lk-step {
  flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--lk-accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700;
}
body.dark .lk-step { color: var(--accent-light); }
.lk-pick.is-set .lk-step { background: var(--accent); color: #fff; }
.lk-pick-text { flex: 1; min-width: 0; }
.lk-pick-label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.lk-pick-value { display: block; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-pick-value.is-placeholder { color: var(--text-secondary); font-weight: 500; }
.lk-chev { flex: none; color: var(--text-secondary); }
.lk-picker-foot {
  display: flex; gap: 8px; padding: 10px 12px; background: var(--bg-secondary);
}
.lk-picker-foot .lk-btn { flex: 1; }

/* ---------- buttons ---------- */
.lk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: var(--lk-radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-primary);
  font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.lk-btn:active { transform: scale(0.98); }
.lk-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.lk-btn-primary:disabled { opacity: 0.45; cursor: default; transform: none; }
.lk-btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
body.dark .lk-btn-ghost { color: var(--accent-light); }
.lk-btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }

/* ---------- section titles ---------- */
.lk-section-title {
  margin: 28px 2px 10px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-secondary);
}

/* ---------- quick search ---------- */
.lk-search { position: relative; }
.lk-search input {
  width: 100%; height: 52px;
  padding: 0 44px 0 46px;
  border-radius: var(--lk-radius);
  border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-primary);
  font: inherit; font-size: 16px;
  box-shadow: var(--lk-shadow);
}
.lk-search input:focus { outline: 2px solid var(--accent-light); outline-offset: 1px; }
.lk-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.lk-search-icon { position: absolute; left: 16px; top: 15px; color: var(--text-secondary); pointer-events: none; }
.lk-search-clear {
  position: absolute; right: 6px; top: 6px; width: 40px; height: 40px;
  border: 0; background: none; color: var(--text-secondary); font-size: 20px; cursor: pointer;
}
.lk-search-results {
  margin-top: 8px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--lk-radius); box-shadow: var(--lk-shadow);
  overflow: hidden;
}
.lk-search-results:empty { display: none; }
.lk-sr-group { padding: 10px 14px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-secondary); }

/* ---------- reverse bitting (code page) ---------- */
.lk-reverse {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px;
  margin: 12px 0 4px; padding: 10px 12px;
  border-radius: var(--lk-radius-sm); border: 1px solid var(--lk-accent-line); background: var(--lk-accent-soft);
  font-size: 14px;
}
.lk-reverse small { flex-basis: 100%; color: var(--text-secondary); font-size: 12px; }
.lk-reverse.is-flipped { border-color: #d97706; background: rgba(217, 119, 6, 0.12); }

/* ---------- VIN -> vehicle ---------- */
.lk-vin { display: flex; gap: 8px; }
.lk-vin-input {
  flex: 1; min-width: 0; height: 52px; padding: 0 14px;
  border-radius: var(--lk-radius); border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-primary);
  font-family: var(--lk-mono); font-size: 16px; letter-spacing: 0.04em;
  box-shadow: var(--lk-shadow);
}
.lk-vin-input:focus { outline: 2px solid var(--accent-light); outline-offset: 1px; }
.lk-vin .lk-btn { height: 52px; flex: none; }
.lk-vin-scan { padding: 0 12px; }
@media (max-width: 380px) { .lk-vin-scan span { display: none; } }
.lk-vin-out:not(:empty) {
  margin-top: 8px; overflow: hidden;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--lk-radius); box-shadow: var(--lk-shadow);
}
.lk-vin-msg { margin: 0; padding: 12px 14px; font-size: 14px; }
.lk-vin-msg.is-err { color: var(--danger, #dc2626); }
.lk-vin-msg + .lk-row { border-top: 1px solid var(--border); }

/* ---------- contribute card ---------- */
.lk-contrib {
  display: flex; align-items: center; gap: 12px;
  width: 100%; margin-top: 20px; padding: 14px;
  border-radius: var(--lk-radius); border: 1px solid var(--lk-accent-line);
  background: var(--lk-accent-soft); color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.lk-contrib:active { transform: scale(0.99); }
.lk-contrib .lk-row-title, .lk-contrib .lk-row-sub { display: block; }
.lk-contrib .lk-row-sub { white-space: normal; margin-top: 2px; }
.lk-contrib-icon {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; background: var(--accent); color: #fff;
}

/* ---------- VIN scanner overlay (vin-scan.js) ---------- */
.vs-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: #000; color: #fff; text-align: center;
}
.vs-box { position: relative; width: 100%; max-width: 640px; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #111; }
.vs-video { width: 100%; height: 100%; object-fit: cover; }
.vs-aim { position: absolute; left: 6%; right: 6%; top: 38%; height: 24%; border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 8px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.vs-hint { margin: 0; max-width: 520px; font-size: 14px; opacity: 0.85; }
.vs-status { margin: 0; min-height: 20px; font-size: 14px; font-weight: 600; }
.vs-cancel { min-width: 160px; }

/* ---------- generic list rows ---------- */
.lk-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 10px 14px;
  background: none; border: 0; border-top: 1px solid var(--border);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.lk-row:first-child { border-top: 0; }
.lk-sr-group + .lk-row { border-top: 0; }
.lk-row:active, .lk-row:hover { background: var(--bg-secondary); }
.lk-row-main { flex: 1; min-width: 0; }
.lk-row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-row-sub { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-row-end { flex: none; font-size: 13px; color: var(--text-secondary); }

/* ---------- recent chips ---------- */
.lk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lk-chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  min-height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-primary);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lk-chip small { color: var(--text-secondary); font-size: 12px; }

/* ---------- tips card ---------- */
.lk-tips { display: grid; gap: 10px; }
.lk-tip {
  display: flex; gap: 12px; padding: 14px;
  border-radius: var(--lk-radius); background: var(--bg-surface); border: 1px solid var(--border);
}
.lk-tip-icon {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--lk-accent-soft); color: var(--accent); font-size: 18px;
}
.lk-tip b { display: block; font-size: 15px; }
.lk-tip span { font-size: 13px; color: var(--text-secondary); }

/* ---------- view top bar ---------- */
.lk-topbar {
  position: sticky; top: -16px; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  margin: -16px -16px 12px; padding: 10px 8px;
  background: color-mix(in srgb, var(--bg-body) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.lk-back {
  display: inline-flex; align-items: center; gap: 2px;
  height: 40px; padding: 0 10px 0 4px;
  border: 0; border-radius: var(--lk-radius-sm); background: none;
  color: var(--accent); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
body.dark .lk-back { color: var(--accent-light); }
.lk-crumbs { flex: 1; min-width: 0; font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; padding-right: 8px; }

/* ---------- headers ---------- */
.lk-head { margin: 4px 2px 16px; }
.lk-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
body.dark .lk-eyebrow { color: var(--accent-light); }
.lk-title { font-size: 28px; font-weight: 760; letter-spacing: -0.02em; line-height: 1.15; margin-top: 2px; word-break: break-word; }
.lk-subtitle { margin-top: 4px; color: var(--text-secondary); font-size: 15px; }

.lk-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lk-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--lk-accent-soft); color: var(--accent);
  font-size: 12.5px; font-weight: 600;
}
body.dark .lk-badge { color: var(--accent-light); }
.lk-badge.is-ok { background: var(--lk-ok-soft); color: var(--success); }
.lk-badge.is-muted { background: var(--lk-muted-soft); color: var(--text-secondary); }

/* ---------- cards ---------- */
.lk-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--lk-radius); box-shadow: var(--lk-shadow);
  overflow: hidden;
}
.lk-card + .lk-card { margin-top: 12px; }
.lk-card-pad { padding: 16px; }

/* series cards on the vehicle view */
.lk-series {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--lk-radius); box-shadow: var(--lk-shadow);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.lk-series + .lk-series { margin-top: 8px; }
.lk-series:active { transform: scale(0.995); }
.lk-series:hover { border-color: var(--lk-accent-line); }
.lk-series-mark {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--lk-accent-soft); color: var(--accent);
}
body.dark .lk-series-mark { color: var(--accent-light); }
.lk-series.is-empty .lk-series-mark { background: var(--lk-muted-soft); color: var(--text-secondary); }
.lk-series-main { flex: 1; min-width: 0; }
.lk-series-name { font-family: var(--lk-mono); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.lk-role {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 6px;
  background: rgba(245, 158, 11, 0.14); color: #b45309; font-size: 12px; font-weight: 650;
}
body.dark .lk-role { color: #fbbf24; }
.lk-role-head {
  display: flex; align-items: center; gap: 8px; margin: 18px 2px 8px;
  font-size: 13px; font-weight: 750; color: #b45309;
}
body.dark .lk-role-head { color: #fbbf24; }
.lk-role-head:first-child { margin-top: 0; }
.lk-role-head span { font-weight: 600; color: var(--text-secondary); }
.lk-series-meta { margin-top: 2px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-series-type { margin-top: 3px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lk-group-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 22px 2px 10px;
}
.lk-group-label b { font-size: 15px; }
.lk-group-label span { font-size: 13px; color: var(--text-secondary); }

/* ---------- notes ---------- */
.lk-note {
  display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 12px;
  border-radius: var(--lk-radius);
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 14px; white-space: pre-line;
}
.lk-note-icon { flex: none; }
.lk-note-body { flex: 1; min-width: 0; }
.lk-note-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ---------- details / disclosure ---------- */
.lk-more { margin-top: 12px; }
.lk-more > summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0 16px;
  list-style: none; cursor: pointer;
  font-weight: 650;
}
.lk-more > summary::-webkit-details-marker { display: none; }
.lk-more > summary::after {
  content: ''; width: 9px; height: 9px;
  border-right: 2px solid var(--text-secondary); border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg) translateY(-3px); transition: transform 0.2s;
}
.lk-more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.lk-more-body { padding: 0 16px 16px; }

.lk-kv { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 8px 12px; font-size: 14px; }
.lk-kv dt { color: var(--text-secondary); }
.lk-kv dd { font-weight: 550; word-break: break-word; }
.lk-sub-h { margin: 18px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-secondary); }
.lk-sub-h:first-child { margin-top: 4px; }
.lk-blanks { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.lk-blank { padding: 8px 10px; border-radius: 8px; background: var(--bg-secondary); font-size: 13px; }
.lk-blank small { display: block; color: var(--text-secondary); font-size: 11px; }
.lk-blank b { font-family: var(--lk-mono); font-size: 13px; }
.lk-fits { display: grid; gap: 2px; font-size: 14px; }
.lk-fits div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.lk-fits div:last-child { border-bottom: 0; }
.lk-fits span { color: var(--text-secondary); white-space: nowrap; }
.lk-empty-spec { font-size: 14px; color: var(--text-secondary); }

/* ---------- segmented control ---------- */
.lk-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin: 16px 0 12px;
  border-radius: 12px; background: var(--bg-secondary);
}
.lk-seg button {
  min-height: 42px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-secondary);
  font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer;
}
.lk-seg button.is-on { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* ---------- code input ---------- */
.lk-code-input {
  width: 100%; height: 60px; padding: 0 16px;
  border-radius: var(--lk-radius); border: 2px solid var(--border);
  background: var(--bg-surface); color: var(--text-primary);
  font-family: var(--lk-mono); font-size: 26px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lk-code-input:focus { outline: none; border-color: var(--accent); }
.lk-code-input::placeholder { font-size: 17px; letter-spacing: 0; font-weight: 500; color: var(--text-secondary); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; text-transform: none; }

/* ---------- decode positions ---------- */
.lk-decode-help { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.lk-positions {
  display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 6px;
}
.lk-pos { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.lk-pos input {
  width: 100%; max-width: 56px; aspect-ratio: 3 / 4;
  border-radius: 10px; border: 2px solid var(--border);
  background: var(--bg-surface); color: var(--text-primary);
  text-align: center; font-family: var(--lk-mono); font-size: clamp(18px, 5vw, 26px); font-weight: 750;
  caret-color: transparent;
}
.lk-pos input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--lk-accent-soft); }
.lk-pos input.is-set { background: var(--lk-accent-soft); border-color: var(--lk-accent-line); }
.lk-pos input.is-bad { animation: lk-shake 0.3s; border-color: var(--error); }
.lk-pos label { font-size: 11px; font-weight: 700; color: var(--text-secondary); }
@keyframes lk-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.lk-depth-pad { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lk-depth-pad button {
  flex: 1 0 44px; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-primary);
  font-family: var(--lk-mono); font-size: 18px; font-weight: 700; cursor: pointer;
}
.lk-depth-pad button.lk-pad-clear { font-family: inherit; font-size: 13px; font-weight: 600; flex-basis: 64px; }
.lk-depth-pad button:active { background: var(--lk-accent-soft); }

.lk-meter { margin: 16px 0 6px; }
.lk-meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lk-meter-count { font-size: 22px; font-weight: 760; letter-spacing: -0.01em; }
.lk-meter-count small { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.lk-meter-bar { height: 6px; margin-top: 8px; border-radius: 99px; background: var(--bg-secondary); overflow: hidden; }
.lk-meter-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.25s ease; }
.lk-meter.is-found .lk-meter-bar i { background: var(--success); }

/* ---------- code list ---------- */
.lk-codes { margin-top: 12px; }
.lk-code-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 54px; padding: 8px 14px;
  background: none; border: 0; border-top: 1px solid var(--border);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.lk-code-row:first-child { border-top: 0; }
.lk-code-row:hover, .lk-code-row:active { background: var(--bg-secondary); }
.lk-code-row .c { font-family: var(--lk-mono); font-size: 17px; font-weight: 750; min-width: 64px; }
.lk-code-row .k { flex: 1; font-family: var(--lk-mono); font-size: 15px; letter-spacing: 0.18em; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-code-row .k em { font-style: normal; color: var(--accent); font-weight: 750; }
body.dark .lk-code-row .k em { color: var(--accent-light); }
.lk-code-row.is-exact { background: var(--lk-accent-soft); }
.lk-list-foot { padding: 12px; text-align: center; border-top: 1px solid var(--border); }
.lk-muted { color: var(--text-secondary); font-size: 14px; }
.lk-center { text-align: center; padding: 28px 16px; }

/* ---------- code view ---------- */
.lk-code-hero { padding: 20px 16px 18px; text-align: center; }
.lk-code-big { font-family: var(--lk-mono); font-size: 44px; font-weight: 800; letter-spacing: 0.04em; line-height: 1.1; }
.lk-code-type { margin-top: 6px; font-size: 14px; color: var(--text-secondary); }
.lk-cuts {
  display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 48px));
  justify-content: center; gap: clamp(3px, 1vw, 6px); margin-top: 16px;
}
.lk-cut { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.lk-cut b {
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 4 / 5;
  border-radius: clamp(6px, 2vw, 10px); background: var(--accent); color: #fff;
  font-family: var(--lk-mono); font-size: clamp(16px, 5vw, 26px); font-weight: 800;
}
.lk-cut small { font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.lk-cuts-label { margin-top: 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.lk-cuts.is-bottom .lk-cut b { background: var(--bg-secondary); color: var(--text-primary); }
.lk-keyart {
  display: grid; place-items: center;
  margin: 18px auto 0; max-width: 520px; aspect-ratio: 4 / 1;
  border-radius: 14px;
}
.lk-keyart img { width: 100%; height: 100%; object-fit: contain; }
.lk-keyart:not(.has-img) { border: 1.5px dashed var(--border); background: var(--bg-secondary); }
.lk-keyart-empty { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; font-weight: 600; opacity: 0.8; }

.lk-blanks-card { margin-top: 12px; }
.lk-blanks-card .lk-sub-h { margin-top: 0; }
.lk-blank-type { margin: 12px 0 6px; font-size: 13px; font-weight: 700; }
.lk-blank-type:first-of-type { margin-top: 2px; }
.lk-blank-list { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--lk-radius-sm); overflow: hidden; text-align: left; }
.lk-blanks-card .lk-blank-list { margin-top: 0; }
.lk-blank-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 14px; }
.lk-blank-list li:first-child { border-top: 0; }
.lk-blank-list li span { color: var(--text-secondary); }
.lk-blank-list li b { font-family: var(--lk-mono); font-weight: 600; text-align: right; }
.lk-blank-more summary { margin-top: 8px; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.lk-blank-more .lk-blank-list { margin-top: 6px; }
.lk-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

/* ---------- sheet (picker) ---------- */
.lk-sheet-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0; transition: opacity 0.2s;
}
.lk-sheet-backdrop.is-open { opacity: 1; }
.lk-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001;
  display: flex; flex-direction: column;
  max-height: 88vh; max-height: 88dvh;
  background: var(--bg-surface); color: var(--text-primary);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.lk-sheet.is-open { transform: translateY(0); }
.lk-sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--border); margin: 8px auto 2px; }
.lk-sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 10px 18px; }
.lk-sheet-head h3 { flex: 1; font-size: 19px; font-weight: 750; }
.lk-sheet-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bg-secondary); color: var(--text-primary); font-size: 18px; cursor: pointer; }
.lk-sheet-filter { padding: 0 16px 10px; }
.lk-sheet-filter input {
  width: 100%; height: 46px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: 16px;
}
.lk-sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 8px 16px; overscroll-behavior: contain; }
.lk-sheet-body .lk-row { border-radius: 10px; border-top: 0; }
.lk-sheet-body .lk-row.is-on { background: var(--lk-accent-soft); }
.lk-decade { padding: 12px 10px 6px; font-size: 12px; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.06em; }
.lk-years { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 6px; }
.lk-year {
  min-height: 48px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-primary);
  font: inherit; font-size: 16px; font-weight: 650; cursor: pointer;
}
.lk-year.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lk-year:active { background: var(--lk-accent-soft); }
.lk-sheet textarea, .lk-form input, .lk-form select, .lk-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: 15px;
}
.lk-form { display: grid; gap: 12px; padding: 0 16px 16px; }
.lk-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.lk-form .lk-btn { width: 100%; }

.lk-toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 1100;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 16px; border-radius: 12px;
  background: #0f172a; color: #fff; font-size: 14px; font-weight: 600;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.lk-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.lk-skel { height: 64px; border-radius: var(--lk-radius); background: linear-gradient(90deg, var(--bg-secondary), var(--bg-surface), var(--bg-secondary)); background-size: 200% 100%; animation: lk-skel 1.2s infinite; }
.lk-skel + .lk-skel { margin-top: 10px; }
@keyframes lk-skel { to { background-position: -200% 0; } }

/* ---------- vehicle extras ---------- */
.lk-expect .lk-sub-h { margin-top: 0; }
.lk-expect dd { line-height: 1.5; }
.lk-supplier-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.lk-supplier-row .lk-row-title, .lk-supplier-row .lk-row-sub { display: block; white-space: normal; }
.lk-panel-filter {
  width: 100%; height: 42px; padding: 0 12px; margin-bottom: 4px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: 15px;
}
.lk-products { display: grid; gap: 6px; }
.lk-product {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-surface); color: inherit; text-decoration: none;
}
.lk-product:hover { border-color: var(--lk-accent-line); }
.lk-product-img { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 10px; background: #fff; overflow: hidden; color: var(--text-secondary); }
.lk-product-img img { width: 100%; height: 100%; object-fit: contain; }
.lk-product-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lk-product-name { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lk-product-meta { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-product-end { flex: none; display: grid; justify-items: end; gap: 2px; font-size: 15px; }
.lk-product-end small { font-size: 11.5px; color: var(--text-secondary); }
.lk-product-end small.is-ok { color: var(--success); font-weight: 650; }
.lk-fineprint { margin: 10px 2px 0; font-size: 12.5px; }
.lk-bit { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.lk-bit:last-of-type { border-bottom: 0; }
.lk-bit-lock { font-weight: 650; }
.lk-bit-val { text-align: right; }
.lk-bit-val small { display: block; color: var(--text-secondary); font-size: 12px; }
.lk-pending { color: #b45309; font-weight: 650; }
body.dark .lk-pending { color: #fbbf24; }
.lk-tipline { padding: 6px 0 10px; border-bottom: 1px dashed var(--border); }
.lk-tipline:last-of-type { border-bottom: 0; }
.lk-tipline p { font-size: 14.5px; white-space: pre-line; }
.lk-tipline small { color: var(--text-secondary); font-size: 12px; }
.lk-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.lk-form .lk-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-primary); }
.lk-form .lk-check input { width: 20px; height: 20px; min-height: 0; }
.lk-form-error { padding: 10px 12px; border-radius: 10px; background: rgba(220, 38, 38, 0.1); color: #b91c1c; font-size: 14px; font-weight: 600; }
body.dark .lk-form-error { color: #fca5a5; }
.lk-fits-more { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 4px; }
.lk-fits-more > summary { cursor: pointer; padding: 10px 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-secondary); list-style: none; }
.lk-fits-more > summary::-webkit-details-marker { display: none; }
.lk-fits-more > summary::after { content: ' ▸'; }
.lk-fits-more[open] > summary::after { content: ' ▾'; }

/* ---------- locked cuts (not bought yet) ---------- */
.lk-locked { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; letter-spacing: 0; font-size: 13px; color: var(--accent); }
body.dark .lk-locked { color: var(--accent-light); }
.lk-unlock { display: grid; justify-items: center; gap: 10px; margin-top: 16px; }
.lk-unlock .lk-muted { max-width: 340px; font-size: 13px; }
.lk-unlock-cuts { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 40px)); gap: 5px; width: 100%; justify-content: center; }
.lk-unlock-cuts i { aspect-ratio: 4 / 5; border-radius: 8px; background: repeating-linear-gradient(135deg, var(--bg-secondary) 0 6px, var(--border) 6px 8px); }

/* ---------- database card (home) ---------- */
.lk-db-card {
  display: block; width: 100%; padding: 0; text-align: left; cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--lk-radius); box-shadow: var(--lk-shadow);
  color: inherit; font: inherit; overflow: hidden;
}
.lk-db-card:hover { border-color: var(--lk-accent-line); }
.lk-db-nums { display: grid; grid-template-columns: repeat(3, 1fr); }
.lk-db-nums > div { padding: 14px 8px 10px; text-align: center; border-left: 1px solid var(--border); min-width: 0; }
.lk-db-nums > div:first-child { border-left: 0; }
.lk-db-nums b { display: block; font-size: 20px; font-weight: 760; letter-spacing: -0.01em; }
.lk-db-nums span { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-secondary); }
.lk-db-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--border); background: var(--bg-secondary);
  font-size: 14px; font-weight: 650; color: var(--accent);
}
body.dark .lk-db-foot { color: var(--accent-light); }

/* ---------- database browser ---------- */
.lk-seg.lk-seg-3 { grid-template-columns: repeat(3, 1fr); }
.lk-seg.lk-seg-sm { margin: 0; }
.lk-seg.lk-seg-sm button { min-height: 36px; font-size: 13.5px; }
.lk-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.lk-tile {
  padding: 14px; border-radius: var(--lk-radius);
  background: var(--bg-surface); border: 1px solid var(--border); box-shadow: var(--lk-shadow);
}
.lk-tile b { display: block; font-size: 24px; font-weight: 780; letter-spacing: -0.02em; }
.lk-tile span { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.lk-coverage .lk-muted { margin-top: 6px; font-size: 13px; }
.lk-cov-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 650; }
.lk-cov-row b { font-size: 18px; }
.lk-bar-row .lk-row-main { display: grid; gap: 6px; }
.lk-bar { height: 6px; border-radius: 99px; background: var(--bg-secondary); overflow: hidden; }
.lk-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.lk-row-end b { color: var(--text-primary); }
.lk-row-end.is-ok { color: var(--success); font-weight: 650; }
.lk-mono { font-family: var(--lk-mono); }
.lk-row .lk-series-mark { width: 36px; height: 36px; border-radius: 10px; }
.lk-series-mark.is-muted { background: var(--lk-muted-soft); color: var(--text-secondary); }
.lk-filters { display: grid; gap: 8px; margin-bottom: 10px; }
.lk-filters .lk-search input { height: 46px; box-shadow: none; }
.lk-filters .lk-search-icon { top: 12px; }
.lk-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lk-filter-row select {
  width: 100%; height: 42px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-primary);
  font: inherit; font-size: 15px;
}
.lk-result-count { margin: 4px 2px 8px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.lk-ymm-year {
  flex: none; min-width: 52px; padding: 5px 0; text-align: center;
  border-radius: 8px; background: var(--lk-accent-soft); color: var(--accent);
  font-family: var(--lk-mono); font-size: 14px; font-weight: 750;
}
body.dark .lk-ymm-year { color: var(--accent-light); }
@media (max-width: 420px) { .lk-wide { display: none; } }

.lk-desktop-empty { display: none; }

/* ---------- tablet / desktop ---------- */
@media (min-width: 640px) {
  .lk-finder, .lk-main { padding-left: 24px; padding-right: 24px; }
  .lk-hero { margin-left: -24px; margin-right: -24px; padding: 36px 28px 72px; }
  .lk-topbar { margin-left: -24px; margin-right: -24px; }
  .lk-title { font-size: 32px; }
  .lk-sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(520px, calc(100vw - 48px)); max-height: min(720px, 86vh);
    border-radius: 20px;
    transform: translate(-50%, -46%); opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .lk-sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
  .lk-sheet-grip { display: none; }
  .lk-sheet-head { padding-top: 14px; }
  .lk-years { grid-template-columns: repeat(6, 1fr); }
  .lk-code-big { font-size: 56px; }
}

@media (min-width: 960px) {
  .lk { flex-direction: row; height: 100%; min-height: 0; }
  .lk-finder {
    display: block !important;
    flex: none; width: 400px; height: 100%; overflow-y: auto;
    border-right: 1px solid var(--border);
    padding-bottom: 96px; /* clear the app's bottom nav */
  }
  .lk-main { display: block !important; flex: 1; height: 100%; overflow-y: auto; padding: 16px 40px 110px; }
  .lk-main-inner { max-width: 760px; margin: 0 auto; }
  .lk-topbar { margin: -16px -40px 16px; padding: 10px 32px; }
  .lk-desktop-empty { display: grid; place-items: center; min-height: 70vh; text-align: center; color: var(--text-secondary); }
  .lk-desktop-empty svg { color: var(--border); margin-bottom: 16px; }
  .lk-desktop-empty h3 { color: var(--text-primary); font-size: 20px; margin-bottom: 6px; }
  .lk-series-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .lk-series-list .lk-series + .lk-series { margin-top: 0; }
  .screen-home .screen-content.lk-host { overflow: hidden; }
}

/* OCR verification: source picture + review flags (admin) */
.lk-srcpic-frame { overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; max-height: 70vh; }
.lk-srcpic-frame img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.lk-srcpic-frame.is-zoomed img { width: auto; max-width: none; cursor: zoom-out; }
.lk-flagged { border-color: #d97706; color: #b45309; }
.lk-review-list { display: flex; flex-direction: column; gap: 8px; }
.lk-review-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.lk-review-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: none; border: 0; padding: 4px 0; color: inherit; font: inherit; cursor: pointer; min-height: 44px; }
.lk-review-open small { font-weight: 400; opacity: .7; margin-left: 4px; }

/* ---------- home: global search + one-vehicle summary; key types (vehicle page too) ---------- */
.lk-search-main { margin-top: -44px; }
.lk-search-main input { box-shadow: var(--lk-shadow); }
.lk-section-title + .lk-picker { margin-top: 0; }
.lk-sr-group span { margin-left: 4px; font-weight: 600; opacity: 0.7; }
.lk-vsum { padding: 4px 12px 12px; border-top: 1px solid var(--border); background: var(--bg-body); }
.lk-vsum-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 2px 0; }
.lk-vsum-h b { font-size: 17px; }
.lk-vsum-h .lk-btn svg { width: 14px; height: 14px; }
.lk-vsum .lk-section-title { margin-top: 14px; }
.lk-types { padding: 0; overflow: hidden; }
.lk-type { border-top: 1px solid var(--border); }
.lk-type:first-child { border-top: 0; }
.lk-type > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.lk-type > summary::-webkit-details-marker { display: none; }
.lk-type > summary::before {
  content: ''; flex: none; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(-45deg); transition: transform 0.15s; opacity: 0.55;
}
.lk-type[open] > summary::before { transform: rotate(45deg); }
.lk-type-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lk-type-main b { font-size: 15px; }
.lk-type-main small { color: var(--text-secondary); font-size: 12.5px; line-height: 1.35; }
.lk-type-van { flex: none; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: rgba(220, 38, 38, 0.1); color: #b91c1c; }
.lk-type-van.has { background: var(--lk-ok-soft); color: inherit; }
.lk-type .lk-products { padding: 0 10px 12px; }
.lk-keys-sups { margin-bottom: 10px; }
.lk-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lk-chip.is-on small { color: inherit; opacity: 0.85; }
.lk-keys-status { margin-top: 10px; padding: 0; overflow: hidden; }
.lk-keys-status .lk-supplier-row + .lk-supplier-row { margin-top: 0; border-top: 1px solid var(--border); }
