/* Repair page */
.repair-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.ctrl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ctrl-chip { border: 1px solid var(--line-strong); background: var(--bg); color: var(--text-2); border-radius: 999px; padding: 8px 14px; font: 600 14px var(--font); cursor: pointer; }
.ctrl-chip:hover { color: var(--text); }
.ctrl-chip[aria-pressed="true"] { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.repair-3d { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .repair-3d { grid-template-columns: minmax(0, 1fr); } }
.viewer { position: relative; width: 100%; height: clamp(320px, 52vw, 560px); border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--bg); border: 1px solid var(--line); touch-action: none; }
.viewer canvas { display: block; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; padding: 20px; text-align: center; }
.viewer-tip { position: absolute; pointer-events: none; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.viewer-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.viewer-tools .explode { flex: 1; min-width: 180px; margin: 0; }
.part-panel { position: sticky; top: calc(var(--header-h) + 16px); }
.part-panel h3 { margin: 0; }
.symptoms { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.part-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.part-chips .chip { cursor: pointer; font-family: inherit; }
.guide-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--text); cursor: pointer; font: inherit; }
.guide-link:hover { border-color: var(--accent); }
.guide-link > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.guide-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
ul.tick { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
ul.tick li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 8px; }
.g-steps { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 14px; }
.g-step { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
@media (max-width: 700px) { .g-step { grid-template-columns: minmax(0, 1fr); } }
.g-step h3 { margin: 2px 0 6px; }
.g-step p { margin: 0; color: var(--text-2); }
.g-n { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ill-box { border-radius: 12px; background: var(--bg); border: 1px solid var(--line); padding: 6px; }
svg.ill { display: block; width: 100%; height: auto; }
.ill .il-body { fill: var(--panel-2); stroke: var(--line-strong); stroke-width: 2; }
.ill .il-part { fill: color-mix(in srgb, var(--muted) 35%, transparent); stroke: var(--text-2); stroke-width: 1.5; }
.ill .il-line { fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linecap: round; }
.ill .il-acc { fill: color-mix(in srgb, var(--accent) 45%, transparent); stroke: var(--accent); stroke-width: 2; }
.ill .il-acc-f { fill: var(--accent); }
.ill .il-acc-s { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.ill .il-arrow { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.ill .il-hot-s { fill: none; stroke: var(--warn); stroke-width: 3; stroke-linecap: round; }
.ill .il-bad-s { fill: none; stroke: var(--bad); stroke-width: 3; stroke-linecap: round; }
.ill .il-ok-s { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.ill .il-board { stroke: #1f7a4d; stroke-width: 8; stroke-linecap: round; }
.ill .il-board-f { fill: #1f7a4d; opacity: .75; }
.ill .il-pin { stroke: #c0c7d2; stroke-width: 3; stroke-linecap: round; }
.ill .il-solder { fill: #d7dde6; stroke: #9aa4b2; stroke-width: 1.5; }
.ill .il-gold { fill: #e7b84a; }
.ill .il-gold-s { stroke: #e7b84a; stroke-width: 2; }
.ill .il-iron { stroke: var(--text-2); stroke-width: 9; stroke-linecap: round; }
.ill .il-wick { stroke: #d08a3a; stroke-width: 7; stroke-linecap: round; }
.ill .il-wire { fill: none; stroke: #ef4444; stroke-width: 3; }
.ill .il-wire + .il-wire { stroke: var(--text-2); }
.ill .il-ribbon { fill: #d98a2b; opacity: .85; }
.ill .il-rubber { fill: color-mix(in srgb, var(--muted) 30%, transparent); stroke: var(--muted); stroke-width: 3; }
.ill .il-carbon { fill: #111827; }
.ill .il-spring { fill: none; stroke: var(--accent); stroke-width: 3; }
.ill .il-corr { fill: #9ad6b2; opacity: .9; }
.ill .il-brush { stroke: var(--warn); stroke-width: 8; stroke-linecap: round; }
.ill .il-t { fill: var(--text-2); font: 600 12px var(--font); }
.ill .il-ok-t { fill: var(--ok); font: 700 12px var(--font); }
.ill .il-bad-t { fill: var(--bad); font: 700 12px var(--font); }

.viewer-note { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); font-size: 13px; color: var(--text-2); }
/* simple 2D diagram */
.viewer.d2-host { display: grid; place-items: center; }
.d2-wrap { width: 100%; max-width: 780px; padding: 8px 12px; }
svg.d2 { display: block; width: 100%; height: auto; overflow: visible; }
.d2 .hs { cursor: pointer; transition: fill .15s, stroke .15s, filter .2s, opacity .3s; }
.d2 .d2-hit, .d2 .d2-shell { fill: transparent; stroke: transparent; stroke-width: 3; }
.d2 .hs.hover.d2-hit, .d2 .hs.hover.d2-shell { fill: color-mix(in srgb, var(--neon-violet) 20%, transparent); stroke: var(--neon-violet); filter: drop-shadow(0 0 8px var(--neon-violet)); }
.d2 .hs.sel.d2-hit, .d2 .hs.sel.d2-shell { fill: color-mix(in srgb, var(--neon-cyan) 22%, transparent); stroke: var(--neon-cyan); filter: drop-shadow(0 0 12px var(--neon-cyan)); }
.d2 .d2-inner { opacity: 0; pointer-events: none; transition: opacity .4s; }
.d2.inside .d2-inner { opacity: 1; pointer-events: auto; }
.d2 .d2-top .hs { pointer-events: auto; }
.d2.inside .pad-btn, .d2.inside .pad-well, .d2.inside .pad-gate, .d2.inside .pad-face, .d2.inside .pad-lbl, .d2.inside .pad-capdot, .d2.inside .pad-fill, .d2.inside .pad-touch { opacity: .16; }
.d2.inside .pad-body { fill-opacity: .25; }
.d2 .d2-pcb { fill: #1f7a4d; fill-opacity: .8; stroke: #34d399; stroke-width: 2; }
.d2 .d2-batt { fill: #3b82f6; fill-opacity: .85; stroke: #93c5fd; stroke-width: 2; }
.d2 .d2-motor { fill: #a7b0bd; stroke: #e5e7eb; stroke-width: 1.5; }
.d2 .d2-weight { fill: #6b7280; }
.d2 .d2-ribbon { fill: none; stroke: #d98a2b; stroke-width: 9; stroke-linecap: round; }
.d2 .d2-port { fill: #b8c0cc; stroke: #6b7280; stroke-width: 2; }
.d2 .d2-lbl { fill: var(--text-2); font: 700 12px var(--font); pointer-events: none; }
.d2 .d2-batt + .d2-lbl { fill: #fff; }
.d2 .hs.hover:not(.d2-hit):not(.d2-shell) { filter: drop-shadow(0 0 8px var(--neon-violet)) brightness(1.15); }
.d2 .hs.sel:not(.d2-hit):not(.d2-shell) { filter: drop-shadow(0 0 12px var(--neon-cyan)) brightness(1.25); }
