/* =====================================================================
   assets/student-ui.css — "MISSION CONTROL": the look of every student page
   =====================================================================
   WHAT THIS FILE IS
   The shared style sheet for the signed-in student area: the dashboard
   (dashboard.php), My results, one result, one writing result, My mistakes,
   Messages, the share page and the grammar pages (they load this file first,
   then assets/grammar.css on top).

   It is plain CSS on purpose: no Tailwind, no build step. Every class starts
   with "sd-" (student dashboard). Never use "ad-": ad blockers hide it.

   WHERE TO CHANGE COLOURS
   Everything is a variable at the top:
     :root        = DAY mode  (light page, white panels)
     html.dark    = NIGHT mode (deep navy page, dark panels, faint grid + stars)
   The four skills always keep their own colour, in both modes:
     Listening = cyan (--l)   Reading = violet (--r)
     Writing   = pink (--w)   Speaking = amber (--s)
   Gold (--gold) is for the big important numbers (your band, your streak).

   FONTS (all served from /fonts/fonts.css — nothing is loaded from Google)
     Inter     = everything you read
     Orbitron  = tiny uppercase panel labels (class .sd-lab) and the wordmark
     Anton     = the very big display numbers (class .sd-num)

   NIGHT / DAY RULE: the <html> element gets class "dark" when
   localStorage.theme is anything except 'light' (same rule as the whole site).

   MOTION: only transform and opacity are animated. People who turned on
   "reduce motion" on their phone get no animation at all (see the bottom).

   After editing, raise SD_CSS_VERSION in includes/student_nav.php.
   ===================================================================== */

/* ── 1. COLOURS — DAY MODE ──────────────────────────────────────────── */
:root {
  --bg: #f4f3fb;            /* page                                      */
  --card: #ffffff;          /* panels                                    */
  --glass: rgba(255,255,255,.82);   /* the sticky top bar                */
  --line: #e4e2f0;          /* 1px borders                               */
  --line2: #edecf5;         /* even fainter lines, empty heat squares    */
  --ink: #12102e;           /* main text                                 */
  --body: #45436a;          /* normal paragraph text                     */
  --mute: #6f6d8f;          /* small grey text                           */
  --brand: #6d4ee0; --brand-dk: #5b3ed0; --brand-ink: #4c2fb8; --brand-soft: #ece7fd;
  --hero: #12102e; --hero-ink: #b9b6d8;          /* dark boxes on light pages (grammar hero, share card) */
  --gold: #ffc947; --gold-fill: #f0b429; --gold-ink: #1a1400; --gold-soft: #fff3d1; --gold-txt: #8a5b00;
  --l: #0ea5d9; --l-soft: #e0f6ff; --l-ink: #006f94;      /* Listening  */
  --r: #7c5ce6; --r-soft: #ede8ff; --r-ink: #5235b8;      /* Reading    */
  --w: #db2777; --w-soft: #ffe4f1; --w-ink: #a3155a;      /* Writing    */
  --s: #d97706; --s-soft: #fff1dc; --s-ink: #8a4b00;      /* Speaking   */
  --m: #12102e; --m-soft: #e6e4f3; --m-ink: #12102e;      /* Full mock  */
  --ok: #0f9d6e; --ok-soft: #e0f7ee; --bad: #d12d4a; --bad-soft: #ffe3e8; --warn: #e3a700;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(18,16,46,.05), 0 8px 24px -18px rgba(18,16,46,.25);
  --shadow-up: 0 16px 36px -14px rgba(18,16,46,.28);
  --num-font: Anton, Impact, "Arial Narrow Bold", sans-serif;
  --lab-font: Orbitron, "Segoe UI", Inter, sans-serif;
}

/* ── 2. COLOURS — NIGHT MODE ────────────────────────────────────────── */
html.dark {
  --bg: #070b1c;
  --card: #0f1430;
  --glass: rgba(10,14,36,.74);
  --line: rgba(255,255,255,.08);
  --line2: rgba(255,255,255,.05);
  --ink: #f2f3ff; --body: #c3c7e6; --mute: #8b90b8;
  --brand: #a78bfa; --brand-dk: #8f6ff5; --brand-ink: #cdbcff; --brand-soft: rgba(167,139,250,.14);
  --hero: #0f1430; --hero-ink: #9ba3d3;
  --gold: #ffc947; --gold-fill: #ffc947; --gold-ink: #1a1400; --gold-soft: rgba(255,201,71,.13); --gold-txt: #ffd978;
  --l: #38d6ff; --l-soft: rgba(56,214,255,.13);  --l-ink: #9ae9ff;
  --r: #a78bfa; --r-soft: rgba(167,139,250,.14); --r-ink: #cdbcff;
  --w: #f472b6; --w-soft: rgba(244,114,182,.14); --w-ink: #ffb0d6;
  --s: #ffb347; --s-soft: rgba(255,179,71,.14);  --s-ink: #ffd08c;
  --m: #ffc947; --m-soft: rgba(255,201,71,.12);  --m-ink: #ffd978;
  --ok: #34d399; --ok-soft: rgba(52,211,153,.14); --bad: #fb7185; --bad-soft: rgba(251,113,133,.14); --warn: #ffc947;
  --shadow: 0 1px 0 rgba(255,255,255,.02), 0 10px 30px -18px rgba(0,0,0,.8);
  --shadow-up: 0 18px 40px -16px rgba(0,0,0,.85);
}

