:root{
  --bg:#050505;
  --panel:#0e0e0e;
  --panel-2:#141414;
  --panel-3:#1b1b1b;
  --border:rgba(255,255,255,.09);
  --text:#f5f5f5;
  --muted:#a4a4a4;
  --success:#65d78d;
  --danger:#ff6b6b;
  --warning:#ffd25f;
  --shadow:0 22px 60px rgba(0,0,0,.38);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;min-height:100%;font-family:Inter,Segoe UI,Arial,sans-serif;background:radial-gradient(circle at top,#161616 0,#0b0b0b 40%,#050505 100%);color:var(--text)}
button{font:inherit;cursor:pointer}
img{display:block;max-width:100%}
.screen{min-height:100vh}
.hidden{display:none !important}
.panel{background:linear-gradient(180deg,#121212,#0a0a0a);border:1px solid var(--border);box-shadow:var(--shadow);border-radius:8px}
.tag{display:inline-flex;align-items:center;padding:7px 12px;border-radius:4px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);font-size:.72rem;text-transform:uppercase;letter-spacing:.14em;color:#dadada;font-weight:700}
.primary-btn,.secondary-btn,.ghost-btn,.control-btn{border:none;border-radius:4px;padding:13px 16px;transition:.2s ease}
.primary-btn{background:#fff;color:#101010;font-weight:700}
.secondary-btn{background:#1a1a1a;color:#fff;border:1px solid rgba(255,255,255,.08)}
.ghost-btn{background:linear-gradient(180deg,#1a1a1a,#111);color:#fff;border:1px solid rgba(255,255,255,.1)}
.control-btn{background:linear-gradient(180deg,#252525,#121212);color:#fff;border:1px solid rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 5px 0 #090909,0 12px 20px rgba(0,0,0,.28);font-weight:700;min-height:48px}
.control-btn:active{transform:translateY(3px);box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 2px 0 #090909,0 6px 10px rgba(0,0,0,.2)}
.power-on{border-color:rgba(99,213,139,.26)}
.power-off{border-color:rgba(255,102,102,.26)}
.primary-btn:hover,.secondary-btn:hover,.ghost-btn:hover,.component-card:hover,.mode-btn:hover,.difficulty-card:hover,.level-cell:hover{transform:translateY(-1px)}

.loader-screen,.mode-screen,.levels-screen,.result-screen{display:grid;place-items:center;padding:24px}
.loader-card,.mode-card,.result-card{width:min(980px,100%);padding:28px}
.loader-svg{width:100%;display:block}
.trace-bg{stroke:#333;stroke-width:1.8;fill:none}
.trace-flow{stroke:#fff;stroke-width:1.8;fill:none;stroke-dasharray:40 420;stroke-dashoffset:438;filter:drop-shadow(0 0 6px rgba(255,255,255,.8));animation:flow 3s cubic-bezier(.5,0,.9,1) infinite}
.trace-flow.alt{opacity:.55;animation-delay:.4s}
@keyframes flow{to{stroke-dashoffset:0}}
.loader-meta{width:min(520px,100%);margin:0 auto;text-align:center}.loader-meta p{margin:0 0 14px;color:#e3e3e3;font-size:1rem;letter-spacing:.05em;text-transform:uppercase}.progress-bar{height:10px;border-radius:3px;overflow:hidden;background:#131416;border:1px solid rgba(255,255,255,.08)}.progress-bar div{height:100%;width:0;background:linear-gradient(90deg,#fff,#989898);transition:width .24s ease}.loader-meta span{display:inline-block;margin-top:10px;color:var(--muted)}

.mode-brand,.brand-mini{display:flex;align-items:center;gap:14px}.mode-brand img{width:70px;height:70px;padding:12px;background:#111;border:1px solid var(--border);border-radius:6px}.brand-mini img{width:58px;height:58px;padding:10px;background:#111;border:1px solid var(--border);border-radius:6px}.mode-card p{color:var(--muted);margin:12px 0 0}.mode-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:24px}.mode-btn,.difficulty-card,.level-cell{background:linear-gradient(180deg,#171717,#0f0f0f);border:1px solid rgba(255,255,255,.08);color:#fff;border-radius:6px}.mode-btn{padding:22px;display:grid;gap:8px;text-align:left}.mode-btn small,.difficulty-card p,.levels-head p,.level-picker-head p,.result-card p{color:var(--muted);line-height:1.55}

.levels-shell{width:min(1250px,100%);display:grid;gap:18px}.levels-head{display:grid;grid-template-columns:auto 1fr auto;gap:18px;align-items:center;padding:18px}.levels-head h1,.result-card h1{margin:8px 0 8px}.progress-summary{padding:12px 16px;border:1px solid rgba(255,255,255,.08);background:#151515;border-radius:6px;text-align:left}.progress-summary span,.grade-box span,.result-stats span,.pill span,.info-box span{display:block;color:var(--muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.08em}.progress-summary strong,.pill strong,.grade-box strong,.result-stats strong,.info-box strong{display:block;margin-top:6px;font-size:1rem}
.difficulty-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.difficulty-card{padding:18px;display:grid;gap:10px}.difficulty-card.locked{opacity:.58}.difficulty-card .status{font-size:.78rem;color:var(--muted)}.difficulty-card .meta{display:flex;justify-content:space-between;gap:10px;font-size:.85rem;color:#e7e7e7}.difficulty-card button{margin-top:4px}
.level-picker{padding:18px}.level-picker-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.pagination-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.level-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-top:16px}.level-cell{padding:12px;text-align:center;min-height:94px;display:grid;align-content:center;gap:6px}.level-cell small{color:var(--muted)}.level-cell.done{border-color:rgba(99,213,139,.26);background:rgba(99,213,139,.08)}.level-cell.active{border-color:rgba(255,255,255,.25)}.level-cell.locked{opacity:.42;pointer-events:none}

.dashboard,.exam-screen{padding:18px}.dash-topbar,.exam-topbar{display:grid;grid-template-columns:auto minmax(220px,300px) 1fr auto;align-items:center;gap:14px;padding:16px 18px}.brand-mini span{display:block;color:var(--muted);font-size:.75rem;letter-spacing:.14em}.safety-strip{min-height:74px;padding:10px 12px;border-radius:4px;border:1px solid #3f3512;background:repeating-linear-gradient(135deg,#161616 0 12px,#161616 12px 24px,#d4a81d 24px 36px,#d4a81d 36px 48px)}.safety-inner{display:grid;gap:6px;background:rgba(0,0,0,.7);padding:8px 10px;border:1px solid rgba(255,255,255,.06)}.safety-inner strong{font-size:.8rem;letter-spacing:.2em}.dash-info{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.pill{padding:10px 12px;background:#151515;border:1px solid rgba(255,255,255,.06);border-radius:4px}
.main-grid{margin-top:18px;display:grid;grid-template-columns:290px 1fr 290px;gap:18px;align-items:start}.side-column,.center-column,.exam-story,.exam-workspace{padding:18px}.side-head h3,.center-head h2{margin:10px 0 0}.center-head{display:grid;gap:14px}.center-head p{margin:0;color:var(--muted);line-height:1.6}.control-bar,.exam-controls{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.visual-board{margin-top:18px;display:grid;grid-template-columns:1fr 1fr 1.1fr;gap:14px;align-items:start}.device-panel,.parts-panel{border-radius:6px;background:radial-gradient(circle at top,rgba(255,255,255,.05),transparent 40%),linear-gradient(180deg,#171717,#0f0f0f);border:1px solid rgba(255,255,255,.06);padding:14px}.panel-label,.panel-label-row{font-size:.82rem;letter-spacing:.12em;text-transform:uppercase;color:#ddd}.panel-label-row{display:flex;justify-content:space-between;align-items:center;gap:10px}.panel-label-row small{color:var(--muted);letter-spacing:normal;text-transform:none}.device-image{width:100%;height:280px;object-fit:contain;margin-top:12px}.case-image.flash{opacity:.5;transform:scale(.992)}
.component-grid{margin-top:14px;display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.component-grid.locked{opacity:.42;pointer-events:none}.component-card{min-height:126px;border:1px solid rgba(255,255,255,.08);background:#121212;border-radius:4px;padding:10px;color:#fff;text-align:left;display:flex;flex-direction:column;justify-content:space-between}.component-card img{height:60px;object-fit:contain;align-self:center;filter:drop-shadow(0 10px 16px rgba(0,0,0,.28))}.component-card span{display:block;font-size:.92rem;line-height:1.3}
.tutorial-guide{margin-top:16px;padding:14px;background:#121212;border:1px solid rgba(255,255,255,.06);border-radius:4px}.tutorial-guide p{margin:8px 0 0;color:#eaeaea;line-height:1.5}
.diagnosis-list{display:grid;gap:10px;margin-top:14px}.diag-item{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;padding-bottom:8px;border-bottom:1px solid rgba(255,255,255,.06)}.diag-item .left{display:flex;align-items:center;gap:10px}.status-dot{width:11px;height:11px;border-radius:2px}.status-dot.ok{background:var(--success)}.status-dot.warn{background:var(--warning)}.status-dot.bad{background:var(--danger)}.diag-status{font-weight:700}.diag-status.ok{color:var(--success)}.diag-status.warn{color:var(--warning)}.diag-status.bad{color:var(--danger)}
.alert-box{margin-top:14px;padding:14px;border-radius:4px;background:rgba(255,102,102,.08);border:1px solid rgba(255,102,102,.22)}.alert-box strong{display:block;color:#ff8f8f;margin-bottom:6px}.alert-box p{margin:0;color:#ffd2d2;line-height:1.5}
.task-list{list-style:none;padding:0;margin:14px 0 0;display:grid;gap:10px;counter-reset:task}.task-list li{counter-increment:task;padding:12px 12px 12px 46px;border-radius:4px;background:#141414;border:1px solid rgba(255,255,255,.06);position:relative;color:#ddd}.task-list li::before{content:counter(task);position:absolute;left:12px;top:50%;transform:translateY(-50%);width:22px;height:22px;border-radius:2px;display:grid;place-items:center;background:#212121;color:#fff;font-size:.83rem;font-weight:800}.task-list li.done{color:#cbffe0;border-color:rgba(99,213,139,.22);background:rgba(99,213,139,.08)}.task-list li.done::before{background:rgba(99,213,139,.18);color:#9fffca}
.approved-box{margin-top:18px;padding:16px;border:1px solid rgba(255,255,255,.06);background:#121212;border-radius:4px;text-align:center}.approved-stamp{display:inline-grid;place-items:center;min-height:54px;padding:10px 14px;border:2px dashed rgba(255,255,255,.18);font-weight:800;letter-spacing:.18em;color:#6fe29a;background:rgba(99,213,139,.08);margin-bottom:10px}.approved-stamp.active{border-color:rgba(99,213,139,.48);box-shadow:0 0 0 4px rgba(99,213,139,.06)}.approved-box p{margin:0;color:var(--muted);line-height:1.5}.approved-box .primary-btn{margin-top:14px;width:100%}
.exam-progress{padding:12px 16px;border-radius:6px;background:#151515;border:1px solid rgba(255,255,255,.08)}.exam-story h1{margin:10px 0}.symptom-list{display:grid;gap:8px;margin-top:18px}.symptom-list .symptom{padding:10px 12px;background:#121212;border:1px solid rgba(255,255,255,.06);border-radius:4px}.exam-submit-row{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-top:16px;flex-wrap:wrap}.exam-submit-row span{color:var(--muted);line-height:1.5}
.result-card{width:min(720px,100%)}.grade-box{margin-top:18px;padding:18px;background:#121212;border:1px solid rgba(255,255,255,.07);border-radius:6px;text-align:center}.grade-box strong{font-size:2rem}.result-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:16px}.result-stats>div{padding:16px;background:#121212;border:1px solid rgba(255,255,255,.07);border-radius:6px;text-align:center}.breakdown{margin-top:16px;display:grid;gap:10px}.breakdown-item{padding:12px;background:#121212;border:1px solid rgba(255,255,255,.07);border-radius:6px}.result-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}

.modal,.action-overlay,.danger-overlay{position:fixed;inset:0;background:rgba(0,0,0,.76);backdrop-filter:blur(4px);display:grid;place-items:center;padding:22px;z-index:99}.modal-card,.action-card,.danger-card{width:min(980px,100%);padding:24px;position:relative}.close-btn{position:absolute;top:14px;right:14px;width:42px;height:42px;border-radius:4px;border:1px solid rgba(255,255,255,.1);background:#1a1a1a;color:#fff;font-size:1.5rem}.modal-grid{display:grid;grid-template-columns:330px 1fr;gap:22px;align-items:center}.preview-wrap{min-height:340px;border-radius:6px;background:linear-gradient(180deg,#1a1a1a,#101010);border:1px solid rgba(255,255,255,.06);display:grid;place-items:center;padding:18px}.preview-wrap img{max-width:100%;max-height:290px;filter:drop-shadow(0 18px 28px rgba(0,0,0,.34))}.modal-content h2{margin:12px 0 10px;font-size:2rem}.modal-content p{margin:0;color:var(--muted);line-height:1.7}.tutorial-info{margin-top:14px;padding:14px;border-radius:4px;background:#121212;border:1px solid rgba(255,255,255,.06);color:#ececec;line-height:1.65}.info-boxes{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:18px 0}.info-box{padding:14px;border-radius:4px;background:#151515;border:1px solid rgba(255,255,255,.06)}.modal-actions-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.feedback-box{margin-top:16px;padding:14px 16px;border-radius:4px;background:#151515;border:1px solid rgba(255,255,255,.06);color:#e0e0e0;line-height:1.65;min-height:74px}.feedback-box.loading{opacity:.72}
.action-card{width:min(420px,100%);text-align:center}.action-spinner{width:62px;height:62px;margin:0 auto 16px;border:4px solid rgba(255,255,255,.14);border-top-color:#fff;animation:spin 1s linear infinite}.action-progress{height:10px;border:1px solid rgba(255,255,255,.08);background:#111;overflow:hidden;border-radius:3px;margin-top:16px}.action-progress div{height:100%;width:0;background:linear-gradient(90deg,#fff,#9b9b9b)}@keyframes spin{to{transform:rotate(360deg)}}
.danger-card{width:min(420px,100%);text-align:center;border:2px solid rgba(255,102,102,.55)}.danger-icon{width:86px;height:86px;margin:0 auto 16px;border:2px solid rgba(255,102,102,.38);display:grid;place-items:center;font-size:2.4rem;color:#ff6161;background:rgba(255,102,102,.12)}.danger-card h2{margin:0 0 8px;font-size:2rem}.danger-card p{margin:0;color:#f0f0f0;font-size:1.05rem}.danger-card strong{display:block;margin-top:8px;color:#ff8686;font-size:1rem;letter-spacing:.08em;text-transform:uppercase}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(18px);padding:13px 18px;border-radius:4px;background:rgba(9,9,10,.94);border:1px solid rgba(255,255,255,.1);color:#fff;box-shadow:var(--shadow);opacity:0;pointer-events:none;transition:.22s ease;z-index:130}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media (max-width: 1400px){
  .dash-topbar,.exam-topbar{grid-template-columns:1fr;justify-items:start}
  .dash-info{grid-template-columns:repeat(2,1fr);width:100%}
  .main-grid{grid-template-columns:260px 1fr 260px}
  .visual-board{grid-template-columns:1fr}
  .level-grid{grid-template-columns:repeat(4,1fr)}
}
@media (max-width: 1120px){
  .mode-grid,.difficulty-cards{grid-template-columns:1fr}
  .main-grid{grid-template-columns:1fr}
  .order-center{order:1}.order-diagnosis{order:2}.order-tasks{order:3}
  .control-bar,.exam-controls{grid-template-columns:repeat(2,1fr)}
  .modal-grid{grid-template-columns:1fr}
  .level-grid{grid-template-columns:repeat(3,1fr)}
}
@media (max-width: 760px){
  .loader-card,.mode-card,.result-card,.levels-shell{padding:0}
  .loader-screen,.mode-screen,.levels-screen,.result-screen,.dashboard,.exam-screen{padding:12px}
  .dash-info,.info-boxes,.modal-actions-grid,.result-stats,.level-grid{grid-template-columns:1fr}
  .level-picker-head,.exam-submit-row{display:grid}
  .device-image{height:220px}
  .preview-wrap{min-height:240px}
  .exam-progress,.progress-summary{width:100%}
}

/* Refinamentos de centralização e carregamentos */
.loader-screen{
  width:100%;
  min-height:100dvh;
  height:100dvh;
  padding:0;
  place-items:stretch;
  overflow:hidden;
}
.loader-screen .loader-card{
  width:100%;
  max-width:none;
  min-height:100dvh;
  height:100dvh;
  border-radius:0;
  border:0;
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  align-items:center;
  justify-items:center;
  padding:clamp(16px,3vw,36px);
}
.loader-screen .loader-svg{
  width:min(980px,96vw);
  max-height:74dvh;
  margin:auto;
}
.loader-screen .loader-meta{
  width:min(560px,92vw);
  padding-bottom:clamp(10px,3vh,34px);
}

.mode-screen{
  width:100%;
  min-height:100dvh;
  height:100dvh;
  padding:clamp(16px,3vw,36px);
  place-items:center;
  overflow:auto;
}
.mode-screen .mode-card{
  width:min(1100px,100%);
  min-height:min(720px,calc(100dvh - 72px));
  margin:auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:clamp(22px,4vw,44px);
}
.mode-screen .mode-brand{justify-content:center;text-align:left}
.mode-screen .mode-card>p{text-align:center;margin-top:16px}
.mode-screen .mode-grid{width:100%;margin-top:32px}
.mode-screen .mode-btn{min-height:180px;align-content:center}

.action-overlay{
  background:rgba(0,0,0,.88);
  backdrop-filter:blur(7px);
}
.action-card{
  width:min(560px,calc(100vw - 30px));
  padding:34px 30px;
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 0 0 1px rgba(255,255,255,.04),0 28px 80px rgba(0,0,0,.65);
  position:relative;
  overflow:hidden;
}
.action-card::before{
  content:"";
  position:absolute;
  left:0;right:0;top:0;
  height:4px;
  background:linear-gradient(90deg,transparent,#fff,transparent);
  animation:actionScan 1.2s ease-in-out infinite;
}
@keyframes actionScan{0%,100%{opacity:.25;transform:translateX(-35%)}50%{opacity:1;transform:translateX(35%)}}
.action-spinner{
  width:84px;
  height:84px;
  border-width:6px;
  box-shadow:0 0 28px rgba(255,255,255,.1);
}
.action-card h2{font-size:1.6rem;margin:10px 0 8px}
.action-card p{color:#cfcfcf;line-height:1.55;margin:0}
.action-progress{height:12px;margin-top:22px}
.action-progress div{transition:width .82s ease}

.close-btn{
  display:grid;
  place-items:center;
  padding:0;
  line-height:1;
  text-align:center;
  font-family:Arial,Helvetica,sans-serif;
}

@media (min-width:1600px){
  .mode-screen .mode-card{width:min(1280px,92vw);min-height:min(780px,calc(100dvh - 90px))}
  .mode-screen .mode-grid{gap:22px}
  .mode-screen .mode-btn{min-height:210px;padding:28px}
}

@media (max-width:760px){
  .loader-screen .loader-card{padding:12px}
  .loader-screen .loader-svg{width:100%;max-height:68dvh}
  .mode-screen{padding:12px;align-items:center}
  .mode-screen .mode-card{width:100%;min-height:calc(100dvh - 24px);padding:20px 16px}
  .mode-screen .mode-brand{justify-content:flex-start}
  .mode-screen .mode-grid{grid-template-columns:1fr;gap:12px;margin-top:20px}
  .mode-screen .mode-btn{min-height:130px;padding:18px}
  .action-card{padding:28px 20px}
  .action-spinner{width:72px;height:72px}
}


/* =========================================================
   CORREÇÃO V4.1 — TELA DE MODOS CENTRALIZADA DE VERDADE
   ========================================================= */
html,
body{
  width:100%;
  min-width:0;
  min-height:100%;
  overflow-x:hidden;
}

#modeScreen{
  width:100%;
  min-width:0;
  min-height:100dvh;
}

#modeScreen:not(.hidden){
  display:grid;
  place-items:center;
  align-content:center;
  justify-content:center;
  padding:clamp(14px, 3vw, 36px);
}

#modeScreen .mode-card{
  width:min(1100px, calc(100vw - clamp(28px, 6vw, 72px)));
  max-width:100%;
  margin:auto;
  padding:clamp(22px, 4vw, 44px);
  min-height:0;
  max-height:calc(100dvh - clamp(28px, 6vw, 72px));
  overflow:auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

#modeScreen .mode-brand{
  justify-content:center;
  align-items:center;
}

#modeScreen .mode-card > p{
  text-align:center;
}

#modeScreen .mode-grid{
  width:100%;
  grid-template-columns:repeat(3, minmax(0, 1fr));
}

#modeScreen .mode-btn{
  width:100%;
  min-width:0;
}

@media (max-width: 900px){
  #modeScreen .mode-card{
    width:min(760px, calc(100vw - 24px));
    max-height:calc(100dvh - 24px);
    padding:22px;
  }

  #modeScreen .mode-grid{
    grid-template-columns:1fr;
  }

  #modeScreen .mode-btn{
    min-height:118px;
  }
}

@media (max-width: 520px){
  #modeScreen:not(.hidden){
    padding:10px;
  }

  #modeScreen .mode-card{
    width:100%;
    max-height:calc(100dvh - 20px);
    padding:18px 14px;
  }

  #modeScreen .mode-brand{
    justify-content:flex-start;
    text-align:left;
  }

  #modeScreen .mode-brand img{
    width:58px;
    height:58px;
  }

  #modeScreen .mode-card h1{
    font-size:clamp(1.8rem, 10vw, 2.5rem);
  }

  #modeScreen .mode-grid{
    gap:10px;
    margin-top:16px;
  }
}


/* =========================================================
   V4.2 — LAYOUT DE NÍVEIS, MONITOR E ECONOMIA DE DICAS
   ========================================================= */

html, body{
  width:100%;
  min-width:0;
  overflow-x:hidden;
}

#levelsScreen{
  width:100%;
  min-width:0;
  min-height:100dvh;
}

#levelsScreen:not(.hidden){
  display:block;
  padding:clamp(12px, 2.4vw, 28px);
}

#levelsScreen .levels-shell{
  width:min(1380px, 100%);
  margin:0 auto;
  min-width:0;
}

#levelsScreen .levels-head{
  width:100%;
  min-width:0;
}

#levelsScreen .difficulty-cards{
  width:100%;
  min-width:0;
}

#levelsScreen .difficulty-card{
  min-width:0;
  overflow:hidden;
}

#levelsScreen .level-picker{
  width:100%;
  min-width:0;
  overflow:hidden;
}

#levelsScreen .level-picker-head{
  align-items:center;
}

#levelsScreen .pagination-controls{
  justify-content:flex-end;
}

#levelsScreen .level-grid{
  grid-template-columns:repeat(6, minmax(0, 1fr));
}

.level-cell{
  min-width:0;
  overflow-wrap:anywhere;
}

.monitor-visual-wrap{
  position:relative;
  width:100%;
  min-width:0;
  display:grid;
  place-items:center;
}

.monitor-overlay{
  position:absolute;
  inset:18% 12% 24%;
  display:grid;
  place-items:center;
  text-align:center;
  padding:10px;
  font-size:clamp(.72rem, 1.2vw, .95rem);
  font-weight:800;
  letter-spacing:.12em;
  color:#eaeaea;
  background:rgba(8,8,8,.72);
  border:1px solid rgba(255,255,255,.14);
  text-transform:uppercase;
  pointer-events:none;
}

.hint-shop{
  margin-top:18px;
  padding:16px;
  border:1px solid rgba(255,210,95,.22);
  background:linear-gradient(180deg, rgba(255,210,95,.06), #111);
  border-radius:4px;
}

.hint-shop-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.hint-shop-head > div{
  display:grid;
  gap:8px;
}

.hint-cost{
  padding:8px 10px;
  border:1px solid rgba(255,210,95,.25);
  background:rgba(255,210,95,.08);
  color:var(--warning);
  font-weight:800;
  white-space:nowrap;
}

.hint-shop p{
  margin:12px 0;
  color:var(--muted);
  line-height:1.55;
}

.hint-shop .secondary-btn{
  width:100%;
}

.purchased-hint{
  margin-top:12px;
  padding:12px;
  border-left:3px solid var(--warning);
  background:#171717;
  color:#f3e6b1;
  line-height:1.55;
}

#levelsScreen .progress-summary{
  min-width:150px;
}

#levelsScreen .levels-head > *{
  min-width:0;
}

#examScreen,
#dashboardScreen{
  width:100%;
  min-width:0;
  overflow-x:hidden;
}

.exam-story,
.exam-workspace,
.center-column,
.side-column,
.visual-board,
.device-panel,
.parts-panel{
  min-width:0;
}

@media (max-width: 1180px){
  #levelsScreen .levels-head{
    grid-template-columns:auto 1fr;
  }

  #levelsScreen .progress-summary{
    grid-column:1 / -1;
    width:100%;
  }

  #levelsScreen .level-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 800px){
  #levelsScreen:not(.hidden){
    padding:10px;
  }

  #levelsScreen .levels-head{
    grid-template-columns:1fr;
    align-items:stretch;
  }

  #levelsScreen .levels-head > .ghost-btn{
    width:max-content;
  }

  #levelsScreen .difficulty-cards{
    grid-template-columns:1fr;
  }

  #levelsScreen .level-picker-head{
    display:grid;
    grid-template-columns:1fr;
    gap:14px;
  }

  #levelsScreen .pagination-controls{
    display:grid;
    grid-template-columns:1fr auto 1fr;
    width:100%;
    justify-content:stretch;
  }

  #levelsScreen .level-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }

  .monitor-overlay{
    inset:17% 10% 24%;
  }
}

