/* Ruang IoT — label data live Digital Twin di atas model 3D (Opsi A, 2026-10-24). Hanya elemen .iw-t3-*. */
.iw-t3-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.iw-t3-layer[hidden] { display: none; }
.iw-t3-tag {
    /* Iterasi 1 (R3D-3): chip satu baris di ATAS komponen; kartu rincian (.iw-t3-more) hanya saat disorot/disematkan. */
    position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer;
    font: 500 11.5px/1.3 var(--iw-font, Inter, system-ui, sans-serif); color: #0f1c30;
    will-change: transform; transition: transform .12s linear;
}
.iw-t3-chip {
    display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px 0 6px; border-radius: 100px; white-space: nowrap;
    background: rgba(255, 255, 255, .95); border: 1px solid #cbd5e1; box-shadow: 0 2px 6px rgba(15, 28, 48, .18);
}
.iw-t3-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; flex: 0 0 auto; }
.iw-t3-chip > b { font-weight: 800; font-size: 10.5px; color: #475569; }
.iw-t3-chip > strong { font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #0f1c30; }
.iw-t3-chip[data-tone="success"]::before { background: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, .22); }
.iw-t3-chip[data-tone="success"] > strong { color: #047857; }
.iw-t3-chip[data-tone="info"]::before { background: #3b82f6; }
.iw-t3-chip[data-tone="info"] > strong { color: #1d4ed8; }
.iw-t3-chip[data-tone="warning"]::before { background: #f59e0b; }
.iw-t3-chip[data-tone="warning"] > strong { color: #b45309; }
.iw-t3-chip[data-tone="danger"] { border-color: #fca5a5; }
.iw-t3-chip[data-tone="danger"]::before { background: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, .25); }
.iw-t3-chip[data-tone="danger"] > strong { color: #b91c1c; }
.iw-t3-chip[data-tone="muted"] > strong { color: #64748b; }
.iw-t3-more {
    display: none; position: absolute; left: 0; top: 24px; z-index: 2; min-width: 150px; max-width: 230px;
    padding: 6px 9px 7px; border-radius: 9px; background: rgba(255, 255, 255, .97); border: 1px solid #cbd5e1; border-left: 3px solid #94a3b8;
    box-shadow: 0 6px 18px rgba(15, 28, 48, .2);
}
.iw-t3-tag:hover { z-index: 3; }
.iw-t3-tag:hover > .iw-t3-more, .iw-t3-tag[data-open="1"] > .iw-t3-more { display: block; }
.iw-t3-tag[data-open="1"] > .iw-t3-chip { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .25), 0 2px 6px rgba(15, 28, 48, .18); }
.iw-t3-more > b { display: block; margin-bottom: 3px; font-weight: 800; font-size: 11px; letter-spacing: .2px; color: #33445f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iw-t3-more > span { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: baseline; }
.iw-t3-more > span + span { margin-top: 2px; }
.iw-t3-more i { font-style: normal; color: #52627d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iw-t3-more strong { font: 800 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #0f1c30; }
.iw-t3-more small { grid-column: 1 / -1; font-size: 10.5px; color: #64748b; }
.iw-t3-more span[data-tone="success"] strong { color: #047857; }
.iw-t3-more span[data-tone="warning"] strong { color: #b45309; }
.iw-t3-more span[data-tone="danger"] strong { color: #b91c1c; }
.iw-t3-more span[data-tone="info"] strong { color: #1d4ed8; }
.iw-t3-more span[data-tone="muted"] strong { color: #64748b; }
.iw-t3-tag[data-tone="success"] > .iw-t3-more { border-left-color: #10b981; }
.iw-t3-tag[data-tone="warning"] > .iw-t3-more { border-left-color: #f59e0b; }
.iw-t3-tag[data-tone="danger"] > .iw-t3-more { border-left-color: #ef4444; }
.iw-t3-tag[data-tone="info"] > .iw-t3-more { border-left-color: #3b82f6; }

.iw-t3-bar {
    /* Kiri bawah: tombol Run/Tambah editor menempati kiri atas kanvas. */
    position: absolute; left: 8px; bottom: 8px; z-index: 4; pointer-events: auto;
    display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 16px);
    padding: 4px 5px 4px 9px; border-radius: 100px;
    background: rgba(255, 255, 255, .92); border: 1px solid #cbd5e1; color: #1e2a3d;
    box-shadow: 0 4px 14px rgba(15, 28, 48, .12);
    font: 600 11.5px/1.25 var(--iw-font, Inter, system-ui, sans-serif);
}
.iw-t3-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 0; opacity: 0; transition: max-width .2s ease, opacity .2s ease; }
.iw-t3-bar:hover .iw-t3-text, .iw-t3-bar:focus-within .iw-t3-text, .iw-t3-bar.is-open .iw-t3-text { max-width: min(520px, 60vw); opacity: 1; }
.iw-t3-bar { cursor: default; }
@media (prefers-reduced-motion: reduce) { .iw-t3-text { transition: none; } }
.iw-t3-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.iw-t3-dot[data-tone="success"] { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.iw-t3-dot[data-tone="info"] { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.iw-t3-dot[data-tone="warning"] { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.iw-t3-dot[data-tone="danger"] { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }
.iw-t3-toggle {
    flex: 0 0 auto; height: 24px; padding: 0 10px; border-radius: 100px; cursor: pointer;
    border: 1px solid #cbd5e1; background: #fff; color: #1e3a8a; font: 700 11px/1 var(--iw-font, Inter, sans-serif);
}
.iw-t3-toggle:focus-visible { outline: 3px solid #5b8cff; outline-offset: 2px; }

[data-theme="dark"] .iw-t3-chip, html[data-bs-theme="dark"] .iw-t3-chip, [data-theme="dark"] .iw-t3-more, html[data-bs-theme="dark"] .iw-t3-more { background: rgba(15, 26, 43, .95); border-color: #2c3d57; color: #e6edf7; }
[data-theme="dark"] .iw-t3-chip > b, html[data-bs-theme="dark"] .iw-t3-chip > b, [data-theme="dark"] .iw-t3-more > b, html[data-bs-theme="dark"] .iw-t3-more > b { color: #c7d4e8; }
[data-theme="dark"] .iw-t3-chip > strong, html[data-bs-theme="dark"] .iw-t3-chip > strong, [data-theme="dark"] .iw-t3-more strong, html[data-bs-theme="dark"] .iw-t3-more strong { color: #f1f5fb; }
[data-theme="dark"] .iw-t3-more i, html[data-bs-theme="dark"] .iw-t3-more i { color: #9fb0c9; }
[data-theme="dark"] .iw-t3-chip[data-tone="success"] > strong, [data-theme="dark"] .iw-t3-more span[data-tone="success"] strong { color: #6ee7b7; }
[data-theme="dark"] .iw-t3-chip[data-tone="warning"] > strong, [data-theme="dark"] .iw-t3-more span[data-tone="warning"] strong { color: #fcd34d; }
[data-theme="dark"] .iw-t3-chip[data-tone="danger"] > strong, [data-theme="dark"] .iw-t3-more span[data-tone="danger"] strong { color: #fca5a5; }
[data-theme="dark"] .iw-t3-chip[data-tone="info"] > strong, [data-theme="dark"] .iw-t3-more span[data-tone="info"] strong { color: #93c5fd; }
[data-theme="dark"] .iw-t3-bar, html[data-bs-theme="dark"] .iw-t3-bar { background: rgba(15, 26, 43, .92); border-color: #2c3d57; color: #e6edf7; }
[data-theme="dark"] .iw-t3-toggle, html[data-bs-theme="dark"] .iw-t3-toggle { background: #13233a; border-color: #2c3d57; color: #9cc0ff; }
@media (max-width: 700px) {
    .iw-t3-more { max-width: 180px; min-width: 120px; font-size: 10.5px; }
    .iw-t3-bar { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) { .iw-t3-tag { transition: none; } }
/* Kartu rincian chip yang ditaruh di bawah komponen membuka ke atas bila perlu dibiarkan default (ke bawah). */