/* ── 3. BASE ────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.sd { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.5; min-height: 100vh; }
/* night sky: a faint grid and a few stars, drawn with gradients (no image to download) */
html.dark body.sd {
  background-color: #070b1c;
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 0%, rgba(167,139,250,.14), transparent 70%),
    radial-gradient(ellipse 50% 35% at 90% 5%, rgba(56,214,255,.10), transparent 70%),
    radial-gradient(1px 1px at 23px 41px, rgba(255,255,255,.55), transparent 100%),
    radial-gradient(1px 1px at 157px 112px, rgba(255,255,255,.35), transparent 100%),
    radial-gradient(1.5px 1.5px at 211px 27px, rgba(255,201,71,.55), transparent 100%),
    radial-gradient(1px 1px at 91px 203px, rgba(255,255,255,.45), transparent 100%),
    radial-gradient(1px 1px at 266px 171px, rgba(56,214,255,.5), transparent 100%),
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 100% 900px, 100% 700px, 300px 260px, 300px 260px, 300px 260px, 300px 260px, 300px 260px, 56px 56px, 56px 56px;
  background-repeat: no-repeat, no-repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat;
}
.sd a { color: var(--brand); }
.sd a:hover { color: var(--brand-ink); }
.sd button { font: inherit; }
.sd a, .sd button, .sd label, .sd summary { -webkit-tap-highlight-color: transparent; }   /* 10 Nov 2026: no grey flash on phones */
.sd-logo { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sd h1, .sd h2, .sd h3 { letter-spacing: -.01em; }
.sd :focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sd-ic { flex: none; }
.sd-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg) !important; padding: 8px 12px; border-radius: 8px; }
.sd-skip:focus { left: 8px; }
.sd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the two special fonts */
.sd-lab { font-family: var(--lab-font); font-weight: 700; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.sd-num { font-family: var(--num-font); font-weight: 400; letter-spacing: .01em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ── 4. TOP BAR (includes/student_nav.php) ──────────────────────────── */
.sd-imp { background: var(--gold); color: var(--gold-ink); text-align: center; padding: 8px 12px; font-weight: 600; font-size: 13.5px; }
.sd-imp a { color: inherit; text-decoration: underline; }
.sd-top { position: sticky; top: 0; z-index: 30; background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line); }
.sd-top-in { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 12px; }
.sd-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink) !important; white-space: nowrap; }
.sd-logo img { border-radius: 10px; display: block; flex: none; width: 34px; height: 34px; object-fit: cover; }
.sd-logo .wm { font-family: var(--lab-font); font-weight: 700; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; }
.sd-tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; margin-left: 6px; }
.sd-tabs::-webkit-scrollbar { display: none; }
.sd-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px; border-radius: 11px; font-weight: 600; font-size: 13.5px; color: var(--body); text-decoration: none; white-space: nowrap; position: relative; transition: background-color .15s, color .15s; }
.sd-tabs a:hover { background: var(--brand-soft); color: var(--brand-ink); }
.sd-tabs a.on { color: var(--ink); background: var(--brand-soft); }
.sd-tabs a.on::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--gold-fill); }
.sd-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--w); color: #fff; font-size: 12px; font-weight: 800; text-align: center; line-height: 20px; }
.sd-adminbtn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 99px; background: var(--gold-fill); color: var(--gold-ink) !important; font-weight: 800; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.sd-adminbtn:hover { filter: brightness(1.05); }
.sd-theme { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: transparent; color: var(--body); cursor: pointer; display: inline-grid; place-items: center; padding: 0; flex: none; transition: transform .15s; }
.sd-theme:hover { transform: rotate(-12deg); color: var(--ink); }
.sd-theme .sun { display: none; } .sd-theme .moon { display: block; }
html.dark .sd-theme .sun { display: block; } html.dark .sd-theme .moon { display: none; }
.sd-out { display: inline-flex; align-items: center; gap: 6px; color: var(--mute) !important; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.sd-out:hover { color: var(--bad) !important; }
.sd-avbtn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 12px; display: inline-flex; flex: none; text-decoration: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--gold-fill); }
.sd-av { width: 36px; height: 36px; border-radius: 99px; background: var(--l); color: #fff; font-weight: 800; display: grid; place-items: center; }
.sd-bottom { display: none; }
.sd-adminview { background: var(--gold-fill); color: var(--gold-ink); font-weight: 700; font-size: 14px; padding: 10px 20px; text-align: center; }
.sd-adminview a { color: var(--gold-ink) !important; text-decoration: underline; margin-left: 6px; }

@media (max-width: 760px) {
  .sd-tabs, .sd-out span { display: none; }
  .sd-top-in { padding: 8px 14px; gap: 10px; }
  .sd-logo { flex: 1; } .sd-logo .wm { font-size: 11px; }
  .sd-logo img { width: 30px; height: 30px; }
  .sd-adminbtn { height: 32px; padding: 0 12px; font-size: 12px; }
  body.sd { padding-bottom: 78px; }
  /* the bottom bar: five icons a thumb can reach */
  .sd-bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .sd-bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 10px; font-size: 10.5px; font-weight: 700; color: var(--mute); text-decoration: none; position: relative; }
  .sd-bottom a.on { color: var(--gold-txt); }
  html.dark .sd-bottom a.on { color: var(--gold); }
  .sd-bottom a.on::before { content: ""; position: absolute; top: 0; left: 50%; width: 22px; height: 2px; border-radius: 2px; background: var(--gold-fill); transform: translateX(-50%); }
  .sd-badge-dot { position: absolute; top: 4px; left: 56%; min-width: 17px; line-height: 17px; font-size: 10px; padding: 0 4px; }
}

/* ── 5. LAYOUT ──────────────────────────────────────────────────────── */
.sd-main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 56px; display: flex; flex-direction: column; gap: 18px; }
.sd-g2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.sd-g2 > * { min-width: 0; }
@media (max-width: 1000px) { .sd-g2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .sd-main { padding: 14px 16px 40px; gap: 14px; } }

.sd-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
@media (max-width: 760px) { .sd-card { padding: 16px; } }
.sd-card h2 { margin: 0; font-size: 17px; font-weight: 800; }
.sd-card h2.sd-lab { font-size: 10.5px; font-weight: 700; letter-spacing: .18em; }
.sd-card .sd-sub { margin: 4px 0 14px; font-size: 13.5px; color: var(--mute); }
.sd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sd-head .sd-link { font-weight: 700; font-size: 13.5px; text-decoration: none; }
.sd-lift { transition: transform .2s ease, box-shadow .2s ease; }
.sd-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.sd-empty { color: var(--mute); font-size: 14px; padding: 6px 0; margin: 0; }
.sd-foot { text-align: center; color: var(--mute); font-size: 12.5px; margin: 6px 0 0; }
.sd-note { font-size: 13px; color: var(--mute); margin: 4px 0 0; }

