/* ==========================================================
   INICIO - PARTE 0: CSS VALLEY V2.6 CORREGIDO
   Corrección de escapes Markdown accidentales.
   ========================================================== */

:root{ --cu:118; --lime:#a2c300; --green:#1ba055; }

  *{box-sizing:border-box;-webkit-tap-highlight-color:transparent}

  html,body{height:100%;margin:0;overflow:hidden;overscroll-behavior:none;background:#fff;

  touch-action:manipulation}

  body{font-family:"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;color:#333;user-select:none}

  img{display:block;pointer-events:none;-webkit-user-drag:none;user-select:none}

  /* stop Android offering its own long-press menu over the canvas */

  #sheet,#sheet *,#tray,#tray *{-webkit-touch-callout:none}

  button{font:inherit}



  #splash{position:fixed;inset:0;z-index:300;background:#fff;display:flex;flex-direction:column;

    align-items:center;justify-content:center;gap:24px;transition:opacity .4s,visibility .4s}

  #splash.gone{opacity:0;visibility:hidden}

  #splash h1{margin:0;font-size:40px;color:#3a3a3a;font-weight:700}

  #splash .ver{margin-top:-14px;font-size:14px;color:#9aa6b2;letter-spacing:1px}

  .studs{display:flex;gap:9px}

  .stud{width:22px;height:22px;border-radius:6px;animation:pop 1.1s ease-in-out infinite}

  .stud:nth-child(1){background:#f5c518}.stud:nth-child(2){background:#3f9c35;animation-delay:.1s}

  .stud:nth-child(3){background:#f07d1a;animation-delay:.2s}.stud:nth-child(4){background:#d92b2b;animation-delay:.3s}

  .stud:nth-child(5){background:#2196d3;animation-delay:.4s}

  @keyframes pop{0%,70%,100%{transform:translateY(0);opacity:.4}35%{transform:translateY(-12px);opacity:1}}

  @media (prefers-reduced-motion:reduce){.stud{animation:none;opacity:1}}



  #app{height:100%;display:flex;flex-direction:column}

  #work{flex:1;min-height:0;position:relative;overflow:hidden;background:#fff}

  #stage{position:absolute;inset:0;overflow:auto;background:#fff;transition:background .2s;touch-action:pan-x pan-y}

  #work.dim #stage{background:#999}

  #work.dim #sheet{opacity:.55}

  #sheet{position:relative;width:3200px;height:1800px}

  .wrap{position:absolute}.wrap img{position:absolute}

  .blk{cursor:grab}

  /* A touch starting on a block belongs to the drag, not to scrolling the canvas.

     Scoped to the canvas so tray blocks can still be swiped sideways. */

  #sheet .blk,#sheet .blk *{touch-action:none}

  /* the artwork has 123 / abc printed on it, so the value sits in a panel

     that covers the printed placeholder */

  .ival{position:absolute;background:#fff;display:flex;align-items:center;justify-content:center;

    color:#26313c;font-weight:600;overflow:hidden;white-space:nowrap;line-height:1}

  /* the key face is blank, so the letter sits straight on it with no backing */

  .kletter{position:absolute;display:flex;align-items:center;justify-content:center;

    color:#2a2a2a;overflow:hidden;line-height:1;font-weight:600;

    font-family:Georgia,'Times New Roman',serif;font-style:italic}



  /* the A/B port grid that sits on top of a motor block (long press to show) */

  .pgrid{position:absolute;display:flex;background:#fff;box-sizing:border-box;

    border-style:solid;border-color:#3a3a3a;z-index:3;cursor:pointer}

  .pgrid>div{flex:1 1 0;display:flex;align-items:center;justify-content:center;

    box-sizing:border-box;color:#26313c;font-weight:700;line-height:1}

  .pgrid>div+div{border-left-style:solid;border-left-color:#3a3a3a}





  /* block currently being executed */

  .blk.exec img{filter:brightness(1.12)

    drop-shadow(0 0 7px rgba(255,255,255,.95)) drop-shadow(0 0 16px rgba(70,200,255,.95))}

  /* start-on-key press/release */

  .blk.keypress{transition:transform .09s ease}

  .blk.keypress.down{transform:scale(.93) translateY(3px)}

  #stop.active span{animation:beat 1s ease-in-out infinite}

  @keyframes beat{0%,100%{opacity:1}50%{opacity:.5}}



  /* drag ghost + snap indicator */

  #ghost{position:fixed;left:0;top:0;z-index:200;pointer-events:none;opacity:.92;

    filter:drop-shadow(0 6px 10px rgba(0,0,0,.28))}

  #caret{position:absolute;z-index:8;background:#39b0ec;border-radius:4px;box-shadow:0 0 0 3px rgba(57,176,236,.28);display:none}

  #ring{position:absolute;z-index:8;border:4px dashed #39b0ec;border-radius:12px;display:none;

    background:rgba(57,176,236,.12)}

  #band{position:absolute;z-index:7;border:4px solid #39b0ec;border-radius:16px;display:none;

    background:rgba(57,176,236,.15);pointer-events:none}

  /* a displaced input falls out of its socket and stays on the canvas */

  /* shrink and fade in place, glide across, then settle back to full size */

  @keyframes ejectdrop{

    0%  {transform:translate(var(--dx),var(--dy)) scale(1);   opacity:1;

         animation-timing-function:ease-out}

    16% {transform:translate(var(--dx),var(--dy)) scale(.86); opacity:.5;

         animation-timing-function:cubic-bezier(.4,0,.25,1)}

    62% {transform:translate(0,0) scale(.86);                 opacity:.5;

         animation-timing-function:ease-out}

    100%{transform:translate(0,0) scale(1);                   opacity:1}

  }

  .ejecting{animation:ejectdrop .4s both;z-index:6}

  #ring.replace{border-color:#f0a020;background:rgba(240,160,32,.16)}



  /* A touch tap is followed by a synthetic click at the same spot a moment later.

     The editor stays inert until that has passed, so the ghost click can't press

     a key or dismiss the card. */

  #editor{position:fixed;inset:0;z-index:250;background:rgba(30,40,52,.45);

    display:none;align-items:center;justify-content:center;pointer-events:none}

  #editor.open{display:flex}

  #editor.armed{pointer-events:auto}

  #edcard{background:#fff;border-radius:18px;padding:20px;width:300px;

    box-shadow:0 12px 40px rgba(0,0,0,.3)}

  #edtitle{font-size:13px;color:#8f9aa5;margin-bottom:10px}

  #edview{border:3px solid #3aa5d9;border-radius:8px;height:56px;display:flex;align-items:center;

    justify-content:center;font-size:30px;font-weight:600;color:#26313c;margin-bottom:14px;

    overflow:hidden;white-space:nowrap;padding:0 10px}

  #edtext{width:100%;border:3px solid #3aa5d9;border-radius:8px;height:56px;font-size:24px;

    text-align:center;color:#26313c;margin-bottom:14px;outline:none;padding:0 10px}

  #edpad{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}

  #edpad button{height:56px;border:none;border-radius:10px;background:#eef1f4;font-size:22px;

    color:#26313c;cursor:pointer}

  #edpad button:active{background:#dde3e8}

  #edrow{display:flex;gap:9px;margin-top:14px}

  #edrow button{flex:1;height:50px;border:none;border-radius:10px;font-size:16px;cursor:pointer}

  #edcancel{background:#eef1f4;color:#5b6b7a}

  #edok{background:#1ba055;color:#fff}



  #sounds{position:fixed;inset:0;z-index:250;background:rgba(30,40,52,.45);

    display:none;align-items:center;justify-content:center;pointer-events:none}

  #sounds.open{display:flex}

  #sounds.armed{pointer-events:auto}

  #sndcard{background:#fff;border-radius:18px;padding:20px;width:360px;

    box-shadow:0 12px 40px rgba(0,0,0,.3)}

  #sndcard h3{margin:0 0 4px;font-size:17px;color:#3a4753}

  #sndcard p{margin:0 0 12px;font-size:12px;color:#96a2ae}

  #sndgrid{display:flex;flex-direction:column;gap:6px;margin-bottom:16px;max-height:52vh;

    overflow-y:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y}

  #sndgrid::-webkit-scrollbar{width:8px}

  #sndgrid::-webkit-scrollbar-thumb{background:#c6cfd8;border-radius:8px}

  /* flex items shrink to fit by default — without this the rows collapse

     instead of the list scrolling */

  .srow{flex:0 0 auto;display:flex;align-items:center;border-radius:10px;background:#eef1f4;overflow:hidden}

  .srow.chosen{background:#d7ecdc}

  .srow .pick{flex:1;height:60px;border:none;background:transparent;font:inherit;font-size:16px;

    color:#26313c;cursor:pointer;text-align:left;padding:0 16px;display:flex;align-items:center;gap:12px}

  .srow.chosen .pick{color:#14663a;font-weight:600}

  .srow .pick:active{background:rgba(0,0,0,.05)}

  .srow .pick b{display:inline-block;min-width:28px;color:#7c8892;font-weight:600}

  .srow .pick i{color:#aab4bd;font-style:normal;font-size:13px}

  .srow .prev{width:60px;height:60px;border:none;background:transparent;cursor:pointer;

    display:grid;place-items:center;border-left:1px solid rgba(0,0,0,.07)}

  .srow .prev svg{width:19px;height:19px;fill:#6b7784}

  .srow .prev:active{background:rgba(0,0,0,.08)}

  .sndrow{display:flex;gap:8px;margin-bottom:10px}

  .sndrow button{flex:1;height:46px;border:none;border-radius:9px;font-size:14px;cursor:pointer;

    background:#eef1f4;color:#26313c}

  .sndrow button.rec{background:#e03434;color:#fff}

  .sndrow button:disabled{opacity:.4;cursor:default}

  #sndstate{font-size:12px;color:#96a2ae;margin-bottom:14px;min-height:16px}

  #sndclose,#colclose{width:100%;height:46px;border:none;border-radius:9px;background:#1ba055;

    color:#fff;font-size:15px;cursor:pointer}



  #speeds{position:fixed;inset:0;z-index:250;background:rgba(30,40,52,.45);

    display:none;align-items:center;justify-content:center;pointer-events:none}

  #speeds.open{display:flex}

  #speeds.armed{pointer-events:auto}

  #spcard{background:#fff;border-radius:18px;padding:20px;width:min(94vw,380px);

    box-shadow:0 12px 40px rgba(0,0,0,.3)}

  #spcard h3{margin:0 0 12px;font-size:17px;color:#3a4753}

  #spgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:16px}

  .sptile{border:none;border-radius:10px;background:#eef1f4;cursor:pointer;height:62px;

    display:flex;align-items:center;justify-content:center;padding:0;

    font-size:22px;font-weight:700;color:#26313c}

  .sptile.chosen{background:#d7ecdc;box-shadow:inset 0 0 0 2px #1ba055;color:#14663a}

  .sptile:active{background:#dde3e8}

  #spclose{width:100%;height:46px;border:none;border-radius:9px;background:#eef1f4;color:#5b6b7a;

    font-size:15px;cursor:pointer}



  #backgrounds{position:fixed;inset:0;z-index:250;background:rgba(30,40,52,.45);

    display:none;align-items:center;justify-content:center;pointer-events:none}

  #backgrounds.open{display:flex}

  #backgrounds.armed{pointer-events:auto}

  #bgcard{background:#fff;border-radius:18px;padding:20px;width:min(94vw,600px);

    box-shadow:0 12px 40px rgba(0,0,0,.3)}

  #bgcard h3{margin:0 0 4px;font-size:17px;color:#3a4753}

  #bgcard p{margin:0 0 12px;font-size:12px;color:#96a2ae}

  #bggrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px;margin-bottom:16px;

    max-height:58vh;overflow-y:auto;touch-action:pan-y;padding-right:4px}

  #bggrid::-webkit-scrollbar{width:8px}

  #bggrid::-webkit-scrollbar-thumb{background:#c6cfd8;border-radius:8px}

  .bgtile{position:relative;border:none;padding:0;border-radius:10px;overflow:hidden;

    cursor:pointer;aspect-ratio:256/160;background:#eef1f4;

    box-shadow:inset 0 0 0 1px rgba(20,40,60,.12)}

  .bgtile img{width:100%;height:100%;object-fit:cover;display:block}

  .bgtile .num{position:absolute;left:4px;top:4px;min-width:19px;height:19px;border-radius:5px;

    background:rgba(20,30,42,.72);color:#fff;font-size:11px;font-weight:600;

    display:flex;align-items:center;justify-content:center;padding:0 4px}

  .bgtile .none{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;

    color:#98a4b0;font-size:11.5px;text-align:center;padding:0 6px}

  .bgtile.chosen{box-shadow:0 0 0 3px #1ba055}

  .bgtile.pending{opacity:.45;cursor:default}

  #bgclose{width:100%;height:46px;border:none;border-radius:9px;background:#eef1f4;color:#5b6b7a;

    font-size:15px;cursor:pointer}



  #letters{position:fixed;inset:0;z-index:250;background:rgba(30,40,52,.45);

    display:none;align-items:center;justify-content:center;pointer-events:none}

  #letters.open{display:flex}

  #letters.armed{pointer-events:auto}

  #ltcard{background:#fff;border-radius:18px;padding:20px;width:min(94vw,480px);

    box-shadow:0 12px 40px rgba(0,0,0,.3)}

  #ltcard h3{margin:0 0 4px;font-size:17px;color:#3a4753}

  #ltcard p{margin:0 0 12px;font-size:12px;color:#96a2ae}

  #ltgrid{margin-bottom:16px}

  .krow{display:flex;justify-content:center;gap:6px;margin-bottom:6px}

  .kkey{width:38px;height:48px;border:none;border-radius:8px;background:#eef1f4;font-size:18px;

    font-weight:600;color:#26313c;cursor:pointer;flex:0 0 auto;padding:0}

  .kkey.wide{width:62px;font-size:13px}

  .kkey.chosen{background:#f2c318;color:#4a3c00}

  .kkey.on{background:#3aa5d9;color:#fff}

  .kkey:active{background:#dde3e8}

  #ltclose{width:100%;height:46px;border:none;border-radius:9px;background:#eef1f4;color:#5b6b7a;

    font-size:15px;cursor:pointer}



  #colours{position:fixed;inset:0;z-index:250;background:rgba(30,40,52,.45);

    display:none;align-items:center;justify-content:center;pointer-events:none}

  #colours.open{display:flex}

  #colours.armed{pointer-events:auto}

  #colcard{background:#fff;border-radius:18px;padding:20px;width:360px;

    box-shadow:0 12px 40px rgba(0,0,0,.3)}

  #colcard h3{margin:0 0 4px;font-size:17px;color:#3a4753}

  #colcard p{margin:0 0 12px;font-size:12px;color:#96a2ae}

  #colgrid{display:flex;flex-direction:column;gap:6px;margin-bottom:16px;max-height:52vh;

    overflow-y:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y}

  #colgrid::-webkit-scrollbar{width:8px}

  #colgrid::-webkit-scrollbar-thumb{background:#c6cfd8;border-radius:8px}

  .swatch{width:30px;height:30px;border-radius:8px;flex:0 0 auto;

    box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}

  .swatch.off{background:repeating-linear-gradient(45deg,#e2e7ec,#e2e7ec 5px,#cfd6dd 5px,#cfd6dd 10px)}

  #tray.over{background:#ffe9e9;box-shadow:inset 0 0 0 3px #e88}



  /* on-screen display area. pointer-events:none so it never gets in the way

     of dragging blocks underneath it. */

  #display{position:absolute;left:50%;top:46%;transform:translate(-50%,-50%);z-index:25;

    pointer-events:none;display:none;border-radius:16px;overflow:hidden;background:#fff;

    border:3px solid #cdd6de;box-shadow:0 10px 34px rgba(20,35,55,.28)}

  /* size is worked out in paintDisplay so the window keeps the 16:10 shape

     of the background images whatever the screen is */

  #display.medium,#display.full{display:block}

  #dispbg{position:absolute;inset:0}

  /* only the title bar takes input; the rest stays transparent to the canvas */

  #disphead{position:absolute;left:0;right:0;top:0;height:36px;z-index:2;display:flex;

    align-items:center;pointer-events:auto;cursor:grab;touch-action:none;

    background:linear-gradient(rgba(255,255,255,.94),rgba(255,255,255,.6));

    border-bottom:1px solid rgba(20,40,60,.1)}

  #disphead.moving{cursor:grabbing}

  #disphead .grip{flex:1;height:100%;display:flex;align-items:center;padding-left:12px;gap:4px}

  #disphead .grip i{width:4px;height:4px;border-radius:50%;background:#aab4bd;display:block}

  #dispclose{width:36px;height:36px;border:none;background:transparent;cursor:pointer;

    display:grid;place-items:center}

  #dispclose svg{width:15px;height:15px;stroke:#5b6b7a;stroke-width:2.8;stroke-linecap:round;fill:none}

  #dispclose:active{background:rgba(20,40,60,.08)}

  #disptext{position:absolute;left:0;right:0;top:36px;bottom:0;display:flex;align-items:center;

    justify-content:center;font-weight:700;color:#26313c;text-align:center;padding:0 18px;

    overflow:hidden;text-shadow:0 2px 8px rgba(255,255,255,.85)}

  #disptext span{max-width:100%;word-break:break-word;line-height:1.12}





  #verlabel{position:absolute;left:8px;top:4px;z-index:5;font-size:11px;color:#b7c0c8;

    letter-spacing:.3px;pointer-events:none;user-select:none}

  #hub{position:absolute;top:0;right:26px;z-index:40;background:linear-gradient(#4fb3e8,#2b93cf);

    border-radius:0 0 22px 22px;padding:12px 20px 14px;display:flex;align-items:center;gap:14px;

    box-shadow:0 3px 10px rgba(0,60,110,.25);color:#fff;border:none;cursor:pointer}

  #hub .brick{width:58px;height:35px;border-radius:5px;background:linear-gradient(#fdfdfd,#dde2e6);

    box-shadow:inset 0 -3px 0 rgba(0,0,0,.12);position:relative;flex:0 0 auto}

  #hub .brick:before,#hub .brick:after{content:"";position:absolute;top:-5px;width:12px;height:6px;

    border-radius:3px 3px 0 0;background:#f0f2f4}

  #hub .brick:before{left:9px}#hub .brick:after{left:33px}

  #hub .badge{width:30px;height:30px;border-radius:50%;background:#5b6b7a;display:grid;place-items:center;flex:0 0 auto}

  #hub.on .badge{background:var(--green)}

  #hub .badge svg{width:17px;height:17px;fill:#fff}

  #hub .state{font-size:13px;white-space:nowrap;max-width:190px;overflow:hidden;text-overflow:ellipsis}



  #rail{position:absolute;right:22px;top:50%;transform:translateY(-50%);z-index:35;display:flex;flex-direction:column;gap:16px}

  .rbtn{width:46px;height:46px;border-radius:50%;border:none;background:#f1f4f7;display:grid;place-items:center;

    cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.16)}

  .rbtn svg{width:24px;height:24px;stroke:#5b6b7a;fill:none;stroke-width:2.2;stroke-linecap:round}

  .rbtn:focus-visible{outline:3px solid #2196d3;outline-offset:2px}



  #stop{position:absolute;right:0;bottom:20px;z-index:35;background:linear-gradient(#fbdd3d,#f0c400);

    border-radius:16px 0 0 16px;padding:16px 30px 16px 26px;border:none;cursor:pointer;box-shadow:0 3px 8px rgba(120,90,0,.3)}

  #stop span{display:block;width:38px;height:38px;border-radius:5px;background:linear-gradient(#e8433f,#c22a26)}



  /* fixed, so it clears the work area and covers the tray as well */

  #scrim{position:fixed;inset:0;z-index:110;display:none}

  #scrim.open{display:block}

  #panel{position:fixed;top:0;right:0;bottom:0;width:min(46%,620px);background:#fff;z-index:120;

    box-shadow:-4px 0 18px rgba(0,0,0,.18);display:flex;flex-direction:column;

    transform:translateX(102%);transition:transform .25s ease}

  #panel.open{transform:none}

  #panel header{display:flex;align-items:center;padding:22px 26px 10px;flex:0 0 auto}

  #panel h2{margin:0;font-size:26px;color:#8f9aa5;font-weight:700;flex:1}

  .xbtn{width:40px;height:40px;border:none;background:transparent;cursor:pointer;display:grid;place-items:center}

  .xbtn svg{width:26px;height:26px;stroke:#8f9aa5;stroke-width:2.4;stroke-linecap:round;fill:none}

  #list{flex:0 1 auto;overflow-y:auto;padding:8px 20px;min-height:60px;max-height:34vh}

  .row{display:flex;align-items:center;gap:16px;border-radius:10px;padding:14px 16px;margin-bottom:12px;

    background:#c9d2da;color:#fff;transition:background .12s}

  .row.found{background:#9fb0bf;cursor:pointer}

  .row.blocked{background:#c9d2da;opacity:.6}

  .row.connected{background:var(--green)}

  .row.pressed{background:var(--lime)}

  .row .hbrick{width:74px;height:44px;border-radius:5px;background:linear-gradient(#fdfdfd,#dde2e6);

    position:relative;flex:0 0 auto;box-shadow:inset 0 -3px 0 rgba(0,0,0,.12)}

  .row .hbrick:before{content:"";position:absolute;left:8px;top:7px;width:14px;height:10px;border-radius:2px;background:#37b34a}

  .row .nm{flex:1;font-weight:700;font-size:19px;letter-spacing:.4px;text-transform:uppercase;

    overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  .batt{font-size:11px;color:#fff;border:2px solid #fff;border-radius:3px;padding:2px 5px;position:relative;min-width:38px;text-align:center}

  .batt:after{content:"";position:absolute;right:-5px;top:6px;width:3px;height:8px;background:#fff;border-radius:0 2px 2px 0}

  .kill{width:34px;height:34px;border-radius:50%;background:#e03434;border:none;cursor:pointer;display:grid;place-items:center;flex:0 0 auto}

  .kill svg{width:16px;height:16px;stroke:#fff;stroke-width:3;stroke-linecap:round;fill:none}

  #panelfoot{padding:16px;display:flex;flex-direction:column;align-items:center;gap:10px;flex:0 0 auto}

  #refresh{width:58px;height:58px;border-radius:50%;background:#eceff2;border:none;cursor:pointer;display:grid;place-items:center}

  #refresh svg{width:28px;height:28px;stroke:#8f9aa5;fill:none;stroke-width:2.2;stroke-linecap:round}

  #refresh:disabled{opacity:.4;cursor:default}

  #hint{font-size:12.5px;color:#98a4b0;text-align:center;max-width:92%;line-height:1.45;min-height:18px}

  #ports{flex:0 0 auto;padding:10px 20px;border-top:1px solid #e6eaee;font-size:12px;

    color:#6b7784;background:#fff;-webkit-touch-callout:none}

  #ports .prow{margin-bottom:4px}

  #ports .raw{margin-left:8px;font-family:ui-monospace,Consolas,monospace;font-size:10.5px;color:#aab4bd}

  #ports .conds{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}

  #ports .conds span{font-size:10.5px;padding:2px 7px;border-radius:10px;background:#eef1f4;color:#9aa6b2}

  #ports .conds span.on{background:#1ba055;color:#fff}

  #diagwrap{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;border-top:1px solid #e6eaee}

  #diagtoggle{width:100%;text-align:left;padding:9px 20px;border:none;background:#f7f9fa;color:#9aa6b2;

    font-size:11.5px;cursor:pointer;display:flex;align-items:center;gap:8px}

  #diagwrap.closed .car{transform:rotate(-90deg)}

  #diagwrap.closed #diag{display:none}

  .car{transition:transform .15s}

  #diag{flex:1 1 auto;min-height:90px;padding:12px 20px;font-size:11.5px;color:#8b97a3;

    overflow:auto;background:#fcfdfd;user-select:text;-webkit-user-select:text;cursor:text}

  #diagwrap.closed{flex:0 0 auto}

  #diagbar{display:flex;align-items:center;background:#f7f9fa}

  #diagbar #diagtoggle{flex:1}

  #copylog{border:none;background:#eceff2;color:#6b7784;font-size:11px;cursor:pointer;

    padding:5px 12px;margin:0 14px;border-radius:6px}

  #copylog:active{background:#dde3e8}

  #diag b{color:#5b6b7a}

  #diag .l{font-family:ui-monospace,Consolas,monospace;font-size:11px;white-space:pre-wrap;color:#7c8892}



  footer{flex:0 0 auto;background:#fafbfc;border-top:1px solid #dfe4e9}

  #tray{display:flex;align-items:flex-end;padding:16px 18px 18px;overflow-x:auto;overflow-y:hidden;

    transition:background .15s;touch-action:pan-x}

  #tray::-webkit-scrollbar{height:9px}#tray::-webkit-scrollbar-thumb{background:#c3ccd5;border-radius:9px}

  .grp{display:flex;align-items:flex-end;gap:10px;padding:0 16px;position:relative;flex:0 0 auto}

  #traytabs{display:flex;gap:3px;padding:7px 16px 0;overflow-x:auto;border-bottom:1px solid #e6eaee;

    background:#f4f7f9;touch-action:pan-x}

  #traytabs::-webkit-scrollbar{display:none}

  .tab{flex:0 0 auto;border:none;background:transparent;font:inherit;font-size:14px;font-weight:600;

    padding:9px 16px;border-radius:9px 9px 0 0;cursor:pointer;white-space:nowrap;

    border-bottom:3px solid transparent;opacity:.5}

  .tab.on{opacity:1;border-bottom-color:currentColor;background:#fafbfc}

  .tab:focus-visible{outline:2px solid #2196d3;outline-offset:-2px}

  .pitem{flex:0 0 auto;cursor:grab}



/* ==========================================================

   INICIO - CSS PARTE 0: IDENTIDAD VISUAL VALLEY

   ========================================================== */

:root{--valley:#20a64a;--valley-dark:#111820;--valley-soft:#eef4f0}

body{background:linear-gradient(135deg,#f7faf8,#edf2f4);}

#splash{background:radial-gradient(circle at 50% 35%,#26333b 0,#111820 58%,#0b1014 100%);color:white}

#splash h1{letter-spacing:.8px;font-weight:800;text-shadow:0 4px 18px rgba(0,0,0,.28)}

.valley-tag{margin-top:10px;font-size:14px;letter-spacing:2px;text-transform:uppercase;color:#9fe1b1}

#work{background:linear-gradient(180deg,#f9fbfa,#edf2f4)}

#stage{background-image:radial-gradient(circle at 1px 1px,rgba(32,166,74,.08) 1px,transparent 0);background-size:22px 22px}

#hub{box-shadow:0 8px 26px rgba(16,24,32,.15);border:1px solid rgba(32,166,74,.18)}

#hub.on{box-shadow:0 8px 28px rgba(32,166,74,.24)}

#panel{box-shadow:-18px 0 45px rgba(10,20,28,.20)}

#panel header{background:linear-gradient(135deg,#172129,#0f171d);color:white}

#panel header h2{color:white}

#traytabs{background:#f2f6f3;border-top:1px solid #dfe9e2}

.tab.on{background:white;border-bottom-color:var(--valley)!important}

.rbtn{box-shadow:0 5px 16px rgba(16,24,32,.12)}

#verlabel{font-weight:700;color:#56645d}

/* ==========================================================

   FIN - CSS PARTE 0: IDENTIDAD VISUAL VALLEY

   ========================================================== */



/* ==========================================================

   INICIO - CSS PARTE 1: CATEGORÍAS VALLEY ESTILO EV3

   ========================================================== */

#traytabs{

  display:flex!important;justify-content:center!important;align-items:flex-end!important;

  gap:8px!important;width:100%!important;padding:8px 20px 5px!important;

  overflow:visible!important;background:#f2f6f3!important;border-bottom:1px solid #dce5df!important;

}

#traytabs .tab{

  position:relative!important;width:48px!important;height:17px!important;flex:0 0 48px!important;

  padding:0!important;margin:0!important;border:1px solid rgba(0,0,0,.20)!important;

  border-radius:4px!important;background:var(--cat)!important;color:transparent!important;

  opacity:1!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 1px 2px rgba(0,0,0,.16)!important;

  transition:transform .14s ease,height .14s ease!important;

}

#traytabs .tab:hover{transform:translateY(-2px)}

#traytabs .tab.on{

  height:21px!important;transform:translateY(-2px);outline:2px solid #fff!important;

  box-shadow:0 0 0 1px #8f9a94,0 3px 8px rgba(0,0,0,.20)!important;

}

#traytabs .tab::after{

  content:attr(data-tip);position:absolute;left:50%;bottom:29px;transform:translateX(-50%) translateY(4px);

  background:#111820;color:#fff;font-size:12px;font-weight:650;line-height:1;padding:8px 10px;border-radius:7px;

  white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:.14s;z-index:200;

  box-shadow:0 5px 15px rgba(0,0,0,.22);

}

#traytabs .tab:hover::after{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0)}

#tray{

  display:flex!important;justify-content:center!important;align-items:center!important;

  width:100%!important;padding:14px 24px 18px!important;overflow-x:auto!important;overflow-y:hidden!important;

}

#tray .grp{

  display:flex!important;justify-content:center!important;align-items:center!important;

  gap:12px!important;padding:0!important;margin:0 auto!important;width:max-content!important;

}

#tray .pitem{

  width:100px!important;height:108px!important;display:flex!important;align-items:center!important;

  justify-content:center!important;flex:0 0 100px!important;

}

#tray .pitem>*{margin:auto!important}

/* ==========================================================

   FIN - CSS PARTE 1: CATEGORÍAS VALLEY ESTILO EV3

   ========================================================== */



/* ==========================================================

   INICIO - CSS PARTE 2: CENTRO DE CONEXIÓN VALLEY

   ========================================================== */

#panel{width:min(520px,92vw)!important;background:#f7faf8!important}

#panel header{padding:20px 22px 14px!important}

#panel h2{font-size:22px!important}

#list{max-height:none!important;flex:1 1 auto!important;padding:14px 18px!important}

#ports{display:none!important}

#diagwrap{display:none!important}

#panelfoot{padding:12px 18px 20px!important;border-top:1px solid #e2e9e4}

#refresh{background:#fff!important;border:1px solid #d9e3dc!important;box-shadow:0 4px 14px rgba(17,24,32,.08)}

#hint{font-size:13px!important;color:#75827a!important}

.hubcard{

  background:#fff;border:1px solid #dce6df;border-radius:16px;margin:0 0 14px;padding:15px;

  box-shadow:0 7px 20px rgba(17,24,32,.07);color:#26313c;

}

.hubtop{display:flex;align-items:center;gap:10px;margin-bottom:13px}

.hubtop .hbrick{width:56px;height:34px}

.hubname{font-weight:800;font-size:15px;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.hubbatt{font-size:11px;font-weight:800;color:#168b43;background:#e7f6ec;border-radius:12px;padding:5px 8px}

.hubactions{display:flex;gap:7px}

.hubactions button{border:0;border-radius:9px;padding:7px 9px;cursor:pointer;font-size:11px;font-weight:700}

.renamehub{background:#eef3f0;color:#425149}

.disconnecthub{background:#ffe9e9;color:#b52d2d}

.portgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}

.portcard{

  min-height:106px;border:1px solid #e1e8e3;border-radius:12px;background:#f8faf9;padding:10px;

  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;

}

.porttitle{font-size:10px;font-weight:800;letter-spacing:.8px;color:#87948c;margin-bottom:7px}

.devname{font-size:13px;font-weight:800;color:#26313c}

.sensorvalue{font-size:30px;line-height:1;font-weight:900;color:#20a64a;margin-top:5px}

.tilticon{font-size:30px;line-height:1;margin-bottom:4px;display:block;transition:transform .15s ease}

.emptyport{font-size:12px;color:#a3aea7}

.search-empty{padding:38px 18px;text-align:center;color:#87948c;font-size:14px;line-height:1.55}

.foundhub{

  display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #dce6df;border-radius:14px;

  padding:13px 14px;margin-bottom:10px;cursor:pointer;box-shadow:0 4px 14px rgba(17,24,32,.05)

}

.foundhub .nm{color:#26313c!important;font-size:15px!important;text-transform:none!important}

@media(max-width:620px){#tray{justify-content:flex-start!important}.portgrid{grid-template-columns:1fr 1fr}}

/* ==========================================================

   FIN - CSS PARTE 2: CENTRO DE CONEXIÓN VALLEY

   ========================================================== */





/* ==========================================================

   INICIO - CSS PARTE 3: BANDEJA UNIFORME

   ========================================================== */

#tray{

  scrollbar-width:none!important;

  -ms-overflow-style:none!important;

}

#tray::-webkit-scrollbar{

  display:none!important;

  width:0!important;

  height:0!important;

}

#tray .grp{

  gap:12px!important;

  align-items:center!important;

}

#tray .pitem{

  width:100px!important;

  height:108px!important;

  display:flex!important;

  align-items:center!important;

  justify-content:center!important;

  flex:0 0 100px!important;

  margin:0!important;

  padding:0!important;

}

#tray .pitem>*{

  margin:auto!important;

  transform-origin:center center!important;

}

#tray .pitem img{

  max-height:72px!important;

  width:auto!important;

  object-fit:contain!important;

}



/* ==========================================================

   FIN - CSS PARTE 3: BANDEJA UNIFORME

   ========================================================== */





/* ==========================================================

   INICIO - CSS PARTE 4: BLUETOOTH Y SCROLLBARS

   ========================================================== */

#hub{

  top:10px!important;right:22px!important;width:50px!important;height:50px!important;

  padding:0!important;border-radius:50%!important;display:grid!important;place-items:center!important;gap:0!important;

}

#hub .brick,#hub .state{display:none!important}

#hub .badge{width:34px!important;height:34px!important;margin:0!important}

#hub .badge svg{width:20px!important;height:20px!important}

#stage,#tray,#traytabs{scrollbar-width:none!important;-ms-overflow-style:none!important}

#stage::-webkit-scrollbar,#tray::-webkit-scrollbar,#traytabs::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}

/* ==========================================================

   FIN - CSS PARTE 4: BLUETOOTH Y SCROLLBARS

   ========================================================== */





/* ==========================================================

   INICIO - CSS PARTE 5: INTERFAZ TECNOLOGICA VALLEY

   ========================================================== */

:root{--valley-green:#20a64a;--valley-dark:#101820;--valley-line:#d8e3df;--valley-soft:#f4f8f6}

body{background:#eef3f1!important}

#work{background:linear-gradient(180deg,#f7faf9 0%,#eef4f1 100%)!important}

#stage{position:relative!important;background-color:#f7faf9!important;background-image:radial-gradient(circle at 1px 1px,rgba(32,166,74,.10) 1px,transparent 1.2px)!important;background-size:24px 24px!important;box-shadow:inset 0 0 0 1px rgba(16,24,32,.06)!important}

#valleyWatermark{position:fixed;left:50%;top:43%;transform:translate(-50%,-50%);width:min(420px,32vw);height:auto;opacity:.09;pointer-events:none;user-select:none;z-index:0;filter:grayscale(8%);object-fit:contain}#sheet{position:relative!important;z-index:2!important}

#sheet{position:relative!important;z-index:1!important}

#traytabs{background:rgba(245,249,247,.96)!important;border-top:1px solid var(--valley-line)!important;border-bottom:1px solid var(--valley-line)!important;box-shadow:0 -6px 18px rgba(16,24,32,.04)!important}

#tray{background:rgba(250,252,251,.98)!important;border-top:0!important}

#hub{background:linear-gradient(145deg,#18232b,#0f171d)!important;border:1px solid rgba(255,255,255,.14)!important;box-shadow:0 8px 22px rgba(16,24,32,.20)!important;transition:transform .16s ease,box-shadow .16s ease!important}

#hub:hover{transform:translateY(-2px)!important;box-shadow:0 11px 26px rgba(16,24,32,.25)!important}

#hub .badge{background:var(--valley-green)!important;border-radius:50%!important;display:grid!important;place-items:center!important;box-shadow:0 0 0 4px rgba(32,166,74,.12)!important}

.rbtn{background:rgba(255,255,255,.94)!important;border:1px solid #d8e3df!important;box-shadow:0 5px 14px rgba(16,24,32,.10)!important;backdrop-filter:blur(8px)}

#conn{box-shadow:-14px 0 36px rgba(16,24,32,.16)!important;border-left:1px solid rgba(32,166,74,.18)!important}

#conn .chead{background:linear-gradient(135deg,#101820,#17262d)!important}

#stage,#tray,#traytabs{scrollbar-width:none!important;-ms-overflow-style:none!important}

#stage::-webkit-scrollbar,#tray::-webkit-scrollbar,#traytabs::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}

/* ==========================================================

   FIN - CSS PARTE 5: INTERFAZ TECNOLOGICA VALLEY

   ========================================================== */





#hub{padding:10px 16px!important;gap:9px!important;border-radius:0 0 18px 18px!important}

#hub .connect-label{display:inline-block;color:#fff;font:700 13px/1 Arial,sans-serif;letter-spacing:.2px;white-space:nowrap}

#hub .badge{width:34px!important;height:34px!important}

#hub .badge svg{width:18px!important;height:18px!important}





/* ==========================================================

   INICIO - LOGO VALLEY EN PANTALLA DE INICIO

   ========================================================== */

#splash .splash-valley-logo{

  width:150px;

  max-width:26vw;

  height:auto;

  object-fit:contain;

  margin:0 0 22px;

  filter:drop-shadow(0 10px 24px rgba(0,0,0,.28));

}

#splash .studs{

  margin-top:0!important;

}

/* ==========================================================

   FIN - LOGO VALLEY EN PANTALLA DE INICIO

   ========================================================== */





/* ==========================================================

   INICIO - SELECTORES TECNOLÓGICOS SIMPLIFICADOS

   ========================================================== */

#bgcard{

  width:min(94vw,760px)!important;

}

#bggrid{

  display:grid!important;

  grid-template-columns:54px repeat(3,minmax(150px,1fr)) 54px!important;

  align-items:center!important;

  gap:10px!important;

  max-height:none!important;

  overflow:hidden!important;

  padding:4px!important;

}

#bggrid .bgtile{

  width:100%!important;

  min-width:0!important;

}

.bgnav{

  width:48px;

  height:74px;

  border:1px solid #d6e0e7;

  border-radius:16px;

  background:#f3f6f8;

  color:#314354;

  font-size:30px;

  font-weight:700;

  cursor:pointer;

  box-shadow:0 5px 14px rgba(20,35,50,.10);

}

.bgnav:hover{

  background:#e7f5ec;

  color:#159447;

  border-color:#9ed6b3;

}

.bgnav:active{

  transform:scale(.96);

}

#sndgrid .srow .pick,

#colgrid .srow .pick{

  justify-content:center!important;

  text-align:center!important;

}

#sndgrid .srow .pick b,

#colgrid .srow .pick b{

  min-width:34px!important;

  text-align:center!important;

  font-size:17px!important;

}

#colgrid .srow .pick{

  gap:18px!important;

}

#colgrid .swatch{

  width:34px!important;

  height:34px!important;

}

/* ==========================================================

   FIN - SELECTORES TECNOLÓGICOS SIMPLIFICADOS

   ========================================================== */





/* ==========================================================

   INICIO - AJUSTE FINAL VALLEY: MARCA DE AGUA Y CONECTAR

   ========================================================== */



/* Marca de agua más grande, siempre detrás de los bloques */

#stage::before{

  content:""!important;

  position:fixed!important;

  left:50vw!important;

  top:42vh!important;

  width:min(980px,72vw)!important;

  height:min(500px,48vh)!important;

  transform:translate(-50%,-50%)!important;

  background:url("../img/logo_valley.png") center/contain no-repeat!important;

  opacity:.105!important;

  pointer-events:none!important;

  z-index:0!important;

}

#stage > *{

  position:relative;

  z-index:1;

}



/* Botón Conectar completo y tecnológico */

#hub{

  position:fixed!important;

  top:18px!important;

  right:22px!important;

  width:auto!important;

  min-width:148px!important;

  height:50px!important;

  padding:0 18px!important;

  display:flex!important;

  align-items:center!important;

  justify-content:center!important;

  gap:10px!important;

  border:1px solid rgba(48,190,99,.55)!important;

  border-radius:16px!important;

  background:linear-gradient(135deg,#111b23 0%,#1d2a34 100%)!important;

  box-shadow:0 10px 28px rgba(15,27,36,.22), inset 0 1px 0 rgba(255,255,255,.08)!important;

  color:#fff!important;

  overflow:hidden!important;

  cursor:pointer!important;

  z-index:60!important;

  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease!important;

}

#hub:hover{

  transform:translateY(-2px)!important;

  border-color:#21b45b!important;

  box-shadow:0 13px 32px rgba(15,27,36,.28),0 0 0 3px rgba(33,180,91,.10)!important;

}

#hub:active{

  transform:translateY(0) scale(.98)!important;

}

#hub .hubpic{

  display:none!important;

}

#hub .bt{

  position:static!important;

  flex:0 0 30px!important;

  width:30px!important;

  height:30px!important;

  border-radius:50%!important;

  display:flex!important;

  align-items:center!important;

  justify-content:center!important;

  margin:0!important;

  background:#19aa55!important;

  color:#fff!important;

  box-shadow:0 0 0 4px rgba(25,170,85,.13)!important;

}