@media (max-width: 520px){
  #levelsScreen .level-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  #levelsScreen .level-cell{
    min-height:80px;
    padding:10px 6px;
  }

  .hint-shop-head{
    align-items:flex-start;
  }

  .hint-cost{
    font-size:.8rem;
  }
}


/* =========================================================
   V4.3 — RELATÓRIOS DE EXAME E PROCEDIMENTOS DE MANUTENÇÃO
   ========================================================= */

.component-card.removed{
  opacity:.42;
  border-style:dashed;
  position:relative;
}

.component-card.removed::after{
  content:'RETIRADA';
  position:absolute;
  inset:auto 6px 6px 6px;
  padding:5px 6px;
  background:#090909;
  border:1px solid rgba(255,107,107,.34);
  color:#ff8b8b;
  font-size:.68rem;
  font-weight:800;
  letter-spacing:.12em;
  text-align:center;
}

.inspection-report{
  display:grid;
  gap:10px;
  margin-top:2px;
}

.inspection-report .report-title{
  font-size:.76rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#cfcfcf;
  font-weight:800;
}

.inspection-report .report-row{
  display:grid;
  grid-template-columns:110px 1fr;
  gap:10px;
  align-items:start;
  padding:9px 10px;
  background:#101010;
  border:1px solid rgba(255,255,255,.06);
}

