/* ── Fault Report Builder — app.css ─────────────────────────────────────
   1. base · 2. fx/toast · 3. header/footer · 4. buttons · 5. login
   6. map · 7. mission shell · 8. brief/diff · 9. config/panel/flow
   10. feedback/live · 11. quiz · 12. check · 13. simulator
   14. shots · 15. mission-done/pills · 16. dex/trophy · 17. bonus
   18. sandbox/anatomy · 19. certificate + print · 20. modal · 21. tokens */

/* 1 ─ base */
:root {
  --bg: #0d1220;
  --bg2: #131a2c;
  --card: #182136;
  --card2: #1e2a42;
  --line: #2a3856;
  --txt: #e8eefc;
  --dim: #93a4c8;
  --acc: #7ee787;
  --acc2: #79c0ff;
  --warn: #ffd166;
  --bad: #ff7b72;
  --gold: #f2cc60;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #182347 0%, var(--bg) 55%);
  color: var(--txt);
  font: 16px/1.55 "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.25; }
h2 { margin: 0 0 10px; font-size: 22px; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
.dim { color: var(--dim); }

/* 2 ─ fx + toast */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.cf {
  position: absolute; top: -12px; display: block;
  animation: cfall linear forwards;
}
@keyframes cfall {
  to { transform: translateY(108vh) rotate(540deg); opacity: 0.1; }
}
#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 26px; z-index: 95; pointer-events: none;
}
.toastmsg {
  background: #232f4d; border: 1px solid var(--line); color: var(--txt);
  padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  animation: popin .18s ease-out;
}
@keyframes popin { from { transform: translateY(8px); opacity: 0; } }

/* 3 ─ header/footer */
header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: rgba(13, 18, 32, .85); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: .3px; margin-right: 8px; }
nav { display: flex; gap: 4px; }
.hspace { flex: 1; }
footer { text-align: center; color: var(--dim); font-size: 12px; padding: 18px 0 26px; }
main { max-width: 980px; margin: 0 auto; padding: 20px 18px 40px; }
.hudxp { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.xpwrap { flex: 1; height: 10px; background: #0a0f1c; border-radius: 99px; border: 1px solid var(--line); overflow: hidden; min-width: 90px; }
.xpfill { height: 100%; background: linear-gradient(90deg, var(--acc2), var(--acc)); border-radius: 99px; transition: width .4s; }
.lvl { font-size: 12px; color: var(--dim); white-space: nowrap; }
.xppill { background: var(--card2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; font-size: 12px; white-space: nowrap; }
.streakpill { background: rgba(255, 209, 102, .12); border: 1px solid rgba(255, 209, 102, .4); color: var(--warn); border-radius: 99px; padding: 3px 10px; font-size: 13px; white-space: nowrap; }

/* 4 ─ buttons */
.btn {
  background: var(--card2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 16px; transition: transform .06s, background .15s;
}
.btn:hover:not(:disabled) { background: #263453; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #2ea043, #238636); border-color: #2ea043; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #34b74c, #26913c); }
.btn.danger { background: linear-gradient(180deg, #b62324, #93201f); border-color: #da3633; }
.btn.warn { background: #6b5410; border-color: var(--warn); color: var(--warn); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.hbtn {
  background: transparent; color: var(--txt); border: 1px solid transparent;
  border-radius: 8px; padding: 6px 10px; font-size: 15px;
}
.hbtn:hover { background: var(--card2); }
.hbtn.on { background: var(--card2); border-color: var(--line); }

/* 5 ─ login */
.loginwrap { display: flex; justify-content: center; padding: 5vh 12px 20px; }
.logincard {
  width: 520px; max-width: 96vw; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px; box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.loginbrand { font-size: 30px; font-weight: 800; letter-spacing: .4px; }
.loginlab { color: var(--acc2); margin-top: 4px; }
.loginplat { color: var(--dim); font-size: 14px; margin: 4px 0 18px; }
.loginform label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--dim); }
.loginform input {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--txt);
}
.loginform input:focus { outline: 2px solid var(--acc2); border-color: transparent; }
.lerr { color: var(--bad); min-height: 20px; margin-top: 8px; font-size: 14px; }
.howto-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.howto-t { font-weight: 700; margin-bottom: 6px; }
.howto-box ul { margin: 0; padding-left: 20px; color: var(--dim); font-size: 14px; }
.howto-box li { margin: 5px 0; }
.howto-box b { color: var(--txt); }
.loginver { margin-top: 14px; text-align: center; color: var(--dim); font-size: 12px; }

/* 6 ─ map */
.maptitle { font-size: 26px; font-weight: 800; margin: 8px 0 2px; }
.mapsub { color: var(--dim); margin-bottom: 18px; }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mnode {
  position: relative; text-align: left; background: var(--card); color: var(--txt);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-height: 128px;
  transition: transform .08s, border-color .15s;
}
.mnode:hover { transform: translateY(-2px); border-color: var(--acc2); }
.mnode.locked { opacity: .55; }
.mnode.done { border-color: #245c33; }
.mnode.next { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.mnode-ico { font-size: 26px; }
.mnode-name { font-weight: 700; margin-top: 6px; }
.mnode-sub { color: var(--dim); font-size: 13px; margin-top: 2px; }
.mnode-badge {
  position: absolute; top: 10px; right: 12px; font-size: 12px; font-weight: 700;
  color: var(--acc); background: rgba(126, 231, 135, .1); border: 1px solid rgba(126,231,135,.4);
  border-radius: 99px; padding: 2px 9px;
}
.mnode.done .mnode-badge { color: #9af0a5; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(126,231,135,.12); } }

/* 7 ─ mission shell */
.mhead { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.mtitle { font-size: 19px; font-weight: 700; flex: 1; }
.steppill { background: var(--card2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; font-size: 13px; white-space: nowrap; }
.goalbanner {
  background: linear-gradient(90deg, rgba(121,192,255,.12), rgba(126,231,135,.08));
  border: 1px solid rgba(121,192,255,.35); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 15px;
}
.mfoot { margin-top: 16px; display: flex; justify-content: flex-end; }
.stepcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; margin-bottom: 8px;
}

/* 8 ─ brief / diff */
.briefbody { font-size: 16px; }
.briefbody p { margin: 10px 0; }
.note, .warnbox, .winbox, .pattern, .howto {
  border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px;
}
.note { background: rgba(121,192,255,.08); border: 1px solid rgba(121,192,255,.35); }
.warnbox { background: rgba(255,209,102,.08); border: 1px solid rgba(255,209,102,.4); }
.winbox { background: rgba(126,231,135,.1); border: 1px solid rgba(126,231,135,.45); }
.pattern {
  background: #0a0f1c; border: 1px solid var(--line); font-family: Consolas, "Courier New", monospace;
  font-size: 14px; white-space: pre-wrap; line-height: 1.5; overflow-x: auto;
}
.howto { background: var(--bg2); border: 1px solid var(--line); }
.howto ol { margin: 0; padding-left: 22px; }
.howto li { margin: 6px 0; }
.diffwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 720px) { .diffwrap { grid-template-columns: 1fr; } }
.diffcol { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.difftitle { padding: 9px 12px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--line); background: var(--card2); }
.diffbody { padding: 10px 12px; font-family: Consolas, "Courier New", monospace; font-size: 13.5px; }
.diffline { padding: 2px 6px; border-radius: 6px; white-space: pre-wrap; }
.diffline.g { background: rgba(126,231,135,.14); color: #b8f5be; }

/* 9 ─ config: where/element/panel/flow/chips */
.wherebadge {
  display: inline-block; background: rgba(121,192,255,.1); border: 1px solid rgba(121,192,255,.4);
  color: var(--acc2); border-radius: 99px; padding: 3px 12px; font-size: 13.5px; margin-bottom: 10px;
  font-family: Consolas, "Courier New", monospace;
}
.elemcard {
  display: inline-block; background: var(--card2); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 12px; font-weight: 600; margin-bottom: 8px;
}
.paneltable { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 12px 0; }
.prow { display: grid; grid-template-columns: 220px 1fr; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
@media (max-width: 640px) { .prow { grid-template-columns: 1fr; } }
.pprop { padding: 10px 12px; background: var(--bg2); font-size: 14px; color: var(--dim); border-right: 1px solid var(--line); }
.pval { padding: 8px 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot {
  display: inline-block; border-radius: 9px; font-size: 14.5px; min-width: 90px;
  min-height: 34px; padding: 5px 12px; vertical-align: middle;
}
.slot.empty {
  background: #0a0f1c; color: var(--dim); border: 2px dashed #3a4c74; min-width: 120px;
}
.slot.empty:hover { border-color: var(--acc2); color: var(--txt); }
.slot.filled { background: rgba(126,231,135,.12); border: 1px solid rgba(126,231,135,.5); color: #b8f5be; }
.slot.revealed { border-style: dotted; opacity: .9; }
.slot.type {
  background: #0a0f1c; border: 1px solid #3a4c74; color: var(--txt);
  padding: 6px 10px; font-family: Consolas, "Courier New", monospace;
}
.slot.type:focus { outline: 2px solid var(--acc2); }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.chipbank-t { color: var(--dim); font-size: 13.5px; margin-top: 14px; }
.chipbank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  background: var(--card2); border: 1px solid #3a4c74; color: var(--txt);
  border-radius: 99px; padding: 6px 14px; font-size: 14px; max-width: 420px;
}
.chip:hover { border-color: var(--acc2); }
.chip.sel { border-color: var(--acc); background: rgba(126,231,135,.14); box-shadow: 0 0 0 1px var(--acc); }

.flowwrap { background: #0a0f1c; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; overflow-x: auto; }
.flow-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fnode {
  background: var(--card2); border: 1px solid #3a4c74; border-radius: 10px;
  padding: 8px 14px; font-size: 14px; text-align: center; max-width: 640px;
}
.fnode .fl { font-weight: 700; }
.fnode.fstart, .fnode.fend { border-radius: 99px; background: #101a30; color: var(--dim); padding: 5px 18px; font-size: 13px; }
.fnode.fdecision { border-color: var(--warn); background: rgba(255,209,102,.07); }
.fnode.ffeedback { border-color: var(--bad); background: rgba(255,123,114,.07); }
.fnode.fparam { border-color: var(--acc2); }
.farms { display: flex; gap: 18px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.arm { display: flex; flex-direction: column; align-items: center; gap: 8px; background: rgba(255,255,255,.02); border: 1px dashed #2a3856; border-radius: 12px; padding: 10px 12px; min-width: 200px; }
.arm-label { font-size: 12.5px; font-weight: 700; letter-spacing: .4px; }
.arm-label.true { color: var(--acc); }
.arm-label.false { color: var(--bad); }
.fslots { display: flex; flex-direction: column; gap: 5px; align-items: center; margin-top: 6px; }
.fslotrow { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--dim); flex-wrap: wrap; justify-content: center; }
.fmembers { text-align: left; font-size: 12.5px; color: var(--dim); font-family: Consolas, "Courier New", monospace; margin-top: 5px; }

/* 10 ─ feedback + live line */
.fbline { margin-top: 12px; min-height: 30px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#fbtext { color: var(--warn); font-size: 15px; }
#fbtext:empty { display: inline; }
.blive {
  margin-top: 10px; background: rgba(121,192,255,.07); border: 1px dashed rgba(121,192,255,.4);
  color: var(--acc2); border-radius: 10px; padding: 8px 12px; font-size: 14px;
}

/* 11 ─ quiz */
.quizlist { display: flex; flex-direction: column; gap: 14px; }
.qcard { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.qtext { font-weight: 600; margin-bottom: 10px; }
.qopts { display: flex; flex-direction: column; gap: 7px; }
.qopt {
  text-align: left; background: var(--card2); border: 1px solid #3a4c74; color: var(--txt);
  border-radius: 10px; padding: 9px 13px;
}
.qopt:hover:not(:disabled) { border-color: var(--acc2); }
.qopt.good { border-color: var(--acc); background: rgba(126,231,135,.14); }
.qopt.bad { border-color: var(--bad); background: rgba(255,123,114,.12); }
.qopt.dim { opacity: .5; }
.qwhy { margin-top: 10px; color: var(--dim); font-size: 14.5px; }

/* 12 ─ checklist */
.checklist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ckgroup { font-weight: 700; font-size: 13.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--acc2); margin-top: 10px; }
.ckitem {
  display: flex; gap: 10px; align-items: flex-start; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.ckitem.on { border-color: rgba(126,231,135,.5); background: rgba(126,231,135,.07); }
.ckitem input { margin-top: 3px; accent-color: #2ea043; }
.checkhint { color: var(--dim); font-size: 13.5px; margin-top: 10px; }

/* 13 ─ simulator */
.simwrap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 14px; background: #f4f6fb; color: #17233b; }
.simchrome { display: flex; align-items: center; gap: 12px; background: #232f4d; color: #e8eefc; padding: 8px 14px; flex-wrap: wrap; }
.simbrand { font-weight: 700; font-size: 14px; }
.simnavs { display: flex; gap: 4px; flex-wrap: wrap; }
.simnav { background: transparent; border: 1px solid transparent; color: #cdd9f5; border-radius: 8px; padding: 5px 11px; font-size: 14px; }
.simnav.on { background: #35466f; color: #fff; }
.simbody { padding: 18px; min-height: 220px; }
.simhome-t { font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.simform { max-width: 520px; }
.simfield { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: #2a3a5c; }
.simfield > span { display: block; margin-bottom: 4px; }
.simfield input[type="text"], .simfield textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #b9c4dd; border-radius: 8px; background: #fff; color: #17233b;
}
.simfield textarea { resize: vertical; font-family: inherit; }
.quickpicks { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.quickpicks .btn { background: #fff; color: #17233b; border: 1px solid #b9c4dd; }
.simdate { padding: 8px 10px; border: 1px solid #b9c4dd; border-radius: 8px; }
.simnow { font-size: 12.5px; font-weight: 400; margin-top: 4px; color: #5a6b8f; }
.simmsg { color: #b62324; font-size: 13px; margin-top: 4px; font-weight: 600; }
.simoverview .simgrid { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; font-size: 13.5px; }
.simgrid th { background: #232f4d; color: #e8eefc; text-align: left; padding: 8px 10px; }
.simgrid td { border-top: 1px solid #dde4f2; padding: 7px 10px; vertical-align: top; }
.simgrid tr.stripe td { background: #eef2fb; }
.taskshead { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-weight: 700; }
.simtask { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 8px; font-size: 14.5px; }
.simtask.active { border-color: var(--acc2); background: rgba(121,192,255,.08); }
.simtask.done { border-color: rgba(126,231,135,.4); color: var(--dim); text-decoration: line-through; }
.simtaskmark { margin-right: 4px; }

/* 14 ─ shots */
.shotrow { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.shot { margin: 0; max-width: 460px; flex: 1 1 280px; }
.shot img { width: 100%; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.shot figcaption { color: var(--dim); font-size: 13.5px; margin-top: 6px; }
.shot.pending {
  background: var(--bg2); border: 1px dashed #3a4c74; border-radius: 12px;
  padding: 18px; text-align: center;
}
.shot-ico { font-size: 26px; }
.shot-t { font-weight: 600; margin-top: 6px; }
.shot-cap { color: var(--dim); font-size: 13px; margin-top: 4px; }

/* 15 ─ mission done / pills */
.donewrap { display: flex; justify-content: center; padding: 4vh 0; }
.donecard {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 34px; text-align: center; max-width: 620px; width: 100%;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.donebig { font-size: 30px; font-weight: 800; }
.donename { color: var(--acc2); font-size: 18px; margin-top: 4px; }
.donexp { font-size: 42px; font-weight: 800; color: var(--acc); margin: 12px 0; }
.pillrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.pill { background: var(--card2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 14px; font-size: 14px; }
.pill.badge { border-color: rgba(242,204,96,.5); background: rgba(242,204,96,.08); }
.pill.card { border-color: rgba(121,192,255,.5); background: rgba(121,192,255,.08); }
.donecard .btnrow { justify-content: center; }

/* 16 ─ dex + trophy */
.dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.dexcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; text-align: left; color: var(--txt); min-height: 110px;
}
.dexcard:hover { border-color: var(--acc2); }
.dexcard.locked { opacity: .6; }
.dexico { font-size: 28px; }
.dexico.big { font-size: 44px; }
.dexname { font-weight: 700; margin-top: 6px; }
.dextag { color: var(--dim); font-size: 13px; margin-top: 2px; }
.trophylocked, .trophyopen { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 34px; }
.trophybig { font-size: 54px; }
.trophytxt { color: var(--dim); margin: 8px 0 12px; }

/* 17 ─ bonus vault */
.bonusgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.bonuscard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; text-align: left; color: var(--txt); }
.bonuscard:hover:not(.locked) { border-color: var(--acc2); transform: translateY(-2px); }
.bonuscard.locked { opacity: .55; }
.bonusico { font-size: 34px; }
.bonusname { font-weight: 700; font-size: 17px; margin-top: 8px; }
.bonusdesc { color: var(--dim); font-size: 14px; margin-top: 6px; }
.bonuslock { color: var(--warn); font-size: 13px; margin-top: 10px; }

/* 18 ─ sandbox + anatomy */
.sbxrow { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 12px; }
.sbxlabel { font-weight: 700; }
.sbxtoggles { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.sbxtoggle { display: flex; flex-direction: column; gap: 2px; background: var(--bg2); border: 1px solid #3a4c74; border-radius: 10px; padding: 8px 14px; color: var(--txt); min-width: 200px; text-align: left; }
.sbxtoggle.on { border-color: var(--acc); background: rgba(126,231,135,.08); }
.sbxk { font-size: 12px; color: var(--dim); }
.sbxv { font-weight: 600; }
.sbxverdict { border-radius: 10px; padding: 9px 12px; font-size: 14.5px; margin-bottom: 10px; }
.sbxverdict.ok { background: rgba(126,231,135,.1); border: 1px solid rgba(126,231,135,.45); }
.sbxverdict.bug { background: rgba(255,123,114,.1); border: 1px solid rgba(255,123,114,.45); }
.sbxverdict.sub { background: rgba(255,209,102,.08); border: 1px solid rgba(255,209,102,.4); }
.sbxverdict.none { background: var(--bg2); border: 1px solid var(--line); color: var(--dim); }
.anatsec { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 12px; }
.anatsect { font-weight: 700; font-size: 17px; margin-bottom: 10px; }
.anatnodes { display: flex; gap: 8px; flex-wrap: wrap; }
.anatnode { background: var(--bg2); border: 1px solid #3a4c74; color: var(--txt); border-radius: 99px; padding: 6px 14px; font-size: 14px; font-family: Consolas, "Courier New", monospace; }
.anatnode:hover { border-color: var(--acc2); }
.anatattr { background: #0a0f1c; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-family: Consolas, "Courier New", monospace; font-size: 13px; display: inline-block; margin: 2px 4px 2px 0; }

/* 19 ─ certificate + print */
.certcontrols { display: flex; gap: 12px; align-items: end; margin: 12px 0; flex-wrap: wrap; }
.certcontrols label { font-size: 14px; color: var(--dim); display: block; }
.certcontrols input {
  display: block; margin-top: 4px; padding: 9px 12px; min-width: 300px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--txt);
}
#certpage {
  background: #fdfcf7; color: #1d2433; border-radius: 6px; padding: 10px;
  width: 100%; aspect-ratio: 297 / 210; position: relative; overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.certinner {
  position: absolute; inset: 10px; border: 3px double #9a7b2f; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4% 6%;
}
.certprog { font-size: clamp(10px, 1.8vw, 16px); letter-spacing: 1.5px; text-transform: uppercase; color: #6c6244; }
.certmod { font-size: clamp(9px, 1.5vw, 13px); color: #8a8060; margin-top: 2px; }
.certtitle { font-size: clamp(20px, 4.4vw, 40px); font-weight: 800; margin-top: 3%; font-family: Georgia, "Times New Roman", serif; }
.certawarded { color: #8a8060; margin-top: 2%; font-style: italic; }
.certname {
  font-size: clamp(22px, 5vw, 46px); font-weight: 700; margin-top: 1.5%;
  font-family: Georgia, "Times New Roman", serif; border-bottom: 2px solid #9a7b2f; padding: 0 4% 2%;
}
.certstats { margin-top: 3%; font-size: clamp(10px, 1.6vw, 14px); color: #4d4633; }
.certbadges { margin-top: 2.5%; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.certbadges .pill { background: rgba(154,123,47,.1); border-color: #c8ab63; color: #4d4633; font-size: clamp(9px, 1.4vw, 12px); }
.certbadges .dim { color: #a49a78; font-size: 13px; }
.certdate { margin-top: 2.5%; font-size: clamp(9px, 1.4vw, 12px); color: #8a8060; }
.certwm { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: .08; max-width: 46%; pointer-events: none; }
.certwmtxt { font-size: 64px; font-weight: 800; color: #1d2433; opacity: .06; font-family: Georgia, serif; }
.certseal { position: absolute; right: 4%; bottom: 5%; max-width: 12%; pointer-events: none; }
.certsealtxt {
  font-size: clamp(9px, 1.4vw, 12px); font-weight: 700; color: #9a7b2f;
  border: 2px solid #9a7b2f; border-radius: 99px; padding: 8px 12px; opacity: .8;
}
@media print {
  @page { size: A4 landscape; margin: 0; }
  body * { visibility: hidden !important; }
  #certpage, #certpage * { visibility: visible !important; }
  #certpage {
    position: fixed; inset: 0; width: 297mm; height: 210mm; aspect-ratio: auto;
    border-radius: 0; box-shadow: none; padding: 0;
  }
}

/* 20 ─ modal */
.modalbg {
  position: fixed; inset: 0; background: rgba(5, 8, 16, .72); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modalcard {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px; max-width: 900px; width: 100%;
  max-height: 88vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.modalx {
  position: absolute; top: 10px; right: 10px; background: var(--card2);
  border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 4px 10px;
}
.lightbox img { max-width: 100%; border-radius: 10px; }
.lightboxcap { color: var(--dim); font-size: 14px; margin-top: 8px; }
.importmodal h3 { margin-top: 0; }
.cmpwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.cmp { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.cmp-t { font-weight: 700; margin-bottom: 6px; }
.cmpr { padding: 3px 0; color: var(--dim); }
.cardmodal h3 { margin: 8px 0 2px; }
.samplebox {
  background: #0a0f1c; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-family: Consolas, "Courier New", monospace; font-size: 14px; margin-top: 12px;
}

/* 21 ─ token highlighter */
.tok-k { color: #79c0ff; font-weight: 600; }
.tok-e { color: #ffd166; font-weight: 600; }
.tok-a { color: #7ee787; }
.tok-f { color: #f778ba; }
.tok-s { color: #ffa657; }
