@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700;800&family=Manrope:wght@500;600;700;800&display=swap');
:root{color-scheme:dark;--bg:#090e1b;--panel:#111a2b;--panel2:#162238;--text:#f4f7ff;--muted:#9ba9c1;--line:rgba(190,210,255,.13);--accent:#8c9cff;--cyan:#65d8df;--orange:#ffad70;--green:#67d6a2;--red:#ff7d8a}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% -20%,#1c2d4b 0,transparent 55%),var(--bg);color:var(--text);font-family:"DM Sans",sans-serif;min-height:100vh}
button,input,textarea{font:inherit}button{cursor:pointer}.topbar{height:68px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 max(18px,calc((100% - 1120px)/2));position:sticky;top:0;background:#090e1beF;backdrop-filter:blur(16px);z-index:5}
.html-academy-global-back{flex:0 0 auto;border:1px solid var(--line);background:#1a2941;color:var(--text);border-radius:11px;padding:9px 12px;font:600 13px "DM Sans",sans-serif;cursor:pointer;white-space:nowrap}.html-academy-global-back:focus-visible{outline:2px solid var(--cyan);outline-offset:3px}.top-title{text-align:center;display:grid;gap:2px}.top-title b{font:800 15px Manrope}.top-title small{font-size:10px;color:var(--muted);letter-spacing:1.4px}.ghost,.btn,.tab-btn{border:1px solid var(--line);background:#1a2941;color:var(--text);border-radius:11px;padding:10px 14px}.ghost{font-size:12px}
.shell{max-width:1120px;margin:auto;padding:22px 18px 40px}.hero{display:grid;grid-template-columns:260px 1fr;gap:28px;align-items:center;padding:24px 28px;border:1px solid var(--line);border-radius:24px;background:linear-gradient(115deg,#15243b,#111a2b 65%);overflow:hidden}
.hero-art{height:190px;position:relative;display:grid;place-items:center;background:radial-gradient(circle,#29466b 0,transparent 68%)}.art-orbit{position:absolute;width:170px;height:170px;border:1px solid #8c9cff55;border-radius:50%;box-shadow:0 0 0 18px #8c9cff0c,0 0 0 38px #8c9cff08}.html-mark{font:800 66px "DM Mono";color:#ffb77f;text-shadow:0 8px 35px #ff995c66;z-index:1}.art-tag{position:absolute;font:500 10px "DM Mono";padding:6px 9px;border:1px solid #ffffff30;border-radius:20px;background:#101b2d}.tag-one{top:25px;right:24px;color:var(--cyan)}.tag-two{bottom:24px;left:22px;color:#c0aaff}
.eyebrow{font:500 10px "DM Mono";letter-spacing:2px;color:var(--cyan)}h1{font:800 clamp(25px,4vw,38px) Manrope;margin:9px 0}.hero-copy p{color:var(--muted);margin:0 0 18px;line-height:1.6}.stats{display:flex;gap:28px}.stats div{display:grid;gap:2px}.stats b{font:800 20px Manrope}.stats small{font-size:11px;color:var(--muted)}.progress{height:7px;background:#ffffff12;border-radius:9px;margin-top:15px;overflow:hidden}.progress i{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--accent),var(--cyan));transition:width .3s}
.tabs{display:flex;gap:8px;overflow-x:auto;padding:20px 0 14px;scrollbar-width:thin}.tabs button{white-space:nowrap;border:1px solid var(--line);background:#111a2b;color:var(--muted);border-radius:12px;padding:11px 14px;font-size:12px}.tabs button.active{background:#28375b;border-color:#899aff88;color:white}
.panel{min-height:340px;border:1px solid var(--line);border-radius:20px;background:linear-gradient(145deg,#121d30,#0f1727);padding:22px}.section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:18px}.section-head h2{margin:0 0 5px;font:800 21px Manrope}.muted{color:var(--muted);font-size:13px;line-height:1.6}.level-grid,.project-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.level-card,.project-card,.lesson-card{border:1px solid var(--line);border-radius:15px;background:#17243a;padding:16px}.level-card{cursor:pointer;transition:.2s}.level-card:hover,.project-card:hover{transform:translateY(-2px);border-color:#8c9cff88}.level-card h3,.project-card h3{margin:7px 0;font-size:15px}.level-card p,.project-card p{font-size:12px;color:var(--muted);line-height:1.55}.level-card .num{font:500 11px "DM Mono";color:var(--cyan)}.pill{font-size:10px;border-radius:20px;padding:5px 8px;background:#263858;color:#cbd5ff}.pill.done{background:#164332;color:#82e5b7}.pill.lock{background:#382b35;color:#ffb5bd}
.lesson-list{display:grid;gap:9px}.lesson-row{display:flex;align-items:center;gap:12px;border:1px solid var(--line);background:#17243a;border-radius:13px;padding:13px;text-align:left;color:var(--text);width:100%}.lesson-row:disabled{opacity:.48;cursor:not-allowed}.lesson-row .number{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:#293a5c;color:var(--cyan);font:500 12px "DM Mono"}.lesson-row strong{display:block;font-size:13px}.lesson-row small{color:var(--muted);font-size:11px}
.btn{background:linear-gradient(120deg,#6678df,#5364bd);border:0;font-weight:700;font-size:13px}.btn.secondary{background:#263650;border:1px solid var(--line)}.btn.success{background:#176347}.btn.danger{background:#693947}.actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:15px}
.lesson-body{display:grid;grid-template-columns:1fr 1fr;gap:14px}.box{background:#0b1321;border:1px solid var(--line);border-radius:13px;padding:14px;min-width:0}.box h3{font-size:13px;margin:0 0 10px}.code{font:12px/1.8 "DM Mono",monospace;white-space:pre-wrap;overflow-wrap:anywhere;color:#c5dcff;background:#080e18;border-radius:10px;padding:13px;margin:0;overflow:auto}.explain{font-size:13px;line-height:1.75;color:#d4deef}.output{border-left:3px solid var(--green);padding:9px 12px;background:#10251f;color:#b6f2d6;font-size:13px;border-radius:7px}
.question{font-size:17px;font-weight:700;line-height:1.5;margin:10px 0 16px}.choices{display:grid;gap:9px}.choice{padding:13px;border:1px solid var(--line);background:#17243a;color:var(--text);border-radius:11px;text-align:left}.choice.correct{border-color:var(--green);background:#15372c}.choice.wrong{border-color:var(--red);background:#3b202a}.feedback{padding:12px;border-radius:10px;margin-top:13px;background:#1b2a40;font-size:13px;line-height:1.6}
.code-lines{display:grid;gap:7px}.code-line{font:12px "DM Mono";padding:11px;background:#0a1220;border:1px solid var(--line);border-radius:8px;display:flex;gap:10px}.code-line button{border:0;background:#293b5b;color:#fff;border-radius:6px;padding:4px 8px}.editor-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.editor{width:100%;min-height:260px;resize:vertical;background:#080e18;color:#c7e0ff;border:1px solid var(--line);border-radius:12px;padding:13px;font:12px/1.65 "DM Mono";tab-size:2}.preview{width:100%;height:280px;border:1px solid var(--line);border-radius:12px;background:white}
.bug-line{display:grid;grid-template-columns:30px 1fr;gap:7px;align-items:center;margin:7px 0}.bug-line label{font:11px "DM Mono";color:var(--muted)}.bug-line input{width:100%;min-width:0;background:#080e18;color:#ffd6b4;border:1px solid var(--line);border-radius:8px;padding:9px;font:11px "DM Mono"}
footer{text-align:center;color:#71819e;font-size:11px;padding:25px 0 5px}footer span{color:var(--cyan)}
@media(max-width:700px){.shell{padding:14px 12px 30px}.hero{grid-template-columns:105px 1fr;padding:17px 14px;gap:12px}.hero-art{height:145px}.art-orbit{width:100px;height:100px}.html-mark{font-size:39px}.art-tag{font-size:8px}.tag-one{right:0}.tag-two{left:0}.hero-copy p{font-size:12px}.stats{gap:14px}.stats b{font-size:17px}.level-grid,.project-grid{grid-template-columns:1fr 1fr}.panel{padding:15px}.lesson-body,.editor-grid{grid-template-columns:1fr}.tabs{margin:0 -3px}.topbar{padding:0 13px}}
@media(max-width:390px){.hero{grid-template-columns:1fr}.hero-art{height:105px}.level-grid,.project-grid{grid-template-columns:1fr}.top-title{display:none}}


/* ===== CodeQuest HTML Academy Home ===== */
.home-panel{padding:0;overflow:hidden;background:linear-gradient(145deg,#101b2e,#0b1424)}
.academy-hero{display:grid;grid-template-columns:1.08fr .92fr;gap:28px;padding:22px;border:1px solid var(--line);border-radius:19px;background:linear-gradient(115deg,#14243c,#101a2c)}
.academy-hero-image{position:relative;min-height:270px;border-radius:15px;overflow:hidden;background:#101b2c}
.academy-hero-image img{width:100%;height:100%;min-height:270px;object-fit:cover;display:block}
.hero-chip{position:absolute;left:14px;bottom:14px;padding:8px 11px;border:1px solid #8be5ed55;border-radius:9px;background:#071321d9;color:#8be5ed;font:11px "DM Mono"}
.academy-hero-copy{align-self:center;padding:8px 4px}
.academy-hero-copy h1{font-size:clamp(27px,4vw,43px);line-height:1.16}
.academy-hero-copy p{color:var(--muted);line-height:1.7;font-size:14px}
.hero-cta{margin-top:18px;padding:13px 20px}
.home-section-heading{display:flex;justify-content:space-between;align-items:end;margin:30px 2px 16px}
.home-section-heading h2{font:800 23px Manrope;margin:6px 0}
.home-section-heading p{margin:0;color:var(--muted);font-size:13px}
.academy-card-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.academy-feature-card{position:relative;min-height:190px;overflow:hidden;text-align:left;color:white;border:1px solid #b8d4ff24;border-radius:16px;padding:16px;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;background:#14233a;isolation:isolate;transition:transform .2s,border-color .2s}
.academy-feature-card:hover{transform:translateY(-3px);border-color:#76dce6a8}
.academy-feature-card::before{content:"";position:absolute;inset:0;z-index:-2;background:linear-gradient(0deg,#07111ff5 0%,#09142680 58%,#09142612 100%)}
.academy-feature-card.image-card::after{content:"";position:absolute;inset:0;z-index:-3;background-image:var(--card-image);background-size:cover;background-position:center;transition:transform .35s}
.academy-feature-card.image-card:hover::after{transform:scale(1.06)}
.academy-feature-card strong{font:800 19px Manrope;margin:5px 0}
.academy-feature-card small{font-size:11px;color:#d3deef;line-height:1.5}
.academy-feature-card .card-kicker{font:10px "DM Mono";letter-spacing:1.3px;color:#8be5ed}
.academy-feature-card i{position:absolute;right:14px;top:12px;font-size:20px;font-style:normal;color:#9debf0}
.graphic-card{background:radial-gradient(circle at 75% 24%,#3b6591 0,transparent 42%),linear-gradient(145deg,#1c3654,#101a2c)}
.graphic-card::before{background:linear-gradient(0deg,#07111ff0,#07111f10 100%)}
.graphic-symbol{position:absolute;right:20px;top:16px;font:800 53px "DM Mono";color:#9be7ed88;text-shadow:0 0 28px #54dce955}
.puzzle-art{background:radial-gradient(circle at 75% 20%,#7356a2 0,transparent 45%),linear-gradient(145deg,#2a315c,#101a2c)}
.project-art{background:radial-gradient(circle at 75% 20%,#267e78 0,transparent 45%),linear-gradient(145deg,#173e4a,#101a2c)}
.progress-art{background:radial-gradient(circle at 75% 20%,#5269a8 0,transparent 45%),linear-gradient(145deg,#26365d,#101a2c)}
.academy-subnav{display:flex;justify-content:flex-start;margin-bottom:18px}
.progress-overview{padding:20px;border:1px solid var(--line);border-radius:14px;background:#0b1423;display:grid;gap:8px}
.progress-overview strong{font:800 36px Manrope;color:var(--cyan)}
.progress-overview span{font-size:13px;color:var(--muted)}
.progress-metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}
.progress-metric{padding:18px;border:1px solid var(--line);border-radius:13px;background:#17243a;display:grid;gap:9px}
.progress-metric small{color:var(--muted);font-size:12px}
.progress-metric strong{font:800 23px Manrope;color:var(--cyan)}
@media(max-width:760px){.academy-hero{grid-template-columns:1fr;gap:15px;padding:14px}.academy-hero-image,.academy-hero-image img{min-height:190px}.academy-card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.academy-feature-card{min-height:165px;padding:13px}.academy-feature-card strong{font-size:16px}.progress-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:390px){.academy-card-grid{grid-template-columns:1fr}.academy-feature-card{min-height:150px}.home-section-heading h2{font-size:19px}}


/* Learning Path <-> Lesson close navigation */
.path-top-actions {
  position:absolute;
  top:10px;
  right:10px;
  z-index:5;
  margin:0;
}
.lesson-top-actions {
  display:flex;
  justify-content:flex-end;
  margin:0 0 12px;
}
#view.panel:has(.path-top-actions) {
  position:relative;
}
.path-close-btn {
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid #65d8df66;
  border-radius:12px;
  background:linear-gradient(145deg,#172e49,#101c30);
  color:#8be5ed;
  font-size:29px;
  line-height:1;
  cursor:pointer;
  transition:background .2s,border-color .2s,transform .2s;
}
.path-close-btn:hover {
  background:#21415d;
  border-color:#65d8df;
  transform:scale(1.04);
}


/* ===== HTML Example Editor Line Numbers ===== */
.code-editor {
  background:#080e18;
  border-radius:10px;
  padding:13px 0;
  margin:0;
  overflow-x:auto;
  color:#c5dcff;
  font:12px/1.8 "DM Mono",monospace;
}
.code-row {
  display:grid;
  grid-template-columns:38px max-content;
  min-width:100%;
  min-height:21.6px;
}
.code-row .line-number {
  color:#647895;
  text-align:right;
  padding-right:11px;
  user-select:none;
  border-right:1px solid #263650;
}
.code-row code {
  display:block;
  padding-left:12px;
  padding-right:14px;
  color:#c5dcff;
  white-space:pre;
  font:inherit;
}

/* Project Lab workspace */
.project-card-top,.project-workspace-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.project-status{
  display:inline-flex;
  align-items:center;
  border-radius:20px;
  padding:5px 9px;
  font-size:11px;
  font-weight:700;
}
.project-status.is-complete{
  color:#8ce8bd;
  background:#123b35;
}
.project-status.is-pending{
  color:#b9c9dc;
  background:#26364b;
}
.project-workspace-info{
  margin:14px 0 18px;
  padding:17px;
  border:1px solid var(--line);
  border-radius:15px;
  background:#142238;
}
.project-workspace-info h2{
  margin:14px 0 8px;
}
.project-steps{
  padding-left:24px;
  line-height:1.8;
}
.project-steps li{
  padding:3px 0;
}
.project-help,.project-reference{
  margin-top:12px;
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#101c2e;
}
.project-help summary,.project-reference summary{
  cursor:pointer;
  font-weight:700;
}
.project-output{
  margin-top:12px;
  padding:12px;
  border-left:3px solid #28c8d8;
  border-radius:7px;
  background:#102d3b;
  line-height:1.65;
}
.project-reference pre{
  max-height:420px;
  overflow:auto;
  white-space:pre;
  padding:12px;
  border-radius:9px;
  background:#080e18;
  color:#c7e0ff;
  font:12px/1.65 "DM Mono",monospace;
}
.numbered-editor{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  width:100%;
  height:360px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:12px;
  background:#080e18;
}
.line-gutter{
  height:100%;
  margin:0;
  padding:13px 8px;
  overflow:hidden;
  border-right:1px solid #26364b;
  color:#7187a2;
  text-align:right;
  user-select:none;
  white-space:pre;
  font:12px/1.65 "DM Mono",monospace;
}
.numbered-editor .editor{
  width:100%;
  height:100%;
  min-height:0;
  resize:vertical;
  border:0;
  border-radius:0;
  outline:none;
  overflow:auto;
  white-space:pre;
  overflow-wrap:normal;
  word-break:normal;
  tab-size:2;
  font:12px/1.65 "DM Mono",monospace;
}
#projectFeedback:empty{
  display:none;
}
#projectFeedback ul{
  padding-left:22px;
  line-height:1.7;
}
@media(max-width:700px){
  .numbered-editor{height:340px}
  .project-workspace-info{padding:13px}
}


/* Learning Path curriculum enhancements */
.tok-tag{color:#70c8ff}
.tok-attr{color:#c7a6ff}
.tok-string{color:#a8e6a1}
.tok-comment{color:#8292a8;font-style:italic}
.tok-doctype{color:#f3c879}
.tok-entity{color:#f5a6d5}
.lesson-row .number-done{background:#17483d;color:#8ff0c2}
.lesson-reading{line-height:1.75}
.lesson-detail-section{margin-top:17px;padding-top:13px;border-top:1px solid var(--line)}
.lesson-detail-section h3{font-size:13px;margin:0 0 9px}
.lesson-detail-list{margin:7px 0 0;padding-left:21px;color:#d4deef;font-size:13px;line-height:1.8}
.lesson-detail-list li{margin:4px 0}
.html-output-frame{display:block;width:100%;min-height:190px;border:1px solid #d6dce5;border-radius:9px;background:#fff;color:#111;resize:vertical}
.lesson-reading .explain{white-space:pre-line}


/* Stable page position during Learning Path navigation */
html {
  scroll-behavior: auto;
  overflow-anchor: none;
}
body, #view {
  overflow-anchor: none;
}


/* HTML Academy standalone workspace */
.html-workspace{margin-top:16px;padding:14px;border:1px solid var(--line);border-radius:15px;background:#0c1728}
.workspace-toolbar{display:flex;flex-wrap:wrap;gap:7px;margin:8px 0 12px}
.workspace-toolbar .btn{font-size:11px;padding:9px 11px}
.html-file-tabs{display:flex;gap:6px;overflow-x:auto;padding:5px 0 10px}
.html-file-tab{flex:0 0 auto;border:1px solid var(--line);border-radius:8px;background:#17243a;color:var(--text);padding:9px 13px}
.html-file-tab.active{border-color:var(--cyan);background:#123346;color:#9beaf2}
.workspace-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}
.workspace-editor-pane,.workspace-preview-pane{min-width:0}
.workspace-save-status{font-size:11px;color:var(--green);margin:7px 2px}
.workspace-preview-stage{min-height:360px;overflow:auto;padding:8px;background:#111d30;border:1px solid var(--line);border-radius:10px}
.workspace-preview-stage .preview{height:340px;max-width:100%;background:white}
.workspace-preview-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px}
.workspace-preview-head h3{margin:8px 0}
@media(max-width:700px){.workspace-grid{grid-template-columns:1fr}.html-workspace{padding:10px}.workspace-preview-stage{min-height:300px}}



/* HTML Workspace full-screen editor upgrade */
.html-workspace-screen{
  position:fixed;inset:0;z-index:9999;display:flex;flex-direction:column;
  min-height:100dvh;background:#091321;color:var(--text);padding:8px;
  overflow:hidden;gap:5px
}
.html-ws-top{position:relative;display:flex;align-items:center;gap:6px;
  min-height:42px;padding:3px 2px;border-bottom:1px solid var(--line)}
.html-ws-top .btn{padding:7px 10px;font-size:12px}
.ws-file-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;font-size:12px;color:#c9d8eb}
.ws-menu{position:absolute;top:43px;left:0;z-index:10002;min-width:190px;
  max-height:75dvh;overflow:auto;padding:6px;border:1px solid var(--line);
  border-radius:10px;background:#142238;box-shadow:0 12px 35px #0009}
.ws-menu button{display:block;width:100%;text-align:left;border:0;
  border-radius:6px;background:transparent;color:var(--text);
  padding:10px;font-size:13px}
.ws-menu button:active{background:#24415c}
.ws-editor-main{flex:1;min-height:0;display:flex;flex-direction:column;
  border:1px solid var(--line);border-radius:9px;overflow:hidden;background:#0c1728}
.ws-numbered-editor{flex:1;min-height:0;display:flex;overflow:hidden;align-items:stretch}
.ws-numbered-editor .line-gutter{flex:0 0 42px;width:42px;overflow:hidden;
  margin:0;padding:12px 8px;text-align:right;white-space:pre;
  color:#71849e;background:#101e31;border-right:1px solid var(--line);
  font:13px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;
  box-sizing:border-box}
.ws-code-input{flex:1;min-width:0;min-height:0;width:100%;height:100%;
  resize:none;border:0;border-radius:0;padding:12px;
  background:#0c1728;color:#e2edf9;outline:none;
  font:13px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;
  tab-size:2;white-space:pre;overflow:auto;box-sizing:border-box}
.workspace-save-status{flex:0 0 auto;margin:0;padding:4px 9px;
  min-height:22px;font-size:10px;color:#82dcb5}
.ws-reference-bar{display:flex;align-items:center;gap:7px;min-height:42px;
  border-top:1px solid var(--line);padding:5px 1px}
.ws-reference-bar span{font-size:11px;color:#a9bed6;white-space:nowrap}
.ws-reference-bar select,.ws-preview-toolbar select{
  min-width:0;flex:1;background:#14243a;color:var(--text);
  border:1px solid var(--line);border-radius:7px;padding:8px;font-size:11px}
.ws-reference-bar .btn{font-size:11px;padding:8px 12px}
.ws-reference-warning{padding:7px 9px;font-size:11px;color:#f3cf88;
  border-bottom:1px solid var(--line)}
.ws-reference-warning .btn{margin-left:7px;padding:5px 8px;font-size:10px}
.reference-tab{border-style:dashed}
.ws-preview-screen{position:absolute;inset:0;z-index:10001;
  display:flex;flex-direction:column;background:#111827}
.ws-preview-screen[hidden]{display:none}
.ws-preview-toolbar{display:flex;align-items:center;gap:7px;padding:8px;
  min-height:48px;background:#101d30;border-bottom:1px solid var(--line)}
.ws-preview-toolbar span{flex:1;min-width:0;font-size:11px;overflow:hidden}
.ws-preview-toolbar .btn{font-size:11px;padding:7px}
.ws-preview-content{flex:1;min-height:0;display:flex;justify-content:center;
  overflow:auto;background:#283447;padding:8px}
.ws-preview-content iframe{width:100%;height:100%;min-height:100%;
  border:0;background:white}
.html-file-tabs{flex:0 0 auto;min-height:39px;padding:2px 0 5px}
.html-file-tab{padding:7px 11px;font-size:11px}
@media(max-width:520px){
  .html-workspace-screen{padding:5px;gap:4px}
  .ws-reference-bar span{font-size:10px}
  .ws-reference-bar{gap:4px}
  .ws-preview-toolbar{gap:4px;padding:5px}
  .ws-preview-toolbar .btn{padding:6px;font-size:10px}
}

/* Workspace alignment fix v2 */
.ws-numbered-editor {
  display:flex!important;
  align-items:stretch!important;
  overflow:hidden!important;
}
.ws-numbered-editor .line-gutter {
  flex:0 0 46px!important;
  width:46px!important;
  height:100%!important;
  overflow:hidden!important;
  margin:0!important;
  padding:12px 8px!important;
  box-sizing:border-box!important;
  font:400 13px/21.45px ui-monospace,monospace!important;
  white-space:pre!important;
}
.ws-numbered-editor .ws-code-input {
  flex:1!important;
  min-width:0!important;
  padding:12px!important;
  font:400 13px/21.45px ui-monospace,monospace!important;
  letter-spacing:normal!important;
  white-space:pre!important;
  overflow-wrap:normal!important;
}
.html-ws-top .btn,
#wsMenuBtn,#wsUndo,#wsRedo {
  min-width:48px!important;
  min-height:48px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
#wsMenuBtn {font-size:27px!important}
#wsUndo,#wsRedo {font-size:25px!important}


/* Unified scrolling editor and HTML IntelliSense */
.ws-editor-main{
  display:block!important;
  overflow:auto!important;
  min-height:0!important;
  flex:1!important;
  overscroll-behavior:contain;
}
.ws-numbered-editor{
  display:flex!important;
  align-items:flex-start!important;
  overflow:visible!important;
  min-height:100%!important;
  height:auto!important;
}
.ws-numbered-editor .line-gutter{
  position:sticky;
  top:0;
  flex:0 0 46px!important;
  height:auto;
  min-height:46px;
  overflow:hidden!important;
}
.ws-numbered-editor .ws-code-input{
  display:block!important;
  flex:1 1 auto!important;
  height:auto!important;
  min-height:46px!important;
  overflow:hidden!important;
  resize:none!important;
}
.ws-suggestions{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  padding:7px;
  max-height:100px;
  overflow:auto;
  background:#14243a;
  border:1px solid var(--line);
  border-radius:8px;
}
.ws-suggestions[hidden]{display:none!important}
.ws-suggestion{
  border:1px solid #35516e;
  border-radius:6px;
  background:#1b304a;
  color:#dcecff;
  padding:7px 10px;
  font:12px ui-monospace,monospace;
}
.ws-suggestion.selected{
  background:#15516a;
  border-color:#70d9ee;
  color:white;
}


/* Final unified editor scroll correction */
.ws-editor-main {
  display:block!important;
  overflow:auto!important;
  min-height:0!important;
  flex:1 1 auto!important;
}
.ws-numbered-editor {
  display:flex!important;
  align-items:flex-start!important;
  overflow:visible!important;
  min-height:0!important;
  height:auto!important;
  width:100%;
}
.ws-numbered-editor .line-gutter {
  position:static!important;
  top:auto!important;
  flex:0 0 46px!important;
  width:46px!important;
  height:auto!important;
  min-height:46px!important;
  overflow:hidden!important;
}
.ws-numbered-editor .ws-code-input {
  display:block!important;
  flex:1 1 auto!important;
  min-width:0!important;
  height:auto!important;
  min-height:46px!important;
  overflow:hidden!important;
  resize:none!important;
}


/* Project identity and filename visibility */
#wsFileLabel {
  display:block;
  min-width:0;
  max-width:min(48vw,360px);
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:13px;
  font-weight:700;
}


/* Multiple persistent read-only Project Reference tabs */
.reference-tab { display:inline-flex!important; align-items:center!important; gap:8px!important; }
.ws-ref-close {
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%;
  font-size:19px; line-height:1; cursor:pointer;
  background:rgba(255,255,255,.12);
}
.ws-ref-close:hover { background:rgba(255,90,90,.28); }


/* Mobile keyboard: keep workspace controls reachable */
.html-workspace-screen {
  height:100dvh!important;
  min-height:0!important;
  max-height:100dvh!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
.html-ws-top {
  position:sticky!important;
  top:0!important;
  z-index:10001!important;
  flex:0 0 auto!important;
  min-height:52px!important;
  background:#091321!important;
  padding-top:3px!important;
}
.html-file-tabs {
  position:sticky!important;
  top:0!important;
  z-index:10000!important;
  flex:0 0 auto!important;
  background:#091321!important;
}
.ws-editor-main {
  flex:1 1 0%!important;
  min-height:0!important;
  height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-y:contain!important;
  touch-action:pan-y!important;
}


/* Actual visible viewport while Android keyboard is open */
.html-workspace-screen {
  position:fixed!important;
  top:var(--cq-vv-top,0px)!important;
  bottom:auto!important;
  left:0!important;
  right:0!important;
  width:100%!important;
  height:var(--cq-vv-height,100dvh)!important;
  min-height:0!important;
  max-height:var(--cq-vv-height,100dvh)!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
.html-ws-top {
  flex:0 0 auto!important;
  position:relative!important;
  z-index:10001!important;
}
.html-file-tabs {
  flex:0 0 auto!important;
  position:relative!important;
  z-index:10000!important;
}
.ws-editor-main {
  flex:1 1 0!important;
  min-height:0!important;
  height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
}

/* Close control for editable HTML page tabs */
.html-file-tab{display:inline-flex;align-items:center;justify-content:center;gap:8px}
.ws-page-close{
 display:inline-flex;align-items:center;justify-content:center;
 flex:0 0 20px;width:20px;height:20px;border-radius:6px;
 color:#aebed1;font-size:18px;line-height:1;cursor:pointer;user-select:none
}
.ws-page-close:hover{color:#fff;background:rgba(239,91,105,.22)}
.ws-page-close:active{background:rgba(239,91,105,.38)}


/* Premium image cards: HTML Editor, Puzzle, Project Lab, Progress */
.academy-feature-card.image-card{
  min-height:205px;
  border:1px solid rgba(180,225,255,.25);
  border-radius:17px;
  background-color:rgba(17,30,49,.48);
  box-shadow:0 10px 28px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.10);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
  transition:transform .28s ease,border-color .28s ease,box-shadow .28s ease;
}
.academy-feature-card.image-card:hover{
  transform:translateY(-4px);
  border-color:rgba(117,226,235,.72);
  box-shadow:0 15px 34px rgba(0,0,0,.32),0 0 18px rgba(101,216,223,.10);
}
.academy-feature-card.image-card::after{
  background-position:center;
  background-size:cover;
}
@media(max-width:760px){
  .academy-feature-card.image-card{min-height:180px;padding:14px}
}
@media(max-width:390px){
  .academy-feature-card.image-card{min-height:165px}
}


/* Keep the workspace menu at the far-right corner */
.html-ws-top #wsMenuBtn {
  order: 5;
  margin-left: auto !important;
}
.html-ws-top .ws-menu {
  left: auto !important;
  right: 0 !important;
}


/* HTML Bug Hunter - isolated responsive interface */
.bh-shell{
  width:100%;
  max-width:1100px;
  margin:12px auto 24px;
  padding:clamp(12px,2.5vw,22px);
  border:1px solid rgba(150,190,225,.25);
  border-radius:16px;
  background:rgba(10,22,38,.82);
  box-sizing:border-box;
}
.bh-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
}
.bh-toolbar-left{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
.bh-counter,.bh-status{
  display:inline-flex;
  align-items:center;
  border:1px solid rgba(160,195,225,.25);
  border-radius:8px;
  padding:6px 10px;
  font-size:13px;
  font-weight:700;
}
.bh-status.is-done{
  border-color:#398a65;
  color:#a6f0c4;
}
.bh-jump-label{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  font-size:12px;
  color:var(--muted,#aebed1);
}
.bh-jump-label select{
  max-width:min(62vw,330px);
  min-width:145px;
  padding:8px;
  border:1px solid rgba(160,195,225,.3);
  border-radius:8px;
  background:#14243a;
  color:#eef5ff;
}
.bh-progress-track{
  height:7px;
  overflow:hidden;
  margin-top:15px;
  border-radius:10px;
  background:rgba(150,180,210,.15);
}
.bh-progress-fill{
  height:100%;
  border-radius:10px;
  background:#42b98a;
  transition:width .2s ease;
}
.bh-progress-caption{
  display:flex;
  justify-content:space-between;
  margin-top:6px;
  color:var(--muted,#aebed1);
  font-size:12px;
}
.bh-challenge-heading{
  margin:20px 0 14px;
}
.bh-challenge-heading h3{
  margin:0 0 7px;
  font-size:19px;
  line-height:1.4;
}
.bh-challenge-heading p{
  margin:0;
  color:var(--muted,#aebed1);
  font-size:13px;
  line-height:1.7;
}
.bh-editor-heading,.bh-preview-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:14px 0 8px;
  font-size:13px;
}
.bh-editor-heading span,.bh-preview-heading span{
  color:var(--muted,#aebed1);
  font-size:11px;
}
.bh-editor{
  display:block;
  width:100%;
  min-height:330px;
  box-sizing:border-box;
  resize:vertical;
  padding:14px;
  border:1px solid rgba(125,180,220,.35);
  border-radius:10px;
  outline:none;
  background:#071321;
  color:#d8edff;
  font:13px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;
  tab-size:2;
  white-space:pre;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.bh-editor:focus{
  border-color:#54b9d4;
  box-shadow:0 0 0 2px rgba(84,185,212,.12);
}
.bh-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.bh-actions button{
  min-height:38px;
}
.bh-actions button:disabled{
  opacity:.42;
  cursor:not-allowed;
}
.bh-feedback{
  margin-top:10px;
}
.bh-success,.bh-error,.bh-info-panel{
  padding:12px 14px;
  border:1px solid rgba(150,190,225,.25);
  border-radius:10px;
  line-height:1.65;
  font-size:13px;
}
.bh-success{
  border-color:rgba(67,185,130,.5);
  background:rgba(35,125,86,.12);
  color:#c6f5dc;
}
.bh-error{
  border-color:rgba(220,130,105,.45);
  background:rgba(150,65,55,.12);
  color:#ffd4c9;
}
.bh-success p,.bh-error p,.bh-info-panel p{
  margin:5px 0;
}
.bh-info-panel{
  margin-top:10px;
  background:rgba(65,110,155,.12);
  color:#d9eaff;
}
.bh-info-panel[hidden]{
  display:none;
}
.bh-preview{
  display:block;
  width:100%;
  height:260px;
  border:1px solid rgba(150,190,225,.3);
  border-radius:10px;
  background:#fff;
}
.bh-navigation{
  justify-content:space-between;
}
.bh-note{
  margin:14px 0 0;
  color:var(--muted,#aebed1);
  font-size:11px;
  line-height:1.6;
}
@media(max-width:600px){
  .bh-shell{padding:11px;border-radius:12px}
  .bh-toolbar{align-items:flex-start}
  .bh-jump-label{width:100%;justify-content:space-between}
  .bh-jump-label select{flex:1;min-width:0}
  .bh-editor{min-height:290px;font-size:12px}
  .bh-preview{height:220px}
  .bh-actions button{flex:1 1 calc(50% - 8px)}
  .bh-navigation button{flex:1 1 45%}
}



/* BH_FULL_FEEDBACK_V1 */
.bh-feedback-report{
  display:grid;
  gap:14px;
  margin-top:14px;
  text-align:left;
}
.bh-feedback-section{
  min-width:0;
  padding:12px;
  border:1px solid var(--border-color, #d1d5db);
  border-radius:12px;
  background:var(--card-bg, #fff);
}
.bh-feedback-section > strong{
  display:block;
  margin-bottom:7px;
}
.bh-feedback-section > p,
.bh-feedback-explanation p{
  margin:7px 0;
  line-height:1.65;
}
.bh-diff-legend{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0;
  font-size:12px;
}
.bh-diff-legend-remove,
.bh-diff-legend-add{
  padding:5px 8px;
  border-radius:6px;
  font-weight:700;
}
.bh-diff-legend-remove{
  color:#b91c1c;
  background:#fee2e2;
}
.bh-diff-legend-add{
  color:#166534;
  background:#dcfce7;
}
.bh-full-diff,
.bh-full-code{
  display:block;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  overflow-x:auto;
  white-space:pre;
  overflow-wrap:normal;
  padding:10px;
  margin:10px 0 0;
  border-radius:8px;
  background:var(--code-bg, #111827);
  color:#f9fafb;
  font:12px/1.7 monospace;
  tab-size:2;
}
.bh-diff-line{
  display:block;
  min-width:max-content;
  padding:0 5px;
}
.bh-diff-remove{
  color:#fecaca;
  background:rgba(220,38,38,.22);
}
.bh-diff-add{
  color:#bbf7d0;
  background:rgba(22,163,74,.22);
}
.bh-diff-number{
  display:inline-block;
  width:34px;
  color:#9ca3af;
  user-select:none;
}
.bh-diff-symbol{
  display:inline-block;
  width:18px;
  font-weight:800;
}
.bh-diff-remove .bh-diff-symbol{color:#f87171}
.bh-diff-add .bh-diff-symbol{color:#4ade80}
.bh-feedback-section summary{
  cursor:pointer;
  font-weight:700;
  line-height:1.6;
}
.bh-feedback-explanation{
  padding:13px;
  border-left:4px solid #d97706;
  border-radius:8px;
  background:var(--surface-secondary, #f3f4f6);
}
.bh-feedback-success,
.bh-feedback-error{
  padding:12px;
  border-radius:10px;
}
.bh-feedback-success{
  border:1px solid #16a34a;
}
.bh-feedback-error{
  border:1px solid #dc2626;
}
.bh-correct-code{
  border:1px solid #16a34a;
}