/* ── 6. BUTTONS AND CHIPS ───────────────────────────────────────────── */
.sd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--brand); color: #fff !important; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; transition: transform .15s, background-color .15s, filter .15s; white-space: nowrap; }
html.dark .sd-btn { color: #0a0820 !important; }
.sd-btn:hover { background: var(--brand-dk); transform: translateY(-2px); }
.sd-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.sd-btn.sm { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.sd-btn.ghost, html.dark .sd-btn.ghost { background: transparent; color: var(--ink) !important; border: 1px solid var(--line); }
.sd-btn.ghost:hover { background: var(--brand-soft); }
.sd-btn.gold { background: var(--gold-fill); color: var(--gold-ink) !important; }
.sd-btn.gold:hover { filter: brightness(1.05); background: var(--gold-fill); }
.sd-btn.dark { background: var(--hero); color: #fff !important; }
html.dark .sd-btn.dark { background: rgba(255,255,255,.1); border: 1px solid var(--line); color: #fff !important; }
.sd-btn.dark:hover { filter: brightness(1.15); }
.sd-btn.danger, html.dark .sd-btn.danger { background: var(--bad); color: #fff !important; }
.sd-chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--body); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.sd-chip.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.sd-chip[aria-pressed="true"], .sd-chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg) !important; }
.sd-chip .n { opacity: .7; font-weight: 600; }
.sd-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.sd-band { display: inline-block; min-width: 46px; text-align: center; font-weight: 800; border-radius: 10px; padding: 5px 10px; font-size: 15px; font-variant-numeric: tabular-nums; }
.sd-band.hi { background: var(--ok-soft); color: var(--ok); }
.sd-band.mid { background: var(--l-soft); color: var(--l-ink); }
.sd-band.lo { background: var(--s-soft); color: var(--s-ink); }
.sd-band.none { background: var(--line2); color: var(--mute); }
.sd-sk { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.sd-sk.L { background: var(--l-soft); color: var(--l-ink); } .sd-sk.R { background: var(--r-soft); color: var(--r-ink); }
.sd-sk.W { background: var(--w-soft); color: var(--w-ink); } .sd-sk.S { background: var(--s-soft); color: var(--s-ink); }
.sd-sk.M { background: var(--m-soft); color: var(--m-ink); }
.sd-sk.G { background: var(--ok-soft); color: var(--ok); }

/* ── 7. FLASH AND TOAST ─────────────────────────────────────────────── */
.sd-flash { padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.sd-flash.ok { background: var(--ok-soft); color: var(--ok); } .sd-flash.err { background: var(--bad-soft); color: var(--bad); }
.sd-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 80; max-width: calc(100% - 32px); text-align: center; }
.sd-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
@media (max-width: 760px) { .sd-toast { bottom: 92px; } }

/* ── 8. DASHBOARD: command deck (the hero) ──────────────────────────── */
.sd-hero { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 28px; display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; box-shadow: var(--shadow); }
html.dark .sd-hero { background: linear-gradient(135deg, #121840 0%, #0f1430 55%, #0c1130 100%); }
.sd-hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255,201,71,.16), transparent 62%); pointer-events: none; }
.sd-hero > * { position: relative; }
.sd-hero .date { margin: 0; }
.sd-hero h1 { margin: 6px 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.sd-hero .mot { margin: 0; color: var(--body); font-size: 15px; max-width: 560px; }
.sd-hero .mot b { color: var(--gold-txt); }
html.dark .sd-hero .mot b { color: var(--gold); }
.sd-hero-l { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sd-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sd-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-soft); border-radius: 99px; padding: 7px 13px; font-weight: 700; font-size: 13px; color: var(--ink) !important; text-decoration: none; border: 0; cursor: pointer; }
a.sd-pill:hover, button.sd-pill:hover { filter: brightness(1.06); }
.sd-pill .sd-ic { color: var(--gold-txt); }
html.dark .sd-pill .sd-ic { color: var(--gold); }
.sd-flame { animation: sdFlame 1.6s ease-in-out infinite; transform-origin: 50% 80%; display: inline-flex; }

/* the ring with the band estimate */
.sd-ringbox { display: flex; align-items: center; gap: 18px; }
.sd-ring { position: relative; width: 156px; height: 156px; flex: none; }
.sd-ring svg { display: block; width: 100%; height: 100%; }
.sd-ring .val { transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); }
.sd-ring .track { stroke: var(--line2); }
html.dark .sd-ring .track { stroke: rgba(255,255,255,.1); }
.sd-ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sd-ring .num b { font-family: var(--num-font); font-weight: 400; font-size: 52px; line-height: 1; color: var(--gold-txt); letter-spacing: .01em; }
html.dark .sd-ring .num b { color: var(--gold); text-shadow: 0 0 24px rgba(255,201,71,.35); }
.sd-ring .num small { margin-top: 4px; }
.sd-goal p { margin: 0; }
.sd-goal .row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.sd-goal button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 20px; font-weight: 800; cursor: pointer; line-height: 1; transition: transform .15s; }
.sd-goal button:hover { transform: scale(1.08); background: var(--brand-soft); }
.sd-goal b { font-family: var(--num-font); font-weight: 400; font-size: 30px; min-width: 56px; text-align: center; }
.sd-goal .hint { margin-top: 4px; font-size: 12px; color: var(--mute); min-height: 16px; }

