/* IELTS Writing Grader — Account & Teacher pages.
   Same look as the Writing page: Inter (loaded in index.html), indigo gradient, rounded-3xl cards. */

:root {
  --p1-ink: #111827;
  --p1-text: #374151;
  --p1-muted: #6b7280;
  --p1-faint: #9ca3af;
  --p1-line: #e5e7eb;
  --p1-soft: #f9fafb;
  --p1-white: #fff;
  --p1-indigo: #4f46e5;
  --p1-indigo-soft: #eef2ff;
  --p1-red: #dc2626;
  --p1-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --p1-glow: 0 10px 22px -10px rgba(79, 70, 229, .75);
}

/* ---------- Layout ---------- */
.p1-content { max-width: 42rem; margin: 0 auto; padding: 24px 16px 48px; }
.p1-page-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.p1-page-head h1 { margin: 4px 0; color: var(--p1-ink); font-size: 22px; font-weight: 800; line-height: 1.2; }
.p1-page-head p { margin: 0; color: var(--p1-muted); font-size: 13px; line-height: 1.6; }
.p1-eyebrow { color: var(--p1-indigo); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.p1-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.p1-stack { display: grid; gap: 16px; min-width: 0; }
.p1-review-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.p1-review-essay { max-height: 60vh; overflow: auto; }

/* ---------- Cards ---------- */
.p1-panel { min-width: 0; padding: 20px; border: 1px solid #f3f4f6; border-radius: 24px; background: var(--p1-white); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.p1-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.p1-panel h2, .p1-panel h3 { margin: 0; color: var(--p1-ink); font-size: 15px; font-weight: 700; }
.p1-panel-sub { margin: 4px 0 0; color: var(--p1-muted); font-size: 12px; line-height: 1.5; }
.p1-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.p1-stat { padding: 16px; border: 1px solid #f3f4f6; border-radius: 20px; background: var(--p1-white); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.p1-stat strong { display: block; margin-top: 6px; color: var(--p1-ink); font-size: 22px; font-weight: 800; }
.p1-stat span { color: var(--p1-muted); font-size: 11px; }
.p1-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 20px; background: linear-gradient(135deg, #eef2ff, #fae8ff); }
.p1-plan strong { color: var(--p1-ink); font-size: 13px; }
.p1-plan p { margin: 4px 0 0; color: var(--p1-muted); font-size: 11px; line-height: 1.5; }
.p1-banner { margin-bottom: 16px; border: 1px solid #fde68a; border-radius: 16px; padding: 12px 14px; background: #fffbeb; color: #92400e; font-size: 12px; line-height: 1.55; }
.p1-empty { padding: 28px 10px; color: var(--p1-faint); text-align: center; font-size: 13px; }
.p1-divider { height: 1px; margin: 16px 0; background: #f3f4f6; }

/* ---------- Forms & buttons ---------- */
.p1-field { display: grid; gap: 6px; margin: 12px 0; }
.p1-field label, .p1-label { color: var(--p1-text); font-size: 13px; font-weight: 600; }
.p1-input, .p1-textarea, .p1-select { width: 100%; min-height: 46px; box-sizing: border-box; border: 1px solid var(--p1-line); border-radius: 16px; padding: 12px 14px; outline: none; background: var(--p1-soft); color: #1f2937; font: inherit; font-size: 14px; }
.p1-input:focus, .p1-textarea:focus, .p1-select:focus { border-color: transparent; box-shadow: 0 0 0 2px #818cf8; background: var(--p1-white); }
.p1-textarea { min-height: 180px; resize: none; line-height: 1.7; }
.p1-btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; border: 0; border-radius: 999px; padding: 0 20px; background: var(--p1-gradient); box-shadow: var(--p1-glow); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.p1-btn:active { transform: scale(.97); }
.p1-btn:disabled { opacity: .6; box-shadow: none; cursor: not-allowed; }
.p1-btn-secondary { border: 1px solid var(--p1-line); background: var(--p1-white); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); color: var(--p1-text); }
.p1-btn-quiet { min-height: 36px; border: 0; padding: 0 8px; background: transparent; box-shadow: none; color: var(--p1-indigo); font-size: 12px; }
.p1-btn-full { width: 100%; }
.p1-link { border: 0; padding: 0; background: none; color: var(--p1-indigo); font: inherit; font-size: 12px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.p1-hint { color: var(--p1-muted); font-size: 11px; line-height: 1.5; }
.p1-form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }


/* ---------- Tags, avatars, lists ---------- */
.p1-tag { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 0 10px; background: var(--p1-indigo-soft); color: #4338ca; font-size: 10px; font-weight: 700; white-space: nowrap; }
.p1-tag-yellow { background: #fef3c7; color: #92400e; }
.p1-tag-blue { background: #e0e7ff; color: #3730a3; }
.p1-tag-coral { background: #fee2e2; color: #b91c1c; }
.p1-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(135deg, #e0e7ff, #fae8ff); color: #4338ca; font-size: 12px; font-weight: 700; }
.p1-list { display: grid; }
.p1-list-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 0; border-bottom: 1px solid #f3f4f6; }
.p1-list-row:last-child { border-bottom: 0; }
.p1-row-main { flex: 1; min-width: 0; }
.p1-row-main strong { display: block; overflow: hidden; color: #1f2937; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.p1-row-main small { display: block; margin-top: 3px; color: var(--p1-faint); font-size: 11px; }
.p1-progress { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--p1-line); overflow: hidden; }
.p1-progress span { display: block; height: 100%; background: var(--p1-gradient); }
.p1-class-code { color: var(--p1-indigo); font-size: 22px; font-weight: 800; letter-spacing: 1.5px; }
.p1-table-wrap { overflow-x: auto; }
.p1-table { width: 100%; border-collapse: collapse; text-align: left; }
.p1-table th { padding: 10px 8px; color: var(--p1-faint); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.p1-table td { padding: 12px 8px; border-top: 1px solid #f3f4f6; color: var(--p1-muted); font-size: 12px; }
.p1-table td:first-child { color: var(--p1-ink); font-weight: 600; }

/* ---------- Sign-in card ---------- */
.p1-auth { display: grid; gap: 16px; }
.p1-auth-art { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 24px; background: var(--p1-gradient); box-shadow: var(--p1-glow); color: #fff; }
.p1-auth-art .p1-eyebrow { color: rgba(255, 255, 255, .8); }
.p1-auth-art h2 { margin: 0; color: #fff; font-size: 24px; font-weight: 800; line-height: 1.2; }
.p1-auth-art p { margin: 0; color: rgba(255, 255, 255, .9); font-size: 13px; line-height: 1.6; }
.p1-auth-quote { display: flex; gap: 10px; align-items: center; color: rgba(255, 255, 255, .9); font-size: 12px; }
.p1-auth-quote .p1-avatar { background: rgba(255, 255, 255, .25); color: #fff; }
.p1-auth-form { padding: 20px; border: 1px solid #f3f4f6; border-radius: 24px; background: var(--p1-white); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.p1-auth-form h2 { margin: 0 0 6px; color: var(--p1-ink); font-size: 20px; font-weight: 800; }
.p1-auth-form > p { margin: 0; color: var(--p1-muted); font-size: 13px; line-height: 1.6; }
.p1-auth-step { display: flex; gap: 6px; align-items: center; margin-bottom: 20px; color: var(--p1-faint); font-size: 11px; }
.p1-auth-step b { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--p1-line); border-radius: 50%; font-size: 11px; }
.p1-auth-step .is-active { background: var(--p1-gradient); border-color: transparent; color: #fff; }

/* ---------- Scores & essay feedback ---------- */
.p1-score { display: flex; align-items: center; gap: 14px; }
.p1-score-circle { display: grid; place-items: center; width: 72px; height: 72px; border: 6px solid #c7d2fe; border-radius: 50%; color: var(--p1-indigo); font-size: 24px; font-weight: 800; }
.p1-score-bars { display: grid; gap: 12px; }
.p1-score-bar { display: grid; grid-template-columns: minmax(110px, 1fr) 1.4fr 30px; align-items: center; gap: 8px; color: var(--p1-muted); font-size: 11px; }
.p1-score-bar i { height: 6px; border-radius: 999px; background: var(--p1-line); overflow: hidden; }
.p1-score-bar i:after { display: block; width: var(--score-width); height: 100%; background: var(--p1-gradient); content: ''; }
.p1-score-inputs { display: grid; grid-template-columns: 1fr 80px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; color: var(--p1-text); font-size: 13px; }
.p1-score-inputs input { width: 100%; height: 40px; box-sizing: border-box; border: 1px solid var(--p1-line); border-radius: 12px; padding: 6px 10px; background: var(--p1-soft); font: inherit; font-size: 14px; font-weight: 600; }
.p1-essay-view { padding: 16px; border: 1px solid #f3f4f6; border-radius: 20px; background: var(--p1-soft); color: #1f2937; font-size: 14px; line-height: 1.9; white-space: pre-wrap; }
.p1-highlight { border-radius: 3px; padding: 0 2px; }
.p1-highlight-grammar { background: #fee2e2; color: #b91c1c; text-decoration: line-through; text-decoration-color: var(--p1-red); }
.p1-highlight-vocabulary { background: #fef3c7; color: #92400e; }
.p1-highlight-structure { background: #dbeafe; color: #1e40af; }
.p1-highlight-spelling, .p1-highlight-punctuation { background: #fee2e2; color: #b91c1c; text-decoration: line-through; text-decoration-color: var(--p1-red); }
.p1-highlight-repetition { background: #fef3c7; color: #92400e; }

/* ---------- Toast (sits above the bottom navigation) ---------- */
.p1-toast { position: fixed; z-index: 90; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: min(360px, calc(100vw - 32px)); transform: translate(-50%, 14px); opacity: 0; pointer-events: none; border-radius: 999px; padding: 10px 16px; background: #1f2937; color: #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, .2); font-size: 12px; text-align: center; transition: .2s ease; }
.p1-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Telegram login (Phase 3) ---------- */
.p1-error { margin: 10px 0 0; border: 1px solid #fecaca; border-radius: 16px; padding: 10px 14px; background: #fef2f2; color: #b91c1c; font-size: 12px; line-height: 1.5; }
.p1-code-input { font-size: 22px; font-weight: 700; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
a.p1-btn { text-decoration: none; }
.p1-btn-quiet:disabled { opacity: .5; cursor: not-allowed; }
#navAccountLabel { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Small phones (375 px) ---------- */
@media (max-width: 380px) {
  .p1-score-bar { grid-template-columns: minmax(84px, 1fr) 1fr 30px; }
  .p1-plan, .p1-list-row { flex-wrap: wrap; }
  .p1-row-main { flex-basis: 140px; }
}

/* ---------- Payment method sheet ---------- */
.p1-sheet-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(17, 24, 39, .5); animation: p1SheetFade .2s ease both; }
.p1-sheet { width: 100%; max-width: 520px; box-sizing: border-box; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: #fff; box-shadow: 0 -10px 30px rgba(0, 0, 0, .18); animation: p1SheetUp .25s ease both; }
.p1-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.p1-sheet-head h2 { margin: 0; color: var(--p1-ink); font-size: 20px; font-weight: 800; }
.p1-sheet-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 14px; background: #f3f4f6; color: #374151; font-size: 18px; cursor: pointer; }
.p1-sheet-sub { margin: 6px 0 0; color: var(--p1-muted); font-size: 13px; }
.p1-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.p1-method { display: grid; place-items: center; min-height: 96px; border: 1px solid var(--p1-line); border-radius: 20px; background: var(--p1-soft); cursor: pointer; font: inherit; transition: transform .15s ease, border-color .15s ease; }
.p1-method:active:not(:disabled) { transform: scale(.97); }
.p1-method:hover:not(:disabled) { border-color: #818cf8; }
.p1-method:disabled { opacity: .5; cursor: not-allowed; }
.p1-logo-payme { display: inline-block; padding: 6px 12px; border-radius: 8px 14px 14px 8px; background: #00cccc; color: #fff; font-size: 22px; font-weight: 800; font-style: italic; letter-spacing: -.5px; }
.p1-logo-click { display: inline-flex; align-items: center; gap: 8px; color: #111827; font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.p1-logo-click i { width: 20px; height: 20px; border: 6px solid #0a7cff; border-radius: 7px; transform: rotate(45deg); }
.p1-sheet-note { margin: 14px 0 0; color: var(--p1-muted); font-size: 12px; line-height: 1.6; text-align: center; }
@keyframes p1SheetFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes p1SheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
/* =====================================================================
   AURA skin — design tokens, top bar, bottom navigation
   ===================================================================== */
:root {
  --aura-ink: #0f1238;
  --aura-night: #0f1238;
  --aura-indigo: #4f46e5;
  --aura-indigo-600: #4338ca;
  --aura-indigo-50: #eef2ff;
  --aura-violet: #7c3aed;
  --aura-gold: #f5b544;
  --aura-gold-50: #fff7e6;
  --aura-mint: #10b981;
  --aura-canvas: #f6f7fb;
  --aura-line: rgba(15, 18, 56, .08);
  --aura-muted: #6b7280;
  --aura-faint: #9ca3af;
  --aura-brand: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --aura-shadow-sm: 0 1px 2px rgba(15, 18, 56, .06), 0 1px 1px rgba(15, 18, 56, .04);
  --aura-shadow-md: 0 8px 24px -10px rgba(15, 18, 56, .18), 0 2px 6px -2px rgba(15, 18, 56, .06);
  --aura-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Top bar ---------- */
.aura-top { position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--aura-line); }
.aura-top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 42rem; margin: 0 auto; padding: 6px 12px 6px 16px; min-height: 58px; box-sizing: border-box; }
.aura-brand { display: flex; align-items: center; gap: 10px; min-height: 46px; min-width: 0; border: 0; padding: 0; background: none; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.aura-logo { position: relative; display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; background: var(--aura-brand); box-shadow: 0 6px 14px -6px rgba(79, 70, 229, .7), inset 0 1px 0 rgba(255, 255, 255, .25); color: #fff; font-size: 19px; font-weight: 800; letter-spacing: -.5px; }
.aura-logo::after { content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--aura-gold); box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.aura-brand-text { display: flex; flex-direction: column; min-width: 0; }
.aura-name { margin: 0; color: var(--aura-ink); font-size: 17px; font-weight: 800; letter-spacing: .14em; line-height: 1.1; }
.aura-tagline { margin-top: 2px; color: var(--aura-muted); font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aura-top-chip { flex: 0 0 auto; }
.aura-chip-btn { display: flex; align-items: center; min-height: 46px; min-width: 46px; border: 0; padding: 0 4px; background: none; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.aura-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid #fde4b0; border-radius: 999px; background: var(--aura-gold-50); color: #8a5a00; font-size: 12px; font-weight: 600; white-space: nowrap; transition: transform .15s var(--aura-ease); }
.aura-chip b { color: #6b4400; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.aura-chip-btn:active .aura-chip { transform: scale(.96); }
.aura-coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe3a3 0 30%, #f5b544 31% 100%); box-shadow: inset 0 0 0 1.5px #d99a22; }
.aura-chip.is-low { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.aura-chip.is-low b { color: #991b1b; }
.aura-chip-login { border: 0; background: var(--aura-brand); color: #fff; box-shadow: 0 6px 14px -6px rgba(79, 70, 229, .7); }

/* ---------- Bottom navigation ---------- */
.aura-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid var(--aura-line); box-shadow: 0 -6px 20px -12px rgba(15, 18, 56, .18); }
.aura-nav-in { display: flex; max-width: 42rem; margin: 0 auto; padding: 0 4px; }
.nav-btn { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; padding: 7px 0 8px; border: 0; background: none; color: var(--aura-faint); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .2s var(--aura-ease); }
.nav-btn .nav-icon-wrap { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .2s var(--aura-ease), transform .2s var(--aura-ease); }
.nav-btn .nav-icon-wrap svg { transition: transform .2s var(--aura-ease); }
.nav-btn:active .nav-icon-wrap { transform: scale(.92); }
.nav-label { max-width: 100%; overflow: hidden; font-size: 11px; font-weight: 600; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.nav-btn.nav-active { color: var(--aura-indigo); }
.nav-btn.nav-active .nav-icon-wrap { background: var(--aura-indigo-50); }
.nav-btn.nav-active .nav-icon-wrap svg { transform: translateY(-1px); stroke-width: 2.3; }
.nav-btn.nav-active .nav-label { color: var(--aura-ink); font-weight: 700; }
.nav-btn.nav-active::before { content: ''; position: absolute; top: 0; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 3px 3px; background: var(--aura-brand); }
.nav-btn:focus-visible { outline: none; }
.nav-btn:focus-visible .nav-icon-wrap { box-shadow: 0 0 0 2px #a5b4fc; }

@media (max-width: 340px) { .aura-tagline { display: none; } }
@media (max-width: 380px) {
  .nav-btn .nav-icon-wrap { width: 44px; }
  .nav-label { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-btn, .nav-btn .nav-icon-wrap, .nav-btn .nav-icon-wrap svg, .aura-chip { transition: none; }
}

/* =====================================================================
   AURA skin — page canvas, Writing page, result (Feedback) screen
   ===================================================================== */
.aura-body { background: radial-gradient(120% 60% at 50% -10%, #e7e8ff 0%, rgba(231, 232, 255, 0) 60%) no-repeat, var(--aura-canvas); color: var(--aura-ink); }

/* Cards on Writing and Feedback (also restyles cards drawn by multilevel.js / task1.js there) */
#pageWriting .bg-white.rounded-3xl, #pageFeedback .bg-white.rounded-3xl { border-color: var(--aura-line); box-shadow: var(--aura-shadow-sm), 0 10px 30px -18px rgba(15, 18, 56, .22); }
#pageWriting textarea, #pageWriting input:not([type=file]):not([type=checkbox]):not([type=radio]), #pageWriting select { border: 1.5px solid #e6e8f2; border-radius: 18px; background: #f8f9fc; color: var(--aura-ink); font-size: 15px; line-height: 1.6; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
#pageWriting textarea:focus, #pageWriting input:not([type=file]):focus, #pageWriting select:focus { border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); outline: none; }
#pageWriting textarea::placeholder, #pageWriting input::placeholder { color: #a3a8bf; }

/* Exam chooser + Mock topic pills */
.topic-mode { min-height: 46px; border: 1.5px solid transparent; background: #f2f3f8; color: #4b5068; font-weight: 600; line-height: 1.25; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s var(--aura-ease); }
.topic-mode:active { transform: scale(.97); }
.topic-mode.sel { border-color: #c7d2fe; background: #fff; color: var(--aura-indigo-600); box-shadow: 0 6px 16px -10px rgba(79, 70, 229, .6); }

/* Writing form */
.aura-write-head { display: grid; gap: 4px; }
.aura-kicker { justify-self: start; padding: 4px 10px; border-radius: 999px; background: var(--aura-indigo-50); color: var(--aura-indigo-600); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.aura-write-title { margin: 2px 0 0; color: var(--aura-ink); font-size: 18px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
.aura-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--aura-ink); font-size: 14px; font-weight: 700; }
.aura-step { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--aura-night); color: #fff; font-size: 11px; font-weight: 800; }
.aura-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aura-label-row .aura-label { margin-bottom: 0; }
.aura-textbtns { display: flex; align-items: center; }
.aura-textbtn { min-height: 46px; padding: 0 8px; border: 0; background: none; color: var(--aura-muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.aura-textbtn-accent { color: var(--aura-indigo); }
.aura-wc { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 2px 0; color: var(--aura-muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.aura-wc #wordCount { color: var(--aura-ink); font-weight: 800; }
.aura-wc-goal { padding: 3px 9px; border-radius: 999px; background: #f2f3f8; color: var(--aura-muted); font-size: 11px; }
.aura-wc.is-ok .aura-wc-goal { background: #dcfce7; color: #15803d; }
.aura-wc.is-ok .aura-wc-goal::before { content: '✓ '; }
.aura-cta { min-height: 54px; padding: 0 22px; font-size: 15px; letter-spacing: .01em; }
#gradeProgress .h-2\.5 { height: 8px; background: #eceef6; }
#errorBox { border-radius: 16px; }

/* ---------- Result screen ---------- */
.aura-result-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.aura-result-title { margin: 0; color: var(--aura-ink); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.aura-pill-btn { min-height: 46px; padding: 0 16px; border: 1.5px solid #e0e3f0; border-radius: 999px; background: #fff; color: var(--aura-indigo-600); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.aura-pill-btn:active { transform: scale(.97); }
.aura-note { margin: 0; padding: 10px 14px; border: 1px solid #d1fae5; border-radius: 16px; background: #ecfdf5; color: #047857; font-size: 12px; font-weight: 500; line-height: 1.5; }

.aura-hero { position: relative; overflow: hidden; padding: 22px 20px 16px; border-radius: 28px; background: radial-gradient(120% 90% at 100% 0%, rgba(124, 58, 237, .55) 0%, rgba(124, 58, 237, 0) 55%), radial-gradient(90% 80% at 0% 100%, rgba(79, 70, 229, .45) 0%, rgba(79, 70, 229, 0) 60%), var(--aura-night); box-shadow: 0 24px 40px -24px rgba(15, 18, 56, .7); color: #fff; }
.aura-hero-main { display: flex; align-items: center; gap: 18px; }
.aura-ring, .score-ring.aura-ring { display: grid; place-items: center; width: 112px; height: 112px; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--ring, #10b981) calc(var(--pct) * 1%), rgba(255, 255, 255, .12) 0); animation: auraRingIn .9s var(--aura-ease) both; }
.aura-ring-in { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 92px; height: 92px; border-radius: 50%; background: #161a4a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.aura-ring-num { color: #fff; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.aura-ring-cap { margin-top: 4px; color: #a5b4fc; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.aura-hero-text { min-width: 0; }
.aura-hero-label { margin: 0; color: #c7d2fe !important; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.aura-hero-level { margin: 6px 0 0; color: #fff; font-size: 20px; font-weight: 800; line-height: 1.2; }
.aura-hero-level:empty { display: none; }
.aura-hero-sub { margin: 6px 0 0; color: rgba(226, 232, 255, .75); font-size: 12px; line-height: 1.45; }
.aura-hero-crit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.aura-hero-crit span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #a5b4fc; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.aura-hero-crit b { color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0; }
.aura-hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
.aura-hero-brand { display: inline-flex; align-items: center; gap: 6px; color: rgba(226, 232, 255, .7); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.aura-hero-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--aura-gold); }
.aura-hero-share { display: flex; gap: 8px; }
.aura-share { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 46px; min-height: 46px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s ease, transform .15s var(--aura-ease); }
.aura-share:active { transform: scale(.95); }
.aura-share-tg { padding: 0; background: #229ed9; }
@keyframes auraRingIn { from { transform: scale(.85) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

.aura-teacher-note { border-color: #c7d2fe !important; background: linear-gradient(135deg, #eef2ff, #f5f3ff) !important; }
.aura-section-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--aura-ink); font-size: 15px; font-weight: 800; }
.aura-section-sub { margin: 4px 0 14px; color: var(--aura-muted); font-size: 12px; }

/* Criteria tiles */
.criteria-tab { display: flex; flex-direction: column; gap: 8px; min-height: 96px; padding: 14px; border: 1.5px solid #eceef6; border-radius: 20px; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.criteria-tab.is-active { border-color: var(--crit); background: var(--crit-bg); box-shadow: 0 12px 22px -16px var(--crit); }
.crit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.crit-short { color: var(--aura-muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.crit-score { color: var(--crit-ink); font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.crit-bar { display: block; height: 6px; border-radius: 999px; background: #eef0f6; overflow: hidden; }
.criteria-tab.is-active .crit-bar { background: rgba(255, 255, 255, .7); }
.crit-bar i { display: block; height: 100%; border-radius: inherit; background: var(--crit); transition: width .6s var(--aura-ease); }
.crit-label { color: #4b5068; font-size: 11px; font-weight: 600; line-height: 1.3; }

/* Sentence-by-sentence: Pro tag and locked state */
.aura-pro-tag { padding: 2px 7px; border-radius: 999px; background: linear-gradient(135deg, #fde68a, #f5b544); color: #6b4400; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
#sentenceCard:not(.is-locked) .aura-pro-tag { display: none; }
#sentenceCard.is-locked { border-color: #fde4b0 !important; background: linear-gradient(180deg, #fffaf0 0%, #fff 60%); }
.aura-lock { padding: 16px; border-radius: 20px; background: #fff; border: 1px solid #f3e3bd; }
.aura-lock-title { margin: 0; color: var(--aura-ink); font-size: 15px; font-weight: 800; }
.aura-lock-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.aura-lock-list li { position: relative; padding-left: 24px; color: #4b5068; font-size: 13px; line-height: 1.45; }
.aura-lock-list li::before { content: ''; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #dcfce7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat; }
.aura-lock-note { margin: 12px 0; color: var(--aura-muted); font-size: 12px; }

/* Handwriting upgrade card */
.aura-upsell { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px 14px; padding: 18px; border: 1px solid #e0e3f7; border-radius: 24px; background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%); }
.aura-upsell-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #fff; color: var(--aura-violet); box-shadow: var(--aura-shadow-sm); }
.aura-upsell-title { margin: 0; color: var(--aura-ink); font-size: 15px; font-weight: 800; }
.aura-upsell-text { margin: 4px 0 0; color: #4b5068; font-size: 13px; line-height: 1.5; }
.aura-upsell-btn { grid-column: 1 / -1; min-height: 46px; border: 0; border-radius: 999px; background: var(--aura-night); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.aura-upsell-btn:active { transform: scale(.98); }

.aura-result-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.aura-btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 16px; border: 1.5px solid #e0e3f0; border-radius: 999px; background: #fff; color: var(--aura-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.aura-btn-secondary:active { transform: scale(.98); }

/* Empty states on Feedback/Progress */
#feedbackEmpty, #progressEmpty { padding: 36px 24px; }

@media (max-width: 420px) {
  #criterionPanel .grid-cols-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .aura-hero { padding: 18px 16px 14px; }
  .aura-hero-main { gap: 14px; }
  .aura-ring { width: 96px; height: 96px; }
  .aura-ring-in { width: 78px; height: 78px; }
  .aura-ring-num { font-size: 28px; }
  .aura-hero-level { font-size: 17px; }
  .aura-share span { display: none; }
  .aura-share { padding: 0; }
  .aura-result-actions { grid-template-columns: minmax(0, 1fr); }
  .aura-write-title { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .aura-ring { animation: none; }
  .crit-bar i { transition: none; }
}

/* =====================================================================
   AURA skin — logged-out landing (Writing page) and Telegram login
   ===================================================================== */
#pageWriting #authStatus.is-landing { padding: 0; border: 0; background: none; box-shadow: none; text-align: left; }
.aura-land { display: grid; gap: 12px; }
.aura-land-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; padding: 26px 22px 22px; border-radius: 28px; background: radial-gradient(110% 80% at 100% 0%, rgba(124, 58, 237, .6) 0%, rgba(124, 58, 237, 0) 55%), radial-gradient(90% 70% at 0% 100%, rgba(79, 70, 229, .5) 0%, rgba(79, 70, 229, 0) 60%), var(--aura-night); box-shadow: 0 24px 40px -24px rgba(15, 18, 56, .7); color: #fff; animation: auraRise .5s var(--aura-ease) both; }
.aura-land-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #c7d2fe; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.aura-land-title { margin: 16px 0 0; color: #fff; font-size: 30px; font-weight: 800; line-height: 1.12; letter-spacing: -.025em; }
.aura-land-title span { display: block; background: linear-gradient(90deg, #fcd34d 0%, #f5b544 40%, #c4b5fd 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aura-land-sub { margin: 12px 0 0; color: rgba(226, 232, 255, .82); font-size: 14px; line-height: 1.55; }
.aura-land-free { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; margin-top: 18px; padding: 12px 14px; border: 1px solid rgba(245, 181, 68, .35); border-radius: 16px; background: rgba(245, 181, 68, .12); color: #fde7b8; font-size: 13px; line-height: 1.45; }
.aura-land-free[hidden] { display: none; }
.aura-land-free svg { flex: 0 0 auto; color: var(--aura-gold); }
.aura-land-free b { color: #fff; }
.aura-tg-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; margin-top: 18px; border: 0; border-radius: 999px; background: #229ed9; box-shadow: 0 14px 26px -12px rgba(34, 158, 217, .9), inset 0 1px 0 rgba(255, 255, 255, .25); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; transition: transform .15s var(--aura-ease), background .15s ease; }
.aura-tg-btn:active { transform: scale(.97); background: #1c8cc2; }
.aura-land-trust { align-self: stretch; margin: 10px 0 0; color: rgba(226, 232, 255, .65); font-size: 12px; text-align: center; }
.aura-land-card { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--aura-line); border-radius: 24px; background: #fff; box-shadow: var(--aura-shadow-sm), 0 10px 30px -18px rgba(15, 18, 56, .22); animation: auraRise .5s .08s var(--aura-ease) both; }
.aura-land-feat { display: flex; gap: 12px; align-items: flex-start; }
.aura-land-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: var(--aura-indigo-50); color: var(--aura-indigo); }
.aura-land-ft { margin: 0; color: var(--aura-ink); font-size: 14px; font-weight: 700; }
.aura-land-fd { margin: 2px 0 0; color: var(--aura-muted); font-size: 12px; line-height: 1.45; }
.aura-land-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 4px; padding-top: 14px; border-top: 1px solid #f0f1f6; }
.aura-land-steps span { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #4b5068; font-size: 11px; font-weight: 600; line-height: 1.3; text-align: center; }
.aura-land-steps b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--aura-night); color: #fff; font-size: 12px; font-weight: 800; }
@keyframes auraRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Telegram login screen (Account page, drawn by phase1.js) */
.p1-auth-art { position: relative; overflow: hidden; padding: 24px 22px; border-radius: 28px; background: radial-gradient(110% 80% at 100% 0%, rgba(124, 58, 237, .6) 0%, rgba(124, 58, 237, 0) 55%), radial-gradient(90% 70% at 0% 100%, rgba(79, 70, 229, .5) 0%, rgba(79, 70, 229, 0) 60%), var(--aura-night); box-shadow: 0 24px 40px -24px rgba(15, 18, 56, .7); }
.p1-auth-art .p1-eyebrow { color: #c7d2fe; letter-spacing: .12em; }
.p1-auth-art h2 { font-size: 26px; letter-spacing: -.02em; }
.p1-auth-art p { color: rgba(226, 232, 255, .82); }
.p1-auth-form { border-color: var(--aura-line); border-radius: 24px; box-shadow: var(--aura-shadow-sm), 0 10px 30px -18px rgba(15, 18, 56, .22); }
.p1-auth-form h2 { color: var(--aura-ink); letter-spacing: -.01em; }
.p1-auth-step { gap: 8px; color: var(--aura-muted); font-weight: 600; }
.p1-auth-step b { border-color: #e0e3f0; color: var(--aura-muted); }
.p1-auth-step .is-active { background: var(--aura-night); color: #fff; }
.p1-btn-telegram { min-height: 54px; background: #229ed9; box-shadow: 0 14px 26px -12px rgba(34, 158, 217, .9); font-size: 15px; font-weight: 700; }
.p1-code-input { min-height: 60px; border-radius: 18px; }

@media (max-width: 380px) {
  .aura-land-hero { padding: 22px 18px 18px; }
  .aura-land-title { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .aura-land-hero, .aura-land-card { animation: none; }
}

/* =====================================================================
   AURA skin — plan cards (pricing page + Account) and upgrade sheet
   ===================================================================== */
.p1-plan-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px; border: 1.5px solid #eceef6; border-radius: 24px; background: #fff; box-shadow: var(--aura-shadow-sm); }
.p1-plan-card.is-best { margin-top: 10px; border: 2px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #f5b544, #7c3aed 55%, #4f46e5) border-box; box-shadow: 0 18px 36px -20px rgba(79, 70, 229, .55); }
.p1-plan-card.is-current { border-color: #c7d2fe; background: #f8f9ff; }
.p1-plan-ribbon { position: absolute; top: -11px; left: 18px; padding: 4px 10px; border-radius: 999px; background: linear-gradient(135deg, #fde68a, #f5b544); box-shadow: 0 6px 12px -6px rgba(217, 154, 34, .8); color: #5b3a00; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.p1-plan-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.p1-plan-name { color: var(--aura-ink); font-size: 17px; font-weight: 800; }
.p1-plan-save { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 800; }
.p1-plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.p1-plan-price span { color: var(--aura-ink); font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.p1-plan-price s { color: var(--aura-faint); font-size: 13px; font-weight: 600; }
.p1-plan-per { margin: 0; color: var(--aura-indigo-600); font-size: 12px; font-weight: 700; }
.p1-plan-feats { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.p1-plan-feats li { position: relative; padding-left: 26px; color: #3f4460; font-size: 13px; line-height: 1.45; }
.p1-plan-feats li::before { content: ''; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: var(--aura-indigo-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat; }
.p1-plan-card .p1-btn { margin-top: 16px; }
.p1-btn-best { min-height: 52px; background: var(--aura-night); box-shadow: 0 14px 26px -14px rgba(15, 18, 56, .9); }
.p1-plan-current { align-self: flex-start; margin-top: 14px; padding: 8px 12px; border-radius: 999px; background: var(--aura-indigo-50); color: var(--aura-indigo-600); font-size: 12px; font-weight: 700; }
.p1-included { padding: 18px; border: 1px dashed #d9dcf0; border-radius: 22px; background: #fafbff; }
.p1-included strong { color: var(--aura-ink); font-size: 14px; font-weight: 800; }
.p1-included > p { margin: 12px 0 0; color: var(--aura-muted); font-size: 11px; line-height: 1.5; }

/* Upgrade (payment method) sheet — appended to <body> */
.p1-sheet-backdrop { background: rgba(15, 18, 56, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.p1-sheet { position: relative; padding-top: 14px; border-radius: 28px 28px 0 0; }
.p1-sheet-grab { display: block; width: 40px; height: 5px; margin: 0 auto 12px; border-radius: 999px; background: #e0e3f0; }
.p1-sheet-head h2 { color: var(--aura-ink); font-size: 19px; }
.p1-sheet-close { width: 46px; height: 46px; border-radius: 50%; background: #f2f3f8; }
.p1-sheet-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 18px; background: radial-gradient(120% 120% at 100% 0%, rgba(124, 58, 237, .5) 0%, rgba(124, 58, 237, 0) 60%), var(--aura-night); color: #fff; }
.p1-sheet-plan div { display: grid; gap: 2px; min-width: 0; }
.p1-sheet-plan strong { font-size: 15px; font-weight: 800; }
.p1-sheet-plan span { color: rgba(226, 232, 255, .75); font-size: 12px; }
.p1-sheet-plan b { flex: 0 0 auto; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.p1-sheet-sub { margin-top: 14px; }
.p1-method-grid { margin-top: 10px; }
.p1-method { min-height: 92px; border: 1.5px solid #e6e8f2; background: #fff; box-shadow: var(--aura-shadow-sm); }
.p1-method:hover:not(:disabled) { border-color: #a5b4fc; box-shadow: 0 10px 20px -14px rgba(79, 70, 229, .6); }
.p1-method:disabled { background: #f8f9fc; box-shadow: none; }
.p1-sheet-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 0; color: var(--aura-muted); font-size: 12px; }
.p1-btn, .p1-plan-card, .p1-included { box-sizing: border-box; }

/* =====================================================================
   AURA skin — Account page (wallet, header, panels)
   ===================================================================== */
.p1-panel { border-color: var(--aura-line); border-radius: 24px; box-shadow: var(--aura-shadow-sm), 0 10px 30px -18px rgba(15, 18, 56, .22); }
.p1-panel h2, .p1-panel h3 { color: var(--aura-ink); font-weight: 800; }
.p1-page-head h1 { color: var(--aura-ink); letter-spacing: -.01em; }
.p1-plan { background: linear-gradient(135deg, #eef2ff, #f5f3ff); }
.p1-stat { border-color: var(--aura-line); }
.p1-panel-locked { border-color: #fde4b0; background: linear-gradient(180deg, #fffaf0 0%, #fff 70%); }

.p1-acct-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.p1-acct-avatar { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 auto; border-radius: 18px; background: var(--aura-brand); box-shadow: 0 10px 20px -10px rgba(79, 70, 229, .8); color: #fff; font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.p1-acct-head > div { min-width: 0; }
.p1-acct-head h1 { margin: 2px 0; overflow: hidden; color: var(--aura-ink); font-size: 21px; font-weight: 800; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.p1-acct-head p { margin: 0; color: var(--aura-muted); font-size: 13px; }
.p1-acct-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.p1-btn-signout { color: #b91c1c; }

.p1-wallet { position: relative; overflow: hidden; margin-bottom: 16px; padding: 20px; border-radius: 28px; background: radial-gradient(120% 90% at 100% 0%, rgba(124, 58, 237, .55) 0%, rgba(124, 58, 237, 0) 55%), radial-gradient(90% 80% at 0% 100%, rgba(79, 70, 229, .45) 0%, rgba(79, 70, 229, 0) 60%), var(--aura-night); box-shadow: 0 24px 40px -24px rgba(15, 18, 56, .7); color: #fff; }
.p1-wallet-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.p1-wallet-plan { padding: 5px 12px; border-radius: 999px; background: linear-gradient(135deg, #fde68a, #f5b544); color: #5b3a00; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.p1-wallet-note { color: rgba(226, 232, 255, .72); font-size: 12px; }
.p1-wallet-credits { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; }
.p1-wallet-credits strong { color: #fff; font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.p1-wallet-credits span { color: #c7d2fe; font-size: 15px; font-weight: 600; }
.p1-wallet-bar { height: 8px; margin-top: 16px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.p1-wallet-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #fcd34d, #f5b544); transition: width .6s var(--aura-ease); }
.p1-wallet-of { margin: 8px 0 0; color: rgba(226, 232, 255, .7); font-size: 12px; font-variant-numeric: tabular-nums; }
.p1-wallet-hint { margin: 10px 0 0; color: rgba(226, 232, 255, .82); font-size: 13px; }
.p1-wallet.is-low .p1-wallet-credits strong { color: #fca5a5; }
.p1-wallet.is-low .p1-wallet-bar i { background: linear-gradient(90deg, #f87171, #fb923c); }
.p1-wallet-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin-top: 16px; border: 0; border-radius: 999px; background: #fff; box-shadow: 0 12px 24px -14px rgba(0, 0, 0, .6); color: var(--aura-ink); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; transition: transform .15s var(--aura-ease); }
.p1-wallet-btn:active { transform: scale(.97); }
#p1Plans, #p1Queue { scroll-margin-top: calc(76px + env(safe-area-inset-top)); }

@media (max-width: 380px) {
  .p1-wallet-credits strong { font-size: 44px; }
  .p1-acct-foot { grid-template-columns: 1fr; }
}

/* =====================================================================
   AURA skin — Progress page and empty states (Progress / Feedback)
   ===================================================================== */
.aura-empty { display: flex; flex-direction: column; align-items: center; padding: 36px 24px; border: 1px solid var(--aura-line); border-radius: 28px; background: #fff; box-shadow: var(--aura-shadow-sm), 0 10px 30px -18px rgba(15, 18, 56, .22); text-align: center; }
.aura-empty-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; background: linear-gradient(135deg, #eef2ff, #f5f3ff); color: var(--aura-indigo); box-shadow: inset 0 0 0 1px #e0e3f7; }
.aura-empty-title { margin: 16px 0 0; color: var(--aura-ink); font-size: 17px; font-weight: 800; }
.aura-empty-text { max-width: 300px; margin: 6px 0 0; color: var(--aura-muted); font-size: 13px; line-height: 1.55; }
.aura-empty .aura-tg-btn { max-width: 320px; }
.login-prompt-btn.hidden { display: none !important; }
#progressStatus, #feedbackStatus { border-radius: 16px; }

.aura-prog-hero { padding: 22px 20px 18px; border-radius: 28px; background: radial-gradient(120% 90% at 100% 0%, rgba(124, 58, 237, .55) 0%, rgba(124, 58, 237, 0) 55%), radial-gradient(90% 80% at 0% 100%, rgba(79, 70, 229, .45) 0%, rgba(79, 70, 229, 0) 60%), var(--aura-night); box-shadow: 0 24px 40px -24px rgba(15, 18, 56, .7); color: #fff; }
.aura-ring-sm.aura-ring { width: 96px; height: 96px; }
.aura-ring-sm .aura-ring-in { width: 78px; height: 78px; }
.aura-ring-sm .aura-ring-num { font-size: 26px; }
.aura-prog-streak { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .08); }
.aura-prog-flame { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; background: linear-gradient(135deg, #fdba74, #f97316); color: #fff; box-shadow: 0 8px 16px -8px rgba(249, 115, 22, .9); }
.aura-prog-streak-title { margin: 0; color: #fff; font-size: 14px; font-weight: 800; }
.aura-prog-streak-sub { margin: 2px 0 0; color: rgba(226, 232, 255, .7); font-size: 12px; }

.aura-insight { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid #e0e3f7; border-radius: 22px; background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%); }
.aura-insight-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 12px; background: var(--aura-brand); color: #fff; }
.aura-insight-label { margin: 0; color: var(--aura-indigo-600); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.aura-insight-text { margin: 4px 0 0; color: var(--aura-ink); font-size: 14px; font-weight: 600; line-height: 1.45; }
.aura-chip-soft { padding: 4px 10px; border-radius: 999px; background: var(--aura-indigo-50); color: var(--aura-indigo-600); font-size: 11px; font-weight: 700; white-space: nowrap; }
.aura-chip-soft:empty { display: none; }

.aura-tl { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--aura-line); border-radius: 22px; background: #fff; box-shadow: var(--aura-shadow-sm); }
.aura-tl-band { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 58px; flex: 0 0 auto; border-radius: 18px; background: var(--band-bg); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--band) 35%, transparent); }
.aura-tl-band b { color: var(--band-ink); font-size: 20px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.aura-tl-band span { margin-top: 3px; color: var(--band-ink); font-size: 9px; font-weight: 800; letter-spacing: .12em; opacity: .7; }
.aura-tl-main { flex: 1; min-width: 0; }
.aura-tl-meta { display: flex; align-items: center; gap: 8px; color: var(--aura-faint); font-size: 12px; font-weight: 600; }
.aura-trend { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.aura-trend.is-up { background: #dcfce7; color: #15803d; }
.aura-trend.is-down { background: #fee2e2; color: #b91c1c; }
.aura-trend.is-flat { background: #f2f3f8; color: var(--aura-muted); }
.aura-tl-title { display: -webkit-box; margin: 4px 0 0; overflow: hidden; color: var(--aura-ink); font-size: 14px; font-weight: 700; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.aura-tl-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; margin-top: 6px; padding: 0 2px; border: 0; background: none; color: var(--aura-indigo); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.aura-tl-btn:active { opacity: .7; }

#pageProgress .bg-white.rounded-3xl { border-color: var(--aura-line); box-shadow: var(--aura-shadow-sm), 0 10px 30px -18px rgba(15, 18, 56, .22); }

/* =====================================================================
   AURA skin — Mock page, exam bar, pop-up dialog
   ===================================================================== */
#pageMock .bg-white.rounded-3xl { border-color: var(--aura-line); box-shadow: var(--aura-shadow-sm), 0 10px 30px -18px rgba(15, 18, 56, .22); }
#pageMock textarea, #pageMock input:not([type=file]), #pageMock select { border: 1.5px solid #e6e8f2; border-radius: 18px; background: #f8f9fc; color: var(--aura-ink); font-size: 15px; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
#pageMock textarea:focus, #pageMock input:not([type=file]):focus, #pageMock select:focus { border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); outline: none; }

.aura-mock-hero { padding: 22px 20px; border-radius: 28px; background: radial-gradient(120% 90% at 100% 0%, rgba(124, 58, 237, .55) 0%, rgba(124, 58, 237, 0) 55%), radial-gradient(90% 80% at 0% 100%, rgba(79, 70, 229, .45) 0%, rgba(79, 70, 229, 0) 60%), var(--aura-night); box-shadow: 0 24px 40px -24px rgba(15, 18, 56, .7); color: #fff; }
.aura-mock-hero h2 { margin: 14px 0 0; color: #fff; font-size: 23px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.aura-mock-hero p { margin: 8px 0 0; color: rgba(226, 232, 255, .8); font-size: 13px; line-height: 1.55; }
.aura-mock-group { margin: 16px 0 8px; color: var(--aura-faint); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.mock-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 14px; border: 1.5px solid #eceef6; border-radius: 20px; background: #fff; text-align: left; font: inherit; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s var(--aura-ease); }
.mock-opt:active { transform: scale(.98); }
.mock-opt-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 14px; background: linear-gradient(135deg, var(--opt-from), var(--opt-to)); color: var(--aura-ink); }
.mock-opt-body { flex: 1; min-width: 0; display: grid; gap: 5px; }
.mock-opt-body b { color: var(--aura-ink); font-size: 15px; font-weight: 800; }
.mock-opt-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.mock-opt-meta span { padding: 2px 8px; border-radius: 999px; background: #f2f3f8; color: #4b5068; font-size: 11px; font-weight: 600; }
.mock-opt-meta .mock-opt-time { background: var(--aura-night); color: #fff; }
.mock-opt-check { width: 22px; height: 22px; flex: 0 0 auto; border: 2px solid #d9dcea; border-radius: 50%; transition: background .15s ease, border-color .15s ease; }
.mock-opt.sel { border-color: var(--aura-indigo); box-shadow: 0 12px 24px -16px rgba(79, 70, 229, .8); }
.mock-opt.sel .mock-opt-check { border-color: var(--aura-indigo); background: var(--aura-indigo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat; }

.aura-rules { padding: 16px 18px; border: 1px solid #fde4b0; border-radius: 22px; background: #fffaf0; color: #7a4a00; }
.aura-rules-title { display: flex; align-items: center; gap: 8px; margin: 0; color: #8a5a00; font-size: 14px; font-weight: 800; }
.aura-rules ul { display: grid; gap: 6px; margin: 10px 0 0; padding: 0 0 0 18px; font-size: 12px; line-height: 1.5; }

.aura-mk-item { padding: 14px; border: 1px solid #eceef6; border-radius: 20px; background: #fff; }
.aura-mk-title { margin: 0; overflow: hidden; color: var(--aura-ink); font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.aura-mk-sub { margin: 3px 0 0; color: var(--aura-faint); font-size: 12px; }
.aura-mk-score { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; height: 54px; flex: 0 0 auto; padding: 0 8px; border-radius: 16px; background: var(--aura-night); color: #fff; }
.aura-mk-score b { font-size: 20px; font-weight: 800; line-height: 1; }
.aura-mk-score span { margin-top: 3px; color: #a5b4fc; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.aura-mk-status { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; background: #f2f3f8; color: var(--aura-muted); font-size: 11px; font-weight: 700; }
.aura-mk-status.is-pending { background: #fff7e6; color: #8a5a00; }
.aura-mk-parts { display: grid; gap: 2px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: #f8f9fc; }
.aura-mk-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.aura-mk-btn-ghost { border: 1.5px solid #e0e3f0; border-radius: 999px; background: #fff; color: var(--aura-ink); }
.aura-mk-btn-del { width: 46px; padding: 0; border: 1.5px solid #fecaca; border-radius: 999px; background: #fff; color: #dc2626; }

/* Exam screen (kept close to the real computer-based exam) */
.aura-exam-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid #e6e8f2; background: #fff; font-family: 'Inter', sans-serif; }
.aura-timer { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 10px; border-radius: 999px; background: #f2f3f8; color: var(--aura-ink); }
.aura-timer .text-red-600 { color: #dc2626; }
.aura-exam-submit { min-height: 44px; padding: 0 18px; font-size: 14px; }
.task-tab { min-height: 40px; background: #f2f3f8; color: #4b5068; }
.task-tab.act { background: var(--aura-night); color: #fff; }

/* Pop-up dialog (#modal) */
.aura-modal { background: rgba(15, 18, 56, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.aura-modal-card { padding: 22px; border-radius: 26px; background: #fff; box-shadow: 0 30px 60px -20px rgba(15, 18, 56, .5); }
#modalTitle { color: var(--aura-ink); font-size: 17px; font-weight: 800; }
#modalBtns button { min-height: 46px; }

/* =====================================================================
   AURA skin — Teacher workspace (overview, queue, roster, review, settings)
   ===================================================================== */
.p1-teach-hero { padding: 22px 20px 20px; border-radius: 28px; background: radial-gradient(120% 90% at 100% 0%, rgba(124, 58, 237, .55) 0%, rgba(124, 58, 237, 0) 55%), radial-gradient(90% 80% at 0% 100%, rgba(79, 70, 229, .45) 0%, rgba(79, 70, 229, 0) 60%), var(--aura-night); box-shadow: 0 24px 40px -24px rgba(15, 18, 56, .7); color: #fff; }
.p1-teach-hero h1 { margin: 14px 0 0; color: #fff; font-size: 24px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.p1-teach-hero > p { margin: 4px 0 0; color: rgba(226, 232, 255, .75); font-size: 13px; }
.p1-teach-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.p1-teach-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .08); }
.p1-teach-stat strong { color: #fff; font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.p1-teach-stat span { color: #a5b4fc; font-size: 11px; font-weight: 700; }
.p1-teach-cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin-top: 14px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #fde68a, #f5b544); color: #4a2f00; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; box-shadow: 0 12px 24px -14px rgba(245, 181, 68, .9); }
.p1-teach-cta:active { transform: scale(.97); }
@media (min-width: 560px) { .p1-teach-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.p1-code-ticket { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border: 1.5px dashed #c7d2fe; border-radius: 20px; background: #f8f9ff; }
.p1-code-ticket > div { min-width: 0; }
.p1-code-ticket span { color: var(--aura-muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.p1-code-ticket small { display: block; overflow: hidden; color: var(--aura-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.p1-class-code { margin: 2px 0; color: var(--aura-ink); font-size: 26px; font-weight: 800; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.p1-acct-foot-single { grid-template-columns: 1fr; }

/* Shared p1 components used across the teacher pages */
.p1-page-head h1 { font-size: 21px; }
.p1-eyebrow { color: var(--aura-indigo); letter-spacing: .1em; }
.p1-avatar { background: var(--aura-brand); color: #fff; font-weight: 800; }
.p1-list-row { padding: 14px 0; border-bottom-color: #f0f1f6; }
.p1-row-main strong { color: var(--aura-ink); font-size: 14px; }
.p1-row-main small { color: var(--aura-muted); font-size: 12px; }
.p1-list-row .p1-btn { min-height: 42px; padding: 0 16px; font-size: 13px; }
.p1-btn-quiet { min-height: 46px; }
.p1-tag { min-height: 26px; font-size: 11px; }
.p1-tag-yellow { background: #fff7e6; color: #8a5a00; }
.p1-empty { color: var(--aura-muted); }
.p1-table th { color: var(--aura-faint); font-weight: 800; }
.p1-table td { color: #4b5068; font-size: 13px; font-variant-numeric: tabular-nums; }
.p1-table td:first-child { color: var(--aura-ink); font-weight: 700; }
.p1-table tbody tr:nth-child(odd) td { background: #fafbff; }
.p1-input, .p1-textarea, .p1-select { border: 1.5px solid #e6e8f2; border-radius: 18px; background: #f8f9fc; color: var(--aura-ink); }
.p1-input:focus, .p1-textarea:focus, .p1-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
.p1-field label, .p1-label { color: var(--aura-ink); font-weight: 700; }
.p1-score-inputs { padding: 12px 0; border-bottom-color: #f0f1f6; color: var(--aura-ink); font-weight: 600; }
.p1-score-inputs input { height: 46px; border: 1.5px solid #e6e8f2; border-radius: 14px; background: #f8f9fc; color: var(--aura-ink); font-weight: 800; text-align: center; }
.p1-score-inputs input:focus { border-color: #a5b4fc; outline: none; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
.p1-essay-view { border-color: #eceef6; border-radius: 20px; background: #fafbff; color: var(--aura-ink); }
.p1-banner { border-radius: 16px; }
@media (max-width: 380px) {
  .p1-list-row .p1-btn { flex: 1 1 100%; }
  .p1-teach-hero h1 { font-size: 21px; }
}

/* =====================================================================
   AURA — exam screen: phone padding, text size, desktop split view
   ===================================================================== */
.aura-logo-img { display: block; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; box-shadow: 0 6px 14px -6px rgba(15, 18, 56, .6); }
.aura-timer.is-low { background: #fee2e2; color: #b91c1c; animation: auraPulse 1.2s ease-in-out infinite; }
.aura-timer.is-low #timer { color: #dc2626; }
@keyframes auraPulse { 50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, .15); } }
#examWords b { color: var(--aura-ink); font-weight: 800; }
.aura-exam-tools { display: flex; gap: 4px; }
.aura-exam-tool { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 44px; padding: 0 6px; border: 1.5px solid #e6e8f2; border-radius: 12px; background: #fff; color: var(--aura-ink); font: 700 13px/1 'Inter', sans-serif; cursor: pointer; }
.aura-exam-tool span { margin-left: 1px; font-size: 12px; }
.aura-exam-tool-lg { font-size: 16px; }
.aura-exam-tool:active { transform: scale(.94); }
.aura-exam-tool.aura-exam-fs { display: none; }
.aura-exam-fs.is-on { border-color: var(--aura-indigo); color: var(--aura-indigo); }

.aura-exam-body { padding: 14px 14px 96px; }
.aura-exam-topic { margin-bottom: 12px; padding: 14px 16px; border-radius: 16px; background: #eef2ff; color: var(--aura-ink); }
.aura-exam-topic #topicLabel { margin-bottom: 4px; letter-spacing: .06em; }
#examChart { margin-bottom: 12px; }
#examOverlay #examText { padding: 14px 16px; border: 1.5px solid #e6e8f2; border-radius: 16px; line-height: 1.65; }
#examOverlay #examText:focus { border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
#examOverlay #examText, #examOverlay #examTopic { font-size: var(--exam-fs, 15px); }
.aura-exam-divider { display: none; }
#taskTabs { padding: 8px 14px; }

@media (max-width: 420px) {
  .aura-wc-unit { display: none; }
  .aura-exam-bar { gap: 6px; }
  .aura-exam-submit { padding: 0 14px; }
  .aura-timer { padding: 4px 10px 4px 8px; }
}

/* Desktop / large tablets: task on the left, writing on the right, draggable middle line */
@media (min-width: 900px) {
  #examOverlay #examText, #examOverlay #examTopic { font-size: var(--exam-fs, 17px); }
  .aura-exam-tool.aura-exam-fs { display: inline-flex; }
  .aura-exam-bar { padding-left: 20px; padding-right: 20px; }
  #taskTabs { padding: 8px 20px; }
  .aura-exam-body { display: grid; grid-template-columns: var(--exam-left, 45%) 14px minmax(0, 1fr); padding: 0; overflow: hidden; }
  .aura-exam-left, .aura-exam-right { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px; }
  .aura-exam-left { padding-right: 12px; }
  .aura-exam-right { padding-left: 12px; }
  #examOverlay #examText { min-height: 100%; }
  .aura-exam-divider { display: flex; align-items: center; justify-content: center; cursor: col-resize; touch-action: none; }
  .aura-exam-divider span { width: 4px; height: 100%; max-height: 100%; border-radius: 999px; background: #e6e8f2; transition: background .15s ease, width .15s ease; }
  .aura-exam-divider:hover span, .aura-exam-divider:focus-visible span, .aura-exam-divider.is-dragging span { width: 6px; background: var(--aura-indigo); }
  .aura-exam-divider:focus-visible { outline: none; }
  #upBtn { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { .aura-timer.is-low { animation: none; } }

/* =====================================================================
   AURA — dark theme. <html data-theme="dark"> is set by the small script
   in <head> (choice saved on this device from Account → Appearance).
   ===================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --aura-ink: #e8eaf6;
  --aura-night: #1a1f4a;
  --aura-indigo: #818cf8;
  --aura-indigo-600: #a5b4fc;
  --aura-indigo-50: #232a5c;
  --aura-canvas: #0b0d1f;
  --aura-line: rgba(255, 255, 255, .09);
  --aura-muted: #a0a6c4;
  --aura-faint: #737a9c;
  --aura-gold-50: #2a2210;
  --aura-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --p1-ink: #e8eaf6;
  --p1-text: #cfd2e6;
  --p1-muted: #a0a6c4;
  --p1-faint: #737a9c;
  --p1-line: rgba(255, 255, 255, .1);
  --p1-soft: #1c2142;
  --p1-white: #151935;
  --p1-indigo: #a5b4fc;
  --p1-indigo-soft: #232a5c;
  --dk-surface: #151935;
  --dk-soft: #1c2142;
  --dk-soft-2: #242a4f;
  --dk-text: #e8eaf6;
  --dk-text-2: #c4c8de;
  --dk-text-3: #a0a6c4;
  --dk-text-4: #7a80a2;
}
html[data-theme="dark"] body, html[data-theme="dark"] .aura-body { background: radial-gradient(120% 60% at 50% -10%, #1b1f4d 0%, rgba(27, 31, 77, 0) 60%) no-repeat, #0b0d1f; color: var(--dk-text); }

/* Tailwind utilities used in the page templates */
html[data-theme="dark"] .bg-white { background-color: var(--dk-surface); }
html[data-theme="dark"] .bg-gray-50 { background-color: var(--dk-soft); }
html[data-theme="dark"] .bg-gray-100, html[data-theme="dark"] .bg-gray-200 { background-color: var(--dk-soft-2); }
html[data-theme="dark"] .bg-indigo-50, html[data-theme="dark"] .bg-indigo-100, html[data-theme="dark"] .bg-purple-100, html[data-theme="dark"] .bg-blue-100 { background-color: #232a5c; }
html[data-theme="dark"] .bg-amber-50, html[data-theme="dark"] .bg-amber-100 { background-color: #2a2210; }
html[data-theme="dark"] .bg-red-50, html[data-theme="dark"] .bg-red-100 { background-color: #3a1519; }
html[data-theme="dark"] .bg-emerald-50 { background-color: #0f2a22; }
html[data-theme="dark"] .text-gray-900, html[data-theme="dark"] .text-gray-800 { color: var(--dk-text); }
html[data-theme="dark"] .text-gray-700 { color: var(--dk-text-2); }
html[data-theme="dark"] .text-gray-600, html[data-theme="dark"] .text-gray-500 { color: var(--dk-text-3); }
html[data-theme="dark"] .text-gray-400 { color: var(--dk-text-4); }
html[data-theme="dark"] .text-indigo-600, html[data-theme="dark"] .text-indigo-700, html[data-theme="dark"] .text-purple-700, html[data-theme="dark"] .text-blue-700, html[data-theme="dark"] .text-blue-800, html[data-theme="dark"] .text-violet-700, html[data-theme="dark"] .text-violet-800 { color: #a5b4fc; }
html[data-theme="dark"] .text-amber-700, html[data-theme="dark"] .text-amber-800, html[data-theme="dark"] .text-amber-900 { color: #fcd34d; }
html[data-theme="dark"] .text-red-500, html[data-theme="dark"] .text-red-600 { color: #f87171; }
html[data-theme="dark"] .text-emerald-600, html[data-theme="dark"] .text-emerald-700, html[data-theme="dark"] .text-emerald-800, html[data-theme="dark"] .text-green-600, html[data-theme="dark"] .text-teal-700, html[data-theme="dark"] .text-teal-800 { color: #6ee7b7; }
html[data-theme="dark"] .text-rose-700, html[data-theme="dark"] .text-rose-800 { color: #fda4af; }
html[data-theme="dark"] .border-gray-100, html[data-theme="dark"] .border-gray-200, html[data-theme="dark"] .border-gray-300 { border-color: rgba(255, 255, 255, .09); }
html[data-theme="dark"] .border-indigo-100, html[data-theme="dark"] .border-indigo-200, html[data-theme="dark"] .border-indigo-400 { border-color: rgba(129, 140, 248, .3); }
html[data-theme="dark"] .border-amber-100 { border-color: rgba(252, 211, 77, .2); }
html[data-theme="dark"] .border-red-100, html[data-theme="dark"] .border-red-200 { border-color: rgba(248, 113, 113, .25); }
html[data-theme="dark"] .border-emerald-100 { border-color: rgba(110, 231, 183, .2); }

/* AURA surfaces */
html[data-theme="dark"] .aura-top { background: rgba(14, 17, 40, .86); }
html[data-theme="dark"] .aura-nav { background: rgba(14, 17, 40, .94); box-shadow: 0 -6px 20px -12px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .aura-land-card, html[data-theme="dark"] .criteria-tab, html[data-theme="dark"] .aura-tl, html[data-theme="dark"] .aura-mk-item,
html[data-theme="dark"] .mock-opt, html[data-theme="dark"] .aura-pill-btn, html[data-theme="dark"] .aura-btn-secondary, html[data-theme="dark"] .aura-empty,
html[data-theme="dark"] .p1-plan-card, html[data-theme="dark"] .aura-lock, html[data-theme="dark"] .aura-upsell-icon, html[data-theme="dark"] .aura-exam-tool,
html[data-theme="dark"] .p1-sheet, html[data-theme="dark"] .aura-modal-card, html[data-theme="dark"] .aura-mk-btn-ghost, html[data-theme="dark"] .aura-mk-btn-del,
html[data-theme="dark"] .aura-exam-bar, html[data-theme="dark"] .p1-method, html[data-theme="dark"] .p1-btn-secondary, html[data-theme="dark"] .aura-chip-btn .aura-chip:not(.aura-chip-login):not(.is-low) { background-color: var(--dk-surface); }
html[data-theme="dark"] .p1-plan-card.is-best { background: linear-gradient(var(--dk-surface), var(--dk-surface)) padding-box, linear-gradient(135deg, #f5b544, #7c3aed 55%, #4f46e5) border-box; }
html[data-theme="dark"] #pageWriting textarea, html[data-theme="dark"] #pageWriting input:not([type=file]):not([type=checkbox]):not([type=radio]), html[data-theme="dark"] #pageWriting select,
html[data-theme="dark"] #pageMock textarea, html[data-theme="dark"] #pageMock input:not([type=file]), html[data-theme="dark"] #pageMock select,
html[data-theme="dark"] .p1-input, html[data-theme="dark"] .p1-textarea, html[data-theme="dark"] .p1-select, html[data-theme="dark"] .p1-score-inputs input,
html[data-theme="dark"] .topic-mode, html[data-theme="dark"] .aura-wc-goal, html[data-theme="dark"] .crit-bar, html[data-theme="dark"] .mock-opt-meta span:not(.mock-opt-time),
html[data-theme="dark"] .aura-mk-parts, html[data-theme="dark"] .aura-trend.is-flat, html[data-theme="dark"] .aura-mk-status, html[data-theme="dark"] .p1-included,
html[data-theme="dark"] .p1-code-ticket, html[data-theme="dark"] .p1-essay-view, html[data-theme="dark"] .task-tab, html[data-theme="dark"] .aura-timer:not(.is-low),
html[data-theme="dark"] .p1-sheet-close, html[data-theme="dark"] .aura-exam-topic, html[data-theme="dark"] .p1-plan, html[data-theme="dark"] .p1-plan-card.is-current,
html[data-theme="dark"] .p1-table tbody tr:nth-child(odd) td, html[data-theme="dark"] .p1-method:disabled, html[data-theme="dark"] .aura-chip-soft { background: var(--dk-soft); color: var(--dk-text-2); }
html[data-theme="dark"] .topic-mode.sel { background: var(--dk-surface); color: #a5b4fc; border-color: rgba(129, 140, 248, .5); }
html[data-theme="dark"] .task-tab.act { background: #4f46e5; color: #fff; }
html[data-theme="dark"] .aura-chip-soft { color: #a5b4fc; }
html[data-theme="dark"] #examOverlay #examText, html[data-theme="dark"] #pageWriting textarea, html[data-theme="dark"] .p1-input, html[data-theme="dark"] .p1-textarea { color: var(--dk-text); }
html[data-theme="dark"] #examOverlay #examText { background: var(--dk-surface); }
html[data-theme="dark"] #examOverlay { background: #0f1230; color: var(--dk-text); }
html[data-theme="dark"] #examChart > div, html[data-theme="dark"] #examChart img { background: #fff; color: #0f1238; }

/* Borders that were light grey */
html[data-theme="dark"] .criteria-tab, html[data-theme="dark"] .mock-opt, html[data-theme="dark"] .aura-mk-item, html[data-theme="dark"] .p1-plan-card,
html[data-theme="dark"] .aura-pill-btn, html[data-theme="dark"] .aura-btn-secondary, html[data-theme="dark"] .aura-mk-btn-ghost, html[data-theme="dark"] .aura-exam-tool,
html[data-theme="dark"] .p1-method, html[data-theme="dark"] .aura-exam-bar, html[data-theme="dark"] #examOverlay #examText, html[data-theme="dark"] .p1-sheet-grab,
html[data-theme="dark"] #pageWriting textarea, html[data-theme="dark"] #pageMock textarea, html[data-theme="dark"] .p1-input, html[data-theme="dark"] .p1-select,
html[data-theme="dark"] .p1-textarea, html[data-theme="dark"] .p1-score-inputs input, html[data-theme="dark"] .p1-btn-secondary { border-color: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .p1-sheet-grab { background: rgba(255, 255, 255, .15); }
html[data-theme="dark"] .p1-btn-secondary, html[data-theme="dark"] .aura-btn-secondary, html[data-theme="dark"] .aura-mk-btn-ghost { color: var(--dk-text); }
html[data-theme="dark"] .p1-btn-signout { color: #f87171; }
html[data-theme="dark"] .p1-wallet-btn { color: #0f1238; }
html[data-theme="dark"] .aura-step, html[data-theme="dark"] .aura-land-steps b { background: #4f46e5; }

/* Tinted cards */
html[data-theme="dark"] .aura-insight, html[data-theme="dark"] .aura-upsell, html[data-theme="dark"] .aura-teacher-note { background: linear-gradient(135deg, #1d2250, #241d4d) !important; border-color: rgba(129, 140, 248, .25) !important; }
html[data-theme="dark"] .aura-insight-text, html[data-theme="dark"] .aura-upsell-text, html[data-theme="dark"] .crit-label, html[data-theme="dark"] .aura-land-steps span, html[data-theme="dark"] .p1-plan-feats li, html[data-theme="dark"] .aura-lock-list li { color: var(--dk-text-2); }
html[data-theme="dark"] .criteria-tab.is-active .crit-short, html[data-theme="dark"] .criteria-tab.is-active .crit-label { color: #3f4460; }
html[data-theme="dark"] .aura-rules, html[data-theme="dark"] .aura-panel-locked, html[data-theme="dark"] .p1-panel-locked, html[data-theme="dark"] #sentenceCard.is-locked { background: #221d10 !important; border-color: rgba(252, 211, 77, .25) !important; color: #fcd34d; }
html[data-theme="dark"] .aura-rules-title { color: #fcd34d; }
html[data-theme="dark"] .aura-lock { border-color: rgba(252, 211, 77, .2); }
html[data-theme="dark"] .aura-note { background: #0f2a22; border-color: rgba(110, 231, 183, .2); color: #6ee7b7; }
html[data-theme="dark"] .aura-chip:not(.aura-chip-login):not(.is-low) { border-color: rgba(245, 181, 68, .35); background: #2a2210; color: #fcd34d; }
html[data-theme="dark"] .aura-chip b { color: #fde68a; }
html[data-theme="dark"] .aura-chip.is-low { background: #3a1519; border-color: rgba(248, 113, 113, .35); color: #fca5a5; }
html[data-theme="dark"] .aura-chip.is-low b { color: #fecaca; }
html[data-theme="dark"] .aura-kicker { background: #232a5c; }
html[data-theme="dark"] .p1-tag { background: #232a5c; color: #c7d2fe; }
html[data-theme="dark"] .p1-tag-yellow { background: #2a2210; color: #fcd34d; }
html[data-theme="dark"] .p1-tag-coral { background: #3a1519; color: #fca5a5; }
html[data-theme="dark"] .p1-banner { background: #2a2210; border-color: rgba(252, 211, 77, .25); color: #fcd34d; }
html[data-theme="dark"] .p1-error { background: #3a1519; border-color: rgba(248, 113, 113, .3); color: #fca5a5; }
html[data-theme="dark"] .p1-panel, html[data-theme="dark"] .p1-auth-form { box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
html[data-theme="dark"] #pageWriting .bg-white.rounded-3xl, html[data-theme="dark"] #pageFeedback .bg-white.rounded-3xl, html[data-theme="dark"] #pageProgress .bg-white.rounded-3xl, html[data-theme="dark"] #pageMock .bg-white.rounded-3xl { box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .aura-empty-ic { background: #232a5c; box-shadow: none; }
html[data-theme="dark"] .p1-sheet-backdrop, html[data-theme="dark"] .aura-modal { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .p1-table td { border-top-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .p1-list-row, html[data-theme="dark"] .p1-score-inputs, html[data-theme="dark"] .aura-land-steps, html[data-theme="dark"] .p1-divider { border-color: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .p1-divider { background: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .annotated, html[data-theme="dark"] .p1-essay-view { color: var(--dk-text); }
html[data-theme="dark"] .aura-exam-divider span { background: rgba(255, 255, 255, .12); }

/* Appearance switch (Account page) */
.p1-theme-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 5px; border-radius: 18px; background: #f2f3f8; }
.p1-theme-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border: 0; border-radius: 14px; background: transparent; color: var(--aura-muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.p1-theme-seg button.is-on { background: #fff; color: var(--aura-ink); box-shadow: 0 4px 12px -6px rgba(15, 18, 56, .35); }
html[data-theme="dark"] .p1-theme-seg { background: var(--dk-soft); }
html[data-theme="dark"] .p1-theme-seg button.is-on { background: #2c3366; color: #fff; }
html[data-theme="dark"] .criteria-tab:not(.is-active) .crit-score { color: var(--crit); filter: brightness(1.45) saturate(1.1); }
html[data-theme="dark"] .crit-bar i { filter: brightness(1.25); }
html[data-theme="dark"] .mock-opt-ic { color: #0f1238; }
html[data-theme="dark"] #examChart p, html[data-theme="dark"] #examChart th, html[data-theme="dark"] #examChart td { color: #0f1238; }

/* =====================================================================
   Teacher insights — Class progress (Progress tab) and Common mistakes (Feedback tab)
   ===================================================================== */
.p1-ins-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.p1-ins-chips::-webkit-scrollbar { display: none; }
.p1-ins-chips button { flex: 0 0 auto; min-height: 42px; padding: 0 16px; border: 1.5px solid #e0e3f0; border-radius: 999px; background: #fff; color: var(--aura-muted); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.p1-ins-chips button.is-on { border-color: var(--aura-indigo); background: var(--aura-indigo-50); color: var(--aura-indigo-600); }
.p1-ins-avg { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.p1-ins-avg strong { color: #fff; font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.p1-ins-avg span { display: block; color: #c7d2fe; font-size: 13px; font-weight: 700; }
.p1-ins-avg small { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: rgba(226, 232, 255, .7); font-size: 12px; }
.p1-ins-bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; margin-top: 18px; padding-top: 4px; }
.p1-ins-bar { display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.p1-ins-bar b { color: #fff; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.p1-ins-bar i { display: block; width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #fcd34d, #f5b544); }
.p1-ins-bar:not(:last-child) i { background: rgba(255, 255, 255, .22); }
.p1-ins-bar span { color: rgba(226, 232, 255, .65); font-size: 10px; font-weight: 600; white-space: nowrap; }
.p1-ins-crits { display: grid; gap: 12px; }
.p1-ins-crit { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr) 34px; align-items: center; gap: 10px; }
.p1-ins-crit-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; color: #4b5068; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.p1-ins-crit-name b { flex: 0 0 auto; min-width: 34px; padding: 3px 0; border-radius: 8px; background: var(--aura-indigo-50); color: var(--aura-indigo-600); font-size: 11px; text-align: center; }
.p1-ins-crit-bar { height: 8px; border-radius: 999px; background: #eef0f6; overflow: hidden; }
.p1-ins-crit-bar i { display: block; height: 100%; border-radius: inherit; background: var(--aura-brand); }
.p1-ins-crit strong { color: var(--aura-ink); font-size: 15px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.p1-ins-crit.is-weak .p1-ins-crit-name b { background: #fee2e2; color: #b91c1c; }
.p1-ins-crit.is-weak .p1-ins-crit-bar i { background: linear-gradient(90deg, #f87171, #fb923c); }
.p1-ins-rank { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f1f6; }
.p1-ins-rank:last-child { border-bottom: 0; }
.p1-ins-pos { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 10px; background: #f2f3f8; color: var(--aura-muted); font-size: 13px; font-weight: 800; }
.p1-ins-rank:nth-child(1) .p1-ins-pos { background: linear-gradient(135deg, #fde68a, #f5b544); color: #5b3a00; }
.p1-ins-rank:nth-child(2) .p1-ins-pos { background: #e5e7eb; color: #374151; }
.p1-ins-rank:nth-child(3) .p1-ins-pos { background: #fed7aa; color: #9a3412; }
.p1-ins-band { min-width: 44px; padding: 6px 0; border-radius: 12px; background: var(--aura-night); color: #fff; font-size: 15px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.p1-ins-gap { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #fff7e6; color: #8a5a00; font-size: 11px; font-weight: 700; }
.p1-ins-gap.is-met { background: #dcfce7; color: #15803d; }
.p1-ins-rank .p1-row-main small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }

.p1-ins-types { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.p1-ins-type { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 11px; font-weight: 700; white-space: nowrap; }
.p1-ins-type b { font-weight: 800; }
.p1-ins-type-grammar, .p1-ins-type-spelling, .p1-ins-type-punctuation { background: #fee2e2; color: #b91c1c; }
.p1-ins-type-vocabulary { background: #fef3c7; color: #92400e; }
.p1-ins-type-structure { background: #dbeafe; color: #1e40af; }
.p1-ins-mistake { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0f1f6; }
.p1-ins-mistake:last-child { border-bottom: 0; }
.p1-ins-mistake-main { min-width: 0; }
.p1-ins-mistake-main p { margin: 0; color: var(--aura-ink); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.p1-ins-mistake-main small { display: block; margin-top: 3px; color: var(--aura-muted); font-size: 12px; line-height: 1.45; }
.p1-ins-wrong { color: #dc2626; text-decoration: line-through; text-decoration-thickness: 2px; }
.p1-ins-fix { color: #15803d; font-weight: 800; }
.p1-ins-mistake-meta { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 4px; }
.p1-ins-mistake-meta small { color: var(--aura-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.p1-ins-words { display: flex; flex-wrap: wrap; gap: 8px; }
.p1-ins-words span { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 14px; background: #fff7e6; color: #8a5a00; font-size: 12px; font-weight: 600; }
.p1-ins-words b { color: #5b3a00; font-size: 14px; font-weight: 800; }
#teacherProgress .p1-teach-hero h1, #teacherFeedback .p1-teach-hero h1 { overflow-wrap: anywhere; }

html[data-theme="dark"] .p1-ins-chips button { background: var(--dk-surface); border-color: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .p1-ins-chips button.is-on { background: #232a5c; border-color: #818cf8; color: #c7d2fe; }
html[data-theme="dark"] .p1-ins-crit-name { color: var(--dk-text-2); }
html[data-theme="dark"] .p1-ins-crit-bar, html[data-theme="dark"] .p1-ins-pos { background: var(--dk-soft-2); }
html[data-theme="dark"] .p1-ins-crit.is-weak .p1-ins-crit-name b { background: #3a1519; color: #fca5a5; }
html[data-theme="dark"] .p1-ins-rank, html[data-theme="dark"] .p1-ins-mistake { border-color: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .p1-ins-band { background: #4f46e5; }
html[data-theme="dark"] .p1-ins-gap { background: #2a2210; color: #fcd34d; }
html[data-theme="dark"] .p1-ins-gap.is-met, html[data-theme="dark"] .aura-trend.is-up { background: #0f2a22; color: #6ee7b7; }
html[data-theme="dark"] .aura-trend.is-down { background: #3a1519; color: #fca5a5; }
html[data-theme="dark"] .p1-ins-wrong { color: #f87171; }
html[data-theme="dark"] .p1-ins-fix { color: #6ee7b7; }
html[data-theme="dark"] .p1-ins-type { background: #232a5c; color: #c7d2fe; }
html[data-theme="dark"] .p1-ins-type-grammar, html[data-theme="dark"] .p1-ins-type-spelling, html[data-theme="dark"] .p1-ins-type-punctuation { background: #3a1519; color: #fca5a5; }
html[data-theme="dark"] .p1-ins-type-vocabulary, html[data-theme="dark"] .p1-ins-words span { background: #2a2210; color: #fcd34d; }
html[data-theme="dark"] .p1-ins-words b { color: #fde68a; }
html[data-theme="dark"] .p1-ins-type-structure { background: #172554; color: #93c5fd; }

.aura-trend { flex: 0 0 auto; white-space: nowrap; }

/* Mock-only note on Class progress, locked button */
.p1-ins-note { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0 !important; padding: 5px 10px; border-radius: 999px; background: rgba(245, 181, 68, .16); color: #fde7b8 !important; font-size: 11px !important; font-weight: 700; }
.p1-ins-note svg { flex: 0 0 auto; color: var(--aura-gold); }
.p1-ins-note-light { margin: 0 0 10px !important; background: #fff7e6; color: #8a5a00 !important; }
.p1-ins-note-light svg { color: #d99a22; }
.p1-ins-band em { display: block; margin-top: 1px; color: #c7d2fe; font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .06em; }
.p1-btn-locked { color: var(--aura-muted); }
html[data-theme="dark"] .p1-ins-note-light { background: #2a2210; color: #fcd34d !important; }

/* =====================================================================
   Bottom navigation — 3D animated icon tiles (CSS only, no images)
   ===================================================================== */
.nav-btn[data-page="writing"] { --t1: #818cf8; --t2: #6d28d9; --t3: #4c1d95; }
.nav-btn[data-page="mock"] { --t1: #fdba74; --t2: #ea580c; --t3: #9a3412; }
.nav-btn[data-page="progress"] { --t1: #6ee7b7; --t2: #059669; --t3: #065f46; }
.nav-btn[data-page="feedback"] { --t1: #f9a8d4; --t2: #db2777; --t3: #9d174d; }
.nav-btn[data-page="teacher"] { --t1: #7dd3fc; --t2: #0284c7; --t3: #075985; }
.nav-btn[data-page="account"] { --t1: #fde68a; --t2: #d97706; --t3: #92400e; }
.aura-nav .nav-btn .nav-icon-wrap { position: relative; width: 46px; height: 34px; overflow: hidden; border-radius: 13px; background: linear-gradient(165deg, #ffffff 0%, #eef0f7 100%); box-shadow: inset 0 1px 0 #fff, 0 2px 0 #dde0ec, 0 5px 10px -6px rgba(15, 18, 56, .35); transform-style: preserve-3d; transition: background .25s var(--aura-ease), box-shadow .25s var(--aura-ease), transform .2s var(--aura-ease); }
.aura-nav .nav-btn .nav-icon-wrap svg { color: #8b90a8; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9)); transition: color .25s ease, transform .25s var(--aura-ease); }
.aura-nav .nav-btn:active .nav-icon-wrap { transform: translateY(2px) scale(.94); box-shadow: inset 0 1px 0 #fff, 0 0 0 #dde0ec, 0 2px 4px -2px rgba(15, 18, 56, .3); }
.aura-nav .nav-btn.nav-active .nav-icon-wrap { background: radial-gradient(120% 90% at 30% 10%, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 45%), linear-gradient(160deg, var(--t1) 0%, var(--t2) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(0, 0, 0, .18), 0 3px 0 var(--t3), 0 10px 18px -8px var(--t2); animation: navPop .65s var(--aura-ease) both; }
.aura-nav .nav-btn.nav-active .nav-icon-wrap svg { color: #fff; stroke-width: 2.4; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .28)); animation: navFloat 3.2s ease-in-out .7s infinite; }
.aura-nav .nav-btn.nav-active .nav-icon-wrap::after { content: ''; position: absolute; top: -20%; left: -60%; width: 40%; height: 140%; background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .65), rgba(255, 255, 255, 0)); transform: skewX(-20deg); animation: navShine .9s ease-out .15s both; pointer-events: none; }
.aura-nav .nav-btn.nav-active .nav-label { color: var(--t3); }
.aura-nav .nav-btn.nav-active::before { background: linear-gradient(90deg, var(--t1), var(--t2)); }
@keyframes navPop {
  0% { transform: perspective(160px) translateY(0) rotateX(0) scale(1); }
  30% { transform: perspective(160px) translateY(-7px) rotateX(28deg) scale(1.1); }
  60% { transform: perspective(160px) translateY(1px) rotateX(-12deg) scale(.97); }
  80% { transform: perspective(160px) translateY(-2px) rotateX(4deg) scale(1.02); }
  100% { transform: perspective(160px) translateY(0) rotateX(0) scale(1); }
}
@keyframes navFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.5px) rotate(-4deg); } }
@keyframes navShine { from { left: -60%; } to { left: 130%; } }
html[data-theme="dark"] .aura-nav .nav-btn .nav-icon-wrap { background: linear-gradient(165deg, #252a52 0%, #181c3d 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 0 #0c0f26, 0 5px 10px -6px rgba(0, 0, 0, .7); }
html[data-theme="dark"] .aura-nav .nav-btn .nav-icon-wrap svg { color: #8a90b4; filter: none; }
html[data-theme="dark"] .aura-nav .nav-btn.nav-active .nav-icon-wrap { background: radial-gradient(120% 90% at 30% 10%, rgba(255, 255, 255, .4) 0%, rgba(255, 255, 255, 0) 45%), linear-gradient(160deg, var(--t1) 0%, var(--t2) 100%); }
html[data-theme="dark"] .aura-nav .nav-btn.nav-active .nav-label { color: var(--t1); }
@media (max-width: 380px) { .aura-nav .nav-btn .nav-icon-wrap { width: 42px; height: 32px; } }
@media (prefers-reduced-motion: reduce) {
  .aura-nav .nav-btn.nav-active .nav-icon-wrap, .aura-nav .nav-btn.nav-active .nav-icon-wrap svg, .aura-nav .nav-btn.nav-active .nav-icon-wrap::after { animation: none; }
}

/* Drag-and-drop upload areas (handwriting scans) */
.p1-dropzone { transition: box-shadow .15s ease, background .15s ease; }
.p1-dropzone.is-drag { box-shadow: 0 0 0 2px var(--aura-indigo), 0 12px 24px -14px rgba(79, 70, 229, .7); background: var(--aura-indigo-50) !important; }
.p1-drop-hint { display: none; margin: 8px 0 0; color: var(--aura-faint); font-size: 12px; text-align: center; }
@media (hover: hover) and (pointer: fine) { .p1-drop-hint { display: block; } }

/* Small spinner inside busy buttons (login, sign up, promo check) */
.p1-spinner { display: inline-block; width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: .85; animation: p1Spin .7s linear infinite; }
.p1-btn-secondary .p1-spinner { color: var(--p1-indigo); }
@keyframes p1Spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .p1-spinner { animation-duration: 1.6s; } }

/* Policy + AI training ticks on the login screens */
.p1-consent-box { display: grid; gap: 10px; margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--p1-line); border-radius: 16px; background: var(--p1-soft); }
.p1-consent { display: flex; gap: 10px; align-items: flex-start; color: var(--p1-text); font-size: 12px; line-height: 1.5; cursor: pointer; }
.p1-consent input { width: 18px; height: 18px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--p1-indigo); cursor: pointer; }
.p1-consent a { color: var(--p1-indigo); font-weight: 600; }

/* Promo code above the plan cards */
.p1-promo { margin: 0 0 16px; }
.p1-promo label { display: block; margin-bottom: 6px; color: var(--p1-text); font-size: 13px; font-weight: 600; }
.p1-promo-row { display: flex; gap: 8px; }
.p1-promo-row .p1-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .04em; }
.p1-promo-row .p1-btn { flex: 0 0 auto; }
.p1-promo-ok { margin: 8px 0 0; color: #15803d; font-size: 12px; font-weight: 600; }
html[data-theme="dark"] .p1-promo-ok { color: #86efac; }

/* Handwriting check screens: photo left, recognised text right on desktop. Phones keep the stacked layout. */
@media (min-width: 1024px) {
  main:has(#pageAccount:not(.hidden) .p1-scan-review), main:has(#pageTeacherPortal:not(.hidden) .p1-scan-review) { max-width: 76rem; }
  .p1-scan-pair { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 12px; }
  .p1-scan-pair > img { position: sticky; top: 88px; max-height: calc(100vh - 110px); object-fit: contain; background: var(--p1-soft); }
  .p1-scan-pair > .p1-field { margin: 0; }
  .p1-scan-pair > .p1-field .p1-textarea { min-height: 60vh !important; font-size: 13.5px; }
}

/* Full-screen zoomable page photo (scan check screens) */
img[data-p1-zoom] { cursor: zoom-in; }
.p1-zoom { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: rgba(10, 12, 30, .94); }
.p1-zoom-stage { flex: 1; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
.p1-zoom-stage.is-zoomed { cursor: grab; }
.p1-zoom-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; user-select: none; -webkit-user-select: none; }
.p1-zoom-bar { display: flex; justify-content: center; align-items: center; gap: 10px; background: #0a0c1e; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.p1-zoom-bar button { min-width: 44px; height: 44px; border: 0; border-radius: 999px; padding: 0 14px; background: rgba(255, 255, 255, .14); color: #fff; font: 600 18px/1 'Inter', sans-serif; cursor: pointer; }
.p1-zoom-bar button[data-zoom="reset"] { font-size: 14px; }
.p1-zoom-bar span { min-width: 56px; color: #e5e7eb; font: 600 13px/1 'Inter', sans-serif; text-align: center; }

/* Password box with a show/hide eye */
.p1-pass { position: relative; }
.p1-pass .p1-input { padding-right: 48px; }
.p1-pass-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; background: transparent; color: var(--p1-muted); cursor: pointer; }
.p1-pass-eye:hover, .p1-pass-eye[aria-pressed="true"] { color: var(--p1-indigo); background: var(--p1-indigo-soft); }

/* Student / Teacher switch on the login box */
.p1-role-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 18px; padding: 4px; border-radius: 999px; background: var(--p1-soft); border: 1px solid var(--p1-line); }
.p1-role-tabs button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--p1-muted); font: 600 13px/1 'Inter', sans-serif; cursor: pointer; }
.p1-role-tabs button.is-on { background: var(--p1-gradient); color: #fff; box-shadow: var(--p1-glow); }

/* Writing tab: draw attention to the task type picker when nothing was chosen */
.aura-pick-pulse { animation: auraPickPulse 1.1s ease 2; }
@keyframes auraPickPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } 40% { box-shadow: 0 0 0 4px rgba(79, 70, 229, .55); } }
.p1-fix { color: #047857; font-weight: 600; }
html[data-theme="dark"] .p1-fix { color: #6ee7b7; }

/* Long lists: the latest items in a scrolling box */
.p1-scroll { max-height: 440px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.p1-scroll::-webkit-scrollbar { width: 6px; }
.p1-scroll::-webkit-scrollbar-thumb { background: var(--p1-line); border-radius: 999px; }

/* Scan handwriting card */
.p1-scan-card { position: relative; overflow: hidden; padding: 22px; border-radius: 26px; color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, rgba(236, 72, 153, .45) 0%, rgba(236, 72, 153, 0) 55%), linear-gradient(140deg, #312e81 0%, #4f46e5 55%, #7c3aed 100%);
  box-shadow: 0 18px 36px -22px rgba(79, 70, 229, .9); }
.p1-scan-card::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.p1-scan-card-top { display: flex; gap: 14px; align-items: flex-start; }
.p1-scan-card-icon { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.p1-scan-card h2 { margin: 2px 0 4px; color: #fff; font-size: 18px; font-weight: 800; }
.p1-scan-card p { margin: 0; color: rgba(255, 255, 255, .82); font-size: 12.5px; line-height: 1.55; }
.p1-scan-card-btn { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 50px; margin-top: 16px; padding: 0 20px; border: 0; border-radius: 999px; background: #fff; color: #3730a3; font: 700 15px/1 'Inter', sans-serif; cursor: pointer; box-shadow: 0 10px 20px -12px rgba(15, 18, 56, .6); transition: transform .15s ease; }
.p1-scan-card-btn:active { transform: scale(.98); }
.p1-scan-card-btn span:last-child { font-size: 18px; }
.p1-scan-card-tags { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.p1-scan-card-tags span { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 11px; font-weight: 600; }

/* Contact card */
.p1-contact-row { display: flex; flex-wrap: wrap; gap: 10px; }
.p1-contact-row .p1-btn { flex: 1 1 200px; text-decoration: none; }

/* Delete account */
.p1-danger { border-color: #fecaca; }
.p1-btn-danger { background: #dc2626; box-shadow: 0 10px 22px -12px rgba(220, 38, 38, .8); }
html[data-theme="dark"] .p1-danger { border-color: rgba(248, 113, 113, .3); }
.p1-more { display: block; margin: 8px auto 0; font-weight: 700; }
.p1-wc { margin: 6px 2px 0; color: var(--p1-muted); font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* 3D gold coin in the credits chip (top right) */
.aura-chip { padding-left: 6px; gap: 7px; }
.aura-coin { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #fffbe8 0 10%, #ffe28a 26%, #f6bb3c 58%, #d18b12 82%, #a8680a 100%);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, .75), inset 0 -2px 2px rgba(120, 66, 0, .45), 0 2px 0 #b5730c, 0 5px 8px -3px rgba(150, 90, 0, .7);
  transform-style: preserve-3d; animation: auraCoinTurn 7s ease-in-out infinite; }
.aura-coin::before { content: ''; position: absolute; inset: 3.5px; border-radius: 50%; border: 1.5px solid rgba(170, 105, 8, .55);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 60%); }
.aura-coin::after { content: 'A'; position: relative; color: #9a5d00; font: 900 11px/1 'Inter', sans-serif; text-shadow: 0 1px 0 rgba(255, 240, 190, .9), 0 -1px 0 rgba(120, 66, 0, .35); }
.aura-chip.is-low .aura-coin { filter: saturate(.8); }
@keyframes auraCoinTurn { 0%, 78% { transform: perspective(80px) rotateY(0); } 89% { transform: perspective(80px) rotateY(180deg) scale(1.08); } 100% { transform: perspective(80px) rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .aura-coin { animation: none; } }

/* ---------- Bulk grading ---------- */
.p1-tag-red { background: #fee2e2; color: #b91c1c; }
.p1-tag-orange { background: #ffedd5; color: #c2410c; }
.p1-tag-green { background: #dcfce7; color: #15803d; }
.p1-tag .p1-spinner { width: 10px; height: 10px; margin-right: 5px; border-width: 1.5px; }
.p1-btn-orange { background: linear-gradient(135deg, #f97316, #ea580c); box-shadow: 0 10px 22px -12px rgba(234, 88, 12, .85); }
.p1-batch { display: grid; gap: 16px; }
.p1-batch-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.p1-batch-menu .p1-label { grid-column: 1 / -1; margin: 0 0 2px; }
.p1-batch-type { min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--p1-line); border-radius: 14px; background: var(--p1-white); color: var(--p1-ink); font: 600 12.5px/1.3 'Inter', sans-serif; cursor: pointer; }
.p1-batch-type:hover { border-color: #a5b4fc; background: var(--p1-indigo-soft); }
.p1-batch-items { display: grid; gap: 8px; }
.p1-batch-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; border: 1.5px solid var(--p1-line); border-radius: 16px; background: var(--p1-white); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.p1-batch-item.is-active { border-color: var(--p1-indigo); box-shadow: 0 0 0 3px var(--p1-indigo-soft); }
.p1-batch-num { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--p1-indigo-soft); color: var(--p1-indigo); font-size: 12px; font-weight: 800; }
.p1-batch-main { display: grid; gap: 2px; min-width: 0; }
.p1-batch-main strong { color: var(--p1-ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p1-batch-main small { color: var(--p1-muted); font-size: 11.5px; }
.p1-batch-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.p1-batch-add { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 10px; border: 2px dashed #c7d2fe; border-radius: 16px; background: transparent; color: var(--p1-indigo); font: 700 14px/1 'Inter', sans-serif; cursor: pointer; }
.p1-batch-add span { font-size: 20px; }
.p1-batch-actions { display: grid; gap: 8px; margin-top: 14px; }
.p1-batch-back { display: none; margin-bottom: 12px; }
@media (max-width: 1023px) {
  .p1-batch.is-editing .p1-batch-list { display: none; }
  .p1-batch:not(.is-editing) .p1-batch-editor { display: none; }
  .p1-batch-back { display: inline-flex; }
}
@media (min-width: 1024px) {
  main:has(#pageAccount:not(.hidden) .p1-batch), main:has(#pageTeacherPortal:not(.hidden) .p1-batch) { max-width: 76rem; }
  .p1-batch { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); align-items: start; }
  .p1-batch-list { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
}
.p1-batch-pill { position: fixed; z-index: 60; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 10px 16px; border: 0; border-radius: 999px; background: #1e1b4b; color: #fff; font: 600 13px/1.2 'Inter', sans-serif; box-shadow: 0 14px 28px -12px rgba(15, 18, 56, .7); cursor: pointer; }
.p1-batch-dot { width: 10px; height: 10px; border-radius: 50%; background: #f97316; box-shadow: 0 0 0 4px rgba(249, 115, 22, .3); animation: p1Pulse 1.4s ease-in-out infinite; }
@keyframes p1Pulse { 50% { box-shadow: 0 0 0 7px rgba(249, 115, 22, .05); } }
.p1-scan-card-bulk { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 10px 14px; border: 1.5px solid rgba(255, 255, 255, .35); border-radius: 18px; background: rgba(255, 255, 255, .1); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.p1-scan-card-bulk b { display: block; font-size: 14px; }
.p1-scan-card-bulk small { display: block; color: rgba(255, 255, 255, .8); font-size: 11.5px; }
.p1-scan-card-plus { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #4f46e5; font-size: 22px; font-weight: 700; line-height: 1; }
.p1-scan-card-count { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: #f97316; color: #fff; font-size: 12px; font-weight: 800; }

/* Bulk grading: do-not-lock warning */
.p1-warning { display: grid; gap: 4px; margin-bottom: 16px; padding: 14px 16px; border: 2px solid #f97316; border-radius: 18px; background: #fff7ed; color: #9a3412; font-size: 12.5px; line-height: 1.5; box-shadow: 0 10px 24px -18px rgba(234, 88, 12, .9); animation: p1WarnGlow 2.4s ease-in-out infinite; }
.p1-warning b { color: #c2410c; font-size: 14.5px; }
@keyframes p1WarnGlow { 50% { box-shadow: 0 0 0 4px rgba(249, 115, 22, .18); } }
html[data-theme="dark"] .p1-warning { background: #2a1607; border-color: #ea580c; color: #fed7aa; }
html[data-theme="dark"] .p1-warning b { color: #fdba74; }
@media (prefers-reduced-motion: reduce) { .p1-warning { animation: none; } }
