:root{--bg:#eef3f8;--panel:#fff;--text:#172033;--muted:#617087;--line:#d8e0ea;--blue:#2f7ee6;--red:#e25d5d;--green:#1f9d72;--amber:#d89416;--drain:#66717f;--purple:#7b61b6;--shadow:0 12px 30px rgba(26,43,70,.10)}
*{box-sizing:border-box}html,body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}.topbar{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:18px 24px;background:linear-gradient(135deg,#263d65,#315f91);color:#fff}.topbar h1{margin:0;font-size:24px}.topbar p{margin:5px 0 0;opacity:.82}.top-actions{display:flex;gap:9px;flex-wrap:wrap}.progressbar-wrap{max-width:1600px;margin:12px auto 0;padding:0 16px}.progress-label{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-bottom:5px}.progressbar{height:8px;border-radius:99px;background:#dfe7f0;overflow:hidden}.progressbar span{display:block;height:100%;width:0;background:linear-gradient(90deg,#317cc8,#27a477);transition:width .3s}.layout{display:grid;grid-template-columns:265px minmax(560px,1fr) 320px;gap:16px;padding:16px;max-width:1650px;margin:auto}.panel,.workspace{background:var(--panel);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.panel{padding:16px}.panel h2,.workspace h2{margin:0 0 6px;font-size:19px}.muted,.status{color:var(--muted);font-size:13px}.tool-list{display:grid;gap:9px;margin:16px 0}.tool{min-height:46px;padding:9px 12px;text-align:left;border:1px solid var(--line);background:#fff;border-radius:12px;cursor:pointer}.tool:hover,.tool.active{border-color:#6c9ee2;background:#eef6ff}.dot{width:11px;height:11px;border-radius:50%;display:inline-block;margin-right:8px}.cold{background:var(--blue)}.hot{background:var(--red)}.drain{background:var(--drain)}.card.mini{padding:12px;margin-top:12px;border:1px solid var(--line);border-radius:12px;font-size:13px}.card h3,.test-card h3{margin:0 0 7px;font-size:14px}.technical-card label{display:block;margin-top:9px}.technical-card select{width:100%;margin-top:5px;padding:9px;border:1px solid var(--line);border-radius:10px;background:#fff}.checkrow{display:flex!important;gap:8px;align-items:center}.checkrow input{width:auto}.hidden-control{display:none!important}.stage-list{display:grid;gap:7px}.stage{display:flex;align-items:center;gap:8px;color:var(--muted)}.stage span{display:grid;place-items:center;width:23px;height:23px;border-radius:50%;border:1px solid var(--line);font-size:11px}.stage.active{color:#245f9f;font-weight:700}.stage.active span{background:#e8f3ff;border-color:#71a9e5}.stage.done{color:var(--green)}.stage.done span{background:#e4f6ef;border-color:#6fc7a9}.workspace{padding:14px;min-width:0}.workspace-head{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:10px}.legend{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted)}.legend-line{display:inline-block;width:30px;border-top:5px solid;vertical-align:middle;margin-right:4px}.cold-line{border-color:var(--blue)}.hot-line{border-color:var(--red);border-top-style:dashed}.drain-line{border-color:var(--drain);border-top-width:7px}.svg-wrap{overflow:auto;border:1px solid var(--line);border-radius:14px;background:#f9fbfd}.svg-wrap svg{display:block;width:100%;min-width:760px;height:auto}.wall{stroke:#68768c;stroke-width:3;fill:none}.outer{stroke-width:5}.room-title{font-size:27px;font-weight:700;fill:#2d3a50}.room-title.small{font-size:21px}.fixture rect{fill:#fff;stroke:#93a0b2;stroke-width:2}.fixture text{font-size:18px;fill:#253249}.fixture.chamber rect{fill:#f5f7fa}.point{cursor:pointer;stroke:#fff;stroke-width:4}.point.disabled{opacity:.22;cursor:not-allowed}.point.selected{stroke:#f0b429;stroke-width:8}.pipe-cold{stroke:var(--blue);stroke-width:10;fill:none;stroke-linecap:round;stroke-linejoin:round}.pipe-hot{stroke:var(--red);stroke-width:10;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16 8}.pipe-drain{stroke:var(--drain);stroke-width:14;fill:none;stroke-linecap:round;stroke-linejoin:round}.pipe-label{font-size:12px;font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:4;stroke-linejoin:round}.ref-cold{stroke:var(--blue);stroke-width:5;stroke-dasharray:5 9;opacity:.35;fill:none}.ref-hot{stroke:var(--red);stroke-width:5;stroke-dasharray:5 9;opacity:.35;fill:none}.ref-drain{stroke:var(--drain);stroke-width:7;stroke-dasharray:5 9;opacity:.28;fill:none}.fault-marker circle{fill:#f3b137;stroke:#fff;stroke-width:4}.fault-marker text{font-size:18px;font-weight:800;fill:#3d2e13}.hidden-layer{display:none}.workspace-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:11px}.tip{font-size:12px;color:var(--muted)}.evaluation label{display:block;font-size:13px;margin-top:10px}.evaluation input,.evaluation select,.evaluation textarea{width:100%;margin-top:5px;padding:10px;border-radius:10px;border:1px solid var(--line);background:#fff}.two-cols{display:grid;grid-template-columns:1fr 1fr;gap:8px}.test-card{border:1px solid var(--line);border-radius:13px;padding:11px;margin-top:12px;background:#fbfcfe}.btn{border:0;border-radius:11px;padding:10px 13px;cursor:pointer;font-weight:600}.btn:disabled{opacity:.45;cursor:not-allowed}.btn.secondary{background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.25)}.btn.danger{background:#bd4f55;color:#fff}.btn.primary{background:#316fb3;color:#fff}.btn.success{background:var(--green);color:#fff}.btn.warning{background:#d89416;color:#fff}.btn.ghost{background:#eef2f6;color:#364359}.btn.full{width:100%;margin-top:10px}.btn.big{padding:13px}.notice,.score-box{margin-top:10px;border:1px solid var(--line);border-radius:12px;padding:10px;font-size:13px;background:#f8fafc}.notice.ok{border-color:#9dd8c2;background:#effaf6}.notice.bad{border-color:#efb4b4;background:#fff3f3}.score-box strong{font-size:27px;display:block;margin-bottom:8px}.score-grid{display:grid;grid-template-columns:1fr auto;gap:5px 12px;margin-top:9px}.issue-list{padding-left:18px;margin:7px 0 0}.modal{position:fixed;inset:0;background:rgba(20,29,42,.56);display:flex;align-items:center;justify-content:center;padding:18px;z-index:50}.modal.hidden{display:none}.modal-card{background:#fff;width:min(860px,100%);max-height:88vh;overflow:auto;border-radius:18px;padding:20px;box-shadow:0 25px 60px rgba(0,0,0,.25)}.modal-head{display:flex;justify-content:space-between;align-items:center}.modal-head h2{margin:0}.icon-btn{font-size:30px;line-height:1;border:0;background:transparent;cursor:pointer}.modal ol{line-height:1.65}.plan-note{padding:12px;border-radius:12px;background:#eef6ff;margin-top:12px}.tour-highlight{position:relative;z-index:42;outline:5px solid rgba(240,180,41,.92);outline-offset:4px;border-radius:10px}.tour-bubble{position:fixed;left:14px;top:14px;width:min(380px,calc(100% - 28px));background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;box-shadow:0 20px 60px rgba(10,25,45,.25);z-index:45;transition:left .18s ease,top .18s ease}.tour-bubble::before{content:"";position:absolute;width:16px;height:16px;background:#fff;border-left:1px solid var(--line);border-top:1px solid var(--line);transform:rotate(45deg)}.tour-bubble[data-placement="right"]::before{left:-9px;top:calc(50% - 8px)}.tour-bubble[data-placement="left"]::before{right:-9px;top:calc(50% - 8px);transform:rotate(225deg)}.tour-bubble[data-placement="bottom"]::before{top:-9px;left:calc(50% - 8px)}.tour-bubble[data-placement="top"]::before{bottom:-9px;left:calc(50% - 8px);transform:rotate(225deg)}.tour-bubble.hidden{display:none}.tour-bubble h3{margin:4px 0 6px}.tour-bubble p{margin:0;color:var(--muted);line-height:1.45}.tour-count{font-size:11px;color:#7c899a;font-weight:700}.tour-actions{display:flex;justify-content:space-between;gap:10px;margin-top:14px}.plan-table{width:100%;border-collapse:collapse;margin-top:12px;font-size:13px}.plan-table td,.plan-table th{border:1px solid var(--line);padding:8px;text-align:left}.plan-table th{background:#f3f6fa}
@media(max-width:1200px){.layout{grid-template-columns:240px minmax(520px,1fr)}.evaluation{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}.evaluation h2,.evaluation #btnGrade,.evaluation .score-box{grid-column:1/-1}.test-card{margin-top:0}}
@media(max-width:760px){.topbar{align-items:flex-start;flex-direction:column}.layout{grid-template-columns:1fr;padding:10px}.toolbox,.evaluation{grid-column:auto}.evaluation{display:block}.workspace-head,.workspace-footer{align-items:flex-start;flex-direction:column}.top-actions{width:100%}.top-actions .btn{flex:1}.svg-wrap svg{min-width:720px}.two-cols{grid-template-columns:1fr}.tour-bubble{width:min(340px,calc(100% - 28px))}}

/* V4: guía de etapas */
.current-step{margin:8px 0 12px;padding:10px;border-radius:11px;background:#eef6ff;border:1px solid #cfe2f7;display:grid;gap:4px}.current-step b{font-size:13px;color:#245f9f}.current-step span{font-size:12px;color:var(--muted);line-height:1.35}.stage>div{display:grid;gap:1px}.stage b{font-size:12px}.stage small{font-size:10.5px;line-height:1.25;color:inherit;font-weight:400}.intro-hero{display:grid;gap:8px;padding:14px;border-radius:14px;background:linear-gradient(135deg,#eff6ff,#f4fbf7);border:1px solid #d4e5f4}.intro-hero h3{margin:0;font-size:18px}.intro-hero p{margin:0;color:var(--muted);line-height:1.45}.phase-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}.phase-box{border:1px solid var(--line);border-radius:12px;padding:11px;background:#fff}.phase-box strong{display:block;margin-bottom:4px;font-size:13px}.phase-box p{margin:0;color:var(--muted);font-size:12px;line-height:1.4}.rules-box{margin-top:14px;padding:12px;border-radius:12px;background:#fff7e8;border:1px solid #f0d49b}.rules-box ul{margin:6px 0 0;padding-left:19px;line-height:1.5;font-size:13px}.start-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px;flex-wrap:wrap}.btn.modal-primary{background:#316fb3;color:#fff}.btn.modal-secondary{background:#eef2f6;color:#364359}.instruction-steps{display:grid;gap:10px;margin-top:12px}.instruction-step{display:grid;grid-template-columns:32px 1fr;gap:10px;align-items:start;padding:10px;border:1px solid var(--line);border-radius:12px}.instruction-step .num{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#e8f3ff;color:#245f9f;font-weight:800}.instruction-step h4{margin:0 0 3px;font-size:13px}.instruction-step p{margin:0;color:var(--muted);font-size:12px;line-height:1.4}@media(max-width:640px){.phase-grid{grid-template-columns:1fr}}
