/* ============================================================
   SamGenie EduShelf — Gamification styles (additive)
   Purple #6A1FB5 · Orange #FF7A29
   ============================================================ */
:root{
  --sg-purple:#6A1FB5;
  --sg-purple-d:#51148C;
  --sg-orange:#FF7A29;
  --sg-green:#0FA77A;
  --sg-red:#E5484D;
  --sg-ink:#16161d;
  --sg-muted:#7a7a8c;
  --sg-line:#eceaf4;
  --sg-bg:#f4f3f9;
}

/* ---------- shared buttons ---------- */
.sg-btn-block{display:block;width:100%;border:0;border-radius:16px;padding:15px 18px;font-size:16px;font-weight:800;cursor:pointer;margin-top:12px;font-family:inherit;}
.sg-btn-primary{background:linear-gradient(135deg,var(--sg-purple),var(--sg-purple-d));color:#fff;box-shadow:0 10px 24px rgba(106,31,181,.28);}
.sg-btn-orange{background:linear-gradient(135deg,#ff8a3d,var(--sg-orange));color:#fff;box-shadow:0 10px 24px rgba(255,122,41,.32);border:0;border-radius:16px;padding:15px 26px;font-size:16px;font-weight:800;cursor:pointer;font-family:inherit;}
.sg-btn-ghost{background:transparent;color:var(--sg-ink);border:0;font-size:16px;font-weight:800;cursor:pointer;padding:12px 6px;font-family:inherit;}
.sg-btn-outline{background:#fff;color:var(--sg-purple);border:1.6px solid var(--sg-purple);}
.sg-btn-text{background:transparent;color:var(--sg-purple);font-weight:700;}
.sg-btn-half{flex:1;border-radius:14px;padding:14px;font-size:15px;font-weight:800;cursor:pointer;font-family:inherit;}
.sg-card{background:#fff;border:1px solid var(--sg-line);border-radius:20px;padding:18px;box-shadow:0 6px 20px rgba(30,16,60,.05);}
.sg-empty{text-align:center;padding:34px 20px;}
.sg-empty-ico{font-size:38px;margin-bottom:10px;}
.sg-empty h3{margin:0 0 6px;font-family:Fraunces,serif;}
.sg-empty p{color:var(--sg-muted);font-size:13.5px;line-height:1.6;margin:0;}

/* ---------- home: streak / XP card ---------- */
.sg-streak-card{display:flex;align-items:center;gap:14px;background:linear-gradient(135deg,#fff,#fdf6ef);border:1px solid var(--sg-line);border-radius:22px;padding:16px 18px;margin:12px 0;box-shadow:0 8px 24px rgba(30,16,60,.06);}
.sg-streak-left{display:flex;align-items:center;gap:12px;}
.sg-flame{width:52px;height:52px;border-radius:16px;background:linear-gradient(135deg,#ffb04d,var(--sg-orange));display:grid;place-items:center;font-size:26px;box-shadow:0 8px 18px rgba(255,122,41,.35);}
.sg-streak-num{font-size:26px;font-weight:800;color:var(--sg-ink);line-height:1;}
.sg-streak-num small{font-size:12.5px;font-weight:600;color:var(--sg-muted);margin-left:5px;}
.sg-streak-best{font-size:12px;color:var(--sg-muted);margin-top:5px;}
.sg-streak-right{flex:1;min-width:0;}
.sg-xp-row{display:flex;justify-content:space-between;font-size:13.5px;font-weight:700;color:var(--sg-ink);}
.sg-lvl{color:var(--sg-purple);font-weight:800;}
.sg-lvl-track{height:8px;border-radius:99px;background:#eee7f8;margin:7px 0 9px;overflow:hidden;}
.sg-lvl-track i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,var(--sg-purple),#9a5fe0);transition:width .6s;}
.sg-streak-ach{border:0;background:none;color:var(--sg-purple);font-weight:800;font-size:12.5px;cursor:pointer;padding:0;font-family:inherit;}

/* ---------- home: countdown hero ---------- */
.sg-cd-hero{display:flex;align-items:center;justify-content:space-between;gap:14px;background:linear-gradient(135deg,var(--sg-purple),#4a1285);color:#fff;border-radius:22px;padding:18px 20px;margin:12px 0;box-shadow:0 14px 30px rgba(106,31,181,.3);}
.sg-cd-hero.season{background:linear-gradient(135deg,#ff8a3d,var(--sg-orange));}
.sg-cd-tag{display:inline-block;background:rgba(255,255,255,.18);border-radius:99px;padding:4px 11px;font-size:10.5px;font-weight:800;letter-spacing:.4px;margin-bottom:8px;}
.sg-cd-left h3{margin:0;font-family:Fraunces,serif;font-size:20px;}
.sg-cd-sub{font-size:12.5px;opacity:.9;margin-top:5px;max-width:230px;line-height:1.5;}
.sg-cd-right{text-align:center;flex-shrink:0;}
.sg-cd-num{font-size:40px;font-weight:800;line-height:1;font-family:Inter,sans-serif;}
.sg-cd-label{font-size:11px;letter-spacing:1px;text-transform:uppercase;opacity:.85;margin:3px 0 9px;}
.sg-cd-btn{background:#fff;color:var(--sg-purple);border:0;border-radius:99px;padding:8px 16px;font-weight:800;font-size:12.5px;cursor:pointer;font-family:inherit;}

/* ---------- toasts ---------- */
.sg-toast-wrap{position:fixed;left:50%;bottom:84px;transform:translateX(-50%);z-index:30000;display:flex;flex-direction:column;gap:10px;align-items:center;pointer-events:none;width:min(92vw,380px);}
.sg-toast{display:flex;align-items:center;gap:12px;background:#16161d;color:#fff;border-radius:16px;padding:12px 16px;box-shadow:0 14px 40px rgba(0,0,0,.35);opacity:0;transform:translateY(16px) scale(.96);transition:all .3s cubic-bezier(.2,.9,.3,1.2);}
.sg-toast.show{opacity:1;transform:translateY(0) scale(1);}
.sg-toast-ico{font-size:24px;}
.sg-toast b{display:block;font-size:14.5px;}
.sg-toast small{display:block;font-size:12px;opacity:.8;}
.sg-toast-badge{background:linear-gradient(135deg,var(--sg-purple),#8b3fd6);}

/* ---------- JAMB CBT setup ---------- */
.sg-cbt-card{background:#fff;border:1px solid var(--sg-line);border-radius:24px;padding:22px;box-shadow:0 10px 30px rgba(30,16,60,.07);position:relative;}
.sg-cbt-card::before{content:"";position:absolute;top:0;left:0;right:0;height:14px;background:linear-gradient(90deg,var(--sg-purple),#9a5fe0);border-radius:24px 24px 0 0;}
.sg-cbt-head{display:flex;align-items:center;gap:14px;margin:6px 0 18px;}
.sg-cbt-bolt{width:56px;height:56px;border-radius:16px;background:#fff1e7;display:grid;place-items:center;font-size:28px;flex-shrink:0;}
.sg-cbt-head h2{margin:0;font-family:Fraunces,serif;font-size:22px;}
.sg-cbt-head p{margin:3px 0 0;color:var(--sg-muted);font-size:13px;}
.sg-cbt-label{font-size:16px;font-weight:800;margin:18px 0 10px;color:var(--sg-ink);}
.sg-cbt-chips{display:flex;flex-wrap:wrap;gap:9px;}
.sg-cbt-chip{display:inline-block;width:auto;flex:0 0 auto;border:1.6px solid var(--sg-line);background:#fff;border-radius:99px;padding:9px 16px;font-size:13.5px;font-weight:600;color:var(--sg-ink);cursor:pointer;font-family:inherit;transition:all .15s;line-height:1.3;}
.sg-cbt-chip.active{background:var(--sg-purple);border-color:var(--sg-purple);color:#fff;}
.sg-cbt-counts{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;}
.sg-cbt-count{background:#fff;border:1.6px solid var(--sg-line);border-radius:16px;padding:14px 6px;cursor:pointer;text-align:center;font-family:inherit;transition:all .15s;}
.sg-cbt-count b{display:block;font-size:22px;color:var(--sg-ink);}
.sg-cbt-count span{font-size:11.5px;color:var(--sg-muted);}
.sg-cbt-count.active{border-color:var(--sg-purple);box-shadow:0 0 0 3px rgba(106,31,181,.12);}
.sg-cbt-count.active b{color:var(--sg-purple);}
.sg-cbt-note{background:#f3edfb;border:1px solid #e4d7f7;border-radius:16px;padding:13px 15px;font-size:13px;color:#5a3a86;margin:16px 0;line-height:1.5;}
.sg-cbt-start{margin-top:6px;}
.sg-cbt-foot{text-align:center;color:var(--sg-muted);font-size:12.5px;margin-top:12px;}

/* ---------- JAMB CBT exam ---------- */
#jambCbtExam{padding-bottom:20px;}
#jambCbtExam .sg-exam-bar{background:linear-gradient(135deg,var(--sg-purple),#4a1285);color:#fff;border-radius:22px;padding:18px 18px 16px;position:relative;}
.sg-exam-top{display:flex;justify-content:space-between;align-items:center;font-size:17px;}
.sg-exam-timer{background:rgba(255,255,255,.16);border-radius:99px;padding:7px 14px;font-size:15px;}
.sg-exam-progress{height:7px;border-radius:99px;background:rgba(255,255,255,.22);margin-top:14px;overflow:hidden;}
.sg-exam-progress i{display:block;height:100%;background:linear-gradient(90deg,#ffb04d,var(--sg-orange));border-radius:99px;transition:width .3s;}
.sg-exam-calc{background:rgba(255,255,255,.16);border:0;border-radius:10px;padding:7px 11px;cursor:pointer;font-size:16px;line-height:1;}
.sg-exam-card{background:#fff;border:1px solid var(--sg-line);border-radius:22px;padding:20px;margin-top:16px;box-shadow:0 8px 24px rgba(30,16,60,.06);}
.sg-exam-subject{color:var(--sg-muted);font-size:13px;font-weight:600;margin-bottom:8px;}
.sg-exam-card h3{font-size:18px;line-height:1.55;margin:0 0 16px;color:var(--sg-ink);}
.sg-exam-opts{display:grid;gap:11px;}
.sg-cbt-opt{display:flex;align-items:center;gap:13px;width:100%;text-align:left;background:#fff;border:1.6px solid var(--sg-line);border-radius:16px;padding:15px 16px;font-size:15px;cursor:pointer;font-family:inherit;transition:all .15s;color:var(--sg-ink);}
.sg-cbt-opt .sg-radio{width:22px;height:22px;border-radius:50%;border:2px solid #c9c6d8;flex-shrink:0;position:relative;}
.sg-cbt-opt.sel{border-color:var(--sg-purple);background:#f6f1fd;}
.sg-cbt-opt.sel .sg-radio{border-color:var(--sg-purple);}
.sg-cbt-opt.sel .sg-radio::after{content:"";position:absolute;inset:4px;border-radius:50%;background:var(--sg-purple);}
.sg-exam-nav{display:flex;justify-content:space-between;align-items:center;margin-top:18px;margin-bottom:96px;gap:12px;}
#jambCbtExam .sg-exam-nav .sg-btn-ghost,
#jambCbtExam .sg-exam-nav button{border-radius:14px;padding:14px 22px;font-size:16px;font-weight:800;cursor:pointer;font-family:inherit;}
#jambCbtExam .sg-exam-nav .sg-btn-primary{background:linear-gradient(135deg,var(--sg-purple),var(--sg-purple-d));color:#fff;border:0;box-shadow:0 10px 24px rgba(106,31,181,.28);}
#jambCbtExam .sg-exam-nav .sg-btn-orange{background:linear-gradient(135deg,#ff8a3d,var(--sg-orange));color:#fff;border:0;box-shadow:0 10px 24px rgba(255,122,41,.32);}
#jambCbtExam .sg-exam-nav .sg-btn-ghost{background:transparent;color:var(--sg-ink);}
#jambCbtResult{padding-bottom:96px;}
#screen-notebook,#screen-analytics,#screen-achievements,#screen-leaderboard,#screen-referral{padding-bottom:96px;}

/* ---------- JAMB result ---------- */
.sg-result-hero{background:linear-gradient(135deg,var(--sg-purple),#4a1285);color:#fff;border-radius:24px;padding:26px 20px;text-align:center;box-shadow:0 16px 34px rgba(106,31,181,.3);margin-top:10px;}
.sg-result-you{opacity:.9;font-size:14px;}
.sg-result-pct{font-size:64px;font-weight:800;line-height:1.05;font-family:Inter,sans-serif;}
.sg-result-correct{font-size:16px;font-weight:700;margin-top:2px;}
.sg-result-jamb{display:inline-block;background:rgba(255,255,255,.18);border-radius:99px;padding:8px 16px;font-size:13px;font-weight:700;margin-top:14px;}
.sg-result-stats{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0;}
.sg-result-stat{background:#fff;border:1px solid var(--sg-line);border-radius:18px;padding:16px;text-align:center;}
.sg-result-stat b{display:block;font-size:28px;}
.sg-result-stat span{font-size:13px;color:var(--sg-muted);}
.sg-result-stat.good b{color:var(--sg-green);}
.sg-result-stat.bad b{color:var(--sg-red);}
.sg-result-h{font-size:17px;font-weight:800;margin:18px 0 10px;}
.sg-bars{display:grid;gap:12px;}
.sg-bar-row{background:#fff;border:1px solid var(--sg-line);border-radius:16px;padding:14px 16px;}
.sg-bar-top{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:8px;font-size:14px;}
.sg-bar-top span{font-weight:800;}
.sg-bar-track{height:9px;border-radius:99px;background:#eeeaf6;overflow:hidden;}
.sg-bar-track i{display:block;height:100%;border-radius:99px;}
.sg-an-summary{color:var(--sg-muted);font-size:13.5px;margin-bottom:6px;}

/* ---------- notebook ---------- */
.sg-nb-group{font-size:15px;font-weight:800;margin:18px 2px 10px;color:var(--sg-purple);}
.sg-nb-group span{background:#f0e9fa;border-radius:99px;padding:2px 10px;font-size:12px;color:var(--sg-purple);margin-left:6px;}
.sg-nb-item{background:#fff;border:1px solid var(--sg-line);border-radius:18px;padding:16px;margin-bottom:12px;box-shadow:0 6px 18px rgba(30,16,60,.05);}
.sg-nb-meta{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px;}
.sg-nb-meta b{font-size:13px;color:var(--sg-purple);}
.sg-nb-wrong{font-size:12px;color:var(--sg-red);font-weight:700;white-space:nowrap;}
.sg-nb-q{font-size:15px;font-weight:700;line-height:1.5;margin-bottom:8px;color:var(--sg-ink);}
.sg-nb-correct{font-size:13.5px;color:var(--sg-green);font-weight:700;line-height:1.5;}
.sg-nb-exp{font-size:12.5px;color:var(--sg-muted);margin-top:8px;line-height:1.55;background:#faf9fd;border-radius:12px;padding:9px 11px;}
.sg-nb-del{margin-top:10px;border:0;background:none;color:var(--sg-red);font-weight:700;font-size:12.5px;cursor:pointer;font-family:inherit;}

/* ---------- achievements ---------- */
.sg-badge{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--sg-line);border-radius:18px;padding:14px 16px;margin-bottom:10px;opacity:.65;}
.sg-badge.earned{opacity:1;border-color:#e4d7f7;background:linear-gradient(135deg,#fff,#faf7ff);}
.sg-badge-ico{width:48px;height:48px;border-radius:14px;background:#f1eef8;display:grid;place-items:center;font-size:24px;flex-shrink:0;}
.sg-badge.earned .sg-badge-ico{background:linear-gradient(135deg,#f3e8ff,#e4d7f7);}
.sg-badge-txt{flex:1;min-width:0;}
.sg-badge-txt b{display:block;font-size:15px;}
.sg-badge-txt small{color:var(--sg-muted);font-size:12.5px;}
.sg-badge-check{width:26px;height:26px;border-radius:50%;background:var(--sg-green);flex-shrink:0;position:relative;}
.sg-badge-check::after{content:"";position:absolute;left:9px;top:6px;width:6px;height:11px;border:solid #fff;border-width:0 2.5px 2.5px 0;transform:rotate(45deg);}

/* ---------- leaderboard ---------- */
.sg-lb-game-tabs,.sg-lb-period-tabs{display:flex;gap:8px;}
.sg-lb-period-tabs{margin-top:10px;}
.sg-lb-tab{flex:1;border:1.6px solid var(--sg-line);background:#fff;border-radius:99px;padding:10px;font-size:14px;font-weight:700;color:var(--sg-ink);cursor:pointer;font-family:inherit;}
.sg-lb-tab.active{background:var(--sg-purple);border-color:var(--sg-purple);color:#fff;}
.sg-lb-reward{background:linear-gradient(135deg,#fff4e8,#ffe9d4);border:1px solid #ffd9b8;color:#a4501a;border-radius:14px;padding:12px 14px;font-size:13px;font-weight:700;margin-top:14px;text-align:center;}
.sg-lb-loading{text-align:center;color:var(--sg-muted);padding:30px;}
.sg-podium{display:flex;align-items:flex-end;justify-content:center;gap:10px;margin:22px 0 6px;}
.sg-pod{flex:1;text-align:center;max-width:120px;}
.sg-pod-medal{width:42px;height:42px;border-radius:50%;margin:0 auto 4px;display:grid;place-items:center;font-weight:800;font-size:18px;color:#fff;box-shadow:0 6px 14px rgba(0,0,0,.18);}
.sg-pod-medal.m-gold{background:linear-gradient(135deg,#ffd45e,#f0a92b);}
.sg-pod-medal.m-silver{background:linear-gradient(135deg,#d7dbe4,#aab0c0);}
.sg-pod-medal.m-bronze{background:linear-gradient(135deg,#e9c28a,#cd9a52);}
.sg-pod.gold .sg-pod-medal{width:50px;height:50px;font-size:21px;}
.sg-pod-name{font-weight:800;font-size:14px;margin-top:3px;line-height:1.2;}
.sg-pod-pts{font-size:12.5px;color:var(--sg-muted);font-weight:700;margin-bottom:8px;}
.sg-pod-block{border-radius:16px 16px 0 0;margin:0 auto;width:100%;}
.sg-pod.gold .sg-pod-block{background:linear-gradient(180deg,var(--sg-purple),#4a1285);}
.sg-pod.silver .sg-pod-block{background:linear-gradient(180deg,#c9ccd6,#a9aebd);}
.sg-pod.bronze .sg-pod-block{background:linear-gradient(180deg,#e8c38a,#d3a45e);}
.sg-pod.gold .sg-pod-name{color:var(--sg-purple);}
.sg-lb-rows{display:grid;gap:9px;margin-top:14px;}
.sg-lb-row{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--sg-line);border-radius:16px;padding:12px 14px;}
.sg-lb-row.me{border:2px solid var(--sg-purple);background:#faf7ff;}
.sg-lb-rank{width:26px;text-align:center;font-weight:800;color:var(--sg-muted);font-size:16px;}
.sg-lb-av{width:42px;height:42px;border-radius:14px;background:#efeaf8;color:var(--sg-purple);display:grid;place-items:center;font-weight:800;font-size:17px;flex-shrink:0;}
.sg-lb-info{flex:1;min-width:0;}
.sg-lb-info b{display:block;font-size:15px;}
.sg-lb-info small{color:var(--sg-muted);font-size:12.5px;}
.sg-lb-score{font-weight:800;color:var(--sg-purple);font-size:16px;}

/* ---------- reward modal ---------- */
.sg-modal-overlay{position:fixed;inset:0;background:rgba(20,12,40,.55);z-index:29000;display:flex;align-items:center;justify-content:center;padding:22px;}
.sg-modal{background:#fff;border-radius:26px;padding:26px 22px;width:min(420px,100%);text-align:center;box-shadow:0 30px 70px rgba(0,0,0,.35);}
.sg-reward-trophy{font-size:56px;margin-bottom:8px;}
.sg-reward-modal h2{font-family:Fraunces,serif;font-size:24px;margin:0 0 10px;color:var(--sg-purple);}
.sg-reward-modal p{font-size:14.5px;line-height:1.6;color:var(--sg-ink);margin:0 0 14px;}
.sg-reward-ctx{background:#f6f1fd;border-radius:12px;padding:10px;font-size:13px;color:#5a3a86;margin-bottom:6px;}

/* ---------- referral ---------- */
.sg-ref-hero{background:linear-gradient(140deg,var(--sg-purple),#7b2fd6 60%,#9a5fe0);color:#fff;border-radius:22px;padding:26px 22px;margin-bottom:0;}
.sg-ref-hero h1{font-family:Fraunces,serif;font-size:28px;margin:0 0 8px;}
.sg-ref-hero p{font-size:14px;line-height:1.6;opacity:.95;margin:0;}
.sg-ref-card{background:#fff;border-radius:24px;padding:24px 20px;margin:-26px 14px 0;position:relative;box-shadow:0 16px 40px rgba(30,16,60,.14);text-align:center;}
.sg-ref-handshake{font-size:44px;}
.sg-ref-label{font-size:15px;font-weight:800;margin:8px 0 12px;}
.sg-ref-code{border:2px dashed #c9b3ee;background:#faf7ff;color:var(--sg-purple);border-radius:16px;padding:16px;font-size:30px;font-weight:800;letter-spacing:3px;margin-bottom:16px;font-family:Inter,sans-serif;}
.sg-ref-share{display:flex;gap:10px;margin-top:10px;}
.sg-ref-howtitle{font-size:18px;font-weight:800;margin:24px 4px 12px;}
.sg-ref-steps{display:grid;gap:10px;}
.sg-ref-step{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--sg-line);border-radius:16px;padding:15px 16px;font-size:14.5px;}
.sg-ref-num{width:34px;height:34px;border-radius:12px;background:#fff1e7;color:var(--sg-orange);display:grid;place-items:center;font-weight:800;font-size:17px;flex-shrink:0;}
.sg-ref-empty{background:#fff;border:1px dashed var(--sg-line);border-radius:16px;padding:18px;font-size:13.5px;color:var(--sg-muted);line-height:1.6;}
.sg-ref-row{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--sg-line);border-radius:16px;padding:13px 15px;margin-bottom:9px;}
.sg-ref-row .sg-row-main{flex:1;min-width:0;}
.sg-ref-row b{font-size:14.5px;display:block;}
.sg-ref-row small{color:var(--sg-muted);font-size:12px;}
.sg-ref-status{font-size:12px;font-weight:800;white-space:nowrap;}

/* ---------- admin referrals ---------- */
.sg-admin-ref{display:flex;justify-content:space-between;align-items:center;gap:12px;border:1px solid var(--sg-line);border-radius:14px;padding:13px 15px;margin-bottom:10px;background:#faf9fd;}
.sg-admin-ref .btn{white-space:nowrap;}

@media(max-width:480px){
  .sg-cbt-counts{grid-template-columns:repeat(4,1fr);gap:6px;}
  .sg-cbt-count b{font-size:18px;}
  .sg-result-pct{font-size:52px;}
}

/* ============================================================
   v3 round 2 — JAMB links, past-question practice, review,
   assignment form, referral scroll fix
   ============================================================ */

/* referral screen: ensure it scrolls as a normal screen block */
#screen-referral{ padding-bottom:110px; }
#screen-referral .sg-ref-card{ margin-bottom:6px; }

/* JAMB setup: notebook / weak-areas quick links under Start Test */
.sg-jamb-links{display:grid;gap:9px;margin-top:16px;border-top:1px solid var(--sg-line);padding-top:14px;}
.sg-jamb-link{display:flex;align-items:center;gap:12px;text-align:left;background:#faf9fd;border:1px solid var(--sg-line);border-radius:14px;padding:12px 14px;cursor:pointer;font-family:inherit;width:100%;}
.sg-jamb-link b{display:block;font-size:14px;color:var(--sg-ink);}
.sg-jamb-link small{color:var(--sg-muted);font-size:12px;line-height:1.4;}
.sg-jamb-link .chev{margin-left:auto;color:var(--sg-muted);font-size:18px;}

/* Past question practice (tap-to-reveal) */
.sg-past-option{cursor:pointer!important;transition:background .12s,border-color .12s;}
.sg-past-option:hover{background:#f1ecfb!important;}
.sg-past-option.sg-opt-right{background:#e6f7ef!important;border-color:#0FA77A!important;color:#0a7a58!important;font-weight:700;}
.sg-past-option.sg-opt-wrong{background:#fdecec!important;border-color:#E5484D!important;color:#b32b2f!important;font-weight:700;}
.sg-past-hint{margin-top:10px;font-size:12px;color:var(--sg-purple);background:#f4eefb;border:1px dashed #d9c8f2;border-radius:10px;padding:8px 11px;font-weight:700;}
.sg-past-hint.done{border-style:solid;}
.sg-past-reveal{animation:sgFade .25s ease;}
@keyframes sgFade{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:none;}}

/* Assignment / Project form */
.sg-field-label{display:block;font-size:13.5px;font-weight:800;margin-bottom:7px;color:var(--sg-ink);}
.sg-input{width:100%;box-sizing:border-box;padding:13px 14px;border-radius:14px;border:1.6px solid var(--sg-line);font-size:15px;font-family:inherit;background:#fff;color:var(--sg-ink);}
.sg-input:focus{outline:none;border-color:var(--sg-purple);}
textarea.sg-input{resize:vertical;line-height:1.5;}
.sg-cat-chips{display:flex;flex-wrap:wrap;gap:9px;}
.sg-cat-chip{border:1.6px solid var(--sg-line);background:#fff;border-radius:99px;padding:9px 16px;font-size:13.5px;font-weight:700;color:var(--sg-ink);cursor:pointer;font-family:inherit;}
.sg-cat-chip.active{background:var(--sg-purple);border-color:var(--sg-purple);color:#fff;}
.sg-check{display:flex;align-items:flex-start;gap:10px;font-size:13.5px;font-weight:600;color:var(--sg-ink);cursor:pointer;line-height:1.5;}
.sg-check input{width:18px;height:18px;margin-top:2px;accent-color:var(--sg-purple);flex-shrink:0;}
#screen-assignment{padding-bottom:110px;}

/* ============================================================
   Auth (login / sign up): keep the card centered and inside the
   margins on <=360px screens and with large system fonts.
   Scoped + additive — no markup changes.
   ============================================================ */
#screen-auth{ max-width:100%; }
#screen-auth > div[style*="max-width"]{
  width:100%;
  margin:18px auto;
  padding:20px 16px;
  box-sizing:border-box;
}
#screen-auth input,
#screen-auth select,
#screen-auth textarea{
  width:100%;
  max-width:100%;
  min-width:0;
}
#screen-auth .btn,
#screen-auth button{ max-width:100%; }
/* Login / Sign Up tab row: split evenly, never overflow */
#screen-auth .store-tab{ flex:1 1 0; min-width:0; }
/* password/confirm rows: input shrinks, View button holds its width */
#screen-auth [style*="display:flex"]{ min-width:0; }
#screen-auth [style*="display:flex"] input{ flex:1 1 auto; min-width:0; width:auto; }
#screen-auth [style*="display:flex"] .btn{ flex:0 0 auto; width:auto; white-space:nowrap; }
/* two-column select/input grids are allowed to shrink below content size */
#screen-auth [style*="grid-template-columns:1fr 1fr"]{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
#screen-auth [style*="grid-template-columns:1fr 1fr"] > *{ min-width:0; }

@media (max-width:360px){
  #screen-auth > div[style*="max-width"]{ padding:18px 13px; margin:12px auto; }
  #screen-auth [style*="grid-template-columns:1fr 1fr"]{ gap:6px; }
}

/* ============================================================
   Round 3 — New SamGenie mascot logo (white rounded badge)
   and fixed diagonal "SamGenie EduShelf" note watermark.
   Additive only; overrides later stylesheets intentionally.
   ============================================================ */

/* Header brand mark: clean white badge so the square white logo
   sits naturally instead of inside the old purple gradient tile */
.brand-mark{
  background:#fff;
  border:1px solid rgba(106,31,181,.14);
  box-shadow:0 6px 16px -8px rgba(60,14,88,.35);
}

/* Home greeting avatar: default photo (no upload feature yet) is
   the mascot logo inside a white rounded badge; the initials text
   the old JS writes is hidden behind the image */
.sg-greet-av{
  background:#fff url("../assets/samgenie-logo.png") center/cover no-repeat;
  border:2px solid rgba(255,255,255,.85);
  box-shadow:0 8px 18px -8px rgba(60,14,88,.55);
  font-size:0;
  color:transparent;
  overflow:hidden;
}

/* Profile avatar: same mascot-logo white badge treatment */
#profileAvatar.sg-prof-av{
  background:#fff url("../assets/samgenie-logo.png") center/cover no-repeat;
  border:2px solid rgba(255,255,255,.85);
  box-shadow:0 8px 18px -8px rgba(60,14,88,.55);
  font-size:0;
  color:transparent;
  overflow:hidden;
}

/* ---- Note watermark: fixed, 45° diagonal, very low opacity,
   never interactive. Only present while a note is displayed
   (JS toggles body.sg-note-mode); absent on every other screen. */
.sg-watermark{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:5;
  overflow:hidden;
  display:none;
}
body.sg-note-mode .sg-watermark{ display:block; }
.sg-watermark::before{
  content:"";
  position:absolute;
  left:-40%;
  top:-40%;
  width:180%;
  height:180%;
  transform:rotate(-45deg); /* bent 45 degrees across the page */
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='340' height='180'><text x='0' y='95' fill='%236A1FB5' font-family='Georgia,serif' font-weight='700' font-size='26'>SamGenie EduShelf</text></svg>");
  background-repeat:repeat;
  opacity:0.05; /* faint enough that reading is unaffected */
}

/* ============================================================
   Round 4 — Educational News
   Explore-tab hub card (first item), all-news list cards and
   full-article styling. News is article-styled, NOT note-styled,
   and never gets the .sg-note-mode watermark.
   ============================================================ */

/* Explore → Educational News hub entry (first item on Explore) */
.sg-news-hub{
  display:flex; align-items:center; gap:14px;
  background:linear-gradient(135deg,#fff 60%,#F4ECFC);
  border:1.5px solid rgba(106,31,181,.22);
  border-radius:20px; padding:16px 16px; margin-bottom:16px;
  cursor:pointer; box-shadow:0 10px 26px -16px rgba(106,31,181,.55);
  transition:transform .16s ease, box-shadow .16s ease;
}
.sg-news-hub:active{ transform:scale(.985); }
.sg-news-hub-ico{
  flex-shrink:0; width:48px; height:48px; border-radius:15px;
  display:grid; place-items:center; color:#fff;
  background:linear-gradient(135deg,#6A1FB5,#8A3FD8);
  box-shadow:0 8px 18px -8px rgba(106,31,181,.7);
}
.sg-news-hub-ico svg{ width:24px; height:24px; }
.sg-news-hub-txt{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.sg-news-hub-txt b{ font-size:16px; font-weight:800; color:var(--v3-ink,#17131F); }
.sg-news-hub-txt small{ font-size:12.5px; color:var(--v3-muted,#6E6680); line-height:1.45; }
.sg-news-hub .chev{ color:#B7A6CC; font-size:24px; font-weight:700; flex-shrink:0; }

/* All-news list cards (headline + short description) */
.sg-news-card{
  display:block; width:100%; text-align:left; box-sizing:border-box;
  background:#fff; border:1.5px solid var(--v3-border,#ECE8F2);
  border-radius:18px; padding:16px 18px; margin-bottom:12px;
  cursor:pointer; transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.sg-news-card:active{ transform:scale(.99); }
@media (hover:hover){
  .sg-news-card:hover{ border-color:rgba(106,31,181,.4); box-shadow:0 12px 26px -18px rgba(106,31,181,.5); }
}
.sg-news-card .sg-news-date{
  display:inline-block; font-size:11px; font-weight:800; letter-spacing:.04em;
  color:#FF7A29; background:#FFF1E7; border-radius:99px; padding:3px 10px; margin-bottom:9px;
  text-transform:uppercase;
}
.sg-news-card h3{
  font-family:Fraunces,Georgia,serif; font-size:17px; line-height:1.3; font-weight:700;
  color:var(--v3-ink,#17131F); margin:0;
}
.sg-news-card p{
  font-size:13.5px; line-height:1.6; color:var(--v3-muted,#6E6680); margin:7px 0 0;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.sg-news-card .sg-news-read{
  display:inline-block; margin-top:11px; font-size:12.5px; font-weight:800; color:#6A1FB5;
}

/* Full news article (decorated card the original openNews renders) */
.sg-news-article{
  border:1.5px solid var(--v3-border,#ECE8F2) !important;
  box-shadow:0 16px 36px -24px rgba(60,14,88,.5);
}
.sg-news-article .sg-news-art-date{
  font-size:11.5px; font-weight:800; letter-spacing:.05em; text-transform:uppercase;
  color:#FF7A29; margin-bottom:10px;
}
.sg-news-article h2{
  font-family:Fraunces,Georgia,serif !important;
  font-size:23px; line-height:1.28; color:#17131F;
  padding-bottom:14px; border-bottom:2px solid #F4ECFC;
}

/* Publishing label and category metadata for Educational News */
.sg-news-label,
.sg-news-category{
  display:inline-block; vertical-align:middle; margin:0 6px 9px 0;
  border-radius:999px; padding:3px 9px; font-size:10px; font-weight:800;
  line-height:1.2;
}
.sg-news-label{ color:#B45309; background:#FFF1E7; }
.sg-news-category{ color:#6A1FB5; background:#F4ECFC; }

/* Render uploaded Educational News HTML in an isolated frame so its original
   embedded CSS, tables and backgrounds remain intact without affecting the app shell. */
.sg-news-html-frame{
  display:block;
  width:100%;
  min-height:620px;
  height:900px;
  border:0;
  border-radius:12px;
  background:#fff;
}