#hub .bt svg{

  width:17px!important;

  height:17px!important;

}

#hub .hublabel{

  display:block!important;

  position:static!important;

  width:auto!important;

  max-width:none!important;

  margin:0!important;

  padding:0!important;

  white-space:nowrap!important;

  overflow:visible!important;

  color:#fff!important;

  font-size:14px!important;

  font-weight:800!important;

  line-height:1!important;

  opacity:1!important;

}

#hub .hubname,

#hub .hubstatus{

  display:none!important;

}



/* ==========================================================

   FIN - AJUSTE FINAL VALLEY: MARCA DE AGUA Y CONECTAR

   ========================================================== */





/* ==========================================================

   INICIO - UNA SOLA MARCA DE AGUA

   ========================================================== */

#watermark,

.watermark,

#workspace-watermark,

.workspace-watermark,

.valley-watermark,

#stage .watermark,

#stage .valley-watermark{

  display:none!important;

  background:none!important;

  background-image:none!important;

}

#stage::after{

  content:none!important;

  display:none!important;

  background:none!important;

}

#stage::before{

  content:""!important;

  display:block!important;

  position:fixed!important;

  left:50vw!important;

  top:42vh!important;

  width:min(980px,72vw)!important;

  height:min(500px,48vh)!important;

  transform:translate(-50%,-50%)!important;

  background:url("../img/logo_valley.png") center/contain no-repeat!important;

  opacity:.105!important;

  pointer-events:none!important;

  z-index:0!important;

}

