/* /ecodesignlab control panel — shared component (extracted 2026-10-22 from ecodesignlab.html
   and cards-splat.js, byte-identical rules). Used by /ecodesignlab, /DCL (generated) and the
   3dEX-v2 editor (/3dEX-v2/edit/). The id selectors serve the course page; the class aliases
   (.ecl-panel / .ecl-head / .ecl-body / .csp-panel) let the editor reuse the same rules.
   Change the look here once — both surfaces follow. */
/* ── ONE panel (2026-10-15, David): card style — paper #121212, mono, 2px corners, draggable header; sections collapse ── */
#ecl-panel, .ecl-panel { position: fixed; top: 12px; left: 12px; z-index: 400;   /* above the splat overlay map (310) */ width: 232px; max-height: calc(100vh - 24px); overflow: auto; background: #121212; color: #f2f2f2;
    font-family: "SF Mono", Menlo, "JetBrains Mono", "Courier New", monospace; border: 1px solid rgba(255,255,255,0.14); border-radius: 2px; box-shadow: 0 18px 50px rgba(0,0,0,.6); user-select: none; scrollbar-width: none; }
#ecl-panel::-webkit-scrollbar, .ecl-panel::-webkit-scrollbar { display: none; }
#ecl-head, .ecl-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: grab; background: #EB6257; color: #111; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; touch-action: none; }
#ecl-head:active, .ecl-head:active { cursor: grabbing; } .ecl-grip { opacity: .55; font-size: 13px; } .ecl-title { flex: 1; } .ecl-fold { cursor: pointer; padding: 0 4px; font-size: 14px; line-height: 1; }
#ecl-body, .ecl-body { overflow: hidden; } #ecl-body.col, .ecl-body.col { display: none; }
.cpanel { border-top: 1px solid rgba(255,255,255,0.1); color: #f2f2f2; user-select: none; }
.cpanel:first-child { border-top: 0; }
.lens-btn { font: inherit; font-size: 11px; padding: 3px 8px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #f2f2f2; cursor: pointer; }
.lens-btn.active { background: #f2f2f2; color: #111; } #lens-bar { gap: 4px; cursor: default; }
.cpanel-hdr { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; transition: background 0.15s; }
.cpanel-hdr:hover { background: rgba(255,255,255,0.06); }
.cpanel-arr {
    font-size: 9px; color: rgba(255,255,255,0.45);
    transition: transform 0.24s; display: inline-block;
    transform: rotate(90deg);
}
.cpanel-arr.col { transform: rotate(0deg); }
.cpanel-ttl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: rgba(255,255,255,0.75); }
.cpanel-body {
    overflow: hidden; max-height: 400px; padding: 6px 0;
    transition: max-height 0.28s ease, padding 0.28s ease;
}
.cpanel-body.col { max-height: 0; padding: 0; }
.cp-row { display: flex; align-items: center; gap: 10px; padding: 5px 12px; cursor: pointer; white-space: nowrap; font-size: 11px; color: rgba(255,255,255,0.85); transition: background 0.12s; }
.cp-row:hover { background: rgba(255,255,255,0.06); }
.cp-check { cursor: pointer; }
.cp-check input { cursor: pointer; accent-color: #EB6257; }
.cp-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,0.18); transition: background 0.2s;
}
.cp-dot.on  { background: #EB6257; box-shadow: 0 0 5px #EB625788; border-radius: 0; }
.cp-dot.anag-on { background: linear-gradient(135deg,#f00,#00c); }
.cp-dot.ar-on   { background: linear-gradient(135deg,#EB6257,#44D62C); }
.cp-dot.nil { background: transparent; }
.cp-link { color: rgba(255,255,255,0.82); text-decoration: none; }
.cp-link:hover { color: #fff; }


/* ── Grid options sub-panel ── */
#grid-opts {
    display: none;
    background: rgba(255,255,255,0.04);
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 9px 13px 10px;
}
.go-row {
    display: flex; align-items: center; gap: 7px;
    margin-bottom: 8px; font-size: 11px;
}
.go-row:last-child { margin-bottom: 0; }
.go-lbl {
    width: 48px; flex-shrink: 0;
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; color: rgba(255,255,255,0.4);
}
.go-color {
    width: 26px; height: 18px; border: none; border-radius: 4px;
    cursor: pointer; padding: 1px; background: none; flex-shrink: 0;
}
.go-range { flex: 1; accent-color: #44D62C; cursor: pointer; height: 3px; }
.go-val {
    width: 28px; text-align: right; color: #86efac;
    font-size: 10px; flex-shrink: 0;
}
.gs-grp { display: flex; gap: 3px; flex-wrap: wrap; }
.gs-btn {
    padding: 2px 7px; border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.14);
    background: transparent; color: rgba(255,255,255,0.5);
    font-size: 11px; cursor: pointer; transition: all 0.12s;
    letter-spacing: 0.01em;
}
.gs-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.gs-btn.active {
    background: rgba(255,255,255,0.18); color: #fff;
    border-color: rgba(255,255,255,0.32);
}

/* splat panel (Höhe / Größe / Drehung) — was injected by cards-splat.js */
.csp-panel { position: fixed; right: 14px; bottom: 64px; z-index: 400; width: 250px; background: rgba(10,10,10,.92); color: #fff; font-family: "SF Mono", Menlo, monospace; font-size: 11px; padding: 10px 12px; box-shadow: 0 4px 24px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.12); }
.csp-panel .csp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .csp-panel .csp-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.csp-panel .csp-status { color: #EB6257; } .csp-panel .csp-x { cursor: pointer; padding: 2px 6px; background: #fff; color: #111; font-weight: 700; }
.csp-panel .csp-row { display: grid; grid-template-columns: 62px 1fr 42px 10px; gap: 6px; align-items: center; margin: 4px 0; } .csp-panel input[type=range] { width: 100%; accent-color: #EB6257; }
.csp-panel output { text-align: right; } .csp-panel i { font-style: normal; color: #999; }
.csp-panel .csp-btns { display: flex; gap: 6px; margin-top: 8px; } .csp-panel button { flex: 1; font: inherit; padding: 5px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); cursor: pointer; }
.csp-panel.csp-inline { position: static; width: auto; box-shadow: none; border: 0; border-top: 1px solid rgba(255,255,255,.1); background: transparent; }

/* ── phone chrome (2026-10-22, David: "not crowded by too big menu") — built by ecodesignlab/mobile.js ──
   ≤ 640 px: #ecl-panel hides, a 44 px bar of mono text chips sits at the bottom (safe-area aware), a chip opens a
   half-height sheet that holds the panel's own section nodes. Desktop: none of these elements exist / show. */
#ecl-mbar, #ecl-msheet, #ecl-mscrim { display: none; }
@media (max-width: 640px) {
  #ecl-panel { display: none !important; }
  .ecl-mobile #info { display: none !important; }
  #ecl-mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 460; height: calc(44px + env(safe-area-inset-bottom, 0px)); padding: 0 6px env(safe-area-inset-bottom, 0px);
    align-items: center; gap: 2px; background: #121212; border-top: 1px solid rgba(255,255,255,.14); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    font-family: "SF Mono", Menlo, "JetBrains Mono", "Courier New", monospace; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
  #ecl-mbar::-webkit-scrollbar { display: none; }
  .ecl-chip { flex: none; position: relative; height: 32px; padding: 0 9px; display: inline-flex; align-items: center; border: 0; border-radius: 2px; background: transparent; color: #f2f2f2;
    font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer; }
  .ecl-chip.on { background: #EB6257; color: #111; }
  .ecl-chip.na { color: rgba(255,255,255,.45); }
  .ecl-chip-who { flex: 0 1 auto; min-width: 0; max-width: 92px; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 32px; text-transform: none; letter-spacing: 0; font-weight: 400; color: rgba(255,255,255,.7); margin-left: auto; }
  .ecl-chip-new { font-size: 16px; padding: 0 11px; background: #f2f2f2; color: #111; }
  .ecl-chip-dot { display: none; position: absolute; top: 6px; right: 3px; width: 5px; height: 5px; background: #EB6257; }
  .ecl-chip.has .ecl-chip-dot { display: block; } .ecl-chip.on .ecl-chip-dot { background: #111; }
  #ecl-mscrim { position: fixed; inset: 0; z-index: 440; background: transparent; }
  #ecl-mscrim.open { display: block; }
  #ecl-msheet { position: fixed; left: 0; right: 0; bottom: calc(44px + env(safe-area-inset-bottom, 0px)); z-index: 450; max-height: 50vh; max-height: 50dvh; flex-direction: column;
    background: #121212; color: #f2f2f2; border-top: 1px solid rgba(255,255,255,.14); box-shadow: 0 -18px 50px rgba(0,0,0,.5); border-radius: 2px 2px 0 0;
    font-family: "SF Mono", Menlo, "JetBrains Mono", "Courier New", monospace; transition: transform .18s ease; }
  #ecl-msheet.open { display: flex; }
  .ecl-msheet-grip { flex: none; height: 16px; display: grid; place-items: center; touch-action: none; } .ecl-msheet-grip i { width: 36px; height: 3px; background: rgba(255,255,255,.3); }
  .ecl-msheet-head { flex: none; display: flex; align-items: center; padding: 0 12px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; touch-action: none; }
  .ecl-msheet-title { flex: 1; color: #EB6257; } .ecl-msheet-x { padding: 4px 8px; cursor: pointer; }
  .ecl-msheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
  .ecl-msheet-empty { display: none; padding: 10px 12px 16px; font-size: 11px; color: rgba(255,255,255,.55); }
  #ecl-msheet.is-empty .ecl-msheet-empty { display: block; }
  /* the panel sections inside the sheet: headers off (the sheet has its own title), bodies always open, touch-size rows */
  #ecl-msheet .cpanel-hdr { display: none; }
  #ecl-msheet .cpanel { border-top: 0; }
  #ecl-msheet .cpanel + .cpanel { border-top: 1px solid rgba(255,255,255,.1); }
  #ecl-msheet .cpanel-body, #ecl-msheet .cpanel-body.col { max-height: none; padding: 4px 0; transition: none; }
  #ecl-msheet .cp-row { min-height: 40px; font-size: 12px; }
  #ecl-msheet .cp-check input { width: 18px; height: 18px; }
  #ecl-msheet .lens-btn { min-height: 32px; padding: 3px 12px; }
  #ecl-msheet .csp-panel.csp-inline { border-top: 0; }
  #ecl-msheet .csp-panel .csp-row { min-height: 36px; }
  /* MapLibre controls: compact, and the bottom ones sit above the bar */
  .ecl-mobile #map .maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 8px 8px 0 0; }
  .ecl-mobile #map .maplibregl-ctrl-group button { width: 26px; height: 26px; }
  .ecl-mobile #map .maplibregl-ctrl-bottom-right, .ecl-mobile #map .maplibregl-ctrl-bottom-left { bottom: calc(44px + env(safe-area-inset-bottom, 0px)); }
  .ecl-mobile #map .maplibregl-ctrl-scale { font-size: 9px; margin: 0 8px 6px 0; }
}
