:root {
  --bg: #0f1116;
  --panel: #171a21;
  --panel2: #1d2129;
  --line: #2a2f3a;
  --fg: #e6e9ef;
  --dim: #8b94a7;
  --accent: #4da3ff;
  --key: #ffd166;
  --warn: #ffb347;
  --err: #ff6b6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* header */
header {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 14px 0; position: sticky; top: 0; z-index: 20;
}
header .wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
h1 { font-size: 17px; margin: 0; white-space: nowrap; }
h1 a { color: var(--fg); }
h1 span { color: var(--dim); font-weight: 400; }
header form { display: flex; gap: 8px; flex: 1; min-width: 320px; }
.combo { position: relative; flex: 1; }
input[type=search] {
  width: 100%; padding: 10px 12px; font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px;
}
input[type=search]:focus { outline: none; border-color: var(--accent); }
button {
  padding: 10px 18px; font-size: 15px; cursor: pointer;
  background: var(--accent); color: #07121f; border: 0; border-radius: 6px;
  font-weight: 600;
}
button:hover { filter: brightness(1.1); }

/* autocomplete */
.ac {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  margin: 0; padding: 4px; list-style: none; max-height: 340px; overflow-y: auto;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 30;
}
.ac li {
  padding: 7px 10px; border-radius: 4px; cursor: pointer;
  display: flex; gap: 10px; align-items: center;
}
.ac li:hover, .ac li[aria-selected=true] { background: #2a3140; }
.ac .pn { font-family: ui-monospace, Menlo, Consolas, monospace; }
.ac .meta { color: var(--dim); font-size: 12px; margin-left: auto; }

main { padding: 24px 0 40px; }

/* notices */
.note, .err {
  padding: 12px 14px; border-radius: 6px; margin-bottom: 18px;
  background: var(--panel); border: 1px solid var(--line);
}
.note.warn { border-color: var(--warn); color: var(--warn); }
.err { border-color: var(--err); color: var(--err); }
.count { margin-bottom: 14px; color: var(--dim); }
.dim { color: var(--dim); }
.tiny { font-size: 12px; }
.sep { margin: 0 6px; }

/* assembly card */
.asm {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 18px; margin-bottom: 22px;
}
.asm-head { margin-bottom: 14px; }
.asm-head .src { margin-top: 4px; font-size: 12px; }
.acr {
  display: inline-block; padding: 2px 9px; margin-right: 8px;
  background: var(--accent); color: #07121f;
  border-radius: 4px; font-weight: 700; font-size: 13px;
  text-decoration: none;
}
a.acr:hover { filter: brightness(1.15); text-decoration: none; }
.pn { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pn.big { font-size: 19px; font-weight: 600; }

/* split part-number links: family base + exact variant suffix.
   The base is visually distinguished by a dotted underline so it is obvious
   the two halves of one part number go to different searches. */
a.fam {
  color: var(--accent);
  border-bottom: 1px dotted currentColor;
  text-decoration: none;
}
a.fam:hover { background: rgba(77,163,255,.14); text-decoration: none; }
a.var { color: var(--fg); text-decoration: none; }
a.var:hover { color: var(--accent); text-decoration: underline; }
.pn.big a.fam, .pn.big a.var { font-weight: 600; }

/* family listing: full part numbers, each one a single link to its exact search */
.fam-table td.pn a.var { color: var(--accent); font-weight: 600; }
.fam-table td.pn a.var:hover { text-decoration: underline; }

/* module / platform listing */
.mod-table td.num { font-variant-numeric: tabular-nums; }
.mod-table td.pn a.var, .mod-table a.var { color: var(--accent); font-weight: 600; }
.mod-table a.var:hover { text-decoration: underline; }

/* checksum / fingerprint listing.
   Part numbers and the two hex columns must never wrap: a wrapped checksum is
   unreadable and a wrapped part number reads as two different numbers. The
   table scrolls horizontally instead (.scroll), and the description under the
   part number is allowed to wrap because it is prose. */
.cks-table td.pn a.var { color: var(--accent); font-weight: 600; }
.cks-table td.pn a.var:hover { text-decoration: underline; }
.cks-table td.pn, .cks-table td.mono, .cks-table td.num { white-space: nowrap; }
.cks-table td.pn .tiny { white-space: normal; max-width: 190px; }
.cks-table td.mono a { color: var(--fg); text-decoration: none; }
.cks-table td.mono a:hover { color: var(--accent); text-decoration: underline; }
.cks-table td.veh { min-width: 150px; max-width: 260px; }
.cks-table th, .cks-table td { padding: 7px 9px; }
.cks-table td.num { font-variant-numeric: tabular-nums; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px; padding: 14px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px;
}
dt { color: var(--dim); font-size: 11px; text-transform: uppercase;
     letter-spacing: .04em; margin-bottom: 3px; }
dd { margin: 0; }

h3 { font-size: 14px; margin: 20px 0 8px; text-transform: uppercase;
     letter-spacing: .04em; color: var(--dim); }

/* tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
         vertical-align: top; }
th { color: var(--dim); font-size: 11px; text-transform: uppercase;
     letter-spacing: .04em; font-weight: 600; }
tbody tr:hover { background: var(--panel2); }
tbody tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.fp { max-width: 300px; word-break: break-all; color: var(--dim); }
tr.nested { background: rgba(255,255,255,.02); }

/* security bytes */
.sec td.key {
  color: var(--key); font-size: 15px; font-weight: 600; letter-spacing: .08em;
}
.sec { max-width: 460px; }

/* badges */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.b-strategy { background: #1d3f63; color: #8fc6ff; }
.b-calib    { background: #1f4536; color: #7fd8a8; }
.b-boot     { background: #4a3317; color: #f0bf7f; }
.b-config   { background: #3b2a50; color: #c4a2f0; }
.b-other    { background: #30353f; color: #b6bdcc; }
.m-assembly { background: #1d3f63; color: #8fc6ff; }
.m-hardware { background: #1f4536; color: #7fd8a8; }
.m-software { background: #4a3317; color: #f0bf7f; }

/* intro */
.intro { background: var(--panel); border: 1px solid var(--line);
         border-radius: 8px; padding: 22px; }
.intro h2 { margin-top: 0; font-size: 20px; }
.intro pre { background: var(--bg); border: 1px solid var(--line);
             border-radius: 6px; padding: 12px; overflow-x: auto; font-size: 13px; }

footer { padding: 18px 0 30px; font-size: 12.5px;
         border-top: 1px solid var(--line); margin-top: 10px; }

@media (max-width: 680px) {
  header .wrap { flex-direction: column; align-items: stretch; }
  header form { min-width: 0; }
  .fp { display: none; }
}

/* download / local-library cell */
.dl-cell { white-space: nowrap; }
.lib { font-size: 12px; font-weight: 600; margin-left: 8px; }
.lib.ok   { color: #7fd8a8; }
.lib.bad  { color: var(--err); }
.lib.meh  { color: var(--dim); }
.lib.dim  { color: #6b7280; }
.tiny.bad { color: var(--err); }

.dlbtn, .bundlebtn {
  display: inline-block; padding: 3px 11px; font-size: 12px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  background: #2a3140; color: var(--fg);
  border: 1px solid var(--line); border-radius: 4px;
}
.dlbtn:hover, .bundlebtn:hover { background: var(--accent); color: #07121f; }
.dlbtn.busy, .bundlebtn.busy { opacity: .6; pointer-events: none; }
.bundlebtn { margin-left: 12px; font-weight: 500; }

.ver { white-space: nowrap; }

/* compact assembly list, used instead of cards for large result sets */
.asmlist {
  width: 100%; border-collapse: collapse; margin: 0 0 24px;
  font-size: 13px;
}
.asmlist thead th {
  text-align: left; font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--dim); font-weight: 600;
  padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.asmlist thead th.num { text-align: right; }
.asmlist td { padding: 6px 10px; border-bottom: 1px solid #1b1f28; }
.asmlist td.num { text-align: right; font-variant-numeric: tabular-nums; }
.asmlist td.nowrap { white-space: nowrap; }
.asmlist tbody tr:hover { background: rgba(255,255,255,.03); }
.asmlist .acr { margin-right: 0; font-size: 11px; padding: 1px 7px; }
.viewtoggle { margin-left: 10px; }
.viewtoggle a { color: var(--accent); font-size: 12px; }

/* vehicle -> year -> module picker on the landing page */
.browse { margin: 0 0 28px; }
.bstep { margin-bottom: 18px; }
.bstep h2 {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); font-weight: 600; margin: 0 0 8px;
}
.bstep h2 .dim { text-transform: none; letter-spacing: 0; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 5px;
  background: #171a21; color: var(--fg);
  text-decoration: none; font-size: 13px; line-height: 1.2;
}
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip.on { background: var(--accent); color: #07121f; border-color: var(--accent); }
.chip .cnote { font-size: 11px; color: var(--dim); }
.chip.on .cnote { color: #07121f; opacity: .7; }

/* card title: clickable, but styled as a heading rather than a link */
.titlepn { color: var(--fg); text-decoration: none; }
.titlepn:hover { color: var(--accent); text-decoration: none; }

/* ------------------------------------------------------------------- ffdata */
/* Tab bar. The two databases are separate concerns, so the nav crosses
   between them explicitly rather than pretending it is one dataset. */
.tabs { display: flex; gap: 2px; align-items: center; }
.tabs a {
  padding: 7px 13px; border-radius: 5px; font-size: 13.5px;
  color: var(--dim); text-decoration: none; white-space: nowrap;
}
.tabs a:hover { background: var(--panel2); color: var(--fg); text-decoration: none; }
.tabs a.on { background: var(--panel2); color: var(--fg); font-weight: 600;
             box-shadow: inset 0 -2px 0 var(--accent); }
.tabs a.xapp { margin-left: 10px; color: var(--accent); font-size: 12.5px; }

/* kind badges — deliberately NOT reusing the part-type palette, so a
   "decoded" claim here is never mistaken for a part-database fact */
.k-dtc    { background: #4a1f1f; color: #ff9d9d; }
.k-prompt { background: #3b2a50; color: #c4a2f0; }
.k-ident  { background: #1d3f63; color: #8fc6ff; }
.k-label  { background: #30353f; color: #b6bdcc; }

.facets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
          margin-bottom: 14px; }
.flabel { font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
          color: var(--dim); margin-right: 4px; }
.chip.mini { padding: 1px 7px; font-size: 11.5px; }

/* long display strings need to wrap; symbol names must not */
.ff td.txt { max-width: 720px; white-space: pre-wrap; word-break: break-word; }
.ff td.mono { font-family: ui-monospace, Menlo, Consolas, monospace;
              white-space: nowrap; }
.ff tr.hl { background: rgba(77,163,255,.09); }
.sig { color: var(--key); }

/* namespace grid */
.nsgrid { display: grid; gap: 8px;
          grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ns {
  display: block; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); text-decoration: none;
  color: var(--fg); overflow: hidden;
}
.ns:hover { border-color: var(--accent); text-decoration: none; }
.nsname { font-weight: 600; font-size: 14px; }
.nscount { float: right; color: var(--dim); font-size: 12px;
           font-variant-numeric: tabular-nums; }
.nssample { display: block; margin-top: 3px; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis; }

.whatis { margin: 16px 0; }
.whatis td { vertical-align: middle; }
