:root {
  --d: #004f6e;
  --l: #83ccea;
  --bg: #f4f9fb;
  --tx: #173746;
  --mu: #6b8089;
  --ln: #dce9ee;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--tx);
}
header {
  background: #fffffff2;
  border-bottom: 1px solid var(--ln);
  position: sticky;
  top: 0;
  z-index: 2;
}
.head,
main {
  max-width: 1160px;
  margin: auto;
}
.head {
  padding: 13px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brandwrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #082f40;
  display: grid;
  place-items: center;
  color: #8bdaf2;
  font:
    400 18px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace !important;
}
.brand {
  color: var(--d);
  font-size: 24px;
}
.brand span {
  display: block;
  color: var(--mu);
  font-size: 11px;
  margin-top: 5px;
}
.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.navlink {
  background: #edf5f7;
  color: var(--d);
  border-radius: 10px;
  padding: 10px 13px;
  text-decoration: none;
  font-size: 13px;
}
.gh {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #111;
  color: #fff;
}
.gh svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
main {
  padding: 40px 20px 70px;
}
.ey {
  font-size: 12px;
  letter-spacing: 1.4px;
  color: var(--d);
}
h1 {
  font-size: 38px;
  margin: 9px 0;
}
.sub {
  color: var(--mu);
  line-height: 1.7;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 30px 0;
}
.stat,
.card {
  background: #fff;
  border: 1px solid var(--ln);
  border-radius: 18px;
  padding: 22px;
}
.stat b {
  font-size: 32px;
  color: var(--d);
}
.stat span {
  display: block;
  color: var(--mu);
  font-size: 12px;
  margin-top: 6px;
}
.card h2 {
  font-size: 18px;
  color: var(--d);
  margin-top: 0;
}
.row {
  display: grid;
  grid-template-columns: 1fr 100px 100px 100px;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--ln);
  font-size: 13px;
}
.muted {
  color: var(--mu);
}
.mastery {
  margin: 28px 0;
}
.courseProgress {
  display: grid;
  grid-template-columns: 170px 1fr 70px;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--ln);
}
.miniTrack {
  height: 9px;
  background: #e4eef2;
  border-radius: 20px;
  overflow: hidden;
}
.miniBar {
  height: 100%;
  background: var(--d);
  border-radius: 20px;
}
.recommend {
  margin-top: 18px;
  padding: 16px;
  background: #edf7fa;
  border-radius: 14px;
  color: var(--d);
  font-size: 13px;
  line-height: 1.6;
}
.topicGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.topicCard {
  border: 1px solid var(--ln);
  border-radius: 14px;
  padding: 14px;
}
.topicHead {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12px;
}
.weakBtn {
  display: inline-block;
  margin-top: 12px;
  background: var(--d);
  color: #fff;
  text-decoration: none;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12px;
}
@media (max-width: 650px) {
  .topicGrid {
    grid-template-columns: 1fr;
  }
}
.empty {
  color: var(--mu);
  padding: 15px 0;
}
@media (max-width: 650px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: 1fr 70px 70px 70px;
    font-size: 11px;
  }
}
.brandwrap {
  text-decoration: none;
  color: inherit;
}
.brandwrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}
.brandLogo {
  width: 48px;
  height: 48px;
  display: block;
  filter: drop-shadow(0 6px 12px #004f6e20);
}
.brand {
  line-height: 1;
}
.nav {
  display: flex;
  align-items: center;
  gap: 9px;
}
.headerActions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.authHeader {
  border: 0;
  border-radius: 10px;
  padding: 10px 13px;
  min-height: 39px;
  background: #edf5f7;
  color: var(--d);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
}
.gh {
  text-decoration: none;
}
.brandwrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}
.brandLogo {
  width: 48px;
  height: 48px;
  display: block;
  filter: drop-shadow(0 6px 12px #004f6e20);
}
.brand {
  color: var(--d);
  font-size: 24px;
  line-height: 1;
}
.brand span {
  display: block;
  color: var(--mu);
  font-size: 11px;
  margin-top: 5px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 9px;
}
.headerActions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.authHeader,
.navlink {
  border: 0;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  text-decoration: none;
}
.authHeader,
.navlink {
  background: #edf5f7;
  color: var(--d);
}
.gh {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #111;
  color: #fff;
  text-decoration: none;
}
.gh svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
footer {
  border-top: 1px solid var(--ln);
  background: #fff;
}
.foot {
  max-width: 1160px;
  margin: auto;
  padding: 30px 20px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 25px;
}
.footbrand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--d);
  font-size: 20px;
}
.foot .mark,
.foot .brandLogo {
  width: 38px;
  height: 38px;
}
.footbrand small {
  display: block;
  color: var(--mu);
  font-size: 10px;
  margin-top: 4px;
}
.credit {
  color: var(--mu);
  font-size: 11px;
  margin-top: 12px;
}
.footcol h4 {
  color: var(--d);
  font-size: 11px;
  letter-spacing: 1px;
  margin: 0 0 10px;
}
.footcol a {
  display: block;
  color: var(--mu);
  font-size: 11px;
  text-decoration: none;
  margin: 8px 0;
}
.footcol a:hover {
  color: var(--d);
}
@media (max-width: 760px) {
  .head {
    padding: 10px 14px;
  }
  .brand span {
    display: none;
  }
  .nav {
    gap: 5px;
  }
  .navlink {
    padding: 8px;
    font-size: 11px;
  }
  .gh {
    display: none;
  }
  .authHeader {
    padding: 8px;
    font-size: 11px;
  }
  .foot {
    grid-template-columns: 1fr;
  }
  .footcol {
    display: none;
  }
}
.menuToggle {
  display: none;
  border: 0;
  background: #edf5f7;
  color: #004f6e;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 22px;
  align-items: center;
  justify-content: center;
}
.drawerBackdrop {
  display: none;
}
@media (max-width: 720px) {
  .head {
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  .head > .nav {
    position: fixed;
    top: 0;
    right: -290px;
    width: 280px !important;
    height: 100dvh;
    background: #fff;
    z-index: 1002;
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 7px !important;
    padding: 78px 18px 24px !important;
    overflow-y: auto !important;
    box-shadow: -18px 0 45px #002f4026;
    transition: right 0.28s ease;
  }
  .head > .nav.open {
    right: 0;
  }
  .head > .nav a {
    width: 100%;
    min-height: 46px;
    text-align: left;
    border-radius: 11px;
  }
  .headerActions {
    margin-left: auto;
  }
  .menuToggle {
    display: flex;
    position: relative;
    z-index: 1003;
  }
  .drawerBackdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #062c3a66;
    z-index: 4;
    opacity: 0;
    visibility: hidden;
    transition: 0.25s;
  }
  .drawerBackdrop.open {
    opacity: 1;
    visibility: visible;
  }
  body.drawerOpen {
    overflow: hidden;
  }
}

