/* art-volume: 3D models, parts catalogue, calculator */
.article > .car3d, .article > .parts, .article > .calc { max-width: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
	font: 500 14px/1.2 var(--font-ui); padding: 7px 12px; border: 1px solid var(--rule); background: var(--sheet);
	color: var(--ink); cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--sec); border-color: var(--sec); color: #fff; }

/* ---------- 3D ---------- */
.car3d { margin: 18px 0 8px; font-family: var(--font-ui); }
.car3d__tabs { margin-bottom: 10px; }
.car3d__stage {
	position: relative; height: clamp(300px, 52vw, 520px); border: 1px solid var(--rule);
	background: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #eef1f3 60%, #dfe4e8 100%);
}
.car3d__stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.car3d__stage canvas:active { cursor: grabbing; }
.car3d__hint { position: absolute; left: 12px; bottom: 10px; font-size: 12.5px; color: var(--ink-soft); pointer-events: none; }
.car3d__nogl { display: none; padding: 40px 20px; text-align: center; color: var(--ink-soft); }
.car3d--nogl canvas, .car3d--nogl .car3d__hint { display: none; }
.car3d--nogl .car3d__nogl { display: block; }
.car3d__bar { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 10px 0 14px; }
.car3d__label { font-size: 13px; color: var(--ink-soft); margin-right: 6px; }
.car3d__swatches { display: inline-flex; gap: 6px; vertical-align: middle; }
.car3d__swatch { width: 24px; height: 24px; border: 2px solid #fff; outline: 1px solid var(--rule); cursor: pointer; padding: 0; }
.car3d__swatch:hover { outline-color: var(--ink); }
.car3d__specs { max-width: 560px !important; }

/* ---------- Parts catalogue ---------- */
.parts { margin-top: 18px; font-family: var(--font-ui); }
.parts__search { display: flex; gap: 8px; margin-bottom: 14px; }
.parts__search input {
	flex: 1; font: 15px var(--font-ui); padding: 9px 12px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink);
}
.parts__search input:focus { outline: 3px solid var(--sec); outline-offset: 0; }
.parts__layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.parts__tree { border: 1px solid var(--rule); background: var(--sheet); font-size: 14.5px; }
.parts__tree details { border-bottom: 1px solid var(--rule); }
.parts__tree details:last-child { border-bottom: 0; }
.parts__tree summary { cursor: pointer; padding: 10px 12px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.parts__tree summary::-webkit-details-marker { display: none; }
.parts__tree summary::after { content: "+"; color: var(--sec); font-weight: 700; }
.parts__tree details[open] > summary::after { content: "–"; }
.parts__tree details[open] > summary { background: var(--paper); }
.parts__tree ul { list-style: none; margin: 0 !important; padding: 4px 0 8px !important; }
.parts__tree li { margin: 0 !important; }
.parts__tree button {
	display: block; width: 100%; text-align: left; font: 14px/1.35 var(--font-ui); color: var(--ink); background: none; border: 0;
	padding: 7px 12px 7px 24px; cursor: pointer; border-left: 3px solid transparent;
}
.parts__tree button:hover { background: var(--paper); }
.parts__tree button[aria-current="true"] { border-left-color: var(--sec); color: var(--sec); font-weight: 600; background: var(--paper); }
.parts__tree .parts__count { color: var(--ink-soft); font-weight: 400; font-size: 12.5px; }
.parts__panel { min-width: 0; }
.parts__head { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.parts__sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 12px; }
.parts__scheme { border: 1px solid var(--rule); background: #fbfcfc; margin-bottom: 14px; }
.parts__scheme svg { display: block; width: 100%; height: auto; max-height: 360px; }
.parts__scheme .sch-line { fill: none; stroke: #5b6670; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.parts__scheme .sch-fill { fill: #e9edf0; stroke: #5b6670; stroke-width: 2; }
.parts__scheme .sch-thin { fill: none; stroke: #9aa5ae; stroke-width: 1.4; stroke-dasharray: 5 4; }
.parts__scheme .sch-txt { font: 12px var(--font-ui); fill: #7a858e; }
.parts__scheme .co line { stroke: var(--sec); stroke-width: 1.5; }
.parts__scheme .co circle { fill: #fff; stroke: var(--sec); stroke-width: 2; transition: fill .15s; }
.parts__scheme .co text { font: 700 13px var(--font-ui); fill: var(--sec); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.parts__scheme .co { cursor: pointer; }
.parts__scheme .co.is-hot circle { fill: var(--sec); }
.parts__scheme .co.is-hot text { fill: #fff; }
.parts table tr.is-hot td { background: #e6f3f3 !important; }
.parts .oem { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13.5px; white-space: nowrap; }
.parts .oem-alt { display: block; color: var(--ink-soft); font-size: 12.5px; font-family: var(--font-ui); white-space: normal; }
.parts__copy { font: 12px var(--font-ui); border: 1px solid var(--rule); background: var(--sheet); padding: 2px 6px; margin-left: 6px; cursor: pointer; color: var(--ink-soft); }
.parts__copy:hover { border-color: var(--ink); color: var(--ink); }
.parts__results { margin-bottom: 14px; }
.parts__empty { color: var(--ink-soft); }
@media (max-width: 900px) { .parts__layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Calculator ---------- */
body.section-calculator { --sec: #6b4fa3; }
.nav-top__item[data-section="calculator"], .index-tab[data-section="calculator"] { --tab: #6b4fa3; }
.calc { font-family: var(--font-ui); margin-top: 14px; }
.calc__tabs { margin-bottom: 14px; }
.calc__card { border: 1px solid var(--rule); background: var(--sheet); padding: 18px 20px; margin-bottom: 18px; }
.calc__card h2 { margin-top: 0 !important; }
.calc__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.calc__field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.calc__field input, .calc__field select {
	font: 16px var(--font-ui); padding: 8px 10px; border: 1px solid var(--rule); background: #fff; color: var(--ink); min-width: 0; width: 100%;
}
.calc__field input:focus, .calc__field select:focus { outline: 3px solid var(--sec); outline-offset: 0; }
.calc__swap { font: 600 18px var(--font-ui); border: 1px solid var(--rule); background: var(--paper); padding: 6px 12px; cursor: pointer; height: 40px; }
.calc__swap:hover { border-color: var(--ink); }
.calc__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.calc__row .calc__field { flex: 1 1 160px; }
.calc__out { margin-top: 14px; font-size: 15px; }
.calc__big { font-size: 24px; font-weight: 700; color: var(--sec); word-break: break-word; }
.calc__all { margin-top: 12px; font-size: 14px; }
.calc__all td:last-child { font-variant-numeric: tabular-nums; }
.calc__note { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
@media (max-width: 640px) { .calc__grid { grid-template-columns: minmax(0, 1fr); } .calc__swap { justify-self: start; } }

/* ---------- Visit statistics ---------- */
.site-stats { display: flex; flex-direction: column; gap: 2px; }
.site-stats b { color: var(--ink); font-weight: 600; }

/* ---------- network setup from scratch ---------- */
.article > .ns { max-width: none; }
.ns > p, .ns > ul, .ns > ol.ns-fix, .ns-step > p { max-width: var(--measure); }
.ns-nav { margin: 4px 0 18px; }
.ns-nav .chip { text-decoration: none; }
.ns-steps { counter-reset: ns; list-style: none; padding: 0; margin: 1.2em 0; }
.ns-step { counter-increment: ns; position: relative; padding-left: 46px; margin: 0 0 1.8em; }
.ns-step::before { content: counter(ns); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--sec); color: #fff; font: 600 15px/32px var(--font-ui); text-align: center; }
.ns-step h3 { margin: .25em 0 .4em; }
.ns-code { position: relative; margin: .6em 0 0; }
.ns-code pre { background: #1e2329; color: #e3e6ea; padding: 38px 16px 14px; border-radius: 4px; overflow: auto; margin: 0; white-space: pre; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.ns-code pre code { background: none; border: 0; color: inherit; padding: 0; font: inherit; }
.ns-copy { position: absolute; top: 7px; right: 7px; font: 500 12px var(--font-ui); padding: 4px 10px; border: 1px solid #55606b; background: #2c333b; color: #e3e6ea; border-radius: 3px; cursor: pointer; }
.ns-copy:hover { background: #3a434d; }
.ns-note { border-left: 4px solid var(--sec); background: var(--paper); padding: 10px 14px; margin: 1em 0; }
.ns-fix li { margin: .4em 0; }
.ns-diagram { margin: 1em 0 1.4em; max-width: 720px; border: 1px solid var(--rule); background: var(--sheet); padding: 8px; }
.ns-diagram svg { width: 100%; height: auto; display: block; }
.ns-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 1em 0 1.6em; }
.ns-card { display: block; border: 1px solid var(--rule); border-top: 4px solid var(--sec); padding: 12px 14px; text-decoration: none; color: var(--ink); background: var(--sheet); font-family: var(--font-ui); }
.ns-card:hover { background: var(--paper); }
.ns-card strong { display: block; margin-bottom: 4px; }
.ns-card span { font-size: 14px; color: var(--ink-soft); line-height: 1.4; }
.side__sub .side__sub .side__link { padding-left: 44px; font-size: 13.5px; }

@media (max-width: 600px) { .ns-step { padding-left: 0; } .ns-step::before { position: static; display: inline-block; margin-bottom: 4px; } }

/* ---------- auto tuning ---------- */
.tu-table { overflow-x: auto; margin: .6em 0; max-width: 100%; }
.tu-table table { margin: 0; }
.tu-fig { max-width: 760px; }
.tu-fig figcaption { font: 13px/1.4 var(--font-ui); color: var(--ink-soft); margin-top: 6px; }
.tu .ns-nav .chip { font-size: 13.5px; }
