
.t180pb-wrap{font-family:system-ui,-apple-system,Segoe UI,Roboto,"Noto Sans TC","Microsoft JhengHei",sans-serif;width:100%;max-width:1280px;margin:0 auto;padding:12px;border:1px solid #d7e7f3;border-radius:14px;background:#e9f6ee;box-sizing:border-box}
.t180pb-topbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.t180pb-title{display:flex;align-items:center;gap:10px}
.t180pb-badge{display:inline-flex;align-items:center;justify-content:center;background:#1e88e5;color:#fff;font-weight:800;border-radius:999px;padding:6px 10px;font-size:12px}
.t180pb-h1{font-size:22px;font-weight:900;color:#0b3a57;letter-spacing:1px}
.t180pb-top-actions{display:flex;gap:8px}
.t180pb-btn{border:1px solid #1e88e5;background:#e8f3ff;color:#0b3a57;padding:10px 12px;border-radius:10px;font-weight:800;cursor:pointer}
.t180pb-btn:hover{filter:brightness(0.98)}
.t180pb-btn:active{transform:translateY(1px)}
.t180pb-btn-ghost{background:#fff}
.t180pb-btn-primary{background:#1e88e5;color:#fff;border-color:#1e88e5}
.t180pb-board-area{display:flex;flex-direction:column;gap:12px;align-items:stretch}
@media (max-width: 980px){.t180pb-board-area{grid-template-columns:1fr}.t180pb-side{order:2}}

.t180pb-board{position:relative;display:grid;grid-template-columns:repeat(9,1fr);grid-template-rows:repeat(6,1fr);aspect-ratio: 9/6; width:100%; border:6px solid rgba(255,255,255,0.8); border-radius:12px; overflow:hidden; background:#fff}
.t180pb-cell{position:relative;border:1px solid rgba(0,0,0,0.06);min-height:70px}
.t180pb-cell:nth-child(1){background:#f7b0c9}
.t180pb-cell:nth-child(3){background:#fff68b}
.t180pb-cell:nth-child(5){background:#7ed7ff}
.t180pb-cell:nth-child(6){background:#7ed7ff}
.t180pb-cell:nth-child(11){background:#fff68b}
.t180pb-cell:nth-child(13){background:#7ed7ff}
.t180pb-cell:nth-child(18){background:#bfe1a3}
.t180pb-cell:nth-child(19){background:#fff68b}
.t180pb-cell:nth-child(21){background:#7ed7ff}
.t180pb-cell:nth-child(23){background:#bfe1a3}
.t180pb-cell:nth-child(29){background:#7ed7ff}
.t180pb-cell:nth-child(31){background:#bfe1a3}
.t180pb-cell:nth-child(36){background:#d2d2ee}
.t180pb-cell-label{position:absolute;left:6px;top:6px;background:rgba(0,0,0,0.88);color:#fff;font-weight:900;font-size:14px;padding:6px 10px;border-radius:2px}

.t180pb-robot{position:absolute;left:0;top:0;width:64px;height:64px;transform:translate(0px,0px) rotate(0deg);transform-origin:center;touch-action:none;user-select:none;display:none;z-index:5}
.t180pb-robot-inner{width:100%;height:100%;filter:drop-shadow(0 6px 10px rgba(0,0,0,0.18))}
.t180pb-robot-svg{width:100%;height:100%}
.t180pb-robot-hud{position:absolute;left:50%;top:-18px;transform:translateX(-50%);display:flex;gap:6px}
.t180pb-mini{border:1px solid #1e88e5;background:#fff;color:#0b3a57;border-radius:10px;padding:6px 10px;font-weight:900;cursor:pointer}
.t180pb-mini:active{transform:translateY(1px)}

.t180pb-side{display:flex;flex-direction:column;gap:10px}
.t180pb-panel{background:rgba(255,255,255,0.9);border:1px solid #d7e7f3;border-radius:12px;padding:10px}
.t180pb-panel-h{font-weight:900;color:#0b3a57;margin-bottom:8px}
.t180pb-cards{min-height:120px;display:flex;flex-wrap:wrap;gap:8px;padding:8px;background:#f7fbff;border:1px dashed #b9d7f0;border-radius:12px}
.t180pb-card{display:inline-flex;align-items:center;gap:8px;border:1px solid #1e88e5;background:#e8f3ff;color:#0b3a57;border-radius:12px;padding:10px 10px;font-weight:900}
.t180pb-card .ico{width:18px;height:18px;border-radius:4px;background:#1e88e5}
.t180pb-card-actions{display:flex;gap:8px;margin-top:10px}
.t180pb-run-row{display:flex;gap:8px;flex-wrap:wrap}
.t180pb-status{margin-top:10px;font-weight:800;color:#0b3a57;background:#fff;border:1px solid #d7e7f3;border-radius:12px;padding:10px}

.t180pb-toolbar{display:grid;grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));gap:8px;margin-top:12px}
@media (max-width:980px){.t180pb-toolbar{grid-template-columns:repeat(4,1fr)}}
.t180pb-icbtn{border:2px solid #1e88e5;background:#e8f3ff;color:#0b3a57;border-radius:14px;padding:10px;cursor:pointer;font-weight:900;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:78px}
.t180pb-icbtn:hover{filter:brightness(0.98)}
.t180pb-icbtn:active{transform:translateY(1px)}
.t180pb-icbtn-ico{width:26px;height:26px;border-radius:8px;background:#1e88e5;display:inline-block}
.t180pb-icbtn[data-cmd="go"]{background:#1e88e5;color:#fff}
.t180pb-note{margin-top:10px;font-weight:800;color:#0b3a57}

.t180pb-modal{position:fixed;inset:0;background:rgba(0,0,0,0.45);display:flex;align-items:center;justify-content:center;padding:18px;z-index:99999}
.t180pb-modal-card{max-width:720px;width:100%;background:#fff;border-radius:16px;border:2px solid #1e88e5;overflow:hidden}
.t180pb-modal-h{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:#e8f3ff;font-weight:900}
.t180pb-modal-b{padding:12px 14px;line-height:1.6;font-weight:700;color:#0b3a57}

.t180pb-fs{position:fixed !important; inset:0 !important; margin:0 !important; max-width:none !important; border-radius:0 !important; z-index:9999 !important}

.t180pb-icbtn-img{width:64px;height:64px;object-fit:contain;display:block}

.t180pb-card-img{width:54px;height:54px;object-fit:contain;display:block}

.t180pb-path-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:3;pointer-events:none}
.t180pb-path-active .t180pb-path-canvas{pointer-events:auto;cursor:crosshair}

.t180pb-wrap.t180pb-fullbleed{width:100vw !important;max-width:100vw !important;margin-left:calc(50% - 50vw) !important;margin-right:calc(50% - 50vw) !important;border-radius:0 !important;box-sizing:border-box;}

.t180pb-modal{pointer-events:auto}
.t180pb-modal-card{pointer-events:auto}


/* 強制 hidden 生效 */
.t180pb-modal[hidden]{display:none !important}

@media (min-width: 981px){.t180pb-icbtn{min-height:64px !important; padding:6px !important;} .t180pb-icbtn-img{width:46px !important;height:46px !important;}}

.t180pb-board-wrap{width:100%}

.t180pb-bottom{display:flex;gap:12px;margin-top:12px;align-items:stretch}
.t180pb-panel{flex:1;min-width:260px}
.t180pb-panel.cards{flex:2}
@media (max-width: 980px){
  .t180pb-bottom{flex-direction:column}
  .t180pb-panel{min-width:0}
}

.t180pb-robot-controls{pointer-events:auto;z-index:20}
.t180pb-robot{z-index:10}

.t180pb-robot{transition:transform 1.2s linear, left 1.2s linear, top 1.2s linear;}

/* Toolbar compact 2 rows */
.t180pb-toolbar{display:grid;gap:10px;grid-template-columns:repeat(12, minmax(70px, 1fr));}
.t180pb-icbtn{border:2px solid #1e88e5;border-radius:18px;background:#eaf6ff;min-height:120px;padding:10px;box-sizing:border-box}
.t180pb-icbtn-img{width:64px;height:64px;object-fit:contain}
.t180pb-icbtn-txt{display:block;white-space:nowrap;font-size:18px;line-height:1.1;margin-top:8px; line-height:1.1;}
@media (max-width: 980px){
  .t180pb-toolbar{grid-template-columns:repeat(6, minmax(70px, 1fr));}
  .t180pb-icbtn{min-height:110px}
  .t180pb-icbtn-img{width:58px;height:58px}
  .t180pb-icbtn-txt{font-size:14px}
}

/* === Layout v1.1.0 (Figure 2) === */
.t180pb-main{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start}
.t180pb-board-wrap{flex:1 1 720px;min-width:320px;order:1}
.t180pb-side.t180pb-bottom{flex:1 1 100%;order:2;display:flex;gap:12px;align-items:stretch;margin-top:8px}
.t180pb-panel-cards{flex:2;min-width:360px}
.t180pb-panel-exec{flex:1;min-width:260px}
@media (max-width: 980px){
  .t180pb-side.t180pb-bottom{flex-direction:column}
  .t180pb-panel-cards,.t180pb-panel-exec{min-width:0}
}

/* === Toolbar 2 rows (11 per row) === */
.t180pb-toolbar{display:grid;gap:10px;grid-template-columns:repeat(11, minmax(78px, 1fr));}
.t180pb-icbtn{border:2px solid #1e88e5;border-radius:18px;background:#eaf6ff;min-height:118px;padding:10px;box-sizing:border-box}
.t180pb-icbtn-img{width:72px;height:72px;object-fit:contain}
.t180pb-icbtn-txt{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;line-height:1.15;margin-top:8px}
@media (max-width: 1200px){
  .t180pb-toolbar{grid-template-columns:repeat(8, minmax(74px, 1fr));}
}
@media (max-width: 980px){
  .t180pb-toolbar{grid-template-columns:repeat(6, minmax(70px, 1fr));}
  .t180pb-icbtn{min-height:110px}
  .t180pb-icbtn-img{width:60px;height:60px}
  .t180pb-icbtn-txt{font-size:15px}
}
@media (max-width: 560px){
  .t180pb-toolbar{grid-template-columns:repeat(4, minmax(66px, 1fr));}
  .t180pb-icbtn{min-height:104px;padding:8px}
  .t180pb-icbtn-img{width:56px;height:56px}
  .t180pb-icbtn-txt{font-size:14px}
}

/* === Fullscreen: prevent bottom cut === */
.t180pb-wrap.t180pb-fs{position:fixed;inset:0;z-index:999999;background:#e9f6ee;overflow:auto;padding-bottom:180px}
.t180pb-wrap.t180pb-fs .t180pb-toolbar{margin-bottom:40px}

/* If icon missing, show a friendly glyph instead of blue square */
.t180pb-icbtn[data-cmd="pathPlan"] .t180pb-icbtn-ico::before{content:"🖊️";font-size:28px}
.t180pb-icbtn[data-cmd="robot"] .t180pb-icbtn-ico::before{content:"🤖";font-size:28px}


/* v1.1.1 layout fixes */
.t180pb-board-area{width:100%;}
.t180pb-bottom{display:flex;gap:18px;align-items:flex-start;justify-content:space-between;margin-top:18px;}
.t180pb-bottom .t180pb-panel{flex:1;min-width:0;}
.t180pb-bottom .t180pb-panel:nth-child(1){flex:2;}
@media (max-width: 980px){
  .t180pb-bottom{flex-direction:column;}
}

.t180pb-toolbar{display:grid;grid-template-columns:repeat(11,minmax(0,1fr));gap:12px;align-items:stretch;}
@media (max-width: 980px){.t180pb-toolbar{grid-template-columns:repeat(6,minmax(0,1fr));}}
@media (max-width: 640px){.t180pb-toolbar{grid-template-columns:repeat(4,minmax(0,1fr));}}
.t180pb-icbtn{padding:10px 8px;}
.t180pb-icbtn-img{width:72px;height:72px;object-fit:contain;margin-bottom:6px;}
.t180pb-icbtn-txt{font-size:14px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

.t180pb-wrap:fullscreen,
.t180pb-wrap:-webkit-full-screen{overflow:auto;padding-bottom:240px;}
.t180pb-wrap:fullscreen .t180pb-toolbar,
.t180pb-wrap:-webkit-full-screen .t180pb-toolbar{position:sticky;bottom:0;background:#e9f6ee;z-index:5;padding-bottom:18px;}

/* Side panels under board */
.t180pb-side.t180pb-bottom{display:grid;grid-template-columns:2fr 1fr;gap:12px;align-items:stretch}
@media (max-width: 980px){.t180pb-side.t180pb-bottom{grid-template-columns:1fr}}

@supports(padding:max(0px)){
  .t180pb-wrap:fullscreen{padding-bottom:max(220px, env(safe-area-inset-bottom))}
  .t180pb-wrap:-webkit-full-screen{padding-bottom:max(220px, env(safe-area-inset-bottom))}
}

/* === v1.1.3 Fullscreen: keep command toolbar fixed at bottom === */
.t180pb-wrap.t180pb-fs{overflow:hidden !important}
.t180pb-wrap.t180pb-fs .t180pb-scroll{position:absolute;inset:0;overflow:auto;padding:12px 12px 220px 12px;box-sizing:border-box}
.t180pb-wrap.t180pb-fs .t180pb-toolbar{position:fixed;left:12px;right:12px;bottom:12px;z-index:1000001;margin:0;background:#eaf6ff;border:2px solid #1e88e5;border-radius:18px;padding:10px}

/* === v1.1.4 robot positioning and default hidden === */
.t180pb-board{position:relative}
.t180pb-robot{position:absolute;left:0;top:0;will-change:transform;display:none}
.t180pb-robot[hidden]{display:none !important}

/* === v1.1.4 Fullscreen sticky toolbar + mobile scroll === */
body.t180pb-body-fs{overflow:hidden !important; touch-action:manipulation}
.t180pb-wrap.t180pb-fs{position:fixed;inset:0;z-index:999999;background:#e9f6ee;display:flex;flex-direction:column;overflow:hidden;padding:10px;box-sizing:border-box}
.t180pb-wrap.t180pb-fs .t180pb-scroll{flex:1;overflow:auto;-webkit-overflow-scrolling:touch;padding-bottom:14px}
.t180pb-wrap.t180pb-fs .t180pb-toolbar{position:sticky;bottom:0;z-index:10;background:#e9f6ee;padding-top:8px;padding-bottom:12px}

.t180pb-scroll{width:100%}

.t180pb-wrap.t180pb-fullscreen{position:fixed;inset:0;width:100vw;height:100vh;max-width:none;max-height:none;margin:0 !important;border-radius:0;overflow:auto;padding:14px;box-sizing:border-box;background:#e9f6ee;}

body.t180pb-body-fullscreen{overflow:hidden !important;}

.t180pb-fullscreen .t180pb-toolbar{position:sticky;bottom:0;z-index:50;background:#e9f6ee;padding-bottom:calc(env(safe-area-inset-bottom,0px) + 10px);}

/* === v1.1.8 Fullscreen scroll fix (bottom panels visible) === */
body.t180pb-body-fs{overflow:hidden !important;}
.t180pb-wrap.t180pb-fs{
  position:fixed; inset:0; z-index:999999;
  background:#e9f6ee; box-sizing:border-box;
  overflow:auto !important;
  -webkit-overflow-scrolling:touch;
  padding:10px;
}
/* In fullscreen, keep toolbar in flow (not overlay) */
.t180pb-wrap.t180pb-fs .t180pb-toolbar{
  position:static !important;
  bottom:auto !important;
}
/* Allow full content height in fullscreen */
.t180pb-wrap.t180pb-fs .t180pb-scroll{overflow:visible !important; height:auto !important;}

/* === v1.1.8 Toolbar card layout tweak === */
.t180pb-tool .t180pb-txt{font-size:13px; line-height:1.1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.t180pb-tool .t180pb-ico{display:block; width:72px; height:52px; margin:0 auto 4px auto; background-size:contain; background-repeat:no-repeat; background-position:center;}

.t180pb-icbtn img{width:64px;height:64px;object-fit:contain;display:block;margin:0 auto;}

/* === T180 Program Board v1.2.4 icon rendering fix === */
.t180pb-icbtn-icon{min-height:90px !important; display:flex !important; align-items:center !important; justify-content:center !important;}
.t180pb-icbtn-img{height:auto !important; max-height:86px !important; object-fit:contain !important;}

/* --- Robot color feedback (glow) ---
   Use a glow rather than recoloring the SVG (multi-color SVG can shift incorrectly).
*/
.t180pb-robot{filter:none;}
.t180pb-robot[data-color="red"]{filter:drop-shadow(0 0 14px rgba(255,0,0,0.55));}
.t180pb-robot[data-color="yellow"]{filter:drop-shadow(0 0 14px rgba(255,200,0,0.60));}
.t180pb-robot[data-color="blue"]{filter:drop-shadow(0 0 14px rgba(0,120,255,0.55));}
.t180pb-robot[data-color="green"]{filter:drop-shadow(0 0 14px rgba(0,170,90,0.55));}
