/* ===== Widgets no estilo Dear ImGui (usados nos vídeos e no ImGui Lab) — tamanhos em em ===== */
.igw {
  --ig-bg: rgba(15,15,15,.94); --ig-title: #0a0a0a; --ig-title-a: #294a7a; --ig-frame: rgba(41,74,122,.54); --ig-frame-h: rgba(66,150,250,.40);
  --ig-btn: rgba(66,150,250,.40); --ig-btn-h: #4296fa; --ig-btn-a: #0f87fa; --ig-check: #4296fa; --ig-grab: #3d85e0; --ig-grab-a: #4296fa;
  --ig-text: #fff; --ig-dim: #808080; --ig-border: rgba(110,110,128,.5); --ig-hdr: rgba(66,150,250,.31); --ig-hdr-h: rgba(66,150,250,.8);
  --ig-sep: rgba(110,110,128,.5); --ig-menubar: #242424; --ig-tab: rgba(46,89,148,.86); --ig-tab-a: #3369ad; --ig-popup: rgba(20,20,20,.94);
  --ig-plot: #9c9c9c; --ig-hist: #e6b300; --ig-th: #303033; --ig-tb: #4f4f59; --ig-tl: #3b3b40; --ig-row: rgba(255,255,255,.06);
  --ig-r: 0px; --ig-fr: 0px;
  position: relative; font: 1em/1.3 'JetBrains Mono', Consolas, 'Courier New', monospace; color: var(--ig-text); background: var(--ig-bg);
  border: 1px solid var(--ig-border); border-radius: var(--ig-r); min-width: 21em; box-shadow: 0 .6em 2.2em rgba(0,0,0,.55); text-align: left;
}
.igw.ig-light, .ig-light .igw {
  --ig-bg: rgba(240,240,240,1); --ig-title-a: #d1d1d1; --ig-frame: #fff; --ig-frame-h: rgba(66,150,250,.40); --ig-btn: rgba(66,150,250,.40);
  --ig-btn-h: #4296fa; --ig-check: #4296fa; --ig-grab: rgba(66,150,250,.78); --ig-text: #000; --ig-dim: #999; --ig-border: rgba(0,0,0,.3);
  --ig-hdr: rgba(66,150,250,.31); --ig-sep: rgba(99,99,99,.62); --ig-menubar: #dbdbdb; --ig-tab: rgba(195,203,213,.93); --ig-tab-a: #97b4de;
  --ig-popup: rgba(255,255,255,.98); --ig-plot: #636363; --ig-th: #c7ddf7; --ig-tb: #a1a1a8; --ig-tl: #d1d1d8; --ig-row: rgba(0,0,0,.05);
}
.igw.ig-classic {
  --ig-bg: rgba(0,0,0,.85); --ig-title-a: #5252a1; --ig-frame: rgba(110,110,110,.39); --ig-frame-h: rgba(120,120,204,.4); --ig-btn: rgba(89,102,158,.62);
  --ig-btn-h: rgba(102,122,204,.79); --ig-check: rgba(230,230,230,.5); --ig-grab: rgba(255,255,255,.3); --ig-text: #e6e6e6; --ig-dim: #999;
  --ig-border: rgba(127,127,127,.5); --ig-hdr: rgba(102,102,230,.45); --ig-sep: rgba(127,127,127,.6); --ig-menubar: rgba(102,102,140,.8);
  --ig-tab: rgba(84,84,168,.79); --ig-tab-a: rgba(104,104,196,.84); --ig-popup: rgba(28,28,36,.92); --ig-th: rgba(69,69,114,1);
}
.ig-title { display: flex; align-items: center; gap: .55em; padding: .28em .55em; background: var(--ig-title-a); border-radius: var(--ig-r) var(--ig-r) 0 0; white-space: nowrap; }
.ig-title b { font-size: .7em; font-weight: 400; }
.ig-title .ig-x { margin-left: auto; font-size: 1.1em; line-height: 1; opacity: .85; }
.ig-body { padding: .6em .7em; display: flex; flex-direction: column; gap: .32em; }
.ig-row { display: flex; align-items: center; gap: .45em; min-height: 1.6em; white-space: nowrap; }
.ig-text { color: var(--ig-text); white-space: nowrap; }
.ig-dim, .ig-col-dim { color: var(--ig-dim); }
.ig-col-yellow { color: #ffff00; } .ig-col-green { color: #66ff66; } .ig-col-red { color: #ff6666; }
.igw.ig-light .ig-col-yellow { color: #b38f00; }
.ig-bul { margin-right: .35em; }
.ig-btn { display: inline-block; background: var(--ig-btn); padding: .18em .6em; border-radius: var(--ig-fr); }
.ig-chk { position: relative; flex: none; width: 1.4em; height: 1.4em; background: var(--ig-frame); border-radius: var(--ig-fr); }
.ig-chk.on::after { content: ''; position: absolute; left: .42em; top: .15em; width: .4em; height: .78em; border: solid var(--ig-check); border-width: 0 .22em .22em 0; transform: rotate(45deg); }
.ig-rad { position: relative; flex: none; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--ig-frame); }
.ig-rad.on::after { content: ''; position: absolute; inset: .36em; border-radius: 50%; background: var(--ig-check); }
.ig-radl { margin-right: .7em; }
.ig-frame { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 13em; height: 1.6em; background: var(--ig-frame); border-radius: var(--ig-fr); overflow: hidden; }
.ig-frame em { font-style: normal; position: relative; }
.ig-slider i { position: absolute; top: .16em; bottom: .16em; width: 1.1em; background: var(--ig-grab); border-radius: var(--ig-fr); }
.ig-input { justify-content: flex-start; padding: 0 .45em; }
.ig-cur { display: inline-block; width: 1px; height: 1.05em; margin-left: 1px; background: var(--ig-text); animation: blink 1s steps(1) infinite; }
.ig-combo { justify-content: space-between; padding-left: .45em; }
.ig-combo b { align-self: stretch; display: grid; place-items: center; width: 1.6em; background: var(--ig-btn); font-size: .75em; font-weight: 400; }
.ig-rgb { width: 11.2em; justify-content: space-around; gap: .2em; }
.ig-rgb em { font-size: .9em; }
.ig-sw { flex: none; width: 1.6em; height: 1.6em; border-radius: var(--ig-fr); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.ig-prog { width: 16em; }
.ig-prog i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ig-hist); border-radius: var(--ig-fr); }
.ig-sep { height: 1px; background: var(--ig-sep); margin: .3em 0; }
.ig-spacing { height: .45em; }
.ig-hdr { display: flex; align-items: center; gap: .5em; padding: .22em .45em; background: var(--ig-hdr); border-radius: var(--ig-fr); }
.ig-hdr b, .ig-tree b { font-size: .7em; font-weight: 400; }
.ig-tree { gap: .5em; }
.ig-tabs { display: flex; gap: .25em; border-bottom: 1px solid var(--ig-tab-a); margin-bottom: .25em; }
.ig-tabs span { padding: .18em .65em; background: var(--ig-tab); border-radius: .3em .3em 0 0; }
.ig-tabs span.on { background: var(--ig-tab-a); }
.ig-menubar { display: flex; gap: 1.1em; background: var(--ig-menubar); padding: .2em .7em; }
.ig-body > .ig-menubar { margin: -.6em -.7em .25em; }
.ig-plot { width: 16em; height: 3.6em; }
.ig-plot svg { width: 100%; height: 100%; }
.ig-plot polyline { fill: none; stroke: var(--ig-plot); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ig-table { border: 1px solid var(--ig-tb); font-size: .95em; }
.ig-tr { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.ig-tr span { padding: .15em .5em; border-right: 1px solid var(--ig-tl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-tr span:last-child { border-right: 0; }
.ig-th { background: var(--ig-th); }
.ig-tr:not(.ig-th):nth-child(even) { background: var(--ig-row); }
.ig-child { border: 1px solid var(--ig-border); height: 6.5em; overflow: hidden; padding: .3em .5em; background: rgba(0,0,0,.15); border-radius: var(--ig-fr); }
.ig-canvas { position: relative; height: 10em; background: #1e1e28; border: 1px solid var(--ig-border); }
.ig-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ig-body .hit { outline: .16em solid #ffffff; outline-offset: .18em; border-radius: .2em; }

/* ===== ImGui Lab ===== */
.lab { max-width: 1400px; margin: 0 auto; padding: 26px 24px 50px; }
.lab-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.lab-head h1 { margin: 0; font-size: 34px; letter-spacing: -1px; }
.lab-head h1 span { font: 700 13px var(--mono); vertical-align: middle; margin-left: 8px; padding: 3px 9px; border-radius: 99px; background: rgba(66,150,250,.18); color: #7fb6ff; letter-spacing: 0; }
.lab-head p { margin: 6px 0 0; color: var(--muted); max-width: 720px; }
.lab-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lab-stage { position: relative; height: 690px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--clear, #2e4a66); transition: background .25s; font-size: 13px; user-select: none; }
.lab-stage::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 32px 32px; pointer-events: none; }
.lab-vp { position: absolute; left: 12px; bottom: 10px; font: 11px var(--mono); color: rgba(255,255,255,.55); pointer-events: none; }
.lab-stage .igw { position: absolute; }
.lab-win { width: 30em; }
.lab-win .ig-body { max-height: 590px; overflow: auto; scrollbar-width: thin; scrollbar-color: #4f4f59 transparent; }
.lab-win.collapsed .ig-body { display: none; }
.lab-stage [data-w] { cursor: pointer; }
.lab-stage .ig-title { cursor: move; }
.lab-stage .ig-title b, .lab-stage .ig-x { cursor: pointer; }
.lab-stage .sel { outline: 2px dashed #ffffff; outline-offset: 2px; border-radius: 3px; }
.lab-stage .ig-btn:hover, .lab-stage .ig-combo:hover b { background: var(--ig-btn-h); }
.lab-stage .ig-btn:active { background: var(--ig-btn-a); }
.lab-stage .ig-frame:hover, .lab-stage .ig-chk:hover, .lab-stage .ig-rad:hover { background: var(--ig-frame-h); }
.lab-stage .ig-slider.act i { background: var(--ig-grab-a); }
.lab-stage .ig-hdr:hover { background: var(--ig-hdr-h); }
.lab-stage .ig-tabs span { cursor: pointer; }
.lab-stage .ig-tabs span:hover { background: var(--ig-btn-h); }
.lab-stage .ig-menubar span { cursor: pointer; padding: 0 .3em; }
.lab-stage .ig-menubar span.open, .lab-stage .ig-menubar span:hover { background: var(--ig-hdr-h); }
.lab-stage .ig-row { position: relative; }
.ig-colorin { position: absolute; left: 2em; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; pointer-events: none; }
.ig-input-real { width: 13em; height: 1.6em; border: 0; outline: 0; padding: 0 .45em; font: inherit; color: var(--ig-text); background: var(--ig-frame); border-radius: var(--ig-fr); }
.ig-input-real:focus { background: var(--ig-frame-h); }
.ig-popup { position: absolute; z-index: 10; min-width: 13em; padding: .3em 0; background: var(--ig-popup); border: 1px solid var(--ig-border); box-shadow: 0 .5em 1.5em rgba(0,0,0,.5); }
.ig-popup div { padding: .2em .8em; white-space: nowrap; display: flex; justify-content: space-between; gap: 2em; cursor: pointer; }
.ig-popup div:hover, .ig-popup div.on { background: var(--ig-hdr); }
.ig-popup div small { color: var(--ig-dim); font-size: 1em; }
.ig-popup hr { border: 0; border-top: 1px solid var(--ig-sep); margin: .25em 0; }
.ig-help { color: var(--ig-dim); position: relative; }
.ig-help:hover::after { content: attr(data-tip); position: absolute; left: 1.6em; top: 1.4em; z-index: 12; width: 20em; white-space: normal; padding: .45em .6em; color: var(--ig-text); background: var(--ig-popup); border: 1px solid var(--ig-border); box-shadow: 0 .4em 1.2em rgba(0,0,0,.5); }
.ig-list { display: flex; flex-direction: column; gap: .25em; }
.ig-bug { color: #ff6666; font-size: .92em; white-space: normal; }
.lab-con { width: 25em; }
.lab-con .ig-body { height: 11.5em; }
.lab-con .ig-child { flex: 1; height: auto; overflow: auto; font-size: .92em; scrollbar-width: thin; }
.lab-ov { right: 12px; top: 12px; min-width: 0; background: rgba(15,15,15,.35); border: 0; border-radius: .4em; padding: .45em .7em; line-height: 1.45; }
.lab-reopen { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); }
.lab-sort { opacity: .7; font-size: .8em; }

/* inspetor */
.lab-insp { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; height: 690px; }
.insp-h { padding: 16px 18px 0; }
.insp-h small { font: 700 11px var(--mono); letter-spacing: 1px; text-transform: uppercase; color: #ffffff; }
.insp-h h2 { margin: 2px 0 10px; font: 700 20px var(--mono); }
.insp-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.insp-tabs button { background: none; border: 0; padding: 9px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.insp-tabs button.on { color: var(--text); border-bottom-color: #4296fa; }
.insp-body { flex: 1; overflow: auto; padding: 16px 18px 20px; }
.insp-body .cwrap { margin-top: 0; }
.insp-body .cblock { font-size: 12.5px; }
.insp-body p { color: #cfd3ee; margin: 0 0 12px; font-size: 14.5px; }
.insp-state { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.insp-state code { background: #222222; padding: 3px 8px; }
.iss { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.iss b { display: block; padding: 10px 12px; background: rgba(255,92,122,.08); color: #ffb3c1; font-size: 14px; }
.iss b::before { content: '⚠ '; }
.iss span { display: block; padding: 10px 12px; font-size: 14px; color: #cfd3ee; }
.iss span::before { content: '✔ '; color: var(--ok); font-weight: 700; }

/* pipeline do frame */
.lab-frame { margin-top: 16px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.lf-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.lf-top b { color: var(--text); }
.lf-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.lf-steps div { padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 12.5px; transition: all .15s; }
.lf-steps div code { display: block; font-size: 11.5px; background: none; padding: 0; color: #9dbbff; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lf-steps div.on { border-color: #4296fa; background: rgba(66,150,250,.16); box-shadow: 0 0 20px -6px #4296fa; }
.lf-steps div.you { border-style: dashed; }
.lf-evt { margin-top: 10px; font: 12.5px var(--mono); color: #ffffff; min-height: 1.4em; }

/* problemas comuns + montar o projeto */
.lab-more { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.lab-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.lab-box h2 { margin: 0 0 4px; font-size: 20px; }
.lab-box > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.lab-box ol { margin: 0; padding-left: 20px; color: #cfd3ee; font-size: 14px; }
.lab-box li { margin-bottom: 8px; }
.faq-search { width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; margin-bottom: 10px; }
.faq { max-height: 520px; overflow: auto; }
.faq details { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: rgba(255,255,255,.02); }
.faq summary { padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.faq summary small { color: #7fb6ff; font: 11px var(--mono); margin-left: 6px; }
.faq details p { margin: 0; padding: 0 12px 12px; color: #cfd3ee; font-size: 14px; }

@media (max-width: 1100px) {
  .lab-grid, .lab-more { grid-template-columns: 1fr; }
  .lab-insp { height: auto; max-height: 640px; }
  .lf-steps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .lab { padding: 18px 12px 40px; }
  .lab-stage { font-size: 11px; height: 620px; }
  .lab-win { width: calc(100% - 16px); }
  .lf-steps { grid-template-columns: repeat(2, 1fr); }
}
