:root{--green:#0d3b2e;--green2:#155b46;--gold:#c69b45;--cream:#f8f5ed;--ink:#1e2925;--muted:#68736f;--line:#e4e6df;--red:#a63c32;--yellow:#fff4c7;--shadow:0 12px 40px rgba(13,59,46,.10)}*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;background:var(--cream);color:var(--ink)}button,input{font:inherit}button{cursor:pointer}.topbar{position:sticky;top:0;z-index:20;background:rgba(248,245,237,.95);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);height:76px;padding:8px max(18px,calc((100vw - 1180px)/2));display:flex;align-items:center;justify-content:space-between}.brand{border:0;background:none;display:flex;gap:10px;align-items:center;text-align:left;color:var(--green)}.brand img{width:52px;height:52px;object-fit:contain}.brand b,.brand small{display:block}.brand b{font-family:Georgia,serif;font-size:20px}.brand small{font-size:11px;color:var(--muted)}.top-actions{display:flex;align-items:center;gap:8px}.auth-badge,.tier-badge{padding:7px 10px;border-radius:999px;background:#e7efe9;color:var(--green);font-size:12px;font-weight:800}.view{display:none}.view.active{display:block}.shell{max-width:1180px;margin:0 auto;padding:38px 20px}.narrow{max-width:720px}.hero{min-height:520px;display:grid;grid-template-columns:1.2fr .8fr;gap:44px;align-items:center}.eyebrow{font-size:12px;font-weight:900;letter-spacing:.12em;color:var(--green2)}h1,h2,h3{margin-top:.45em}h1{font-family:Georgia,serif;font-size:clamp(42px,6vw,72px);line-height:1.02;color:var(--green)}h2{font-family:Georgia,serif;font-size:34px;color:var(--green)}p{line-height:1.65}.hero-copy>p{font-size:19px;color:#4f5b56;max-width:720px}.hero-buttons,.trust-row,.center-actions{display:flex;flex-wrap:wrap;gap:12px}.trust-row{margin-top:24px;color:var(--muted);font-size:13px}.hero-logo-card{background:white;border:1px solid var(--line);border-radius:28px;padding:28px;text-align:center;box-shadow:var(--shadow)}.hero-logo-card img{max-width:330px;width:100%}.hero-logo-card p{color:var(--muted)}.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;padding-top:0}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:22px}.card{background:white;border:1px solid var(--line);border-radius:20px;padding:24px;box-shadow:0 4px 18px rgba(13,59,46,.04)}.feature-card{padding:34px}.btn{border:1px solid transparent;border-radius:12px;padding:11px 16px;font-weight:800;transition:.15s}.btn:hover{transform:translateY(-1px)}.btn.primary{background:var(--green);color:white}.btn.secondary{background:#e8f0ec;color:var(--green)}.btn.ghost{background:white;border-color:#d8ddd9;color:var(--green)}.btn.gold{background:var(--gold);color:#17251f}.btn.warn{background:var(--yellow);color:#745b16}.btn.danger{background:#f8e3e1;color:var(--red)}.btn.big{padding:15px 20px}.btn.full{width:100%;margin-top:10px}.back{border:0;background:none;color:var(--green);font-weight:800;margin-bottom:18px}.feature-card label{display:block;font-weight:700;margin:18px 0 6px}.feature-card input:not([type=checkbox]){width:100%;padding:13px;border:1px solid #ccd3cf;border-radius:10px;margin-top:7px}.check{display:flex!important;gap:10px;align-items:flex-start;font-weight:500!important;line-height:1.5}.check input{margin-top:4px}.muted{color:var(--muted);font-weight:400}.stats-row,.result-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:22px 0}.stats-row div,.result-stats div{background:#f4f7f4;padding:15px;border-radius:13px;text-align:center}.stats-row b,.stats-row small,.result-stats b,.result-stats span{display:block}.stats-row b,.result-stats b{font-size:24px;color:var(--green)}.notice{padding:12px;border-radius:10px;background:#eef5f1;color:var(--green);font-size:14px}.hidden{display:none!important}.exam-view.active{display:block;max-width:1380px;margin:0 auto;padding:22px}.exam-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.exam-head h2{margin:3px 0}.timer-box{background:var(--green);color:white;padding:12px 18px;border-radius:14px;text-align:center}.timer-box small,.timer-box b{display:block}.timer-box b{font-size:24px}.exam-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px}.question-card,.palette-card{background:white;border:1px solid var(--line);border-radius:18px;padding:24px}.question-meta{display:flex;justify-content:space-between;color:var(--muted);font-size:13px}.question-card h3{font-size:21px;line-height:1.55;color:var(--ink)}.options{display:grid;gap:10px;margin:20px 0 28px}.option{border:1px solid #d5dbd7;background:white;border-radius:12px;padding:14px;text-align:left;display:flex;gap:12px;line-height:1.5}.option .letter{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#edf2ef;color:var(--green);font-weight:900;flex:0 0 28px}.option.selected{border-color:var(--green);background:#edf5f0}.option.selected .letter{background:var(--green);color:white}.exam-controls{display:flex;justify-content:space-between;gap:10px}.legend{display:flex;flex-wrap:wrap;gap:9px;font-size:11px;color:var(--muted)}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px;background:#eee}.dot.answered{background:#45a171}.dot.flagged{background:#e6b93d}.dot.current{background:var(--green)}.palette{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;margin:18px 0}.pnum{height:40px;border:1px solid #dde2df;background:white;border-radius:9px;font-weight:800}.pnum.answered{background:#e2f3e9;border-color:#9ed1b1}.pnum.flagged{box-shadow:inset 0 -5px #e6b93d}.pnum.current{background:var(--green);color:white}.result-hero{text-align:center}.score-circle{margin:18px auto;width:150px;height:150px;border-radius:50%;background:var(--green);color:white;display:flex;align-items:center;justify-content:center}.score-circle b{font-size:54px}.score-circle span{font-size:16px;margin-top:24px}.result-stats{grid-template-columns:repeat(4,1fr);max-width:700px;margin:20px auto}.premium-cta{background:linear-gradient(145deg,#0d3b2e,#174e3d);color:white}.premium-cta h3{color:white}.premium-cta .eyebrow{color:#e8c982}.analysis-item{margin:14px 0}.analysis-line{display:flex;justify-content:space-between;font-size:14px}.bar{height:8px;background:#edf0ee;border-radius:99px;overflow:hidden;margin-top:5px}.bar i{display:block;height:100%;background:var(--green)}.review-panel{margin-top:24px}.review-item{background:white;border:1px solid var(--line);padding:18px;border-radius:14px;margin:10px 0}.review-item.correct{border-left:5px solid #4a9d6d}.review-item.wrong{border-left:5px solid #b95a50}.review-item small{color:var(--muted)}.tabs{display:flex;gap:8px;margin:20px 0}.tab{flex:1;padding:10px;border:1px solid #d8ddd9;border-radius:10px;background:white;font-weight:800}.tab.active{background:var(--green);color:white}.benefits{padding-left:22px;line-height:2}.dash-head{display:flex;justify-content:space-between;align-items:center}.tier-badge{font-size:14px;padding:9px 14px}.history-item{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}footer{text-align:center;padding:38px 20px;color:var(--muted);border-top:1px solid var(--line);margin-top:30px;background:white}@media(max-width:850px){.hero,.two-col,.exam-layout,.grid-3{grid-template-columns:1fr}.hero{min-height:auto;padding-top:24px}.hero-logo-card{order:-1;max-width:300px;margin:auto}.exam-view.active{padding:12px}.palette-card{order:-1}.palette{grid-template-columns:repeat(10,1fr)}.pnum{height:34px}.topbar{height:66px}.brand img{width:44px;height:44px}.brand b{font-size:16px}.top-actions .btn{font-size:12px;padding:8px 10px}.result-stats{grid-template-columns:repeat(2,1fr)}}@media(max-width:520px){.palette{grid-template-columns:repeat(5,1fr)}.exam-controls{display:grid;grid-template-columns:1fr 1fr}.exam-controls #nextBtn{grid-column:1/-1}.stats-row{grid-template-columns:1fr 1fr}.stats-row div:last-child{grid-column:1/-1}.hero-buttons .btn{width:100%}}


/* =========================================================
   EXAM SCREEN FINAL FIX v3
   ========================================================= */

#view-exam.exam-view {
  display: none;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 24px max(18px, calc((100vw - 1320px) / 2));
  box-sizing: border-box;
  overflow-x: hidden;
}

