/* Tamiya Mini 4WD builder. Hand-written: not part of the Tailwind entry point. */
.tb { --tb-ink:#0f172a; --tb-muted:#5b6b7f; --tb-line:#d9e1ea; --tb-panel:#f7f9fc; --tb-accent:#93c01f; --tb-dark:#101823; }
.tb * { box-sizing:border-box; }
.tb { color:var(--tb-ink); background:#f1f5f9; max-width:1440px; margin:24px auto; padding:24px 22px 56px; border-radius:18px; }
.tb-breadcrumb { display:flex; gap:8px; font-size:.82rem; color:var(--tb-muted); margin-bottom:14px; }
.tb-breadcrumb a { color:inherit; }
.tb-header { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:16px; }
.tb-header h1 { font-size:clamp(1.55rem,3vw,2.5rem); line-height:1.1; margin:2px 0 8px; letter-spacing:-.02em; }
.tb-header p { margin:0; color:var(--tb-muted); max-width:70ch; }
.tb-eyebrow { font-size:.68rem; letter-spacing:.14em; text-transform:uppercase; color:var(--tb-muted); margin:0 0 4px; font-weight:700; }
.tb-pill { display:inline-block; border:1px solid var(--tb-line); border-radius:999px; padding:5px 11px; font-size:.7rem; letter-spacing:.08em; font-weight:700; white-space:nowrap; }
.tb-pill-dark { background:var(--tb-dark); color:#f8fafc; border-color:var(--tb-dark); max-width:100%; overflow:hidden; text-overflow:ellipsis; }
.tb-notice { background:#fff7e6; border:1px solid #f0cf8a; border-radius:10px; padding:10px 12px; font-size:.88rem; }
.tb-muted { color:var(--tb-muted); font-size:.84rem; }
.tb-intro { margin:0 0 12px; }
.tb-toolbar { display:flex; flex-wrap:wrap; gap:10px 14px; align-items:flex-end; background:var(--tb-panel); border:1px solid var(--tb-line); border-radius:14px; padding:12px 14px; }
.tb-toolbar label { display:flex; flex-direction:column; gap:5px; font-size:.72rem; font-weight:700; color:var(--tb-muted); text-transform:uppercase; letter-spacing:.06em; }
.tb-toolbar select,.tb-toolbar input { font:inherit; font-size:.9rem; padding:8px 9px; border:1px solid #b9c6d6; border-radius:9px; background:#fff; color:var(--tb-ink); min-width:150px; max-width:100%; }
.tb-name-field input { min-width:210px; }
.tb-actions { display:flex; flex-wrap:wrap; gap:7px; margin-left:auto; }
.tb button { font:inherit; cursor:pointer; border:1px solid #b9c6d6; background:#fff; border-radius:9px; padding:8px 12px; font-size:.86rem; }
.tb button:hover { border-color:#7f93aa; }
.tb button:focus-visible { outline:3px solid #7dd3fc; outline-offset:2px; }
.tb button:disabled { opacity:.55; cursor:not-allowed; }
.tb .tb-primary { background:var(--tb-dark); color:#f8fafc; border-color:var(--tb-dark); }
.tb-layout { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(300px,.9fr); gap:20px; margin-top:18px; align-items:start; }
.tb-panel-heading { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.tb-panel-heading h2,.tb-panel-heading h3 { margin:0; font-size:1.05rem; }
.tb-panel-heading .tb-pill { font-size:.62rem; }
.tb-visual,.tb-side { min-width:0; }
.tb-visual > .tb-muted { margin:6px 0 10px; }
.tb-3d { position:relative; width:100%; height:430px; border-radius:14px; overflow:hidden; background:#0d1520; border:1px solid #1e293b; touch-action:none; }
.tb-3d-loading { color:#b2c1d3; font-size:.85rem; padding:16px; }
.tb-3d-canvas,.tb3d-canvas { display:block; width:100%; height:100%; }
.tb-3d.is-ready .tb-3d-loading { display:none; }
.tb-3d-tools { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 8px; }
.tb-3d-tools button { padding:6px 10px; font-size:.76rem; }
.tb .tb-3d-hotspot,.tb .tb3d-hotspot { position:absolute; top:0; left:0; transform:translate(0,0); background:rgba(16,24,35,.86); color:#e8eef7; border:1px solid #5b6b7f; border-radius:999px; padding:3px 8px; font-size:.66rem; line-height:1.2; white-space:nowrap; }
.tb .tb-3d-hotspot:hover,.tb .tb3d-hotspot:hover { background:#1d4ed8; border-color:#93c5fd; }
.tb .tb3d-hotspot { width:16px; height:16px; padding:0; }
.tb .tb3d-hotspot::before { content:'+'; display:block; font-size:12px; line-height:14px; }
.tb-hotspot-label { display:none; position:absolute; bottom:20px; left:0; padding:5px 8px; border-radius:6px; background:#101823; color:#f8fafc; }
.tb3d-hotspot:hover .tb-hotspot-label,.tb3d-hotspot:focus-visible .tb-hotspot-label { display:block; }
.tb-3d.is-fallback { height:auto; min-height:120px; background:#f7f9fc; border-style:dashed; }
.tb-3d.is-fallback .tb-3d-loading { display:none; }
.tb-board-panel { margin-top:16px; }
.tb-group { margin-top:10px; }
.tb-group h3 { font-size:.76rem; text-transform:uppercase; letter-spacing:.08em; color:var(--tb-muted); margin:0 0 6px; }
.tb-slots { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:8px; }
.tb-slot { display:flex; flex-direction:column; gap:4px; align-items:flex-start; text-align:left; padding:10px; border-radius:11px; background:#fff; min-height:78px; }
.tb-slot strong { font-size:.84rem; line-height:1.25; overflow-wrap:anywhere; }
.tb-slot small { font-size:.64rem; text-transform:uppercase; letter-spacing:.08em; color:var(--tb-muted); }
.tb-slot.is-empty { border-style:dashed; color:var(--tb-muted); }
.tb-slot.is-kit { border-color:#9bbf3c; }
.tb-flag { font-size:.66rem; font-weight:700; padding:2px 7px; border-radius:999px; }
.tb-flag-pass { background:#e7f7df; color:#2f6b12; }
.tb-flag-review { background:#fff4d6; color:#7a5200; }
.tb-flag-fail { background:#ffe3dc; color:#a72d0b; }
.tb-side { background:var(--tb-panel); border:1px solid var(--tb-line); border-radius:14px; padding:14px; position:sticky; top:var(--tb-header-offset,116px); max-height:calc(100vh - var(--tb-header-offset,116px) - 16px); overflow:auto; scroll-margin-top:var(--tb-header-offset,116px); }
.tb-side h2 { font-size:.95rem; margin:20px 0 6px; }
.tb-summary { font-size:.88rem; font-weight:600; margin:10px 0 6px; border-left:4px solid #94a3b8; background:#fff; padding:9px 11px; border-radius:6px; }
.tb-side > .tb-panel-heading h2 { margin:0; }
.tb-check-counts { margin:0 0 10px; }
.tb-summary-incomplete { border-color:#a16207; }
.tb-summary-conflicts { border-color:#c2410c; }
.tb-summary-needs-verification { border-color:#d97706; }
.tb-summary-documented-checks-passed { border-color:#15803d; }
.tb-checks { list-style:none; padding:0; margin:8px 0 0; display:flex; flex-direction:column; gap:6px; }
.tb-check { background:#fff; border:1px solid var(--tb-line); border-left:4px solid #94a3b8; border-radius:7px; padding:8px 9px; font-size:.8rem; }
.tb-check strong { display:block; font-size:.66rem; text-transform:uppercase; letter-spacing:.07em; color:var(--tb-muted); }
.tb-check p { margin:3px 0 0; color:var(--tb-muted); }
.tb-check-title { display:block; font-weight:600; line-height:1.4; overflow-wrap:anywhere; }
.tb-check-detail { margin-top:5px; }
.tb-check-detail summary { cursor:pointer; font-size:.74rem; color:var(--tb-muted); }
.tb-check-detail[open] > summary { margin-bottom:5px; }
.tb-check-group { list-style:none; min-width:0; }
.tb-check-list { list-style:none; padding:0; margin:8px 0 0; display:grid; gap:6px; }
.tb-review-group > summary,.tb-pass-group > summary,.tb-physical > summary { cursor:pointer; font-size:.8rem; font-weight:600; }
.tb-review-group { border:1px solid var(--tb-line); border-radius:8px; padding:8px 10px; background:#fff; }
.tb-check-fail { border-left-color:#c2410c; background:#fff6f2; }
.tb-check-unknown { border-left-color:#d97706; background:#fffdf3; }
.tb-check-pass { border-left-color:#15803d; background:#f5fdf7; }
.tb-check-sources { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.tb-source { font-size:.7rem; color:#1d4ed8; }
.tb-physical { margin-top:10px; border-top:1px dashed var(--tb-line); padding-top:8px; }
.tb-physical h3 { font-size:.8rem; margin:0 0 4px; }
.tb-physical p { font-size:.74rem; color:var(--tb-muted); margin:2px 0; }
.tb-estimate-grid,.tb-rule-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px 12px; margin:6px 0; }
.tb-estimate-grid dt,.tb-rule-grid dt { font-size:.68rem; color:var(--tb-muted); text-transform:uppercase; letter-spacing:.05em; }
.tb-estimate-grid dd,.tb-rule-grid dd { margin:0 0 4px; font-size:.86rem; font-weight:600; overflow-wrap:anywhere; }
.tb-rule-grid { grid-template-columns:1fr; }
.tb-rule-grid div { display:grid; grid-template-columns:92px 1fr; gap:8px; border-bottom:1px dotted var(--tb-line); padding:3px 0; }
.tb-value-unknown { color:#8a5a00; font-size:.82rem; font-weight:600; }
.tb-delta { font-size:.76rem; background:#eef6e3; border-radius:6px; padding:7px 8px; }
.tb-declarations { display:grid; gap:5px; }
.tb-declaration { display:flex; gap:8px; align-items:flex-start; font-size:.79rem; }
.tb-declaration input { margin-top:3px; }
.tb-rules h3 { margin:0; font-size:.92rem; }
.tb-rules p { margin:4px 0; }
.tb-evidence { margin-top:20px; border:1px solid var(--tb-line); border-radius:12px; padding:10px 13px; }
.tb-evidence summary { cursor:pointer; font-weight:700; font-size:.86rem; }
.tb-evidence div { display:flex; flex-direction:column; gap:3px; margin-top:6px; }
.tb-library { margin-top:22px; }
.tb-saved-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; background:#fff; border:1px solid var(--tb-line); border-radius:9px; padding:8px 10px; margin-top:6px; }
.tb-saved-row strong { min-width:180px; }
.tb-saved-row button { padding:5px 9px; font-size:.76rem; }
dialog { border:0; border-radius:14px; padding:16px; width:min(720px,94vw); max-height:86vh; }
dialog::backdrop { background:rgba(8,15,24,.6); }
dialog h2 { margin:0; }
dialog label { display:flex; flex-direction:column; gap:5px; font-size:.78rem; font-weight:700; margin:10px 0; }
dialog input[type=search],dialog textarea { font:inherit; padding:9px; border:1px solid #b9c6d6; border-radius:9px; width:100%; }
.tb-show-all { flex-direction:row !important; align-items:center; gap:8px !important; font-weight:500 !important; }
.tb-results { display:grid; grid-template-columns:1fr 1fr; gap:8px; max-height:52vh; overflow:auto; margin-top:8px; }
.tb-result { display:flex; flex-direction:column; gap:3px; align-items:flex-start; text-align:left; padding:9px; background:#fff; min-height:96px; }
.tb-result strong { font-size:.84rem; line-height:1.3; }
.tb-result small { font-size:.68rem; color:var(--tb-muted); }
.tb-result p { margin:2px 0; font-size:.75rem; color:var(--tb-muted); }
.tb-result em { font-size:.72rem; color:#8a5a00; }
.tb-result-ok { border-color:#9bbf3c; }
.tb-result-review { border-color:#eab308; background:#fffdf3; }
.tb-result-refused { opacity:.7; }
.tb-picker-footer { margin-top:10px; text-align:right; }
[hidden] { display:none !important; }

@media (max-width:1080px) {
    .tb-layout { grid-template-columns:1fr; }
    .tb-side { position:static; max-height:none; }
}
@media (max-width:640px) {
    .tb { padding:12px 12px 42px; }
    .tb-header { flex-direction:column; gap:8px; }
    .tb-toolbar { padding:10px; }
    .tb-toolbar label, .tb-toolbar select, .tb-toolbar input { width:100%; min-width:0; }
    .tb-actions { width:100%; margin-left:0; }
    .tb-actions button { flex:1 1 42%; }
    .tb-3d { height:300px; }
    .tb-slots { grid-template-columns:1fr 1fr; }
    .tb-slots .tb-slot { min-height:88px; }
    .tb-results { grid-template-columns:1fr; }
    .tb-saved-row strong { min-width:0; width:100%; }
    .tb-estimate-grid { grid-template-columns:1fr; }
}
@media (max-width:380px) { .tb-slots { grid-template-columns:1fr; } }
@media (prefers-reduced-motion: reduce) { .tb * { scroll-behavior:auto !important; transition:none !important; } }
@media print { .tb-toolbar,.tb-side,.tb-library,.tb-3d-tools,.tb-breadcrumb,.tb-header .tb-pill { display:none !important; } .tb-layout { display:block; } }
.tb-slot-wrap,.tb-result-wrap { min-width:0; }
.tb-slot-wrap > .tb-slot,.tb-result-wrap > .tb-result { width:100%; }
.tb-quantity { display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin:.5rem 0; font-size:.8rem; }
.tb-quantity select { max-width:5rem; }

.tb-unplaced { margin-top:14px; border:1px dashed #b9c6d6; border-radius:11px; padding:10px 12px; background:#fbfcfe; }
.tb-unplaced h3 { margin:0 0 4px; font-size:.85rem; }
.tb-unplaced ul { margin:6px 0 0; padding-left:18px; font-size:.8rem; }
.tb-unplaced li { margin:3px 0; }
.tb-pass-group { margin-top:8px; border-top:1px dashed var(--tb-line); padding-top:6px; }
.tb-pass-group summary { cursor:pointer; font-size:.78rem; font-weight:700; color:var(--tb-muted); }
.tb-pass-group .tb-check { margin-top:6px; }
.tb-source-group { display:flex; flex-direction:column; gap:3px; margin:8px 0; }
.tb-source-group details { display:flex; flex-direction:column; gap:3px; }
.tb-source-group summary { cursor:pointer; font-size:.76rem; color:var(--tb-muted); }

.tb-quantity { display:flex; align-items:center; gap:6px; margin-top:5px; font-size:.68rem; font-weight:600; color:var(--tb-muted); text-transform:uppercase; letter-spacing:.04em; }
.tb-quantity select { font:inherit; font-size:.8rem; font-weight:600; padding:3px 6px; border:1px solid #b9c6d6; border-radius:7px; background:#fff; color:var(--tb-ink); min-width:62px; text-transform:none; letter-spacing:normal; }
@media (max-width:640px) {
  .tb3d-hotspot { width:14px; height:14px; padding:0; font-size:0; border-radius:50%; overflow:hidden; }
  .tb3d-hotspot::after { content:''; display:block; width:6px; height:6px; margin:3px; border-radius:50%; background:#a5f345; }
}

.tb-guides { margin-top:24px; border:1px solid var(--tb-line); border-radius:12px; padding:12px 14px; background:var(--tb-panel); }
.tb-guides h2 { margin:0 0 6px; font-size:1rem; }
.tb-guides ul { margin:0; padding-left:20px; font-size:.84rem; display:grid; gap:5px; }
