/* ITS Roads CV2X: virtual hardware build-out (/build). Brand: navy, yellow, concrete paper; cyan only for text links. */
.bld-hero { padding: 26px 0 10px; }
.bld-hero h1 { margin-bottom: .3em; max-width: 26ch; }
.bld-hero .lede { max-width: 70ch; }
.wrap.wide { max-width: 1600px; }
.bld-tabs { margin-top: 10px; }
.bench { margin-bottom: 26px; }
.bench-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets .btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.presets .btn[aria-pressed="true"]:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.bench-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) and (max-width: 1239px) { .bench-grid { grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "bin board" "bin details"; } .bin { grid-area: bin; } .board-col { grid-area: board; } .details { grid-area: details; } }
@media (min-width: 1240px) { .bench-grid { grid-template-columns: 230px minmax(0, 1fr) 310px; } .bin, .details { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; } }
.card.flat { padding: 14px; }
.h3 { font-size: 1.25rem; margin-top: 0; }

/* parts bin */
.bin-cat { font-family: var(--font-display); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 12px 0 2px; }
.bin-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.bin-row:last-child { border-bottom: 0; }
.bin-row .ico { width: 26px; height: 26px; }
.bin-row .ico path { fill: none; stroke: var(--navy); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bin-row .nm { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.bin-row .ds { font-size: .78rem; color: var(--ink-3); line-height: 1.25; }
.bin-row .btn { min-height: 28px; padding: 4px 9px; font-size: .8rem; }
.bin-row .btn.added { opacity: .55; cursor: default; }

/* board */
.board { padding: 10px; }
.board-svg { width: 100%; height: auto; display: block; background: var(--paper); border-radius: 6px; touch-action: none; user-select: none; -webkit-user-select: none; font-family: var(--font-body); }
.board-svg:focus { outline: none; }
.board-note { margin: 8px 0 6px; }
.zones rect { fill: var(--paper-2); stroke: var(--line); stroke-width: 1; }
.zones text { fill: var(--ink-3); font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.lk { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.lk.ethernet { stroke: var(--navy-2); }
.lk.poe { stroke: var(--navy-2); stroke-width: 4.5; }
.lk.fiber { stroke: var(--yellow-deep); stroke-width: 3; stroke-dasharray: 12 5; }
.lk.cellular { stroke: var(--ink-3); stroke-dasharray: 1 6; stroke-width: 3; }
.lk.coax { stroke: var(--ink-2); stroke-width: 1.6; }
.lk.power { stroke: var(--err); stroke-dasharray: 7 4; }
.lk.can { stroke: var(--ok); stroke-width: 3.5; }
.lk.serial { stroke: var(--ink-3); stroke-dasharray: 3 4; stroke-width: 2; }
.lk.dashed { stroke-dasharray: 5 5; }
.lk-bg { fill: var(--paper); opacity: .92; }
.lk-t { font-size: 12px; fill: var(--ink-2); }
.part { cursor: grab; }
.part:active { cursor: grabbing; }
.part rect.box { fill: var(--card); stroke: var(--navy); stroke-width: 1.5; }
.part.sel rect.box, .part:focus rect.box { stroke: var(--yellow); stroke-width: 3.5; }
.part:focus { outline: none; }
.part .ico path { fill: none; stroke: var(--navy); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.part .t1 { font-size: 15px; font-weight: 700; fill: var(--ink); font-family: var(--font-display); }
.part .t2 { font-size: 12px; fill: var(--ink-2); }
.part .st { stroke: var(--card); stroke-width: 1.5; }
.part .st.ok { fill: var(--ok); }
.part .st.warn { fill: var(--warn); }
.part .st.fail { fill: var(--err); }
.part.inline rect.box { fill: var(--warn-bg); }
.part.inline .t1 { font-size: 12px; }
.empty-board { fill: var(--ink-3); font-size: 18px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .part .ico path, :root:not([data-theme="light"]) .bin-row .ico path { stroke: var(--accent-ink); } :root:not([data-theme="light"]) .part rect.box { stroke: var(--accent-ink); } :root:not([data-theme="light"]) .lk.ethernet, :root:not([data-theme="light"]) .lk.poe { stroke: var(--accent-ink); } }
:root[data-theme="dark"] .part .ico path, :root[data-theme="dark"] .bin-row .ico path { stroke: var(--accent-ink); }
:root[data-theme="dark"] .part rect.box { stroke: var(--accent-ink); }
:root[data-theme="dark"] .lk.ethernet, :root[data-theme="dark"] .lk.poe { stroke: var(--accent-ink); }

/* legend */
.legend-wrap { margin-top: 6px; }
.legend-wrap .legend { gap: 8px 14px; font-size: .82rem; }
.legend-wrap .legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-wrap .legend svg { width: 34px; height: 10px; }

/* details */
.details h3 { margin: 4px 0 2px; font-size: 1.15rem; }
.details .cat { font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-display); font-weight: 700; }
.det-sec { margin-top: 12px; }
.det-sec .sf-l { margin-bottom: 4px; }
.det-ul { margin: 0; padding-left: 18px; font-size: .88rem; }
.det-ul li { margin-bottom: 3px; }
.spec-tbl { font-size: .85rem; }
table.spec-tbl td.k { width: 36%; white-space: normal; }
.details .why { background: var(--paper-2); border-left: 4px solid var(--yellow); padding: 8px 10px; border-radius: 0 6px 6px 0; font-size: .9rem; margin-top: 12px; }
.det-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.det-opts .sf { margin-bottom: 8px; }
.det-opts .hint { font-size: .78rem; color: var(--ink-3); }
.det-opts input[type=number], .det-opts select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); max-width: 100%; }
.det-opts .sc { font-size: .88rem; }

/* system check */
.chk-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.chk { list-style: none; margin: 0; padding: 0; }
.chk li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: .88rem; }
.chk li:last-child { border-bottom: 0; }
.chk .d { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.chk .d.pass { background: var(--ok); }
.chk .d.warn { background: var(--warn); }
.chk .d.fail { background: var(--err); }
.chk .d.info { background: var(--ink-3); }
.chk .fix { display: block; color: var(--ink-2); font-size: .8rem; }
.chk .pl { display: inline; }
.chk button.pl { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; font-size: .8rem; cursor: pointer; text-decoration: underline; }
.stack-mini { margin-top: 14px; }
.stack-mini ol { margin: 4px 0 0; padding-left: 18px; font-size: .86rem; }

/* BOM */
.bom-card { margin-top: 14px; }
.bom-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.bom-tbl { font-size: .84rem; }
table.bom-tbl td.k { white-space: normal; width: auto; min-width: 220px; }
.bom-tbl .n { text-align: right; white-space: nowrap; }
.bom-tbl .if { display: block; font-size: .78rem; color: var(--ink-3); font-weight: 400; margin-top: 2px; }

/* CAN card */
.can-card { margin-top: 14px; }
.can-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .can-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .can-grid .can-full { grid-column: 1 / -1; } }
.can-tbl { font-size: .82rem; }
table.can-tbl td.k { white-space: normal; width: 22%; min-width: 150px; }
.can-tbl th, .can-tbl td { min-width: 120px; }
.j1962 { width: 100%; max-width: 360px; height: auto; display: block; margin: 4px 0 8px; }
.j1962 .j-body { fill: var(--paper-2); stroke: var(--navy); stroke-width: 2; }
.j1962 .pin { fill: var(--card); stroke: var(--ink-3); stroke-width: 1; }
.j1962 .pin.gnd, .sw.gnd { fill: #c9c7bf; background: #c9c7bf; }
.j1962 .pin.canh, .sw.canh { fill: #e9cb4e; background: #e9cb4e; }
.j1962 .pin.canl, .sw.canl { fill: #bfe3c3; background: #bfe3c3; }
.j1962 .pin.batt, .sw.batt { fill: #f6c3bf; background: #f6c3bf; }
.j1962 .j-pins text { font-size: 11px; text-anchor: middle; fill: #22231f; font-family: var(--font-mono); }
.j1962 .j-cap { font-size: 11px; text-anchor: middle; fill: var(--ink-3); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.2); }
.pin-tbl { font-size: .86rem; }
table.pin-tbl td.k { width: auto; }
.can-facts { padding-left: 18px; margin: 0; }
.can-facts li { margin-bottom: 4px; }
.bench-can { margin-top: 18px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.can-modes { margin: 10px 0; }
.can-bench-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .can-bench-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.can-stream-cap { margin-bottom: 4px; }
.can-stream { height: 200px; overflow: hidden; background: var(--code-bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; font-size: .78rem; line-height: 1.5; display: flex; flex-direction: column; justify-content: flex-end; }
.cf { display: grid; grid-template-columns: 34px 56px minmax(0, 1fr); gap: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf .dir { color: var(--ink-3); }
.cf.tx .dir { color: var(--err); font-weight: 700; }
.cf .id { color: var(--accent-ink); font-weight: 700; }
.cf .note { color: var(--ink-3); }
.cf.new { animation: cf-in .3s ease-out; }
@keyframes cf-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.can-inject { margin-top: 10px; }
.can-inject .btn-row { margin-top: 6px; }
.can-decoded { font-size: .84rem; }
table.can-decoded td.k { width: 42%; white-space: normal; }
.can-decoded td .on { color: var(--ok); font-weight: 700; }
.can-events { margin-top: 8px; padding: 8px 10px; background: var(--paper-2); border-radius: 6px; }
.hexout { margin-top: 8px; display: grid; gap: 6px; }
.hexout code.hex { display: block; word-break: break-all; font-size: .78rem; background: var(--code-bg); padding: 8px; border-radius: 6px; }

/* protocol stack */
.stack-card { margin-top: 10px; }
.ladder { display: grid; gap: 4px; margin: 12px 0; }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
@media (min-width: 760px) { .lrow { grid-template-columns: 130px minmax(0, 1.4fr) minmax(0, 1fr); } }
.lrow > div { padding: 10px 12px; background: var(--paper-2); border-radius: 6px; font-size: .9rem; }
.lrow .lk { font-family: var(--font-display); font-weight: 700; background: var(--navy); color: #fff; fill: none; }
.lrow.lhead > div { background: transparent; font-family: var(--font-display); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding-bottom: 2px; }
.lrow.lhead .lk { background: transparent; color: var(--ink-2); }
.stack-two { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
@media (min-width: 760px) { .stack-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.psid-tbl { font-size: .86rem; }
table.psid-tbl td.k { width: 40%; }
.bld-foot { margin: 18px 0 30px; }

/* print: the diagram, the bill of materials and the system check */
@media print {
  .top-strip, .site-header, .crumbs, .site-footer, .bld-tabs, .bench-top, .bin, .board-note, .legend-wrap, .bom-head .btn-row, .can-card, .stack-card, .bld-foot, #toast, .cookie-bar, .pending-notice, .det-remove { display: none !important; }
  .bench-grid { display: block; }
  .card.flat { box-shadow: none; border: 0; padding: 0; }
  .board-svg { max-height: 55vh; background: #fff; }
  .details, .bom-card { margin-top: 12px; page-break-inside: avoid; position: static; max-height: none; overflow: visible; }
  .bld-hero .small { display: none; }
}