/* the three stat tiles beside the ring: exam countdown, streak, coins */
.sd-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.sd-stat { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--bg); text-decoration: none; color: var(--ink) !important; display: block; min-width: 0; position: relative; overflow: hidden; text-align: left; cursor: pointer; }
html.dark .sd-stat { background: rgba(255,255,255,.035); }
button.sd-stat { font: inherit; width: 100%; }
.sd-stat .v { display: block; font-family: var(--num-font); font-weight: 400; font-size: 30px; line-height: 1; margin-top: 6px; }
.sd-stat .v small { font-family: Inter, system-ui, sans-serif; font-size: 12px; font-weight: 700; color: var(--mute); margin-left: 4px; letter-spacing: 0; }
.sd-stat .u { display: block; font-size: 12px; color: var(--mute); margin-top: 4px; }
.sd-stat.exam .v { color: var(--l-ink); } html.dark .sd-stat.exam .v { color: var(--l); }
.sd-stat.streak .v { color: var(--s-ink); } html.dark .sd-stat.streak .v { color: var(--s); }
.sd-stat.coins .v { color: var(--gold-txt); } html.dark .sd-stat.coins .v { color: var(--gold); }
.sd-stat.lit::after { content: ""; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, rgba(255,179,71,.35), transparent 70%); }
@media (max-width: 1000px) { .sd-hero { grid-template-columns: 1fr; } .sd-ringbox { order: -1; } }
@media (max-width: 760px) {
  .sd-hero { padding: 18px; gap: 14px; border-radius: 20px; }
  .sd-hero h1 { font-size: 24px; margin: 2px 0 4px; }
  .sd-hero .mot { font-size: 14px; }
  .sd-ring { width: 124px; height: 124px; }
  .sd-ring .num b { font-size: 42px; }
  .sd-stats { gap: 8px; } .sd-stat { padding: 10px 11px; } .sd-stat .v { font-size: 26px; }
  .sd-pill { padding: 6px 11px; font-size: 12.5px; }
}
@media (max-width: 420px) { .sd-stats { grid-template-columns: 1fr 1fr; } .sd-stat.coins { grid-column: span 2; } }

/* exam date pop-up form inside the hero */
.sd-exam { display: none; margin-top: 12px; gap: 8px; flex-wrap: wrap; align-items: center; }
.sd-exam.open { display: flex; }
.sd-exam input { height: 40px; border-radius: 10px; border: 1px solid var(--line); padding: 0 10px; font: inherit; color: var(--ink); background: var(--card); color-scheme: light; }
html.dark .sd-exam input { color-scheme: dark; }

/* "continue where you left off" strip */
.sd-cont { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line); background: var(--bg); }
html.dark .sd-cont { background: rgba(255,255,255,.03); }
.sd-cont .sd-sk { width: 38px; height: 38px; }
.sd-cont .txt { flex: 1; min-width: 0; }
.sd-cont .txt b { display: block; font-size: 14.5px; }
.sd-cont .txt span { font-size: 12.5px; color: var(--mute); }
@media (max-width: 480px) { .sd-cont { flex-wrap: wrap; } .sd-cont .sd-btn { width: 100%; } }

/* the "teacher replied" banner */
.sd-reply { display: flex; align-items: center; gap: 14px; background: var(--s-soft); border: 1px solid transparent; border-radius: 16px; padding: 12px 16px; text-decoration: none; color: var(--ink) !important; }
html.dark .sd-reply { border-color: rgba(255,179,71,.25); }
.sd-reply .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--s); color: #1a0f00; display: grid; place-items: center; flex: none; font-weight: 800; }
.sd-reply b { display: block; font-size: 15px; }
.sd-reply span.t { color: var(--s-ink); font-size: 13.5px; }
.sd-reply .go { margin-left: auto; font-weight: 800; color: var(--s-ink); white-space: nowrap; }