.inspection-report .report-row span{
  color:var(--muted);
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.inspection-report .report-row strong{
  font-weight:700;
  line-height:1.45;
}

.inspection-report .report-ok{color:var(--success)}
.inspection-report .report-warn{color:var(--warning)}
.inspection-report .report-bad{color:var(--danger)}

.action-overlay{
  background:rgba(0,0,0,.86);
  backdrop-filter:blur(7px);
}

.action-card{
  width:min(560px, calc(100vw - 28px));
  min-height:330px;
  padding:30px;
  display:grid;
  align-content:center;
  justify-items:center;
  text-align:center;
  border:1px solid rgba(255,255,255,.16);
  box-shadow:0 30px 80px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.03) inset;
}

.action-spinner{
  width:78px;
  height:78px;
  border-width:5px;
  margin-bottom:18px;
  box-shadow:0 0 24px rgba(255,255,255,.06);
}

.action-card h2{
  margin:0;
  font-size:clamp(1.45rem, 4vw, 2rem);
}

.action-card p{
  min-height:48px;
  max-width:440px;
  margin:12px 0 0;
  color:#d2d2d2;
  line-height:1.6;
}

.action-progress{
  width:100%;
  height:12px;
  margin-top:22px;
}

.action-progress div{
  transition:width .35s ease;
}