/* ==========================================================

   FIN - UNA SOLA MARCA DE AGUA

   ========================================================== */





/* ==========================================================

   INICIO - COLORES Y SONIDOS EN TABLA DE 3 COLUMNAS

   ========================================================== */



/* Ocultar únicamente los botones finales "Listo" de estos dos cuadros */

#colcard > .done,

#sndcard > .done,

#colcard .done,

#sndcard .done{

  display:none!important;

}



/* COLORES */

#colgrid{

  display:grid!important;

  grid-template-columns:repeat(3,minmax(86px,1fr))!important;

  gap:10px!important;

  max-height:none!important;

  overflow:visible!important;

  padding:4px!important;

}

#colgrid .srow{

  min-width:0!important;

  height:88px!important;

  margin:0!important;

  padding:0!important;

  display:block!important;

  border:1px solid #dbe3e8!important;

  border-radius:15px!important;

  overflow:hidden!important;

  background:#eef2f5!important;

}

#colgrid .srow .pick{

  width:100%!important;

  height:100%!important;

  min-width:0!important;

  padding:10px!important;

  display:flex!important;

  flex-direction:column!important;

  align-items:center!important;

  justify-content:center!important;

  gap:8px!important;

  border:0!important;

}

#colgrid .srow .pick b{

  min-width:0!important;

  font-size:15px!important;

  line-height:1!important;

}