/* ── 9. DASHBOARD: quick launch ─────────────────────────────────────── */
.sd-launch { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.sd-launch a { --k: var(--brand); --ks: var(--brand-soft); --ki: var(--brand-ink); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink) !important; box-shadow: var(--shadow); min-height: 128px; }
.sd-launch a::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--k); }
.sd-launch a::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--ks); opacity: .9; transition: transform .25s; }
.sd-launch a:hover::after { transform: scale(1.4); }
.sd-launch a > * { position: relative; z-index: 1; }
.sd-launch .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--ks); color: var(--ki); display: grid; place-items: center; }
.sd-launch .nm { font-weight: 800; font-size: 14px; }
.sd-launch .band { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.sd-launch .band b { font-family: var(--num-font); font-weight: 400; font-size: 26px; line-height: 1; color: var(--ki); }
.sd-launch .band small { font-size: 11px; color: var(--mute); font-weight: 600; }
.sd-launch .go { position: absolute; right: 12px; bottom: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--k); color: #0a0820; display: grid; place-items: center; transition: transform .2s; }
.sd-launch a:hover .go { transform: translateX(3px); }
.sd-launch a.L { --k: var(--l); --ks: var(--l-soft); --ki: var(--l-ink); } .sd-launch a.R { --k: var(--r); --ks: var(--r-soft); --ki: var(--r-ink); }
.sd-launch a.W { --k: var(--w); --ks: var(--w-soft); --ki: var(--w-ink); } .sd-launch a.S { --k: var(--s); --ks: var(--s-soft); --ki: var(--s-ink); }
.sd-launch a.M { --k: var(--gold-fill); --ks: var(--gold-soft); --ki: var(--gold-txt); } .sd-launch a.G { --k: var(--ok); --ks: var(--ok-soft); --ki: var(--ok); }
html.dark .sd-launch a.M { --ki: var(--gold); }
.sd-launch a.M .go, .sd-launch a.G .go { color: #0a0820; }
@media (max-width: 1000px) { .sd-launch { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sd-launch { gap: 10px; } .sd-launch a { padding: 13px 12px 12px; min-height: 112px; gap: 8px; } .sd-launch .ic { width: 32px; height: 32px; } .sd-launch .band b { font-size: 22px; } .sd-launch .band small { display: none; } .sd-launch .go { width: 26px; height: 26px; right: 10px; bottom: 10px; } }

/* ── 10. DASHBOARD: today's plan + weekly goal ──────────────────────── */
.sd-plan { display: flex; flex-direction: column; gap: 10px; }
.sd-step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--c-soft, var(--brand-soft)); border: 1px solid transparent; transition: opacity .3s; }
.sd-step.done { opacity: .5; }
.sd-step .tick { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--c, var(--brand)); background: var(--card); color: #fff; flex: none; display: grid; place-items: center; cursor: pointer; padding: 0; }
.sd-step.done .tick { background: var(--c, var(--brand)); color: #0a0820; }
.sd-step .tick svg { display: none; } .sd-step.done .tick svg { display: block; animation: sdPop .35s ease-out both; }
.sd-step .txt { flex: 1; min-width: 0; }
.sd-step .txt b { display: block; font-size: 14.5px; }
.sd-step .txt span { font-size: 13px; color: var(--body); }
.sd-step .sd-btn { background: var(--c, var(--brand)); min-height: 38px; padding: 0 14px; color: #0a0820 !important; }
html:not(.dark) .sd-step .sd-btn { color: #fff !important; }
.sd-step .sd-btn:hover { filter: brightness(1.08); background: var(--c, var(--brand)); }
@media (max-width: 480px) { .sd-step { flex-wrap: wrap; } .sd-step .txt { flex-basis: calc(100% - 44px); } .sd-step .sd-btn { margin-left: 44px; } }

.sd-week { display: flex; align-items: center; gap: 18px; }
.sd-week .ring { position: relative; width: 112px; height: 112px; flex: none; }
.sd-week .ring svg { width: 100%; height: 100%; display: block; }
.sd-week .ring .val { transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1) .2s; }
.sd-week .ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--num-font); font-size: 30px; }
.sd-week .ring .num small { font-family: Inter, system-ui, sans-serif; font-size: 11px; color: var(--mute); font-weight: 700; margin-left: 2px; }
.sd-week .txt b { display: block; font-size: 15px; }
.sd-week .txt p { margin: 4px 0 0; font-size: 13px; color: var(--body); }
.sd-week .days { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }   /* 9 Nov 2026: wraps on very small phones / big text */
.sd-week .days i { width: 22px; height: 22px; border-radius: 7px; background: var(--line2); display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 800; color: var(--mute); }
.sd-week .days i.on { background: var(--ok); color: #0a0820; }
.sd-week .days i.today { outline: 2px solid var(--gold-fill); outline-offset: 1px; }

/* ── 11. DASHBOARD: skill tiles 2×2 ─────────────────────────────────── */
.sd-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 380px) { .sd-skills { gap: 10px; } }
.sd-skill { display: block; border-radius: 16px; padding: 14px 16px; text-decoration: none; color: var(--ink) !important; border: 1px solid var(--line); background: var(--bg); position: relative; overflow: hidden; }
html.dark .sd-skill { background: rgba(255,255,255,.03); }
.sd-skill::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--k); }
.sd-skill.L { --k: var(--l); --ki: var(--l-ink); } .sd-skill.R { --k: var(--r); --ki: var(--r-ink); }
.sd-skill.W { --k: var(--w); --ki: var(--w-ink); } .sd-skill.S { --k: var(--s); --ki: var(--s-ink); }
.sd-skill .top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sd-skill .nm { font-family: var(--lab-font); font-weight: 700; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ki); }
.sd-skill .dl { font-size: 11.5px; font-weight: 800; border-radius: 99px; padding: 1px 8px; background: var(--card); color: var(--body); border: 1px solid var(--line); }
.sd-skill .dl.up { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .sd-skill .dl.dn { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.sd-skill .mid { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 8px; }
.sd-skill .mid b { font-family: var(--num-font); font-weight: 400; font-size: 34px; line-height: 1; }
.sd-skill .bars { display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.sd-skill .bars i { width: 7px; background: var(--k); border-radius: 3px; opacity: .4; transform-origin: bottom; animation: sdGrow .8s cubic-bezier(.2,.8,.2,1) both; }
.sd-skill .bars i:last-child { opacity: 1; }
.sd-skill .meta { display: block; font-size: 12.5px; color: var(--mute); margin-top: 6px; }

/* ── 12. RESULT ROWS (dashboard + My results) ───────────────────────── */
.sd-rows { list-style: none; margin: 0; padding: 0; }
.sd-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.sd-row:last-child { border-bottom: 0; }
.sd-row .ti { flex: 1; min-width: 170px; }
.sd-row .ti b { display: block; font-size: 14.5px; }
.sd-row .ti span { font-size: 13px; color: var(--mute); }
.sd-row .sc { min-width: 104px; font-size: 13.5px; color: var(--body); font-weight: 600; }
.sd-row .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sd-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--brand); box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line); }
.sd-dot.L { background: var(--l); } .sd-dot.R { background: var(--r); } .sd-dot.W { background: var(--w); } .sd-dot.S { background: var(--s); } .sd-dot.M { background: var(--gold-fill); }
.sd-tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-ink); margin-left: 6px; vertical-align: 1px; }
@media (max-width: 640px) {
  .sd-row { gap: 10px; }
  .sd-row .sc { display: none; }
  .sd-row .acts { width: 100%; padding-left: 52px; }
}