.system-alert-overlay{
  position:fixed;
  inset:0;
  z-index:125;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(0,0,0,.84);
  backdrop-filter:blur(6px);
}

.system-alert-card{
  width:min(500px,100%);
  padding:28px;
  text-align:center;
  border-color:rgba(255,210,95,.32);
}

.system-alert-icon{
  width:76px;
  height:76px;
  display:grid;
  place-items:center;
  margin:0 auto 16px;
  border:2px solid rgba(255,210,95,.42);
  color:var(--warning);
  background:rgba(255,210,95,.08);
  font-size:2.3rem;
  font-weight:900;
}

.system-alert-card h2{
  margin:14px 0 8px;
}

.system-alert-card p{
  color:#e4e4e4;
  line-height:1.65;
  margin:0 0 18px;
}

@media (max-width:600px){
  .inspection-report .report-row{
    grid-template-columns:1fr;
    gap:4px;
  }
  .action-card{
    padding:22px 16px;
    min-height:300px;
  }
}


/* =========================================================
   V4.5 — CARREGAMENTO DE AÇÕES COM PC BRANCO
   A tela inicial permanece com o loader antigo/original.
   ========================================================= */
.pc-action-card{
  width:min(560px,calc(100vw - 28px));
  min-height:390px;
  padding:30px 28px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  text-align:center;
  overflow:hidden;
}