#colgrid .swatch{

  width:34px!important;

  height:34px!important;

  flex:0 0 34px!important;

}

#colgrid .srow .prev{

  display:none!important;

}

#colgrid .srow.chosen{

  outline:2px solid #1baa55!important;

  outline-offset:-2px!important;

  background:#e5f5eb!important;

}



/* SONIDOS */

#sndgrid{

  display:grid!important;

  grid-template-columns:repeat(3,minmax(86px,1fr))!important;

  gap:10px!important;

  max-height:none!important;

  overflow:visible!important;

  padding:4px!important;

}

#sndgrid .srow{

  min-width:0!important;

  height:76px!important;

  margin:0!important;

  padding:0!important;

  display:grid!important;

  grid-template-columns:1fr 42px!important;

  align-items:stretch!important;

  border:1px solid #dbe3e8!important;

  border-radius:15px!important;

  overflow:hidden!important;

  background:#eef2f5!important;

}

#sndgrid .srow .pick{

  min-width:0!important;

  width:100%!important;

  height:100%!important;

  padding:8px!important;

  display:flex!important;

  align-items:center!important;

  justify-content:center!important;

  border:0!important;

}

#sndgrid .srow .pick b{

  min-width:0!important;

  font-size:17px!important;

  line-height:1!important;

}