/* ── 13. WHERE YOU LOSE POINTS ──────────────────────────────────────── */
.sd-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sd-bars .t { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.sd-bars .t small { color: var(--mute); font-weight: 600; }
.sd-bars .tr { height: 8px; background: var(--line2); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.sd-bars .tr i { display: block; height: 100%; border-radius: 99px; width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.sd-bars .tip { margin: 6px 0 0; font-size: 13px; color: var(--body); }
.p-lo { color: var(--bad); } .p-mid { color: var(--s-ink); } .p-hi { color: var(--ok); }
html.dark .p-mid { color: var(--s); }
.b-lo { background: var(--bad); } .b-mid { background: var(--s); } .b-hi { background: var(--ok); }

/* ── 14. BAND JOURNEY CHART + PRACTICE MAP ──────────────────────────── */
.sd-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.sd-chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s ease .3s; }
.sd-chart .draw.in { stroke-dashoffset: 0; }
@media (max-width: 560px) { .sd-chart text { font-size: 19px; } }
.sd-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--mute); }
.sd-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.sd-heatwrap { overflow-x: auto; padding-bottom: 4px; }
.sd-heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); grid-auto-columns: 14px; gap: 4px; }
.sd-heat i { display: block; width: 14px; height: 14px; border-radius: 4px; background: var(--line2); animation: sdFade .35s ease both; --hc: var(--brand); }
.sd-heat i.L { --hc: var(--l); } .sd-heat i.R { --hc: var(--r); } .sd-heat i.W { --hc: var(--w); } .sd-heat i.S { --hc: var(--s); } .sd-heat i.M { --hc: var(--gold-fill); } .sd-heat i.G { --hc: var(--ok); }
.sd-heat i.l1 { background: var(--hc); opacity: .35; } .sd-heat i.l2 { background: var(--hc); opacity: .65; } .sd-heat i.l3 { background: var(--hc); opacity: 1; }
.sd-heatkey { display: flex; align-items: center; gap: 8px 12px; margin-top: 12px; font-size: 12px; color: var(--mute); flex-wrap: wrap; }
.sd-heatkey i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: -1px; }
.sd-kv { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; }
.sd-kv b { display: block; font-family: var(--num-font); font-weight: 400; font-size: 24px; line-height: 1.1; }
.sd-kv span { color: var(--mute); font-size: 12px; font-weight: 600; }

/* ── 15. SIDE PANELS: what's new, messages, badges, quick links ──────── */
.sd-msg { padding: 11px 13px; border-radius: 12px; background: var(--bg); margin-top: 8px; border: 1px solid transparent; }
html.dark .sd-msg { background: rgba(255,255,255,.03); }
.sd-msg.new { border-color: var(--gold-fill); background: var(--gold-soft); }
.sd-msg b { font-size: 14px; }
.sd-msg p { margin: 2px 0 6px; color: var(--body); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sd-msg small { color: var(--mute); font-size: 12px; font-weight: 600; }
.sd-msg form { display: inline; }
.sd-msg form button { border: 0; background: none; color: var(--brand); font-weight: 800; font-size: 12.5px; cursor: pointer; padding: 0; margin-left: 8px; }
.sd-msg .sd-pill { font-size: 10px; padding: 2px 8px; margin-right: 8px; }

.sd-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sd-quick a { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink) !important; padding: 14px 16px; }
.sd-quick .q { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; flex: none; }
.sd-quick b { display: block; font-size: 14.5px; } .sd-quick span.s { font-size: 12.5px; color: var(--mute); }
@media (max-width: 760px) { .sd-quick { grid-template-columns: 1fr 1fr; gap: 10px; } .sd-quick a.sd-card { padding: 12px; } .sd-quick span.s { display: none; } }

.sd-badges { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .sd-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) { .sd-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sd-bdg { border: 1px dashed var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; color: var(--mute); }
.sd-bdg .bi { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 6px; background: var(--bg); display: grid; place-items: center; border: 1px solid var(--line); }
html.dark .sd-bdg .bi { background: rgba(255,255,255,.04); }
.sd-bdg b { display: block; font-size: 12.5px; color: var(--body); }
.sd-bdg small { display: block; font-size: 11px; margin-top: 2px; line-height: 1.3; }
.sd-bdg.on { border: 1px solid rgba(255,201,71,.45); background: var(--gold-soft); color: var(--gold-txt); }
.sd-bdg.on .bi { background: var(--gold-fill); color: var(--gold-ink); border-color: transparent; box-shadow: 0 0 18px rgba(255,201,71,.35); }
.sd-bdg.on b { color: var(--ink); }

/* ── 16. MODAL (picture + share) ────────────────────────────────────── */
.sd-modal { position: fixed; inset: 0; z-index: 60; background: rgba(4,6,20,.6); display: none; align-items: flex-end; justify-content: center; }
.sd-modal.open { display: flex; }
.sd-modal .box { background: var(--card); border: 1px solid var(--line); width: 100%; max-width: 460px; border-radius: 22px 22px 0 0; padding: 20px; max-height: 90vh; overflow: auto; animation: sdUp .25s ease both; }
@media (min-width: 640px) { .sd-modal { align-items: center; padding: 16px; } .sd-modal .box { border-radius: 22px; } }
.sd-modal h3 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.sd-modal .close { float: right; border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--mute); padding: 4px 8px; }