.pc-action-card::before{
  content:none !important;
}

.pc-action-loader{
  width:220px;
  max-width:62vw;
  display:grid;
  place-items:center;
  margin-bottom:4px;
}

.pc-action-svg{
  width:100%;
  height:auto;
  overflow:visible;
  filter:
    drop-shadow(0 0 4px rgba(255,255,255,.35))
    drop-shadow(0 0 16px rgba(255,255,255,.10));
}

.pc-action-svg .pc-base{
  fill:#181818;
}

.pc-action-svg .pc-fill{
  fill:rgba(255,255,255,.10);
  animation:pcActionFill 3.6s ease-in-out infinite;
}

.pc-action-svg .pc-dash path,
.pc-action-svg .pc-dash rect,
.pc-action-svg .pc-dash circle{
  fill:none;
  stroke:#fff;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-dasharray:0 1 359 0;
  animation:
    pcActionDashArray 3.6s ease-in-out infinite,
    pcActionDashOffset 3.6s linear infinite;
}

.pc-action-svg .pc-dash .main{
  stroke-width:2.4;
  filter:drop-shadow(0 0 3px rgba(255,255,255,.9));
}

.pc-action-svg .pc-led{
  fill:#fff;
  animation:pcActionLed 1.1s ease-in-out infinite;
  filter:drop-shadow(0 0 4px rgba(255,255,255,.95));
}