html {
  -webkit-text-size-adjust: 100%;
}
body {
  overflow-x: hidden;
}
button,
a,
input,
textarea {
  touch-action: manipulation;
}
@media (max-width: 720px) {
  .head {
    padding: 10px 14px;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }
  .brandwrap {
    gap: 8px;
  }
  .mark {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }
  .brand {
    font-size: 20px !important;
  }
  .brand span {
    font-size: 9px !important;
  }
  .nav {
    width: 100%;
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto;
    padding: 2px 0 5px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a,
  .nav button,
  .navlink,
  .btn {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 10px 12px !important;
  }
  main {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .hero {
    padding: 24px 20px !important;
    border-radius: 18px !important;
    min-height: auto !important;
  }
  .hero h1 {
    font-size: 30px !important;
  }
  .terminal {
    margin-top: 4px;
  }
  .term {
    min-height: 135px !important;
    padding: 17px !important;
    font-size: 12px !important;
  }
  .grid,
  .featurebar,
  .modegrid,
  .stats,
  .topicGrid,
  .layout {
    grid-template-columns: 1fr !important;
  }
  .section {
    align-items: flex-start;
    gap: 8px;
  }
  .course,
  .mode,
  .card,
  .result {
    padding: 18px !important;
  }
  .course h3 {
    min-height: auto !important;
  }
  .qh {
    flex-direction: column !important;
  }
  .qtext {
    font-size: 18px !important;
  }
  .opt {
    padding: 14px !important;
    min-height: 48px;
  }
  .actions {
    display: flex;
    gap: 8px;
  }
  .actions .btn {
    flex: 1;
  }
  .score {
    font-size: 46px !important;
  }
  .row {
    min-width: 560px;
  }
  .card:has(.row) {
    overflow-x: auto;
  }
  .courseProgress {
    grid-template-columns: 120px 1fr 55px !important;
    gap: 8px !important;
  }
  .toolbar {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 6px;
  }
  .chip {
    flex: 0 0 auto;
  }
  .editor {
    min-height: 300px !important;
    font-size: 14px !important;
  }
  .console,
  .schema {
    overflow-x: auto;
  }
  .foot {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 390px) {
  .brand span {
    display: none !important;
  }
  .hero h1 {
    font-size: 27px !important;
  }
  .qtext {
    font-size: 17px !important;
  }
  .courseProgress {
    grid-template-columns: 105px 1fr 48px !important;
  }
}

@media (max-width: 720px) {
  header {
    position: relative;
    z-index: 1003 !important;
  }
  .head > .nav {
    z-index: 1005 !important;
    pointer-events: auto !important;
  }
  .head > .nav a {
    position: relative;
    z-index: 1006 !important;
    pointer-events: auto !important;
  }
  .drawerBackdrop {
    z-index: 1002 !important;
  }
  .menuToggle {
    z-index: 1007 !important;
  }
}

header {
  background: #fffffff2 !important;
  backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid var(--ln) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  padding: 0 !important;
  color: inherit !important;
  text-align: initial !important;
}
header .head {
  max-width: 1160px !important;
  margin: auto !important;
  padding: 13px 20px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
header .brandwrap {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  text-decoration: none !important;
  color: inherit !important;
}
header .mark {
  width: 48px !important;
  height: 48px !important;
  display: grid !important;
  place-items: center !important;
  background: transparent !important;
  border-radius: 0 !important;
}
header .brandLogo {
  width: 48px !important;
  height: 48px !important;
  display: block !important;
  filter: drop-shadow(0 6px 12px #004f6e20) !important;
}
header .brand {
  color: var(--d) !important;
  font-size: 24px !important;
  line-height: 1 !important;
}
header .brand span {
  display: block !important;
  color: var(--mu) !important;
  font-size: 11px !important;
  margin-top: 5px !important;
}
header .nav {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  width: auto !important;
}
header .navlink {
  border: 0 !important;
  border-radius: 10px !important;
  padding: 10px 13px !important;
  font-size: 13px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  background: #edf5f7 !important;
  color: var(--d) !important;
}
header .headerActions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
header .authHeader {
  border: 0 !important;
  border-radius: 10px !important;
  padding: 10px 13px !important;
  min-height: 39px !important;
  background: #edf5f7 !important;
  color: var(--d) !important;
  cursor: pointer !important;
  font: inherit !important;
  font-size: 13px !important;
  text-decoration: none !important;
}
header .gh {
  width: 39px !important;
  height: 39px !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  background: #111 !important;
  color: #fff !important;
  text-decoration: none !important;
}
header .gh svg {
  width: 20px !important;
  height: 20px !important;
  fill: currentColor !important;
}
footer {
  background: #082f40 !important;
  color: #d9edf4 !important;
  padding: 30px 20px !important;
  border-top: 0 !important;
  text-align: initial !important;
}
footer .foot {
  max-width: 1160px !important;
  margin: auto !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: 1.2fr 1fr 1fr !important;
  gap: 35px !important;
  align-items: start !important;
}
footer .footbrand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #d9edf4 !important;
  font-size: inherit !important;
}
footer .foot .mark,
footer .foot .brandLogo {
  width: 38px !important;
  height: 38px !important;
}
footer .footbrand small {
  display: block !important;
  color: #789ba7 !important;
  font-size: 10px !important;
  margin-top: 4px !important;
}
footer .credit {
  font-size: 11px !important;
  color: #789ba7 !important;
  margin-top: 14px !important;
}
footer .footcol h4 {
  font-size: 12px !important;
  color: #83ccea !important;
  margin: 0 0 11px !important;
}
footer .footcol a {
  display: block !important;
  color: #d9edf4 !important;
  text-decoration: none !important;
  font-size: 12px !important;
  margin: 8px 0 !important;
}
@media (max-width: 720px) {
  header .head {
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  header .brand span {
    display: none !important;
  }
  footer .foot {
    grid-template-columns: 1fr !important;
  }
  footer .footcol {
    display: none !important;
  }
}

.vizgrid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  margin: 28px 0;
}
.vizcard {
  margin: 0 !important;
}
.chartBox {
  height: 280px;
  position: relative;
}
.chartBox canvas {
  width: 100% !important;
  height: 100% !important;
}
.labRings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.ringItem {
  text-align: center;
}
.ring {
  --p: 0;
  width: 112px;
  height: 112px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: conic-gradient(var(--d) calc(var(--p) * 1%), #e4eef2 0);
  display: grid;
  place-items: center;
  position: relative;
}
.ring:before {
  content: "";
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #fff;
}
.ring b {
  position: relative;
  z-index: 1;
  color: var(--d);
  font-size: 20px;
}
.ringItem small {
  display: block;
  color: var(--mu);
  margin-top: 4px;
}
.activityWrap {
  height: 270px;
  position: relative;
}
.activityWrap canvas {
  width: 100% !important;
  height: 100% !important;
}
@media (max-width: 760px) {
  .vizgrid {
    grid-template-columns: 1fr;
  }
  .labRings {
    grid-template-columns: repeat(2, 1fr);
  }
  .chartBox,
  .activityWrap {
    height: 240px;
  }
}

/* Certificate of Mastery & Banner */
.certBannerWrap {
  margin: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.certBanner {
  background: linear-gradient(135deg, #fef9c3 0%, #fffbeb 100%);
  border: 1.5px solid #fde047;
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.12);
  flex-wrap: wrap;
  gap: 12px;
}
.certBannerLeft {
  display: flex;
  align-items: center;
  gap: 14px;
}
.certBannerIcon {
  font-size: 28px;
}
.certBannerTitle {
  font-weight: 750;
  font-size: 15px;
  color: #854d0e;
}
.certBannerSub {
  font-size: 13px;
  color: #a16207;
}
.btnViewCert {
  background: #ca8a04;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(202, 138, 4, 0.25);
  transition: all 0.2s ease;
}
.btnViewCert:hover {
  background: #a16207;
  transform: translateY(-1px);
}

/* Modal Dialog */
.modalBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 39, 53, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}
.certDialog {
  background: #ffffff;
  border-radius: 20px;
  max-width: 860px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: auto;
}
.modalClose {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f1f5f9;
  border: none;
  font-size: 18px;
  color: #475569;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  z-index: 2;
}
.modalClose:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.certPaper {
  background: #ffffff;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}
.certBorder {
  border: 6px double #004f6e;
  border-radius: 12px;
  padding: 36px 32px;
  text-align: center;
  background: radial-gradient(circle at center, #ffffff 0%, #f8fbfd 100%);
  position: relative;
}
.certHeader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.certBrand {
  font-size: 20px;
  font-weight: 800;
  color: #004f6e;
  letter-spacing: -0.5px;
}
.certEyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 2px;
  color: #28a9dc;
  margin-bottom: 12px;
}
.certTitle {
  font-size: 26px;
  color: #004f6e;
  margin: 0 0 16px;
  font-weight: 800;
}
.certPresented {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 8px;
}
.certRecipient {
  font-size: 28px;
  font-weight: 850;
  color: #0f172a;
  border-bottom: 2px solid #cbd5e1;
  display: inline-block;
  padding: 0 30px 4px;
  margin-bottom: 14px;
}
.certReason {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 6px;
}
.certCourse {
  font-size: 20px;
  font-weight: 750;
  color: #0369a1;
  margin-bottom: 14px;
}
.certScoreBadge {
  font-size: 15px;
  color: #15803d;
  background: #dcfce7;
  padding: 6px 16px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 28px;
}
.certFooter {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-top: 1px dashed #cbd5e1;
  padding-top: 20px;
  margin-top: 10px;
}
.certMeta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
  text-align: right;
  direction: rtl;
}
.certSeal {
  width: 76px;
  height: 76px;
  border: 3px dashed #ca8a04;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 3px;
  box-sizing: border-box;
}
.sealInner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ca8a04;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.1;
}
.certActions {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.btnPri {
  background: #004f6e;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 700;
  cursor: pointer;
}
.btnPri:hover {
  background: #00364d;
}
.btnSec {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 650;
  cursor: pointer;
}

@media print {
  body * {
    visibility: hidden;
  }
  #certModal, #certModal * {
    visibility: visible;
  }
  #certModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    padding: 0;
    display: block !important;
  }
  .certDialog {
    box-shadow: none;
    border: none;
    padding: 0;
    max-width: 100%;
    width: 100%;
  }
  .modalClose, .certActions {
    display: none !important;
  }
  .certPaper {
    border: none;
    padding: 0;
  }
}