/* ── 17. ONE RESULT: the review page (result.php) ───────────────────── */
.sd-rhero { color: #fff; border-radius: 22px; padding: 26px; display: flex; flex-wrap: wrap; gap: 22px; align-items: center; background: var(--rh, #1D3FB0); position: relative; overflow: hidden; }
.sd-rhero.L { --rh: #0b6a8f; } .sd-rhero.R { --rh: #4c2fb8; } .sd-rhero.W { --rh: #9d1455; }
html.dark .sd-rhero { background: linear-gradient(135deg, var(--rh), #0f1430 90%); border: 1px solid var(--line); }
.sd-rhero .bandbox { width: 96px; height: 96px; border-radius: 24px; background: #fff; color: var(--rh); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; animation: sdPop .5s ease .2s both; }
.sd-rhero .bandbox b { font-family: var(--num-font); font-weight: 400; font-size: 40px; line-height: 1; }
.sd-rhero .bandbox small { font-size: 12px; font-weight: 700; }
.sd-rhero .info { flex: 1 1 300px; min-width: 0; }
.sd-rhero .info p { margin: 0; color: rgba(255,255,255,.78); font-weight: 600; font-size: 14px; }
.sd-rhero h1 { margin: 4px 0 10px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.sd-rhero .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.sd-rhero .sd-btn.ghost { background: rgba(255,255,255,.12); color: #fff !important; border-color: rgba(255,255,255,.25); }
.sd-rhero .sd-btn.ghost:hover { background: rgba(255,255,255,.22); }
@media (max-width: 760px) {
  .sd-rhero { padding: 18px; gap: 14px; border-radius: 20px; }
  .sd-rhero .bandbox { width: 76px; height: 76px; border-radius: 20px; } .sd-rhero .bandbox b { font-size: 30px; }
  .sd-rhero h1 { font-size: 22px; }
  .sd-rhero .acts { width: 100%; } .sd-rhero .acts .sd-btn { flex: 1 1 auto; }
}
.sd-back { font-weight: 700; font-size: 14px; text-decoration: none; }

.sd-retrybar { background: var(--gold-soft); border: 1px solid rgba(255,201,71,.4); border-radius: 16px; padding: 14px 18px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; position: sticky; top: 70px; z-index: 20; box-shadow: var(--shadow-up); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
@media (max-width: 760px) { .sd-retrybar { top: 56px; padding: 10px 12px; gap: 8px; border-radius: 14px; } .sd-retrybar b { font-size: 14px; min-width: 100%; } .sd-retrybar .sd-btn { min-height: 38px; padding: 0 12px; font-size: 13px; } }
.sd-retrybar b { font-size: 16px; flex: 1; min-width: 220px; }

.sd-rlayout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.sd-rlayout > * { min-width: 0; }
@media (max-width: 980px) { .sd-rlayout { grid-template-columns: 1fr; } }
.sd-gridcard { position: sticky; top: 74px; padding: 18px; }
@media (max-width: 980px) { .sd-gridcard { position: static; } }
.sd-qgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 980px) { .sd-qgrid { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
@media (max-width: 480px) { .sd-qgrid { gap: 4px; } }
.sd-q { width: 100%; aspect-ratio: 1; border-radius: 10px; border: 2px solid transparent; font-weight: 800; font-size: 14px; cursor: pointer; padding: 0; transition: transform .15s; }
@media (max-width: 480px) { .sd-q { font-size: 12px; border-radius: 7px; } }
.sd-q:hover { transform: scale(1.08); }
.sd-q.ok { background: var(--ok-soft); color: var(--ok); }
.sd-q.bad { background: var(--bad-soft); color: var(--bad); }
.sd-q.fix { background: var(--gold-soft); color: var(--gold-txt); }
.sd-q.cur { border-color: var(--ink); }
html.dark .sd-q.cur { border-color: var(--gold); }
.sd-key { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--body); font-weight: 600; }
.sd-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; vertical-align: -1px; margin-right: 6px; }
.sd-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.sd-parts li { display: flex; justify-content: space-between; gap: 10px; }

.sd-qlist { display: flex; flex-direction: column; gap: 12px; }
.sd-qpart { display: flex; flex-direction: column; gap: 12px; }
.sd-qpart[hidden] { display: none; }
.sd-qlist h2.pt { margin: 8px 0 0; font-size: 15px; font-weight: 800; color: var(--body); }
.sd-qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); scroll-margin-top: 90px; }
.sd-qcard.cur { border-color: var(--brand); }
.sd-qcard .in { display: flex; gap: 14px; align-items: flex-start; }
.sd-qnum { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; flex: none; }
.sd-qnum.ok, .sd-st.ok { background: var(--ok-soft); color: var(--ok); }
.sd-qnum.bad, .sd-st.bad { background: var(--bad-soft); color: var(--bad); }
.sd-qnum.fix, .sd-st.fix { background: var(--gold-soft); color: var(--gold-txt); }
.sd-qcard .body { flex: 1; min-width: 0; }
.sd-qcard .meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.sd-qcard .kind { font-family: var(--lab-font); font-size: 10px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .14em; }
.sd-st { font-size: 13px; font-weight: 800; border-radius: 99px; padding: 3px 10px; }
.sd-qcard .stem { margin: 6px 0 12px; font-size: 16px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.sd-gap { display: inline-block; min-width: 46px; padding: 0 8px; border-bottom: 2px solid var(--brand); color: var(--brand-ink); font-weight: 800; text-align: center; font-size: 13px; }
.sd-ans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.sd-ans > div { border-radius: 12px; padding: 10px 12px; }
.sd-ans span { display: block; font-size: 12px; font-weight: 700; color: var(--mute); }
.sd-ans b { font-size: 16px; overflow-wrap: anywhere; }
.sd-ans .you.ok { background: var(--ok-soft); } .sd-ans .you.ok b { color: var(--ok); }
.sd-ans .you.bad { background: var(--bad-soft); } .sd-ans .you.bad b { color: var(--bad); text-decoration: line-through; }
.sd-ans .you.blank b { text-decoration: none; font-style: italic; font-weight: 600; }
.sd-ans .key { background: var(--ok-soft); } .sd-ans .key span, .sd-ans .key b { color: var(--ok); }
.sd-qcard details { margin-top: 12px; }
.sd-qcard summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--brand-ink); }
.sd-qcard blockquote { margin: 10px 0 0; padding: 12px 14px; background: var(--bg); border-radius: 12px; font-size: 14.5px; line-height: 1.55; color: var(--body); overflow-wrap: anywhere; }
html.dark .sd-qcard blockquote { background: rgba(255,255,255,.04); }
.sd-qcard blockquote + blockquote { margin-top: 8px; }
.sd-retry label, .sd-retry p { display: block; font-size: 13px; font-weight: 700; color: var(--mute); margin: 0 0 6px; }
.sd-in { height: 44px; border-radius: 12px; border: 2px solid var(--line); padding: 0 12px; font: inherit; font-size: 15px; width: 260px; max-width: 100%; background: var(--card); color: var(--ink); }
.sd-in:focus { outline: none; border-color: var(--brand); }
.sd-letters { display: flex; gap: 8px; flex-wrap: wrap; }
.sd-letter { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-weight: 800; font-size: 15px; cursor: pointer; }
.sd-letter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sd-res { margin: 10px 0 0; font-size: 15px; font-weight: 800; }
.sd-res.ok { color: var(--ok); animation: sdPop .4s ease both; } .sd-res.bad { color: var(--bad); animation: sdShake .35s ease both; }

/* share card (inside the modal and on the public page) */
.sd-sharecard { background: var(--hero); color: #fff; border-radius: 20px; padding: 22px; text-align: center; border: 1px solid var(--line); }
.sd-sharecard img { border-radius: 12px; }
.sd-sharecard .t { margin: 8px 0 0; font-size: 13px; color: var(--hero-ink); font-weight: 600; }
.sd-sharecard .b { display: block; font-family: var(--num-font); font-weight: 400; font-size: 64px; line-height: 1.1; color: var(--gold); }
.sd-sharecard .n { margin: 0; font-weight: 700; }
.sd-sharecard .u { margin: 6px 0 0; font-size: 12.5px; color: var(--hero-ink); }
.sd-sharebtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* ── 18. ONE WRITING RESULT (writing_result.php) ────────────────────── */
.sd-tablist { display: inline-flex; gap: 6px; background: var(--card); border: 1px solid var(--line); padding: 6px; border-radius: 18px; align-self: flex-start; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; }
.sd-tab { height: 46px; padding: 0 20px; border-radius: 13px; border: 0; background: transparent; font-weight: 800; font-size: 15px; color: var(--body); cursor: pointer; white-space: nowrap; }
.sd-tab[aria-selected="true"] { background: var(--brand); color: #fff; }
html.dark .sd-tab[aria-selected="true"] { color: #0a0820; }
.sd-wlayout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sd-wlayout > * { min-width: 0; }
@media (max-width: 980px) { .sd-wlayout { grid-template-columns: 1fr; } }
.sd-prompt { background: var(--bg); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--line); }
html.dark .sd-prompt { background: rgba(255,255,255,.03); }
.sd-prompt span { display: block; font-family: var(--lab-font); font-size: 10px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .16em; }
.sd-prompt p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.sd-wc { font-size: 13.5px; font-weight: 700; border-radius: 99px; padding: 4px 10px; }
.sd-wc.ok { background: var(--ok-soft); color: var(--ok); } .sd-wc.bad { background: var(--bad-soft); color: var(--bad); }
.sd-essay { font-family: "Source Serif 4", Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; max-height: 560px; overflow: auto; }
@media (max-width: 760px) { .sd-essay { font-size: 16px; padding: 14px; max-height: none; } }
.sd-crit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.sd-crit .t { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; font-weight: 700; }
.sd-crit .tr { height: 8px; background: var(--line2); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.sd-crit .tr i { display: block; height: 100%; border-radius: 99px; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1) .2s; }
.sd-crit p { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--body); }
.sd-list { margin: 0; padding-left: 20px; font-size: 14.5px; line-height: 1.6; color: var(--body); }
.sd-list li + li { margin-top: 4px; }
.sd-fix { border-radius: 12px; background: var(--bg); padding: 10px 12px; font-size: 14px; border: 1px solid var(--line); }
html.dark .sd-fix { background: rgba(255,255,255,.03); }
.sd-fix + .sd-fix { margin-top: 8px; }
.sd-fix .o { color: var(--bad); text-decoration: line-through; }
.sd-fix .c { color: var(--ok); font-weight: 700; display: block; margin-top: 2px; }
.sd-fix .e { color: var(--mute); display: block; margin-top: 2px; font-size: 13px; }

/* ── 19. ANIMATIONS (transform + opacity only) ──────────────────────── */
@keyframes sdRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sdGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sdFlame { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }
@keyframes sdPop { 0% { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes sdShake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes sdFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sdUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sd-rise { animation: sdRise .55s cubic-bezier(.2,.8,.2,1) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sd-chart .draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  .sd-rise { opacity: 1; transform: none; }
}

/* ── 20. PRINTING / SAVE AS PDF ─────────────────────────────────────── */
@media print {
  @page { margin: 14mm; }
  body.sd, html.dark body.sd { background: #fff !important; background-image: none !important; color: #000; padding: 0; font-size: 12pt; }
  .sd-top, .sd-bottom, .sd-imp, .sd-adminview, .sd-noprint, .sd-toast, .sd-modal, .sd-gridcard, .sd-back, .sd-skip, .sd-theme { display: none !important; }
  .sd-main { padding: 0; max-width: none; gap: 10px; }
  .sd-rhero, .sd-hero { background: #fff !important; color: #000; border: 2px solid #000; padding: 12px; }
  .sd-rhero .info p { color: #333; }
  .sd-rhero .bandbox { border: 2px solid #000; color: #000; }
  .sd-rlayout, .sd-wlayout { display: block; }
  .sd-qcard, .sd-card { box-shadow: none; border: 1px solid #999; break-inside: avoid; page-break-inside: avoid; margin-bottom: 8px; }
  .sd-qcard details > summary { display: none; }
  .sd-essay { max-height: none; overflow: visible; border: 0; padding: 0; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sd-pill { color: #000 !important; background: #eee !important; }
  .sd-pill .sd-ic { color: #000; }
  .sd a { color: #000; text-decoration: none; }
}

/* ── Phase 6D (30 Oct 2026): "corrected by teacher" — a small line under the title of a result (result.php, writing_result.php) and a tag in the list (my_results.php) */
.sd-rhero .sd-corr { display: inline-flex; align-items: flex-start; gap: 6px; margin: -4px 0 8px; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.16); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.35; max-width: 100%; }
.sd-rhero .sd-corr svg { flex: none; margin-top: 2px; }
.sd-tag.sd-tag-corr { background: rgba(23,132,90,.14); color: #0B5A3B; }
html.dark .sd-tag.sd-tag-corr { background: rgba(110,231,168,.16); color: #9FE8C4; }