.pc-action-svg .pc-screen-light{
  fill:rgba(255,255,255,.06);
  animation:pcActionScreen 2s ease-in-out infinite;
}

.pc-action-card h2{
  margin:0;
  font-size:clamp(1.35rem,3vw,1.9rem);
}

.pc-action-card p{
  margin:0;
  min-height:44px;
  color:#cfcfcf;
  line-height:1.55;
}

.pc-action-card .action-progress{
  width:min(360px,100%);
  height:9px;
  margin-top:4px;
  border:1px solid rgba(255,255,255,.15);
  background:#101010;
  border-radius:2px;
  overflow:hidden;
}

.pc-action-card .action-progress div{
  height:100%;
  width:0;
  background:linear-gradient(90deg,#6d6d6d,#fff);
  box-shadow:0 0 8px rgba(255,255,255,.45);
  transition:width .35s ease;
}

.action-spinner{
  display:none !important;
}

@keyframes pcActionDashArray{
  0%{stroke-dasharray:0 1 359 0}
  50%{stroke-dasharray:0 359 1 0}
  100%{stroke-dasharray:359 1 0 0}
}

@keyframes pcActionDashOffset{
  0%{stroke-dashoffset:-5}
  100%{stroke-dashoffset:-365}
}

@keyframes pcActionFill{
  0%,20%,100%{fill:rgba(255,255,255,.04)}
  45%,65%{fill:rgba(255,255,255,.16)}
}

@keyframes pcActionLed{
  0%,100%{opacity:.25}
  50%{opacity:1}
}

@keyframes pcActionScreen{
  0%,100%{opacity:.3}
  50%{opacity:1}
}

@media(max-width:600px){
  .pc-action-card{
    width:calc(100vw - 20px);
    min-height:340px;
    padding:22px 16px;
  }
  .pc-action-loader{
    width:170px;
  }
}


/* =========================================================
   VERSÃO FINAL — BOTÃO DE CRÉDITOS
   ========================================================= */

.credits-link{
  text-decoration:none;
  color:#fff;
  cursor:pointer;
}

#modeScreen .mode-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

@media (max-width:1120px){
  #modeScreen .mode-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:760px){
  #modeScreen .mode-grid{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   FIXCORE — VERSÃO 1.0
   LOGO / STATUS / TUTORIAL / OTIMIZAÇÕES
   ========================================================= */

/* Slot oficial para a logo quadrada */
.mode-brand img,
.brand-mini img{
  aspect-ratio:1 / 1;
  object-fit:contain;
  background:#0d0d0d;
  border:1px solid rgba(255,255,255,.10);
}

/* Status da versão */
.version-badge{
  display:inline-flex !important;
  align-items:center;
  gap:8px;
}

.version-mini{
  display:flex !important;
  align-items:center;
  gap:7px;
  margin-top:4px;
  color:#aaa !important;
  font-size:.65rem !important;
  letter-spacing:.08em !important;
}

.version-dot{
  width:8px;
  height:8px;
  flex:0 0 8px;
  display:inline-block;
  border-radius:50%;
  background:#55e27c;
  box-shadow:0 0 0 0 rgba(85,226,124,.42);
  animation:fxzStatusPulse 1.5s ease-in-out infinite;
}

@keyframes fxzStatusPulse{
  0%,100%{
    opacity:.55;
    transform:scale(.88);
    box-shadow:0 0 0 0 rgba(85,226,124,.18);
  }
  50%{
    opacity:1;
    transform:scale(1);
    box-shadow:0 0 0 5px rgba(85,226,124,0);
  }
}

/* Tutorial: progresso neutro, sem ficar verde */
.task-list li.tutorial-task{
  color:#d8d8d8;
  border-color:rgba(255,255,255,.07);
  background:#141414;
}

.task-list li.tutorial-task.tutorial-done{
  color:#fff;
  border-color:rgba(255,255,255,.28);
  background:#1a1a1a;
}

.task-list li.tutorial-task.tutorial-done::before{
  color:#080808;
  background:#fff;
}

.approved-stamp.tutorial-neutral{
  color:#e7e7e7;
  background:#141414;
  border-color:rgba(255,255,255,.22);
  box-shadow:none;
}

.approved-stamp.tutorial-neutral.active{
  color:#fff;
  background:#181818;
  border-color:rgba(255,255,255,.48);
  box-shadow:0 0 0 4px rgba(255,255,255,.035);
}

/* Evita filtros pesados em telas menores */
@media(max-width:800px){
  .action-overlay,
  .system-alert-overlay,
  .danger-overlay{
    backdrop-filter:none !important;
  }

  .pc-action-svg{
    filter:none;
  }
}

/* Mantém responsividade das logos */
@media(max-width:600px){
  .mode-brand img{
    width:58px;
    height:58px;
  }

  .brand-mini img{
    width:42px;
    height:42px;
  }
}

/* Reduz trabalho de animação fora do necessário para usuários que preferem menos movimento */
@media(prefers-reduced-motion:reduce){
  .trace-flow,
  .pc-action-svg .pc-fill,
  .pc-action-svg .pc-dash path,
  .pc-action-svg .pc-dash rect,
  .pc-action-svg .pc-dash circle,
  .pc-action-svg .pc-led,
  .pc-action-svg .pc-screen-light{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
  }

  .version-dot{
    animation-duration:2s;
  }
}


/* =========================================================
   FIXCORE — LOGO FINAL
   A logo usa fundo transparente e não recebe moldura, borda
   ou fundo artificial. O object-fit mantém o zoom correto.
   ========================================================= */

.mode-brand img,
.brand-mini img{
  display:block;
  object-fit:contain;
  object-position:center;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
}

.mode-brand img{
  width:92px;
  height:92px;
}

.brand-mini img{
  width:54px;
  height:54px;
}

@media(max-width:700px){
  .mode-brand img{
    width:72px;
    height:72px;
  }

  .brand-mini img{
    width:44px;
    height:44px;
  }
}
