:root {
  --bg:#f4f7fb;
  --fg:#0d2f64;
  --muted:#5f6f88;
  --card:#ffffff;
  --line:#dbe3ee;
  --brand:#0b3c84;
  --brand2:#31c24b;
  --brand3:#082b60;
  --soft:#eef6ff;
  --soft-green:#eefbf0;
  --danger:#b42318;
  --ok:#027a48;
  --warn:#b54708;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:var(--fg); background:linear-gradient(180deg,#f9fbff 0%, #f4f7fb 100%); }
a { color:var(--brand); text-decoration:none; font-weight:700; }
.topbar { position:sticky; top:0; z-index:10; background:rgba(255,255,255,.96); backdrop-filter: blur(10px); border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:14px 24px; }
.brand-link { display:flex; align-items:center; gap:12px; color:var(--fg); }
.brand-logo { width:52px; height:52px; object-fit:contain; border-radius:12px; background:#fff; box-shadow:0 8px 20px rgba(11,60,132,.08); }
.brand-text { display:flex; flex-direction:column; line-height:1.1; }
.brand-text strong { font-size:1.08rem; }
.brand-text small { color:var(--muted); font-weight:600; margin-top:3px; }
.topbar nav { display:flex; gap:14px; flex-wrap:wrap; align-items:center; }
.topbar nav a { padding:10px 12px; border-radius:10px; }
.topbar nav a:hover { background:var(--soft); }
.nav-toggle { display:none; background:#eef4ff; border:1px solid var(--line); border-radius:10px; padding:8px 10px; font-size:1.1rem; }
.container { max-width:1180px; margin:0 auto; padding:28px 18px 80px; }
.hero { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:22px; }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; }
h1,h2,h3 { margin:0 0 10px; line-height:1.2; }
p { line-height:1.55; }
.muted { color:var(--muted); }
.small { font-size:.92rem; }
.card { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:20px; box-shadow:0 10px 24px rgba(11,60,132,.06); margin-bottom:18px; }
.stack { display:flex; flex-direction:column; gap:16px; }
.row { display:flex; gap:16px; }
.between { justify-content:space-between; }
.center { align-items:center; }
.grid2 { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; }
.cards3 { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px; margin-bottom:18px; }
.metric span { color:var(--muted); display:block; margin-bottom:8px; }
.metric strong { font-size:1.65rem; color:var(--brand3); }
label { font-weight:600; display:flex; flex-direction:column; gap:6px; }
input, select { border:1px solid var(--line); border-radius:12px; padding:10px 12px; font:inherit; background:#fff; min-height:42px; }
input:focus, select:focus { outline:3px solid #dbeafe; border-color:var(--brand); }
.checkbox, .option { flex-direction:row; align-items:flex-start; font-weight:500; }
.option { gap:10px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:#fff; margin:8px 0; }
.option input { min-height:auto; margin-top:3px; flex:0 0 auto; }
.btn { background:linear-gradient(135deg, var(--brand) 0%, var(--brand3) 100%); color:#fff; border:none; padding:11px 16px; border-radius:12px; font-weight:700; cursor:pointer; display:inline-block; text-align:center; }
.btn:hover { filter:brightness(.96); }
.btn.secondary { background:linear-gradient(135deg, var(--brand2) 0%, #23a93e 100%); color:#fff; }
.inline-btn { width:auto; }
.pill { border:1px solid #b7e7c0; border-radius:999px; padding:8px 12px; background:var(--soft-green); color:#166534; font-weight:700; display:inline-block; }
.account-pill { background:var(--soft); border-color:#cfe0ff; color:var(--brand); }
.alert { color:var(--danger); background:#fff4f2; border:1px solid #fecdca; border-radius:12px; padding:12px; }
.copy-alert { color:var(--warn); background:#fffaeb; border-color:#fedf89; margin-bottom:16px; }
.category-block { border-top:1px solid var(--line); padding-top:16px; }
.question-card.correct { border-left:6px solid var(--ok); }
.question-card.wrong { border-left:6px solid var(--danger); }
.explanation { background:#f8fafc; border-left:4px solid var(--brand2); padding:10px 12px; border-radius:8px; }
.score { font-size:1.35rem; font-weight:800; }
.auth-body { min-height:100vh; display:grid; place-items:center; padding:18px; background:linear-gradient(145deg,#eef6ff,#f6fff7); }
.auth-card { width:min(520px, 100%); background:#fff; border:1px solid var(--line); border-radius:24px; padding:28px; box-shadow:0 20px 50px rgba(16,24,40,.08); }
.auth-branding { display:flex; gap:16px; align-items:center; margin-bottom:18px; }
.auth-logo { width:90px; height:90px; object-fit:contain; border-radius:18px; }
pre { white-space:pre-wrap; background:#0b1020; color:#d1e7ff; border-radius:12px; padding:12px; overflow:auto; max-height:320px; }
ul { padding-left:18px; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:14px; -webkit-overflow-scrolling:touch; }
table { width:100%; border-collapse:collapse; background:#fff; }
th,td { padding:11px 12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
th { background:#f8fafc; font-size:.92rem; color:var(--brand3); }
tr:last-child td { border-bottom:none; }
.security-strip { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.security-strip span { border:1px solid #bbf7d0; background:#f0fdf4; color:#166534; border-radius:999px; padding:6px 10px; font-weight:700; font-size:.88rem; }
.no-copy { -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; -webkit-touch-callout:none; }
.secure-test, .secure-review { -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; }
@media print { .secure-test, .secure-review, .no-copy { display:none !important; } body::before { content:"Printing questions is disabled."; display:block; padding:40px; font-size:20px; } }
.compact-hero { margin-bottom:18px; }
.builder-card { padding:0; overflow:hidden; }
.builder-head { padding:20px 20px 10px; }
.builder-wrap { border-left:0; border-right:0; border-radius:0; }
.builder-table th:nth-child(1) { width:34%; }
.builder-table th:nth-child(2) { width:43%; }
.builder-table th:nth-child(3) { width:23%; }
.builder-table td { vertical-align:middle; }
.builder-table .available { display:block; margin-top:4px; color:var(--muted); font-size:.9rem; font-weight:500; }
.builder-table select, .builder-table input { width:100%; }
.builder-table input[disabled], .builder-table select[disabled] { background:#f2f4f7; color:#98a2b3; cursor:not-allowed; }
.actions-row { padding:16px 20px 20px; }
.submit-sticky { position:sticky; bottom:14px; align-self:flex-end; box-shadow:0 8px 20px rgba(25,70,186,.25); }
.admin-heading { display:flex; align-items:center; gap:16px; }
.admin-logo { width:72px; height:72px; object-fit:contain; border-radius:16px; }
form { margin:0; }

@media (max-width:900px){
  .grid2,.cards3{grid-template-columns:1fr;}
  .hero{align-items:flex-start;}
}
@media (max-width:720px){
  .topbar{align-items:stretch; flex-direction:row; flex-wrap:wrap; gap:8px; padding:12px 14px;}
  .brand-logo{width:44px; height:44px;}
  .brand-text strong{font-size:1rem;}
  .brand-text small{font-size:.78rem;}
  .nav-toggle{display:block; margin-left:auto;}
  .topbar nav{display:none; width:100%; flex-direction:column; align-items:stretch; gap:6px; padding-top:8px;}
  .nav-open .topbar nav{display:flex;}
  .topbar nav a{padding:10px; background:#f8fafc; border-radius:10px;}
  .container{padding:18px 12px 80px;}
  .hero{display:block;}
  .card{padding:16px; border-radius:16px;}
  .row{display:block;}
  .btn{width:100%;}
  .inline-btn{width:100%;}
  .hero-actions{display:grid; grid-template-columns:1fr;}
  .metric strong{font-size:1.35rem;}
  .builder-table, .builder-table thead, .builder-table tbody, .builder-table th, .builder-table td, .builder-table tr { display:block; width:100%; }
  .builder-table thead { display:none; }
  .builder-table tr { border-bottom:1px solid var(--line); padding:12px; }
  .builder-table td { border-bottom:none; padding:7px 4px; }
  .builder-head, .actions-row { display:block; }
  .actions-row .btn { width:100%; margin-top:12px; text-align:center; }
  .question-card h3 { font-size:1.05rem; }
  .option { padding:12px; }
  .submit-sticky { position:static; align-self:stretch; }
  .auth-branding{flex-direction:column; align-items:flex-start;}
}
@media (max-width:480px){
  .auth-card{padding:20px; border-radius:18px;}
  th,td{padding:9px 10px;}
  .score{font-size:1.1rem;}
}

/* FPSC/PPSC style paper and report visuals */
.style-paper-card { border:1px solid #bfe7c9; background:linear-gradient(135deg,#ffffff 0%, #f2fff4 100%); }
.style-paper-head { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:14px; }
.style-paper-btn:disabled, .btn:disabled { opacity:.45; cursor:not-allowed; filter:grayscale(.25); }
.style-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; margin-bottom:12px; }
.style-section { border:1px solid var(--line); border-radius:14px; padding:12px; background:#fff; display:flex; flex-direction:column; gap:4px; }
.style-section.ok { border-color:#bbf7d0; background:#f0fdf4; }
.style-section.missing { border-color:#fedf89; background:#fffaeb; }
.style-section span { color:var(--muted); font-size:.92rem; }
.report-cards .accuracy-card { display:flex; flex-direction:column; gap:8px; }
.donut { --pct:0; width:108px; height:108px; border-radius:50%; display:grid; place-items:center; background:conic-gradient(var(--brand2) calc(var(--pct) * 1%), #e6edf5 0); position:relative; }
.donut::before { content:""; position:absolute; width:72px; height:72px; background:#fff; border-radius:50%; }
.donut strong { position:relative; z-index:1; font-size:1.05rem; color:var(--brand3); }
.bar-chart { display:flex; flex-direction:column; gap:12px; }
.bar-row { display:grid; grid-template-columns:240px 1fr; gap:12px; align-items:center; }
.bar-label { display:flex; flex-direction:column; gap:3px; }
.bar-label span { color:var(--muted); font-size:.9rem; }
.bar-track { height:18px; background:#edf2f7; border-radius:999px; overflow:hidden; border:1px solid var(--line); }
.bar-fill { height:100%; min-width:2px; background:linear-gradient(90deg,var(--brand),var(--brand2)); border-radius:999px; }
.weak-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.weak-item { border:1px solid #fedf89; background:#fffaeb; border-radius:14px; padding:12px; display:flex; flex-direction:column; gap:6px; }
.weak-item span { color:var(--muted); }
.pill.inactive { background:#f2f4f7; color:#667085; border-color:#d0d5dd; }
.btn.danger { background:linear-gradient(135deg,#d92d20,#b42318); }
.mini-actions { gap:8px; flex-wrap:wrap; }

@media (max-width:900px){
  .style-grid{grid-template-columns:1fr 1fr;}
  .bar-row{grid-template-columns:1fr;}
  .weak-grid{grid-template-columns:1fr;}
}
@media (max-width:720px){
  .style-paper-head{display:block;}
  .style-paper-head form{margin-top:12px;}
  .style-grid{grid-template-columns:1fr;}
  .donut{width:92px; height:92px;}
  .donut::before{width:62px; height:62px;}
}
.quick-paper-actions { display:flex; flex-direction:column; gap:10px; min-width:280px; }
.quick-paper-actions form { width:100%; }
.quick-paper-actions .btn { width:100%; }
.surprise-btn { background:linear-gradient(135deg,#7c3aed,#0b3c84); }
.compact-style-grid { margin-top:8px; }
.surprise-status { margin-top:12px; }
@media (max-width:720px){
  .quick-paper-actions{min-width:0; width:100%; margin-top:12px;}
}

.btn.ghost { background:#eef4ff; color:var(--brand); border:1px solid var(--line); }
.leaderboard-tabs { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.my-rank { background:#f0fdf4; }
.leaderboard-cards .metric strong { color:var(--brand2); }
@media (max-width:720px){
  .leaderboard-tabs { display:grid; grid-template-columns:1fr 1fr; }
  .leaderboard-tabs .btn { width:100%; }
}

.landing-hero { display:grid; grid-template-columns:1.35fr .65fr; gap:28px; align-items:center; padding:34px; }
.eyebrow { display:inline-block; color:var(--brand2); font-weight:800; letter-spacing:.04em; text-transform:uppercase; margin-bottom:10px; }
.landing-copy h1 { font-size:clamp(2rem, 4vw, 4rem); margin-bottom:14px; color:var(--brand3); }
.landing-subtitle { font-size:1.08rem; max-width:760px; }
.landing-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:22px; }
.landing-visual { display:grid; gap:16px; justify-items:center; }
.landing-visual img { width:min(280px, 100%); background:#fff; border-radius:24px; box-shadow:0 16px 35px rgba(11,60,132,.12); }
.visual-card { width:100%; border:1px solid #bbf7d0; background:#f0fdf4; border-radius:18px; padding:16px; display:flex; flex-direction:column; gap:6px; }
.visual-card span { color:var(--muted); }
.landing-section { margin-top:22px; }
.section-head { margin-bottom:16px; }
.feature-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px; }
.feature-card h3 { color:var(--brand3); }
.feature-card p { color:var(--muted); }
.benefit-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; }
.benefit-grid div { border:1px solid var(--line); background:#fff; border-radius:14px; padding:14px; display:flex; flex-direction:column; gap:6px; }
.benefit-grid span { color:var(--muted); }
.landing-cta { text-align:center; margin-top:22px; }
@media (max-width:900px){
  .landing-hero { grid-template-columns:1fr; padding:22px; }
  .feature-grid, .benefit-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:640px){
  .feature-grid, .benefit-grid { grid-template-columns:1fr; }
  .landing-actions .btn { width:100%; }
}

.compact-feature-grid { grid-template-columns:repeat(3, minmax(0,1fr)); }
.trial-request-card { width:min(620px, 100%); margin:20px auto; }
.success-box { background:#f0fdf4; border:1px solid #bbf7d0; border-radius:16px; padding:18px; }
.success-box h2 { color:var(--ok); }
@media (max-width:720px){
  .compact-feature-grid { grid-template-columns:1fr; }
}
