/* Chapter 05 — 실습 랩 A: 타이어 탈착 · 튜브리스 실런트 · 체인 주유 · 브레이크 패드
   All selectors are prefixed with .lab- to stay clear of repair.css / repair-labs-b.css */

/* ---------- Shared lab chrome ---------- */
.lab { position: relative; }
.prose .lab h3 { margin-top: 0; }
.prose .lab h4 { margin: 0 0 .3em; }
.prose .lab ul, .prose .lab ol { padding-left: 0; margin: 0; }
.prose .lab li { margin: 0; }
.lab .mt { margin-top: 18px; }
.lab-intro { font-size: .93rem; margin: -6px 0 18px; color: var(--ink-2); }
.lab-small { font-size: .82rem; color: var(--muted); line-height: 1.55; margin: 8px 0 0; }
.lab-hint { font-size: .78rem; color: var(--muted); margin: 8px 2px 0; line-height: 1.45; }

.lab-pill { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: .84rem; white-space: nowrap; background: var(--bg-2); color: var(--ink-2); font-family: var(--mono); line-height: 1.3; }
.lab-pill[data-tone="ok"] { background: var(--green-soft); color: var(--green); }
.lab-pill[data-tone="warn"] { background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 72%, var(--ink)); }
.lab-pill[data-tone="bad"] { background: var(--red-soft); color: var(--red); }

.lab-status { margin: 14px 0 0; padding: 12px 14px 12px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--blue); font-size: .93rem; line-height: 1.6; min-height: 3.6em; transition: background .25s, border-color .25s; }
.prose .lab .lab-status { color: var(--ink-2); margin-bottom: 0; }
.lab-status[data-tone="ok"] { border-left-color: var(--green); background: color-mix(in srgb, var(--green-soft) 55%, var(--surface-2)); }
.lab-status[data-tone="warn"] { border-left-color: var(--gold); background: color-mix(in srgb, var(--gold-soft) 55%, var(--surface-2)); }
.lab-status[data-tone="bad"] { border-left-color: var(--red); background: color-mix(in srgb, var(--red-soft) 60%, var(--surface-2)); }

