/* ====== RESET ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #000; color: #fff; }
body { font-family: 'Archivo', 'Arial Black', Arial, sans-serif; font-size: 16px; line-height: 1.5; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ====== CSS VARIABLES ====== */
:root {
  --sky:    #1A97C4;
  --sky-light: #5DD4F0;
  --pink:   #E8365A;
  --yellow: #F5E027;
  --green:  #4CB84A;
  --orange: #F5A623;
  --panel:  #1a1a1a;
  --border: rgba(255, 255, 255, 0.1);
  --muted:  rgba(255, 255, 255, 0.5);
  --max-w:  480px;
}

/* ====== TYPOGRAPHY ====== */
.font-b { font-family: 'Archivo', 'Arial Black', Arial, sans-serif; font-weight: 800; }
.font-a { font-family: 'Times New Roman', Times, serif; font-style: italic; }
.hidden { display: none !important; }

/* ====== SCREENS ====== */
/* NOTE: Never add display: to a #screen-* rule — ID beats class and locks visibility */
.screen            { display: none; position: fixed; inset: 0; overflow-y: auto; flex-direction: column; background: #000; }
.screen.active     { display: flex; }

/* ====== APP TITLE (matches Verb Master exactly) ====== */
.app-title-1 { font-family: 'Archivo', sans-serif; font-weight: 800; color: #FFFFFF; font-size: clamp(20px, 5vw, 34px); display: inline; }
.app-title-2 { font-family: 'Times New Roman', Times, serif; font-style: italic; color: var(--sky); font-size: clamp(23.5px, 5.85vw, 40.5px); display: inline; margin-left: 6px; }
/* Small header variant (screen toolbars) */
.app-title-wrap-sm .app-title-1 { font-size: 17px; }
.app-title-wrap-sm .app-title-2 { font-size: 19px; margin-left: 4px; }

/* ====== FOOTER LOGOTYPE (matches Verb Master exactly) ====== */
.footer-logo {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 14px 16px;
  background: #000;
  font-size: 13px;
  flex-shrink: 0;
}
.footer-logo .logo-en { font-family: 'Arial Black', sans-serif; font-weight: 900; color: #FFFFFF; }
.footer-logo .logo-pipe { color: #fff; margin: 0 0.4em; font-weight: 900; }
.footer-logo .logo-be { font-family: 'Times New Roman', Times, serif; font-style: italic; font-weight: 700; font-size: 15px; color: var(--sky); }
.footer-logo .logo-bilingual { font-family: 'Archivo', sans-serif; font-weight: 800; color: var(--sky); margin-left: 0.15em; }

/* ====== LANGUAGE TOGGLE ====== */
.lang-toggle { display: flex; gap: 4px; }
.lang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 4px;
}
.lang-btn.active { background: #fff; color: #000; border-color: #fff; }

/* ====== SCREEN HEADER ====== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.btn-back {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  padding: 0;
}
.btn-back:hover { color: #fff; }
.btn-exit-home,
.btn-exit-ind {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0;
}
.btn-exit-home:hover,
.btn-exit-ind:hover { color: #fff; }

/* ====== BUTTONS ====== */
.btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-family: 'Archivo', 'Arial Black', Arial, sans-serif;
  font-weight: 800;
  font-size: 15px;
  text-align: center;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: #111; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sky     { background: var(--yellow); color: #000; border-color: var(--yellow); }
.btn-sky:hover:not(:disabled) { background: #e8d200; }
.btn-yellow  { background: var(--yellow); color: #000; border-color: var(--yellow); }
.btn-yellow:hover:not(:disabled) { background: #e8d200; }
.btn-outline { background: transparent;  border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--panel); }
.btn-warning { background: #fff; color: #000; }
.btn-danger  { background: #CC0000; color: #fff; border-color: #CC0000; }

/* ====== FORMS ====== */
.form-group  { margin-bottom: 18px; }
.form-label  {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.form-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #fff;
  font-size: 16px;
}
.form-input:focus { outline: none; border-color: var(--sky); }
.form-select { -webkit-appearance: none; appearance: none; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.filter-toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-toggle-item { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; border: 1.5px solid rgba(255,255,255,0.15); font-size: 13px; font-weight: 600; cursor: pointer; }
.filter-toggle-item input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }
.filter-toggle-spell   { border-color: rgba(245,166,35,0.5);  color: rgba(245,166,35,0.9); }
.filter-toggle-gram    { border-color: rgba(76,184,74,0.5);   color: rgba(76,184,74,0.9); }
.filter-toggle-usage   { border-color: rgba(26,151,196,0.5);  color: rgba(26,151,196,0.9); }
.filter-toggle-exp     { border-color: rgba(245,224,39,0.5);  color: rgba(245,224,39,0.9); }

/* ====== ERROR / SUCCESS MESSAGES ====== */
.error-msg {
  background: rgba(204,0,0,0.12);
  border: 1px solid rgba(204,0,0,0.3);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: #ff7575;
  margin-bottom: 16px;
}
.success-msg {
  background: rgba(76,184,74,0.12);
  border: 1px solid rgba(76,184,74,0.3);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--green);
  margin-bottom: 16px;
}

/* ====== TABS ====== */
.tab-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}
.tab-btn {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab-btn.active  { color: #fff; border-bottom-color: var(--sky); }
.tab-btn:hover   { color: rgba(255,255,255,0.8); }
.tab-panel { display: none; }
.tab-panel:not(.hidden) { display: block; }

/* ====== SPLASH (screen-role) — matches Verb Master exactly ====== */
#screen-role { background: var(--sky); align-items: center; justify-content: center; transition: opacity 0.8s ease; }
.splash-logo { text-align: center; padding: 20px; }
.splash-wordmark { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3em; font-size: clamp(28px, 6.5vw, 64px); line-height: 1; text-align: center; }
.splash-line-2 { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: center; gap: 0.14em; }
.splash-line-1 { display: flex; align-items: baseline; justify-content: center; }
.splash-logo-main { font-family: 'Arial Black', sans-serif; font-weight: 900; color: #000; letter-spacing: -1px; }
.splash-pipe { color: #000; margin-left: 0.4em; font-weight: 100; font-family: Arial, sans-serif; }
.splash-be { font-family: 'Times New Roman', Times, serif; font-style: italic; font-weight: 700; color: var(--yellow); font-size: 1.2em; line-height: 1; }
.splash-bilingual { font-family: 'Archivo', sans-serif; font-weight: 800; color: var(--yellow); }
@media (min-width: 1100px) {
  .splash-wordmark { flex-direction: row; align-items: baseline; }
  .splash-line-2 { flex-wrap: nowrap; }
}

/* ====== LOGIN SCREENS ====== */
.screen-header.screen-header-login { justify-content: flex-end; border-bottom: none; padding: 14px 20px 0; }
.login-header { text-align: center; padding: 16px 20px 12px; }
.login-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: var(--max-w); margin: 0 auto; width: 100%; padding: 0 16px 20px; }

/* Pill tab-switcher (login screens — overrides base .tab-btn rules) */
.tab-switcher { display: flex; background: #1a1a1a; border: 1px solid rgba(255,255,255,0.1); border-radius: 50px; padding: 4px; margin-bottom: 6px; }
.tab-switcher .tab-btn { flex: 1; background: transparent; border: none; color: rgba(255,255,255,0.45); font-family: 'Archivo', 'Arial Black', Arial, sans-serif; font-weight: 700; font-size: 13px; padding: 10px 8px; border-radius: 50px; cursor: pointer; transition: all 0.2s; display: block; width: auto; margin-bottom: 0; border-bottom: none; white-space: nowrap; }
.tab-switcher .tab-btn.active { background: #fff; color: #000; border: none; }
.tab-switcher .tab-btn:hover:not(.active) { color: rgba(255,255,255,0.8); }

/* Login card (white for students, yellow for teacher) */
.login-card { background: #fff; border-radius: 16px; padding: 22px 20px 20px; margin-bottom: 12px; }
#screen-teacher-login .login-card { background: var(--yellow); }

/* Card form fields — light-themed (matches Verb Master exactly) */
.card-label { display: block; font-size: 10px; font-weight: 700; color: #444; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 5px; font-family: 'Archivo', sans-serif; }
.card-input { display: block; width: 100%; padding: 11px 13px; background: #f8f8f8; border: 1px solid #ddd; border-radius: 8px; color: #222; font-size: 15px; font-family: 'Archivo', sans-serif; font-weight: 500; transition: border-color 0.2s; }
.card-input:focus { outline: none; border-color: #000; background: #fff; }
/* Error override inside login card (inline, not box) */
.login-card .error-msg { background: none; border: none; border-radius: 0; padding: 0; font-size: 13px; color: #cc0000; margin: 8px 0 4px; text-align: center; font-weight: 600; }

/* Sub-tab switcher (Register | Forgot code?) */
.sub-tab-switcher { display: flex; gap: 6px; margin-bottom: 20px; }
.sub-tab-btn { flex: 1; padding: 10px 8px; border-radius: 8px; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid #e0e0e0; background: #fff; color: #555; transition: all 0.2s; }
.sub-tab-btn.active { background: #000; color: #fff; border-color: #000; }
.sub-panel { display: none; }
.sub-panel:not(.hidden) { display: block; }

/* Remember checkbox row */
.remember-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; cursor: pointer; }
.label-remember { font-size: 13px; color: #555; font-family: 'Archivo', sans-serif; }

/* Password reveal */
.input-reveal-wrap { position: relative; }
.input-reveal-wrap .card-input { padding-right: 58px; }
.btn-reveal { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: rgba(0,0,0,0.35); background: none; border: none; cursor: pointer; font-family: 'Archivo', sans-serif; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px; }
.btn-reveal:hover { color: rgba(0,0,0,0.65); }

/* Full-width button inside login card */
.btn-full { display: block; width: 100%; padding: 14px; font-size: 15px; font-weight: 800; font-family: 'Archivo', 'Arial Black', Arial, sans-serif; background: #000; color: #fff; border: none; border-radius: 10px; cursor: pointer; text-align: center; margin-top: 4px; }
.btn-full:hover:not(:disabled) { opacity: 0.88; }
.btn-full:disabled { opacity: 0.5; cursor: not-allowed; }

.teacher-access-link { display: block; color: rgba(255,255,255,0.3); font-size: 12px; font-weight: 800; text-decoration: none; text-align: center; margin-top: 14px; padding: 6px 0; }
.teacher-access-link:hover { color: rgba(255,255,255,0.6); }

/* Success / intro inside card */
.card-success { background: #e8f5e9; border-radius: 8px; padding: 12px; margin-top: 10px; font-size: 13px; color: #2e7d32; font-family: 'Archivo', sans-serif; font-weight: 600; }
.recovery-intro-text { font-size: 14px; color: #444; margin-bottom: 14px; font-family: 'Archivo', sans-serif; }

/* Register success */
.reg-success-title { font-size: 20px; margin-bottom: 12px; color: #111; }
.reg-success-code { font-size: 26px; color: #000; letter-spacing: 2px; padding: 14px; background: rgba(0,0,0,0.07); border-radius: 8px; text-align: center; margin-bottom: 12px; }
.reg-success-msg { font-size: 13px; color: #555; margin-bottom: 20px; line-height: 1.5; }

/* ====== WELCOME SCREEN ====== */
.welcome-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  text-align: center;
}
.welcome-name {
  font-size: 32px;
  color: #fff;
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  margin-bottom: 8px;
}
.welcome-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 48px;
}

.home-state {
  padding: 16px 0;
}
.home-state-icon  { font-size: 48px; text-align: center; margin-bottom: 16px; }
.home-state-title { font-size: 22px; font-weight: 800; margin-bottom: 10px; text-align: center; }
.home-state-body  {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 28px;
  text-align: center;
  line-height: 1.6;
}
.home-state-btns { display: flex; flex-direction: column; gap: 12px; }
.home-loading {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ====== INDEPENDENT HOME ====== */
.independent-home-inner {
  flex: 1;
  padding: 24px 24px 40px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
}
.student-greeting {
  font-size: 22px;
  margin-bottom: 24px;
}
.btn-icon { margin-right: 6px; }

/* ---- Independent home — Phase 8 ---- */
.ind-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ind-section-title  { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.ind-cap-msg        { font-size: 13px; color: var(--muted); margin: 8px 0 0; text-align: center; }
.btn-start-ind      { margin-top: 16px; width: 100%; }
.btn-gear           { background: none; border: none; color: rgba(255,255,255,0.45); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.btn-gear:hover     { color: #fff; }

/* History rows */
.ind-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.ind-history-item:last-child { border-bottom: none; }
.ind-history-info   { flex: 1; min-width: 0; }
.ind-history-title  { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind-history-meta   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ind-history-badge  { flex-shrink: 0; }

/* Analytics rows */
.ind-pattern-item   { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ind-pattern-label  { flex: 1; font-size: 13px; }
.ind-pattern-bar    { width: 80px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.ind-pattern-fill   { height: 100%; background: var(--pink); border-radius: 3px; }
.ind-pattern-count  { font-size: 12px; color: var(--muted); width: 36px; text-align: right; }

/* Self-edit badge */
.badge-self-edit { background: rgba(245,166,35,0.2); color: var(--orange); }

/* Disabled start-writing button */
.btn-disabled { opacity: 0.4; cursor: not-allowed; }

/* Small note under an assignment card (e.g. "Analyzing — takes 5 min") */
.acard-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ====== WRITING TYPE PICKER ====== */
.write-type-inner {
  flex: 1;
  padding: 28px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.write-type-title { font-size: 20px; font-weight: 800; margin-bottom: 28px; text-align: center; }
.write-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.write-type-grid .btn-type-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.btn-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
}
.btn-type-card:hover { border-color: var(--sky); }
.type-emoji { font-size: 30px; }
.type-label { font-size: 14px; font-weight: 800; color: #fff; }

/* ====== WRITING PROMPT PICKER ====== */
.write-prompt-inner {
  flex: 1;
  padding: 28px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.write-prompt-type-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.write-prompt-subtitle   { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.write-prompt-list       { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.btn-prompt {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  padding: 14px 16px;
  font-size: 14px;
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-weight: normal;
  text-align: left;
  cursor: pointer;
  line-height: 1.5;
  width: 100%;
}
.btn-prompt:hover { border-color: var(--sky); }
.btn-my-own { margin-top: 6px; }

/* ====== ACCOUNT CREATED SUCCESS ====== */
.success-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}
.success-box-title { font-size: 20px; font-weight: 800; color: var(--green); margin-bottom: 12px; }
.success-box p     { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 16px; line-height: 1.6; white-space: pre-line; }
.your-code-label   { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.code-display {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--sky);
  background: rgba(26,151,196,0.1);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
}

/* ====== SCREEN HEADER EXTRAS ====== */
.screen-header-title { font-size: 15px; flex: 1; text-align: center; }
.header-right { display: flex; align-items: center; gap: 10px; }
.dash-teacher-name { font-size: 13px; color: var(--muted); font-weight: 800; }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; display: inline-block; }

/* ====== TEACHER DASHBOARD ====== */
.dash-inner {
  flex: 1;
  padding: 20px 24px 40px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
/* Teacher dashboard classes tab — needs full desktop width */
.dash-inner-wide {
  max-width: 1100px;
}
.dash-section { margin-bottom: 32px; }
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-section-title { font-size: 15px; margin-bottom: 14px; }
.dash-section-header .dash-section-title { margin-bottom: 0; }
.dash-empty-state { font-size: 14px; color: var(--muted); padding: 16px 0; line-height: 1.6; }
.dash-muted-note  { font-size: 14px; color: var(--muted); }
.dash-add-btn { margin-top: 14px; }

/* ====== SHARED PANEL BOX ====== */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

/* ====== CLASS GRID ====== */
.classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* ====== CLASS CARDS ====== */
.class-card { display: flex; flex-direction: column; gap: 12px; }
.class-card:hover { border-color: var(--sky); }
.class-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.class-card-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  font-family: 'Archivo', sans-serif;
  line-height: 1.3;
}
.class-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.class-meta-text { font-size: 12px; color: rgba(255,255,255,0.4); font-family: 'Archivo', sans-serif; }
.class-card-stats { display: flex; gap: 16px; }
.class-stat { font-size: 13px; color: rgba(255,255,255,0.5); font-family: 'Archivo', sans-serif; }
.class-stat strong { color: #fff; }
.class-code-pill {
  background: var(--sky);
  color: #fff;
  border-radius: 50px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Archivo', sans-serif;
  white-space: nowrap;
}
.class-code-pill.class-code-lg { font-size: 13px; padding: 4px 12px; white-space: nowrap; flex-shrink: 0; }
.class-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ====== BUTTONS — inline / small variants ====== */
/* Override .btn's block/full-width defaults for use inside tables and flex rows */
.btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
}
/* Tiny pencil icon button — sits inline next to a name */
.btn-pencil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 2px 5px;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  vertical-align: middle;
  line-height: 1;
}
.btn-pencil:hover { background: #111; }

/* ====== STUDENT TABLE ====== */
.students-table { width: 100%; border-collapse: collapse; }
.students-table thead { background: #111; }
.students-table th {
  text-align: left;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  font-family: 'Archivo', sans-serif;
  padding: 9px 12px;
  white-space: nowrap;
}
.students-table td {
  padding: 11px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 13px;
  color: #fff;
  vertical-align: middle;
}
.students-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.student-name-cell { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.student-name { font-weight: 700; color: #fff; white-space: nowrap; }
.student-blocked td { opacity: 0.55; }
.action-btns { display: inline-flex; gap: 5px; flex-wrap: nowrap; align-items: center; }
.td-actions { width: 1%; white-space: nowrap; }
.level-select-inline {
  background: #1a1a1a;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 4px 6px;
  font-family: 'Archivo', 'Arial Black', Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s;
}
.level-select-inline:hover { border-color: rgba(255,255,255,0.4); }

/* ====== INPUT SHAKE (wrong code) ====== */
.input-wrong { animation: shake 0.4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* ====== STUDENT FILTER ====== */
.stu-filter-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 2px;
}
.btn-xs.stu-filter-active { background: var(--sky); color: #000; border-color: var(--sky); }

/* ====== STUDENT TABLE — dashboard overview ====== */
.col-stat { text-align: center; font-size: 14px; font-weight: 700; white-space: nowrap; }
.col-muted { color: rgba(255,255,255,0.45); font-size: 13px; }
.error-tag {
  display: inline-block;
  font-size: 11px;
  font-family: 'Archivo', sans-serif;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 2px 6px;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}
.count-badge {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: 700;
  margin-left: 4px;
}

/* ====== STUDENT DETAIL MODAL ====== */
.stu-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.stu-detail-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.stu-detail-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.stu-detail-section-title {
  font-size: 12px;
  font-weight: 700;
  font-family: 'Archivo', sans-serif;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stu-detail-count {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}
.stu-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
}
.stu-detail-row:first-of-type { border-top: none; }
.stu-error-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.stu-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.stu-progress-fill {
  height: 100%;
  background: var(--sky);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ====== REVIEW BADGE ====== */
.review-badge {
  display: inline-block;
  background: var(--pink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ====== STATUS BADGES ====== */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.status-none         { background: rgba(255,255,255,0.08); color: var(--muted); }
.status-submitted    { background: rgba(245,224,39,0.15);  color: var(--yellow); }
.status-analyzing    { background: rgba(245,224,39,0.15);  color: var(--yellow); }
.status-review       { background: rgba(232,54,90,0.2);    color: var(--pink); }
.status-ready        { background: rgba(76,184,74,0.15);   color: var(--green); }
.status-in-progress  { background: rgba(26,151,196,0.15);  color: var(--sky); }
.status-completed    { background: rgba(76,184,74,0.15);   color: var(--green); }

/* ====== STUDENT ROWS (class detail) ====== */
.student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.student-row:last-child { border-bottom: none; }
.student-row-left { flex: 1; min-width: 0; }
.student-row-name { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-assign-student {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.btn-assign-student:hover { border-color: var(--sky); }

/* ====== ASSIGNMENT ROWS ====== */
.assignment-row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.assignment-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.assignment-row-title { font-size: 14px; font-weight: 800; flex: 1; }
.assignment-row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-edit-assign, .btn-delete-assign {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
}
.btn-edit-assign:hover   { color: #fff; border-color: var(--sky); }
.btn-delete-assign:hover { color: var(--pink); border-color: var(--pink); }
.assignment-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.assignment-topic-preview {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ====== ASSIGNMENT CREATE FORM ====== */
.assign-context-bar {
  background: rgba(26,151,196,0.1);
  border: 1px solid rgba(26,151,196,0.25);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--sky);
  font-weight: 800;
  margin-bottom: 20px;
}
.assign-context-bar:empty { display: none; }
.form-row { display: flex; gap: 12px; }
.form-half { flex: 1; min-width: 0; }
.form-textarea { resize: vertical; min-height: 80px; }
.req { color: var(--pink); }
.form-note { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.radio-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.radio-option { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.radio-option input[type="radio"] { width: 16px; height: 16px; flex-shrink: 0; }
.category-checkboxes {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.category-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 4px;
}
.category-tier-header:first-child { margin-top: 0; }
.category-tier-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}
.category-check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.category-check-row input[type="checkbox"] { width: 14px; height: 14px; flex-shrink: 0; }
.btn-advanced-toggle {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0;
  margin-bottom: 16px;
  cursor: pointer;
  display: block;
}
.btn-advanced-toggle:hover { color: #fff; }

/* ====== PHASE 9 — ANALYTICS ====== */
.analytics-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.btn-link-sm  { background: none; border: none; color: var(--sky); font-size: 13px; cursor: pointer; padding: 0; }
.btn-link-sm:hover { text-decoration: underline; }
.analytics-sub { font-size: 12px; color: var(--muted); margin: 0 0 14px; }

/* Hotspot row (class view) */
.hotspot-item  { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.hotspot-item:last-child { border-bottom: none; }
.hotspot-label { flex: 1; font-size: 14px; }
.hotspot-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.trend-tag     { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.trend-up      { background: rgba(232,54,90,0.15);  color: var(--pink);  }
.trend-down    { background: rgba(76,184,74,0.15);  color: var(--green); }
.trend-flat    { background: rgba(255,255,255,0.06); color: var(--muted); }

/* Per-student analytics rows */
.analytics-item  { padding: 10px 0; border-bottom: 1px solid var(--border); }
.analytics-item:last-child { border-bottom: none; }
.analytics-row1  { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.analytics-cat   { flex: 1; font-size: 14px; font-weight: 600; }
.analytics-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { font-size: 11px; border-radius: 4px; padding: 2px 7px; font-weight: 600; }
.chip-first  { background: rgba(76,184,74,0.2);   color: var(--green);  }
.chip-retry  { background: rgba(245,166,35,0.2);  color: var(--orange); }
.chip-fail   { background: rgba(232,54,90,0.15);  color: var(--pink);   }

/* Analytics modal */
.modal-analytics-box { max-width: 440px; }

/* Analytics button on student row */
.btn-analytics { background: none; border: 1px solid var(--border); color: var(--sky); font-size: 11px; border-radius: 6px; padding: 3px 8px; cursor: pointer; white-space: nowrap; }
.btn-analytics:hover { background: rgba(26,151,196,0.1); }

/* Phase 11 — Master Teacher control panel */
.taxonomy-tier-header { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; padding: 10px 0 4px; }
.taxonomy-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.taxonomy-row:last-child { border-bottom: none; }
.taxonomy-row-label { flex: 1; font-size: 13px; font-weight: 600; }
.taxonomy-row-label.inactive-cat { color: var(--muted); text-decoration: line-through; font-weight: 400; }
.taxonomy-tier-select { background: #1a1a1a; color: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; font-size: 12px; }
.taxonomy-tier-select:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-taxonomy-toggle { font-size: 11px; border-radius: 6px; padding: 2px 8px; cursor: pointer; white-space: nowrap; }
.btn-taxonomy-deactivate { color: #cc0000; border: 1px solid rgba(204,0,0,0.3); background: none; }
.btn-taxonomy-deactivate:hover { background: rgba(204,0,0,0.1); }
.btn-taxonomy-reactivate { color: var(--green); border: 1px solid rgba(76,184,74,0.3); background: none; }
.btn-taxonomy-reactivate:hover { background: rgba(76,184,74,0.1); }
.topic-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.topic-row:last-child { border-bottom: none; }
.topic-row-label { flex: 1; font-size: 13px; }
.btn-topic-remove { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; background: none; cursor: pointer; }
.btn-topic-remove:hover { color: #cc0000; border-color: rgba(204,0,0,0.3); }
.teacher-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.teacher-row:last-child { border-bottom: none; }
.teacher-row-info { flex: 1; min-width: 0; }
.teacher-row-name { font-size: 13px; font-weight: 600; }
.teacher-row-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.btn-teacher-delete { font-size: 11px; color: #cc0000; border: 1px solid rgba(204,0,0,0.3); border-radius: 6px; padding: 3px 10px; background: none; cursor: pointer; flex-shrink: 0; }
.btn-teacher-delete:hover { background: rgba(204,0,0,0.1); }
.settings-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.settings-row-label { font-size: 13px; flex: 1; }
.settings-saved-note { font-size: 11px; color: var(--green); opacity: 0; transition: opacity 0.4s; pointer-events: none; }
.settings-saved-note.visible { opacity: 1; }
.master-badge-type { font-size: 9px; font-weight: 700; color: var(--yellow); vertical-align: middle; margin-left: 4px; }

/* Phase 10 — Taxonomy Proposals */
.proposal-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.proposal-item:last-child { border-bottom: none; }
.proposal-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.proposal-label { font-weight: 700; font-size: 14px; }
.proposal-count { font-size: 11px; background: var(--yellow); color: #000; border-radius: 10px; padding: 1px 7px; font-weight: 700; }
.proposal-meta { font-size: 12px; color: var(--muted); margin: 2px 0; line-height: 1.4; }
.proposal-meta strong { color: rgba(255,255,255,0.7); }
.btn-proposal-dismiss { font-size: 11px; color: #cc0000; border: 1px solid rgba(204,0,0,0.3); border-radius: 6px; padding: 2px 8px; margin-top: 6px; background: none; cursor: pointer; }
.btn-proposal-dismiss:hover { background: rgba(204,0,0,0.1); }

/* ====== MODALS ====== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
}
.modal-box {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px 16px 0 0;
  padding: 28px 24px 32px;
  width: 100%;
  max-width: var(--max-w);
  max-height: 90vh;
  overflow-y: auto;
}
/* Centered modal variant — used for wider modals that need full visibility */
.modal-backdrop-centered {
  align-items: center;
  padding: 24px;
}
.modal-backdrop-centered .modal-box {
  border-radius: 16px;
  max-height: 85vh;
}
.modal-title { font-size: 18px; margin-bottom: 20px; }
.modal-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* Terms & Conditions modal */
.modal-terms-box {
  display: flex;
  flex-direction: column;
  max-width: 520px;
  max-height: 85vh;
  overflow: hidden;
}
.modal-terms-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 6px;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}
.terms-h { font-size: 13px; font-weight: 700; color: #fff; margin: 16px 0 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.terms-sub { color: rgba(255,255,255,0.5); font-size: 13px; margin-bottom: 12px; }
.terms-inline-link {
  background: none;
  border: none;
  padding: 0;
  color: #000;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
}

/* ====== STUDENT CODE RESULTS LIST (class creation) ====== */
.student-code-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.student-code-result:last-child { border-bottom: none; }
.student-code-name  { font-size: 14px; flex: 1; }
.student-code-value { font-size: 16px; letter-spacing: 2px; color: var(--sky); }

.modal-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* ====== STUDENT PROFILE (first login) ====== */
.profile-inner {
  flex: 1;
  padding: 40px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.profile-welcome-title { font-size: 22px; margin-bottom: 8px; }
.profile-welcome-body  {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ====== PLACEHOLDER SCREENS ====== */
.placeholder-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.placeholder-icon { font-size: 48px; margin-bottom: 16px; }

/* ====== PHASE 4 — STUDENT HOME (multi-section) ====== */
.student-home-inner {
  flex: 1;
  padding: 24px 20px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
}
.student-home-greeting {
  font-size: 20px;
  margin-bottom: 28px;
}
.home-section {
  margin-bottom: 28px;
}
.home-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 12px;
}
.home-empty-msg {
  font-size: 14px;
  color: var(--muted);
  padding: 16px 0;
  line-height: 1.5;
}
.home-own-btn {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-size: 15px;
}

/* Assignment card (student home) */
.assign-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.acard-info    { flex: 1; min-width: 0; }
.acard-title   { font-size: 15px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard-meta    { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acard-due     { font-size: 12px; color: var(--muted); }
.acard-action  { flex-shrink: 0; }
.acard-btn     { white-space: nowrap; }

/* Assignment status badges (student home cards) */
.acard-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  border-radius: 4px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-draft     { background: rgba(255,255,255,0.08); color: var(--muted); }
.badge-analyzing { background: rgba(245,224,39,0.15);  color: var(--yellow); }
.badge-review    { background: rgba(232,54,90,0.2);    color: var(--pink); }
.badge-ready     { background: rgba(76,184,74,0.2);    color: var(--green); }
.badge-inprogress{ background: rgba(26,151,196,0.15);  color: var(--sky); }
.badge-completed { background: rgba(76,184,74,0.15);   color: var(--green); }
.badge-error     { background: rgba(204,0,0,0.2);      color: #ff7575; }

/* ====== PHASE 4 — WRITING SCREEN ====== */
.writing-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  gap: 16px;
}
.writing-brief      { margin-bottom: 4px; }
.writing-topic-display {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  margin-bottom: 6px;
}
.writing-guideline-display {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.writing-textarea {
  width: 100%;
  min-height: 300px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  line-height: 1.65;
  padding: 14px 16px;
  resize: vertical;
  font-family: 'Times New Roman', Times, serif;
}
.writing-textarea:focus { outline: none; border-color: var(--sky); }
.writing-save-msg {
  font-size: 12px;
  color: var(--green);
  text-align: right;
  margin-top: -8px;
}

/* Bilingual pair component */
.writing-pairs-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 12px; }
.pair-row { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.pair-es-wrap { background: rgba(255,255,255,0.04); padding: 2px; border-bottom: 1px solid var(--border); }
.pair-en-wrap { background: transparent; padding: 2px; position: relative; }
.pair-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15px;
  line-height: 1.55;
  padding: 10px 12px;
  resize: none;
  font-family: inherit;
}
.pair-textarea:focus { outline: none; }
.pair-es-wrap .pair-textarea { color: rgba(255,255,255,0.75); font-family: 'Times New Roman', Times, serif; font-style: italic; }
.btn-remove-pair {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 18px;
  color: var(--muted);
  padding: 0 4px;
  line-height: 1;
}
.btn-remove-pair:hover { color: #fff; }
.btn-add-pair { margin-top: 4px; }

/* Proofreading overlay */
.writing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}
.overlay-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}
.overlay-title   { font-size: 22px; margin-bottom: 16px; }
.proofread-warning {
  font-size: 13px;
  color: var(--yellow);
  margin-bottom: 16px;
  line-height: 1.5;
}
.overlay-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* Narrow action buttons — shrink from full-width to text-fitted, centred in flex column */
#btn-submit-writing,
#btn-view-corrections,
#btn-countdown-home,
#btn-submitted-home {
  display: inline-block;
  width: auto;
  min-width: 200px;
  padding: 14px 24px;
  align-self: center;
}

/* Post-submission states */
.submission-icon { font-size: 48px; margin-bottom: 16px; text-align: center; }
.submission-state-title { font-size: 24px; margin-bottom: 10px; text-align: center; }
.submission-state-body  {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
}
.countdown-display {
  font-size: 52px;
  text-align: center;
  color: var(--sky);
  margin-bottom: 24px;
  letter-spacing: 2px;
}
.placeholder-note { color: var(--muted); font-size: 14px; margin-top: 8px; }


/* ====== PHASE 6 — ERROR REVIEW ====== */
.review-split {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.review-text-panel {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  flex: 0 0 40%;
  min-height: 0;
  overflow: hidden;
}
.review-text-panel-inner {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}
.review-card-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
}
@media (min-width: 600px) {
  .review-split { flex-direction: row; }
  .review-text-panel {
    flex: 0 0 55%;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
  .review-card-panel { flex: 1; }
}
.review-text-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.review-text {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255,255,255,0.85);
  white-space: pre-wrap;
  word-break: break-word;
}
.review-text .text-error {
  background: var(--yellow);
  color: #000;
  border-radius: 3px;
  padding: 1px 3px;
  font-weight: 700;
}
.span-cluster-badge {
  display: inline-block;
  background: #000;
  color: var(--yellow);
  font-size: 9px;
  font-weight: 800;
  font-family: 'Archivo', sans-serif;
  border-radius: 3px;
  padding: 1px 3px;
  margin-left: 2px;
  vertical-align: super;
  line-height: 1;
}
.review-text .text-corrected-grammar {
  background: rgba(76,184,74,0.25);
  color: var(--green);
  border-radius: 3px;
  padding: 1px 3px;
  font-weight: 700;
}
.review-text .text-corrected-spelling {
  background: rgba(245,166,35,0.25);
  color: var(--orange);
  border-radius: 3px;
  padding: 1px 3px;
  font-weight: 700;
}
.review-text .text-corrected-usage {
  background: rgba(26,151,196,0.25);
  color: var(--sky);
  border-radius: 3px;
  padding: 1px 3px;
  font-weight: 700;
}
.review-text .text-corrected-expression {
  background: rgba(245,224,39,0.15);
  color: var(--yellow);
  border-radius: 3px;
  padding: 1px 3px;
  font-weight: 700;
}
.missing-word-marker {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: var(--yellow);
  border-radius: 3px;
  margin: 0 3px;
  vertical-align: middle;
}
.missing-word-inactive {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: rgba(245,224,39,0.35);
  border-radius: 3px;
  margin: 0 3px;
  vertical-align: middle;
}
/* ── Expression suggestion spans in text ── */
.text-expression-suggestion {
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 2px;
  cursor: pointer;
  transition: color 0.15s;
}
.text-expression-suggestion:hover { color: var(--yellow); }
.text-expression-active {
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 2.5px;
  color: var(--yellow);
  cursor: pointer;
  font-weight: 700;
}

/* ── Expression card content ── */
.review-exp-original {
  font-size: 15px;
  color: rgba(255,255,255,0.45);
  text-decoration: line-through;
  margin-bottom: 4px;
}
.review-exp-try {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.review-exp-suggestion {
  font-size: 19px;
  font-weight: 800;
  color: var(--yellow);
  margin-bottom: 8px;
  font-family: 'Archivo', Arial Black, sans-serif;
}
.review-exp-explanation {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  margin: 0 0 4px;
  line-height: 1.5;
}

/* ── Spelling tile card ── */
.spell-answer-display {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.spell-answer-char {
  font-family: 'Archivo', Arial Black, sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
}
.spell-placeholder { color: rgba(255,255,255,0.25); font-size: 20px; font-weight: 700; }
.spell-tiles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}
.spell-tile {
  font-family: 'Archivo', Arial Black, sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 7px 12px;
  min-width: 36px;
  text-align: center;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
}
.spell-tile:hover { background: rgba(255,255,255,0.2); transform: scale(0.94); }
.spell-controls-row { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 8px; }
@keyframes spellShake {
  0%,100% { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  50%  { transform: translateX(6px); }
  80%  { transform: translateX(-3px); }
}
.spell-wrong { animation: spellShake 0.4s ease; }

.review-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
#review-progress { margin-left: auto; font-size: 13px; white-space: nowrap; }
.review-filter-btn {
  flex: 0;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.review-filter-btn:hover:not(:disabled) { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.8); }
.review-filter-btn.active-spell   { border-color: var(--orange); color: var(--orange); background: rgba(245,166,35,0.12); }
.review-filter-btn.active-grammar { border-color: var(--green);  color: var(--green);  background: rgba(76,184,74,0.12); }
.review-filter-btn.active-usage   { border-color: var(--sky);    color: var(--sky);    background: rgba(26,151,196,0.12); }
.review-filter-btn.active-exp     { border-color: var(--yellow); color: var(--yellow); background: rgba(245,224,39,0.12); }
.review-filter-btn:disabled { opacity: 0.3; cursor: default; }
.review-filter-btn .filter-count { font-size: 9px; margin-left: 3px; opacity: 0.8; }
.review-done-panel { padding: 16px 16px 24px; text-align: center; flex-shrink: 0; }
.review-done-title { font-size: 22px; margin: 0 0 10px; }
.review-reread-note { font-size: 16px; color: rgba(255,255,255,0.75); margin: 0 0 20px; letter-spacing: 0.3px; }
.review-done-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-review-home { background: #333; color: #fff; border: none; border-radius: 10px; padding: 14px 28px; font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.btn-review-edit { background: #000; color: #fff; border: 1.5px solid rgba(255,255,255,0.25); border-radius: 10px; padding: 14px 28px; font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit; transition: background 0.15s, border-color 0.15s; }
.btn-review-edit:hover { border-color: rgba(255,255,255,0.6); }
.btn-review-home:hover { background: #444; }
.review-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.review-card.tint-spelling   { background: rgba(245,166,35,0.15);  border-color: rgba(245,166,35,0.3); }
.review-card.tint-grammar    { background: rgba(76,184,74,0.15);   border-color: rgba(76,184,74,0.3); }
.review-card.tint-usage      { background: rgba(26,151,196,0.15);  border-color: rgba(26,151,196,0.3); }
.review-card.tint-expression { background: rgba(245,224,39,0.15);  border-color: rgba(245,224,39,0.3); }
.review-cat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sky);
}
.review-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.option-btn {
  width: 100%;
  text-align: left;
  background: #000;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.option-btn:hover:not(:disabled) { border-color: var(--sky); }
.option-btn.correct           { background: var(--green);  border-color: var(--green); }
.option-btn.wrong             { background: #cc0000;        border-color: #cc0000; }
.option-btn.secondary-correct { background: rgba(245,224,39,0.15); border-color: var(--yellow); color: var(--yellow); }
.option-btn:disabled { cursor: default; }

/* Correction method picker */
.correction-method-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.correction-method-option { display: flex; align-items: center; gap: 6px; }
.correction-method-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.correction-method-btn:hover { border-color: rgba(255,255,255,0.5); color: #fff; }
.correction-method-btn.active { border-color: var(--sky); color: var(--sky); background: rgba(26,151,196,0.12); }
.btn-info {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.btn-info:hover { border-color: var(--sky); color: var(--sky); }
label .btn-info { vertical-align: middle; margin-left: 6px; }
.option-explanation {
  font-size: 12px;
  margin-top: 6px;
  color: rgba(255,255,255,0.75);
  line-height: 1.4;
  font-weight: 400;
}
.review-feedback {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.review-feedback.correct { background: rgba(76,184,74,0.15); border-color: var(--green); color: var(--green); }
.review-feedback.wrong   { background: rgba(204,0,0,0.12);   border-color: #cc0000;      color: #ff6b6b; }
.review-canonical { font-weight: 700; margin-left: 4px; }
.review-canonical::before { content: '→ '; opacity: 0.7; }
.review-comparison-note {
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(245,224,39,0.35);
  background: rgba(245,224,39,0.08);
  color: rgba(255,255,255,0.8);
  margin-top: 8px;
}
.review-stage-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
}
.review-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.review-input {
  flex: 1;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  padding: 10px 14px;
}
.review-input:focus { outline: none; border-color: var(--sky); }
.review-stage-locked { opacity: 0.4; pointer-events: none; }
.review-stage-locked.unlocked { opacity: 1; pointer-events: auto; }
.confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
  display: block;
}

/* ====== CORRECTION EDITOR (Phase 7) ====== */
.editor-split {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.editor-text-panel {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  flex: 0 0 40%;
  min-height: 0;
  overflow: hidden;
}
.editor-text-panel-inner {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.editor-card-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
}
@media (min-width: 600px) {
  .editor-split { flex-direction: row; }
  .editor-text-panel {
    flex: 0 0 55%;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
  .editor-card-panel { flex: 1; }
}
.editor-student-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 4px;
}
.editor-section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 8px;
}
.editor-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.editor-filter-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-right: 4px; }
.editor-text-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.editor-text {
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: #fff;
}
.editor-error-mark {
  background: rgba(232, 54, 90, 0.2);
  border-bottom: 2px solid var(--pink);
  border-radius: 2px;
  position: relative;
}
.editor-error-sup {
  font-size: 10px;
  font-weight: 800;
  color: var(--pink);
  vertical-align: super;
  margin-left: 1px;
}
.editor-errors-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.editor-errors-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.editor-error-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.editor-error-card.deleted { opacity: 0.45; }
.ec-num {
  background: var(--pink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ec-num.ec-num-deleted { background: rgba(255,255,255,0.2); }
.ec-body { flex: 1; min-width: 0; }
.ec-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.ec-cat {
  font-size: 11px;
  font-weight: 800;
  color: var(--sky);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ec-added {
  font-size: 10px;
  font-weight: 800;
  color: var(--green);
  text-transform: uppercase;
}
.ec-type-btn {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: rgba(255,255,255,0.5);
  background: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.ec-type-btn:hover { border-color: var(--sky); color: var(--sky); }
.ec-span {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  font-style: italic;
}
.ec-span.ec-span-deleted { text-decoration: line-through; }
.ec-actions { flex-shrink: 0; }
.review-badge-btn {
  background: rgba(232,54,90,0.15);
  border: 1px solid var(--pink);
  border-radius: 4px;
  color: var(--pink);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  cursor: pointer;
  vertical-align: middle;
}
.review-badge-btn:hover { background: rgba(232,54,90,0.3); }

/* ====== SCHEDULING + NOTIFICATIONS ====== */
.badge-scheduled {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--yellow);
  background: rgba(245,224,39,0.12);
  border: 1px solid rgba(245,224,39,0.3);
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: middle;
}
.assignment-row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.notify-section { margin-bottom: 16px; }
.notify-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.notify-list { display: flex; flex-direction: column; gap: 8px; }
.notify-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.notify-status {
  font-size: 11px;
  font-weight: 800;
  margin-left: auto;
  white-space: nowrap;
}
.notify-status.ok   { color: var(--green); }
.notify-status.fail { color: var(--pink); }
.notify-status.none { color: var(--muted); }