#sndgrid .srow .prev{

  display:flex!important;

  width:42px!important;

  height:100%!important;

  align-items:center!important;

  justify-content:center!important;

  border:0!important;

  border-left:1px solid #d8e0e5!important;

  background:rgba(255,255,255,.22)!important;

}

#sndgrid .srow .prev svg{

  width:18px!important;

  height:18px!important;

}

#sndgrid .srow.chosen{

  outline:2px solid #1baa55!important;

  outline-offset:-2px!important;

  background:#e5f5eb!important;

}



/* Mantener Grabar y Detener */

#sndcard .recrow{

  display:grid!important;

  grid-template-columns:1fr 1fr!important;

  gap:10px!important;

  margin-top:14px!important;

}



/* ==========================================================

   FIN - COLORES Y SONIDOS EN TABLA DE 3 COLUMNAS

   ========================================================== */





/* ==========================================================

   INICIO - ELIMINAR BOTON LISTO DE COLOR

   ========================================================== */

#colmodal .done,

#colmodal .ok,

#colmodal button[data-action="done"],

#colcard .done,

#colcard > button:last-child{

  display:none!important;

}

/* ==========================================================

   FIN - ELIMINAR BOTON LISTO DE COLOR

   ========================================================== */





/* ==========================================================

   INICIO - SOLO MARCA DE AGUA GRANDE CENTRAL

   ========================================================== */