#view-exam.exam-view.active {
  display: block;
}

#view-exam .exam-head {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto 18px;
  box-sizing: border-box;
}

#view-exam .exam-layout {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
  box-sizing: border-box;
}

#view-exam .question-card {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 420px;
  box-sizing: border-box;
  overflow: visible;
}

#view-exam .question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
}

#view-exam #qText {
  display: block;
  width: 100%;
  min-height: 70px;
  margin: 20px 0 18px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.65;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}

#view-exam #options {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 10px;
  margin: 20px 0 28px;
}

#view-exam #options .option {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#view-exam .palette-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  position: sticky;
  top: 100px;
}

#view-exam .palette {
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#view-exam .exam-controls {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 850px) {
  #view-exam.exam-view {
    padding: 16px 12px 30px;
  }

  #view-exam .exam-layout {
    grid-template-columns: 1fr;
  }

  #view-exam .palette-card {
    position: static;
    order: 2;
  }

  #view-exam .question-card {
    order: 1;
  }

  #view-exam #qText {
    font-size: 18px;
  }
}

/* ADMIN DASHBOARD V4 */
#view-admin{width:100%;max-width:none;box-sizing:border-box;padding:48px 24px 72px}
.admin-shell{width:min(1200px,100%);margin:0 auto}
.admin-head{display:flex;justify-content:space-between;align-items:flex-end;gap:28px;margin-bottom:28px}
.admin-head h1{margin:8px 0 12px;font-size:clamp(42px,5vw,68px);line-height:1.02;max-width:900px;overflow-wrap:break-word}
.admin-head p{max-width:760px;margin:0}
.admin-head-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.admin-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-bottom:22px}
.admin-stat{background:#fff;border:1px solid rgba(13,59,46,.10);border-radius:20px;padding:24px;box-shadow:0 10px 30px rgba(13,59,46,.06)}
.admin-stat small{display:block;margin-bottom:12px;color:#64736e}
.admin-stat strong{display:block;font-size:38px;line-height:1;color:var(--green,#0d3b2e)}
.admin-panel-card{background:#fff;border:1px solid rgba(13,59,46,.10);border-radius:22px;padding:24px;margin-top:18px;box-shadow:0 10px 30px rgba(13,59,46,.05)}
.admin-panel-title{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:18px}
.admin-panel-title h3{margin:6px 0 0}
.admin-table-wrap{width:100%;overflow-x:auto}
.admin-table{width:100%;min-width:700px;border-collapse:collapse}
.admin-table th,.admin-table td{padding:14px 12px;border-bottom:1px solid #e8eeeb;text-align:left;vertical-align:middle}
.admin-table th{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:#6b7773}
.admin-table td{font-size:14px}
.admin-table code{background:#f1f5f3;padding:4px 7px;border-radius:7px}
.status-pill,.mode-pill{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:700}
.status-pill.active{background:#e8f4ee;color:#0d3b2e}.status-pill.expired{background:#fbeceb;color:#8d3028}.mode-pill{background:#edf3f0;color:#0d3b2e}
.admin-empty{text-align:center!important;color:#77827e;padding:28px!important}
@media(max-width:850px){#view-admin{padding:32px 16px 56px}.admin-head{align-items:flex-start;flex-direction:column}.admin-head-actions{justify-content:flex-start}.admin-stat-grid{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.admin-stat-grid{grid-template-columns:1fr}.admin-panel-card{padding:16px}}