.lab-stage { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.lab-svg { width: 100%; height: auto; display: block; -webkit-user-select: none; user-select: none; overflow: visible; }
.lab-sub { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.lab-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 700px) { .lab-two { grid-template-columns: 1fr; } }

.lab-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-actions .btn { white-space: normal; text-align: left; line-height: 1.35; touch-action: manipulation; }
.lab .btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.lab .btn.lab-wrong { border: 1px dashed var(--red); color: var(--red); background: transparent; }
.lab .btn.lab-wrong::before { content: "✕"; font-weight: 800; }
.lab .btn.lab-mis { background: transparent; color: var(--ink); border: 1px dashed var(--line-2); }
.lab .btn.lab-mis:hover { border-color: var(--red); color: var(--red); }

.lab-track { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.lab-dot { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); font: 600 .78rem var(--mono); color: var(--muted); display: inline-grid; place-items: center; transition: background .2s, color .2s, border-color .2s; }
.lab-dot:hover { border-color: var(--ink); color: var(--ink); }
.lab-dot.is-done { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.lab-dot[aria-current="step"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.lab-dot.is-done[aria-current="step"] { box-shadow: 0 0 0 3px var(--green-soft); }

.lab-panel { margin-top: 16px; }
.lab-kicker { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; color: var(--accent-ink); margin: 0 0 2px; }
.prose .lab .lab-kicker { color: var(--accent-ink); margin-bottom: 2px; }
.lab-step-title { font-size: 1.15rem; outline: none; }
.lab-step-desc { font-size: .93rem; margin: 0 0 12px; }
.prose .lab .lab-step-desc { margin-bottom: 12px; }

.lab-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.lab-spacer { flex: 1 1 auto; }
.lab-meta { font-size: .78rem; color: var(--muted); }
.lab-switch { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 700; color: var(--ink-2); cursor: pointer; padding: 6px 4px; }
.lab-switch input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); }

.lab-field { margin: 14px 0 8px; }
.lab-field label { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* fx word pop ("펑!", "쉬익~") */
.lab-fx { fill: var(--accent-ink); font-family: var(--serif); font-weight: 800; font-size: 34px; opacity: 0; paint-order: stroke; stroke: var(--surface); stroke-width: 6px; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.lab-fx.is-on { animation: labFx 1.2s ease-out forwards; }
@keyframes labFx { 0% { opacity: 0; transform: translateY(8px) scale(.85); } 18% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.lab-shake { animation: labShake .45s; }
@keyframes labShake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* SVG text */
.lab-t { fill: var(--ink-2); font-family: var(--font); font-weight: 700; font-size: 18px; }
.lab-t-sm { font-size: 13px; }
.lab-t-xs { font-size: 12px; font-family: var(--mono); font-weight: 600; }
.lab-t-muted { fill: var(--muted); }

/* ---------- Lab 1: tire ---------- */
.lab-spoke { stroke: var(--line-2); stroke-width: 1.5; }
.lab-hub { fill: var(--ink-2); }
.lab-rimring { fill: none; stroke: var(--muted); stroke-width: 8; }
.lab-tirering { fill: none; stroke: var(--ink); stroke-width: 17; }
.lab-push { fill: none; stroke: var(--teal); stroke-width: 18; opacity: 0; transition: opacity .35s; }
.lab-push.is-on { opacity: .6; }
.lab-beadoff { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.lab-valve { fill: var(--ink); }
.lab-valve-nut { fill: var(--gold); }
.lab-lever { fill: var(--accent); stroke: var(--accent-ink); stroke-width: 1.5; }
.lab-seg { fill: transparent; stroke: none; pointer-events: none; outline: none; }
.lab-segs.is-on .lab-seg { pointer-events: all; cursor: pointer; fill: color-mix(in srgb, var(--blue) 8%, transparent); stroke: var(--blue); stroke-opacity: .45; stroke-width: 1; transition: fill .2s; }
.lab-segs.is-on .lab-seg:hover { fill: color-mix(in srgb, var(--blue) 28%, transparent); }
.lab-segs.is-on .lab-seg:focus-visible { stroke: var(--accent); stroke-opacity: 1; stroke-width: 3; fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.lab-segs.is-on .lab-seg.is-clean { fill: color-mix(in srgb, var(--green) 26%, transparent); }
.lab-segs.is-on .lab-seg.is-hint { stroke: var(--accent); stroke-opacity: 1; stroke-width: 3; stroke-dasharray: 5 4; }
.lab-segs.is-on .lab-seg.is-found { fill: color-mix(in srgb, var(--red) 38%, transparent); stroke: var(--red); stroke-opacity: 1; }
.lab-thorn { fill: var(--red); stroke: var(--surface); stroke-width: 1.5; }
.lab-pinch { fill: var(--teal); stroke: var(--red); stroke-width: 2.5; }
.lab-rimsec { fill: var(--surface); stroke: var(--ink-2); stroke-width: 3; stroke-linejoin: round; }
.lab-casing { fill: none; stroke: var(--ink); stroke-width: 10; stroke-linecap: round; }
.lab-bead { fill: var(--accent); stroke: var(--ink); stroke-width: 2; }
.lab-tube { fill: var(--muted); fill-opacity: .35; stroke: var(--ink-2); stroke-width: 3; }
.lab-tube.is-new { fill: var(--teal); fill-opacity: .28; stroke: var(--teal); }
.lab-mold { fill: none; stroke: var(--green); stroke-width: 3; stroke-dasharray: 5 4; }
.lab-sec-lever { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; }
.prose ol.steps > li.lab-li-on::before { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.lab-li-go { margin-left: 8px; font: 600 .72rem var(--mono); padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--accent-ink); vertical-align: 1px; white-space: nowrap; }
.lab-li-go:hover { border-color: var(--accent); }

/* ---------- Lab 2: sealant ---------- */
.lab-checks { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 16px; }
.lab-checks li { padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); font-size: .8rem; font-weight: 700; color: var(--muted); line-height: 1.35; display: flex; gap: 8px; align-items: center; transition: background .25s, color .25s, border-color .25s; }
.prose .lab .lab-checks li { color: var(--muted); }
.lab-ck { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 .72rem var(--mono); background: var(--bg-2); color: var(--muted); }
.prose .lab .lab-checks li.is-done { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green); }
.lab-checks li.is-done .lab-ck { background: var(--green); color: #fff; }
@media (max-width: 560px) { .lab-checks { grid-template-columns: 1fr 1fr; } }
.lab-sl-tick { stroke: var(--muted); stroke-width: 2; }
.lab-sl-cavity { fill: var(--surface); }
.lab-sl-wall { fill: none; stroke: var(--ink); stroke-width: 8; transition: stroke .3s; }
.lab-sl-wall.is-flat { stroke: var(--muted); stroke-dasharray: 10 6; }
.lab-sl-rim { fill: none; stroke: var(--muted); stroke-width: 8; }
.lab-sl-puddle { fill: var(--teal); fill-opacity: .6; }
.lab-sl-clump { fill: var(--gold); stroke: color-mix(in srgb, var(--gold) 60%, var(--ink)); stroke-width: 1.5; opacity: .9; }
.lab-sl-coat { fill: none; stroke: var(--teal); stroke-width: 5; stroke-linecap: round; opacity: .85; }
.lab-sl-valve { fill: var(--ink-2); }
.lab-sl-valve.is-sunk { fill: var(--red); }
.lab-sl-core { fill: var(--gold); }
.lab-sl-syr { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2; }
.lab-sl-liq { fill: var(--teal); fill-opacity: .7; }
.lab-sl-rod { fill: var(--ink-2); }
.lab-sl-ideal { fill: none; stroke: var(--green); stroke-width: 7; stroke-linecap: round; opacity: 0; transition: opacity .4s; }
.lab-sl-ideal.is-on { opacity: .75; }
.lab-sl-hit { fill: transparent; cursor: grab; touch-action: none; outline: none; }
.lab-sl-hit.is-drag { cursor: grabbing; }
.lab-sl-hit:focus-visible { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 6 5; }
.lab-wobble { animation: labWobble .22s ease-in-out 4; transform-box: view-box; transform-origin: 50% 50%; }
@keyframes labWobble { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.lab-gauge { position: relative; height: 12px; border-radius: 999px; background: var(--bg-2); margin: 10px 0 6px; }
.lab-gauge-band { position: absolute; top: 0; bottom: 0; background: var(--green); opacity: .45; border-radius: 999px; transition: left .25s, width .25s; }
.lab-gauge-mark { position: absolute; top: -5px; width: 5px; height: 22px; margin-left: -2.5px; background: var(--ink); border-radius: 3px; transition: left .15s; }
.lab-result { margin-top: 14px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.lab-result h4 { font-size: 1.05rem; margin: 0 0 10px; }
.lab-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0 0 10px; font-size: .9rem; }
.lab-dl dt { font-family: var(--mono); font-size: .74rem; color: var(--muted); padding-top: 3px; }
.lab-dl dd { margin: 0; color: var(--ink-2); }
.prose .lab .lab-result p { font-size: .88rem; margin: 0; }

/* ---------- Lab 3: chain ---------- */
.lab-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.lab-ch-svg { touch-action: pan-y; }
.lab-ch-target { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 4; opacity: .7; }
.lab-ch-bottle { fill: var(--surface); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.lab-ch-nozzle { fill: var(--ink); }
.lab-ch-plate { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2; transition: fill .3s, stroke .3s; }
.lab-ch-plate.is-outer { fill: var(--surface-2); stroke: var(--ink); }
.lab-ch-plate.is-ql { fill: var(--gold-soft); stroke: var(--gold); stroke-width: 3; }
.lab-ch-roller { fill: var(--line); stroke: var(--ink-2); stroke-width: 2; transition: fill .3s, stroke .3s; }
.lab-ch-r { cursor: pointer; }
.lab-ch-r:hover .lab-ch-roller { stroke: var(--accent); stroke-width: 3; }
.lab-ch-drip, .lab-ch-shine, .lab-ch-wet { opacity: 0; transition: opacity .3s; pointer-events: none; }
.lab-ch-drip { fill: var(--teal); }
.lab-ch-shine { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; }
.lab-ch-wet { fill: var(--blue); }
.lab-ch.is-dirty .lab-ch-roller { fill: var(--ink-2); }
.lab-ch.is-dirty .lab-ch-plate { fill: color-mix(in srgb, var(--ink) 45%, var(--surface)); }
.lab-ch.is-wet .lab-ch-plate { stroke: var(--blue); }
.lab-ch.is-wet .lab-ch-wet { opacity: .8; }
.lab-ch-r.is-oiled .lab-ch-roller { fill: var(--teal-soft); stroke: var(--teal); }
.lab-ch-r.is-over .lab-ch-drip, .lab-ch-r.is-over .lab-ch-shine { opacity: .95; }
.lab-ch.is-soaked .lab-ch-r.is-oiled .lab-ch-roller { fill: var(--teal); }
.lab-ch.is-wiped .lab-ch-r .lab-ch-drip { opacity: 0; }
.lab-ch.is-wiped .lab-ch-r.is-over .lab-ch-shine { opacity: .45; }
.lab-ch-ql { fill: var(--gold); }
.lab-ch-drop { fill: var(--teal); pointer-events: none; }
.lab-ch-rag { fill: var(--gold-soft); stroke: var(--gold); stroke-width: 2; pointer-events: none; }
.lab-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
.lab-stat { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 2px; }
.lab-stat .v { font-size: 1.25rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.lab-stat .l { font-size: .76rem; color: var(--muted); line-height: 1.3; }
.lab-stat.is-warn .v { color: var(--red); }
.lab-stat.is-ok .v { color: var(--green); }
.lab-meter { margin: 0 0 12px; }
.lab-meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.lab-meter-track { height: 10px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.lab-meter-fill { height: 100%; border-radius: 999px; background: var(--green); width: 0; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.lab-meter-fill[data-tone="warn"] { background: var(--gold); }
.lab-meter-fill[data-tone="bad"] { background: var(--red); }
.lab-advice { list-style: none; display: grid; gap: 6px; font-size: .88rem; color: var(--ink-2); }
.lab-advice li { position: relative; padding-left: 18px; line-height: 1.55; }
.lab-advice li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.lab-lube { margin-top: 20px; padding: 16px 18px; border-radius: var(--radius); border: 1px dashed var(--line-2); }
.lab-lube .chip-row + .chip-row { margin-top: 8px; }
.prose .lab .lab-lube-out { margin: 12px 0 0; font-size: .9rem; }

/* ---------- Lab 4: brakes ---------- */
.lab .tabs { margin-bottom: 20px; }
.lab [role="tabpanel"] { outline: none; }
.lab-br-body { fill: var(--surface); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.lab-br-rotor { fill: var(--line-2); stroke: var(--ink-2); stroke-width: 2; }
.lab-br-heat { fill: var(--accent); }
.lab-br-xfer { fill: var(--violet); }
.lab-br-piston { fill: var(--muted); stroke: var(--ink-2); stroke-width: 2; }
.lab-br-back { fill: var(--ink-2); }
.lab-br-fric { fill: var(--accent); transition: fill .3s; }
.lab-br-pads.is-contam .lab-br-fric { fill: var(--red); }
.lab-br-pin { stroke: var(--gold); stroke-width: 6; stroke-linecap: round; }
.lab-br-spring { fill: none; stroke: var(--teal); stroke-width: 2.5; }
.lab-br-spark { fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; }
.lab-br-leg { font-size: 12px; }
.lab-wear { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); margin-top: 8px; }
.lab-wear-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .88rem; font-weight: 700; color: var(--ink-2); }
.lab-wear-bar { position: relative; height: 12px; margin: 12px 0 4px; border-radius: 999px; background: linear-gradient(90deg, var(--red) 0 20%, var(--gold) 20% 40%, var(--green) 40% 100%); opacity: .9; }
.lab-wear-mark { position: absolute; top: -5px; width: 5px; height: 22px; margin-left: -2.5px; border-radius: 3px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); transition: left .2s; }
.lab-wear-scale { position: relative; height: 16px; font-size: .68rem; color: var(--muted); }
.lab-wear-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.lab-wear-scale span:first-child { transform: none; }
.lab-wear-scale span:last-child { transform: translateX(-100%); }
.lab-rim-band { fill: var(--muted); }
.lab-rim-shoe { fill: var(--line-2); stroke: var(--ink-2); stroke-width: 2; }
.lab-rim-pad { fill: var(--ink-2); transition: fill .3s; }
.lab-rim-groove { fill: var(--surface-2); }
.lab-rim-limit { stroke: var(--red); stroke-width: 2; stroke-dasharray: 5 4; fill: none; }
.lab-rim-ref { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.lab-rim-arm { stroke: var(--ink-2); stroke-width: 6; stroke-linecap: round; fill: none; }
.lab-rim-tire { fill: var(--ink); }
.lab-rim-track { fill: var(--line-2); stroke: var(--ink-2); stroke-width: 2.5; stroke-linejoin: round; }
.lab-rim-zone-ok { fill: var(--green); opacity: .16; }
.lab-rim-zone-bad { fill: var(--red); opacity: .14; }
.lab-rim-padbox { stroke-width: 3; transition: fill .3s, stroke .3s; }
.lab-rim-padbox[data-tone="ok"] { fill: var(--ink-2); stroke: var(--green); }
.lab-rim-padbox[data-tone="warn"] { fill: var(--ink-2); stroke: var(--gold); }
.lab-rim-padbox[data-tone="bad"] { fill: var(--red); stroke: var(--red); }
.lab-checklist { list-style: none; display: grid; gap: 8px; margin: 0 0 14px; }
.lab-checklist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); font-size: .88rem; font-weight: 700; }
.prose .lab .lab-checklist li { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .lab-fx.is-on { animation: none; opacity: 1; }
  .lab-shake, .lab-wobble { animation: none; }
}
@media (max-width: 480px) {
  .lab-stats { gap: 6px; }
  .lab-stat { padding: 8px; }
  .lab-stat .v { font-size: 1.05rem; }
  .lab-nav .btn { padding: 8px 12px; }
}