#watermark,

.watermark,

#workspace-watermark,

.workspace-watermark,

.valley-watermark,

#stage .watermark,

#stage .valley-watermark,

#stage::after{

  display:none!important;

  content:none!important;

  background:none!important;

  background-image:none!important;

}

#stage::before{

  content:""!important;

  display:block!important;

  position:fixed!important;

  left:50vw!important;

  top:42vh!important;

  width:min(980px,72vw)!important;

  height:min(500px,48vh)!important;

  transform:translate(-50%,-50%)!important;

  background:url("../img/logo_valley.png") center/contain no-repeat!important;

  opacity:.105!important;

  pointer-events:none!important;

  z-index:0!important;

}

/* ==========================================================

   FIN - SOLO MARCA DE AGUA GRANDE CENTRAL

   ========================================================== */





/* ==========================================================

   INICIO - SONIDOS COMO IMAGENES: 3 POR PAGINA

   ========================================================== */

#sndgrid{

  display:grid!important;

  grid-template-columns:52px repeat(3,minmax(82px,1fr)) 52px!important;

  align-items:center!important;

  gap:10px!important;

  max-height:none!important;

  overflow:hidden!important;

  padding:4px!important;

}

#sndgrid .srow{

  height:84px!important;

  margin:0!important;

  display:grid!important;

  grid-template-columns:1fr 38px!important;

  border-radius:15px!important;

}

