@font-face { font-family: "Archivo"; src: url(fonts/archivo.woff2) format("woff2"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "Inter"; src: url(fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: block; }

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #14171c;
  --muted: #5d6572;
  --line: #d9dde3;
  --accent: #0b3b6f;
  --accent-ink: #ffffff;
  --hover: #eef3f9;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--ink); color: #fff; padding: 22px 0 20px; }
.top h1 { font: 800 26px/1.1 Archivo, sans-serif; letter-spacing: .01em; margin: 0 0 4px; text-transform: uppercase; }
.top p { margin: 0; color: #b9c0cb; font-size: 15px; }

.pick { margin: 28px 0 20px; }
.field-label { display: block; font-weight: 700; margin-bottom: 8px; }
.combo { position: relative; }
#search {
  width: 100%; font: 600 20px/1.2 Inter, sans-serif; padding: 16px 18px;
  border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
#search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11,59,111,.15); }

#results {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px);
  list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 440px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(20,23,28,.14);
}
#results li { padding: 10px 12px; border-radius: 7px; cursor: pointer; display: grid; gap: 2px; }
#results li[aria-selected="true"], #results li:hover { background: var(--hover); }
#results .code { font: 700 17px/1.2 Archivo, sans-serif; letter-spacing: .01em; }
#results .desc { color: var(--muted); font-size: 14px; }
#results mark { background: #ffe58a; color: inherit; border-radius: 2px; }
#results .none { color: var(--muted); cursor: default; }

.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
kbd { font: 600 12px/1 Inter, sans-serif; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; background: #fff; }

.result { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; margin-bottom: 40px; }
.preview-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(20,23,28,.05); }
#preview { display: block; width: 100%; height: auto; aspect-ratio: 100 / 85; image-rendering: pixelated; outline: 1px dashed #c3c9d1; outline-offset: 0; }
.part-name { margin: 0 0 14px; font-weight: 600; }
.print {
  width: 100%; font: 800 22px/1 Archivo, sans-serif; text-transform: uppercase; letter-spacing: .03em;
  padding: 20px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.print:hover { filter: brightness(1.12); }
.print:focus-visible { outline: 3px solid #f2b705; outline-offset: 3px; }
.print[disabled] { opacity: .6; cursor: progress; }

.empty { color: var(--muted); text-align: center; padding: 40px 0; }

@media (max-width: 720px) {
  .result { grid-template-columns: 1fr; }
}