#sndgrid .srow .pick{

  height:84px!important;

}

#sndgrid .srow .prev{

  width:38px!important;

  height:84px!important;

}

.sndnav{

  width:48px!important;

  height:74px!important;

  border:1px solid #d6e0e7!important;

  border-radius:16px!important;

  background:#f3f6f8!important;

  color:#314354!important;

  font-size:30px!important;

  font-weight:700!important;

  cursor:pointer!important;

  box-shadow:0 5px 14px rgba(20,35,50,.10)!important;

}

.sndnav:hover{

  background:#e7f5ec!important;

  color:#159447!important;

  border-color:#9ed6b3!important;

}

.sndnav:active{

  transform:scale(.96)!important;

}

#sndcard{

  width:min(94vw,660px)!important;

}

#sndcard .done{

  display:none!important;

}

/* ==========================================================

   FIN - SONIDOS COMO IMAGENES: 3 POR PAGINA

   ========================================================== */





/* ==========================================================

   INICIO - SONIDOS SIN BOTON LISTO

   ========================================================== */

#sndmodal button:last-child,

#sndcard > button:last-child,

#sndcard .done,

#sndcard .ok,

#sndcard [data-action="done"]{

  display:none!important;

}

/* ==========================================================

   FIN - SONIDOS SIN BOTON LISTO

   ========================================================== */





/* ==========================================================

   INICIO - MARCA DE AGUA INDEPENDIENTE Y SNAP MEJORADO

   ========================================================== */

#stage::before,

#stage::after{

  content:none!important;

  display:none!important;

  background:none!important;

}

#valleyWatermark{

  display:block!important;

  position:fixed!important;

  left:50vw!important;

  top:42vh!important;

  width:min(980px,72vw)!important;

  height:min(500px,48vh)!important;

  object-fit:contain!important;

  transform:translate(-50%,-50%)!important;

  opacity:.105!important;

  pointer-events:none!important;

  user-select:none!important;

  touch-action:none!important;

  z-index:0!important;

}

#sheet{

  position:relative!important;

  z-index:2!important;

}

#sheet .blk,

#sheet .blk *{

  pointer-events:auto;

}

#ghost{

  pointer-events:none!important;

}

/* ==========================================================

   FIN - MARCA DE AGUA INDEPENDIENTE Y SNAP MEJORADO

   ========================================================== */





/* ==========================================================

   INICIO - TECLADO NUMERICO VALLEY MODERNO

   ========================================================== */

#editor{

  background:rgba(9,18,25,.58)!important;

  backdrop-filter:blur(7px)!important;

  -webkit-backdrop-filter:blur(7px)!important;

}

#edcard{

  width:340px!important;

  padding:18px!important;

  border-radius:24px!important;

  background:linear-gradient(180deg,#16232d 0%,#0f1921 100%)!important;

  border:1px solid rgba(77,213,137,.22)!important;

  box-shadow:

    0 28px 70px rgba(0,0,0,.42),

    0 0 0 1px rgba(255,255,255,.035) inset!important;

}

#edtitle{

  margin:0 0 10px 4px!important;

  color:#8fa2af!important;

  font-size:11px!important;

  font-weight:800!important;

  letter-spacing:1.8px!important;

}

#edview{

  height:70px!important;

  margin-bottom:14px!important;

  border:1px solid rgba(54,211,119,.55)!important;

  border-radius:16px!important;

  background:#091219!important;

  color:#f5fbf8!important;

  font-size:34px!important;

  font-weight:800!important;

  box-shadow:

    0 0 0 3px rgba(31,174,88,.08),

    0 0 24px rgba(31,174,88,.10) inset!important;

}

#edtext{

  height:64px!important;

  margin-bottom:14px!important;

  border:1px solid rgba(54,211,119,.55)!important;

  border-radius:16px!important;

  background:#091219!important;

  color:#f5fbf8!important;

  outline:none!important;

}

#edpad{

  display:grid!important;

  grid-template-columns:repeat(3,1fr)!important;

  gap:9px!important;

}

#edpad button{

  height:58px!important;

  border:1px solid rgba(255,255,255,.055)!important;

  border-radius:14px!important;

  background:linear-gradient(180deg,#253540 0%,#1b2933 100%)!important;

  color:#eef7f2!important;

  font-size:20px!important;

  font-weight:750!important;

  cursor:pointer!important;

  box-shadow:

    0 5px 12px rgba(0,0,0,.20),

    0 1px 0 rgba(255,255,255,.055) inset!important;

  transition:transform .08s ease,background .12s ease,border-color .12s ease!important;

}

#edpad button:hover{

  background:linear-gradient(180deg,#2c414d 0%,#20323d 100%)!important;

  border-color:rgba(49,201,111,.40)!important;

}

#edpad button:active{

  transform:scale(.95)!important;

  background:#183828!important;

  border-color:#2bc36b!important;

}

#edrow{

  gap:10px!important;

  margin-top:14px!important;

}

#edrow button{

  height:52px!important;

  border-radius:14px!important;

  font-size:14px!important;

  font-weight:800!important;

  letter-spacing:.2px!important;

}

#edcancel{

  background:#25323b!important;

  color:#aebbc4!important;

  border:1px solid rgba(255,255,255,.055)!important;

}

#edok{

  background:linear-gradient(135deg,#159c4d,#24c568)!important;

  color:#fff!important;

  border:1px solid rgba(87,239,150,.45)!important;

  box-shadow:0 8px 20px rgba(25,174,83,.22)!important;

}

#edok:hover{

  filter:brightness(1.08)!important;

}

#edcancel:hover{

  background:#2d3c46!important;

  color:#fff!important;

}

/* ==========================================================

   FIN - TECLADO NUMERICO VALLEY MODERNO

   ========================================================== */


/* ==========================================================
   INICIO - PARTE 3: INDICADOR VISUAL DE EJECUCIÓN
   ========================================================== */

/* Bloque que se está ejecutando ahora. */
.blk.exec img{
  filter:brightness(1.14)
    drop-shadow(0 0 7px rgba(255,255,255,.98))
    drop-shadow(0 0 17px rgba(70,200,255,.98));
}

/* Bloque detenido esperando un sensor/condición. */
.blk.exec-waiting img{
  animation:valleySensorWait .72s ease-in-out infinite;
}

@keyframes valleySensorWait{
  0%,100%{
    filter:brightness(1.02)
      drop-shadow(0 0 4px rgba(255,255,255,.8))
      drop-shadow(0 0 7px rgba(70,200,255,.45));
  }
  50%{
    filter:brightness(1.22)
      drop-shadow(0 0 10px rgba(255,255,255,1))
      drop-shadow(0 0 24px rgba(70,200,255,1));
  }
}

@media (prefers-reduced-motion:reduce){
  .blk.exec-waiting img{animation:none;}
}

/* ==========================================================
   FIN - PARTE 3: INDICADOR VISUAL DE EJECUCIÓN
   ========================================================== */


/* ==========================================================
   FIN - PARTE 0: CSS VALLEY V2.6 CORREGIDO
   ========================================================== */
