@import url('https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&family=Cairo:wght@400;600;700;800&family=Caveat:wght@500;700&family=Mada:wght@500;700&family=Nunito:wght@400;600;700;800;900&family=Patrick+Hand&family=Tajawal:wght@400;500;700&display=swap');

:root {
  color-scheme: light;
  --bg-gradient: linear-gradient(135deg, #dcf2ff 0%, #eaf7ff 50%, #f5fbff 100%);
  --bg-home: linear-gradient(135deg, #edf8ff 0%, #f4fbff 52%, #ffffff 100%);
  --pill-gradient: linear-gradient(135deg, #69C8FF 0%, #91D9FF 55%, #B5E8FF 100%);
  --pill-gradient-hover: linear-gradient(135deg, #52BEFF 0%, #7ACEFF 55%, #A1E0FF 100%);
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.94);
  --surface-elevated: #f8fafc;
  --surface-subtle: #f1f5f9;
  --surface-tint: #e8f6ff;
  --surface-promo: linear-gradient(135deg, #f2faff 0%, #e4f5ff 100%);
  --user-bubble-bg: linear-gradient(135deg, #ddf2ff 0%, #eaf7ff 100%);
  --sidebar-bg: rgba(255, 255, 255, 0.88);
  --cream-board: #fdf9ef;
  --wb-dot: rgba(130, 140, 170, 0.17);
  --wb-ink: #181c28;
  --wb-red: #d32f2f;
  --wb-teal: #0d7490;
  --wb-table-border: rgba(24, 28, 40, 0.34);
  --wb-table-head-border: rgba(24, 28, 40, 0.55);
  --wb-highlight: linear-gradient(96deg, rgba(255, 236, 92, 0.35), rgba(255, 236, 92, 0.78) 18%, rgba(255, 238, 102, 0.72) 85%, rgba(255, 236, 92, 0.25));
  --ink: #1e2438;
  --ink-strong: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --placeholder: #8b94ad;
  --border-soft: rgba(120, 136, 180, 0.2);
  --border-strong: #cbd5e1;
  --accent-primary: #69C8FF;
  --accent-secondary: #91D9FF;
  --accent-light: #B5E8FF;
  --accent-text: #0277bd;
  --accent-blue: #69C8FF;
  --accent-red: #e53935;
  --xp-bg: #eff6ff;
  --xp-border: #bfdbfe;
  --xp-text: #1d4ed8;
  --streak-bg: #fff7ed;
  --streak-border: #fed7aa;
  --streak-text: #c2410c;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #15803d;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #dc2626;
  --demo-banner-bg: rgba(255, 243, 196, 0.94);
  --demo-banner-text: #5d4300;
  --demo-banner-border: rgba(217, 169, 44, 0.45);
  --highlighter: rgba(255, 238, 88, 0.72);
  --shadow-card: 0 18px 46px rgba(91, 108, 160, 0.12);
  --shadow-hover: 0 24px 56px rgba(91, 108, 160, 0.18);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --backdrop-modal: rgba(10, 14, 26, 0.56);
  --focus-ring: rgba(105, 200, 255, 0.32);
  --scrollbar-thumb: rgba(100, 116, 139, 0.34);
  --radius-card: 28px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --font-ui: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-hand-latin: 'Caveat', 'Patrick Hand', 'Nunito', cursive;
  --font-hand-ar: 'Aref Ruqaa', 'Mada', 'Cairo', sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-gradient: linear-gradient(135deg, #0c1524 0%, #101d32 52%, #13253e 100%);
  --bg-home: linear-gradient(135deg, #0e1726 0%, #111e33 55%, #14253d 100%);
  --surface: #182135;
  --surface-glass: rgba(24, 33, 53, 0.94);
  --surface-elevated: #202b44;
  --surface-subtle: #25324e;
  --surface-tint: rgba(105, 200, 255, 0.16);
  --surface-promo: linear-gradient(135deg, #17273f 0%, #1b314e 100%);
  --user-bubble-bg: linear-gradient(135deg, #19324f 0%, #1f3c5e 100%);
  --sidebar-bg: rgba(18, 25, 42, 0.92);
  --cream-board: #121826;
  --wb-dot: rgba(148, 163, 184, 0.16);
  --wb-ink: #e8edf7;
  --wb-red: #f87171;
  --wb-teal: #38bdf8;
  --wb-table-border: rgba(203, 213, 225, 0.28);
  --wb-table-head-border: rgba(226, 232, 240, 0.48);
  --wb-highlight: linear-gradient(96deg, rgba(250, 204, 21, 0.14), rgba(250, 204, 21, 0.34) 18%, rgba(250, 204, 21, 0.28) 85%, rgba(250, 204, 21, 0.12));
  --ink: #e5eaf5;
  --ink-strong: #f8fafc;
  --ink-secondary: #cbd5e1;
  --muted: #94a3b8;
  --placeholder: #7b8ba5;
  --border-soft: rgba(148, 163, 184, 0.2);
  --border-strong: #334155;
  --accent-primary: #69C8FF;
  --accent-text: #91D9FF;
  --accent-red: #f87171;
  --xp-bg: rgba(37, 99, 235, 0.22);
  --xp-border: rgba(96, 165, 250, 0.42);
  --xp-text: #93c5fd;
  --streak-bg: rgba(234, 88, 12, 0.22);
  --streak-border: rgba(251, 146, 60, 0.42);
  --streak-text: #fdba74;
  --warning-bg: rgba(217, 119, 6, 0.18);
  --warning-border: rgba(251, 191, 36, 0.36);
  --warning-text: #fde68a;
  --success-bg: rgba(22, 163, 74, 0.2);
  --success-border: rgba(74, 222, 128, 0.35);
  --success-text: #86efac;
  --danger-bg: rgba(220, 38, 38, 0.2);
  --danger-border: rgba(248, 113, 113, 0.38);
  --danger-text: #fca5a5;
  --demo-banner-bg: rgba(120, 83, 12, 0.42);
  --demo-banner-text: #fde68a;
  --demo-banner-border: rgba(251, 191, 36, 0.38);
  --shadow-card: 0 12px 32px rgba(2, 6, 23, 0.38);
  --shadow-hover: 0 16px 38px rgba(2, 6, 23, 0.48);
  --shadow-soft: 0 6px 18px rgba(2, 6, 23, 0.3);
  --backdrop-modal: rgba(3, 7, 18, 0.72);
  --focus-ring: rgba(105, 200, 255, 0.34);
  --scrollbar-thumb: rgba(148, 163, 184, 0.3);
}

html.theme-animating,
html.theme-animating body,
html.theme-animating .fahim-sidebar,
html.theme-animating .card,
html.theme-animating .settings-card,
html.theme-animating .onboarding-card,
html.theme-animating .gami-modal-card,
html.theme-animating .home-pill-bar,
html.theme-animating .topbar-pill,
html.theme-animating .topbar-icon-pill,
html.theme-animating .leaderboard-card,
html.theme-animating .leaderboard-row,
html.theme-animating .podium-card,
html.theme-animating .side-drawer,
html.theme-animating .tutor-right-pill,
html.theme-animating .wb-heading-line,
html.theme-animating .wb-text-line {
  transition: background-color 200ms ease, background 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body.pastel-bg {
  background: var(--bg-gradient);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Container & Topbar */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  max-width: 1240px;
  margin: 0 auto;
  gap: 16px;
}

.landing-topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--sidebar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.landing-topbar-wrap .topbar {
  padding-block: 14px;
}

[dir="rtl"] .landing-cta-arrow {
  transform: scaleX(-1);
}

.topbar-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(91, 108, 160, 0.14);
}

.brand-name {
  background: linear-gradient(135deg, var(--ink-strong) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-link {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 4px;
}

.nav-link:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

/* Pill Buttons */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.btn-pill:active {
  transform: scale(0.98);
}

.btn-gradient {
  background: var(--pill-gradient);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(14, 86, 138, 0.24);
  box-shadow: 0 10px 24px rgba(105, 200, 255, 0.34), 0 3px 10px rgba(145, 217, 255, 0.2);
}

.btn-gradient:hover:not(:disabled) {
  background: var(--pill-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(105, 200, 255, 0.44), 0 5px 14px rgba(145, 217, 255, 0.26);
}

.btn-gradient:disabled,
.btn-gradient.is-disabled {
  background: #cfd5e3;
  color: #ffffff;
  text-shadow: none;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: var(--surface-glass);
  color: var(--ink);
  border: 1.8px solid var(--border-strong);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: var(--surface);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.btn-white {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.btn-white:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

/* Language Switcher */
.lang-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--surface-glass);
  border: 1px solid var(--border-soft);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  gap: 6px;
  backdrop-filter: blur(8px);
}

.lang-select {
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}

.lang-select option {
  background: var(--surface);
  color: var(--ink);
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 34px 20px 24px;
}

.hero-title {
  font-size: clamp(2.15rem, 4.4vw, 3.6rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0 auto 14px;
  max-width: 780px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1.02rem, 1.8vw, 1.24rem);
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 28px;
  line-height: 1.6;
  font-weight: 600;
}

.hero-cta-wrap {
  margin-bottom: 42px;
}

/* Animated Laptop Mockup */
.laptop-stage {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  isolation: isolate;
}

.laptop-glow {
  position: absolute;
  inset: -22px -16px -10px;
  background: radial-gradient(
    ellipse at 50% 48%,
    rgba(105, 200, 255, 0.34) 0%,
    rgba(145, 217, 255, 0.24) 44%,
    rgba(181, 232, 255, 0.16) 72%,
    transparent 82%
  );
  filter: blur(22px);
  z-index: 0;
  pointer-events: none;
}

.laptop-frame {
  width: 90%;
  margin: 0 auto;
  background: linear-gradient(180deg, #1b2030 0%, #121622 100%);
  border: 2px solid #d7dde9;
  border-bottom: none;
  border-radius: 20px 20px 6px 6px;
  padding: 11px 11px 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 18px 40px rgba(27, 34, 58, 0.2);
  position: relative;
  z-index: 2;
}

.laptop-camera {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #5b6991 0%, #242b40 65%, #0e121c 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  margin: 0 auto 7px;
}

.laptop-screen {
  background: var(--cream-board);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(15, 20, 35, 0.45);
  background-image: radial-gradient(rgba(140, 150, 175, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
  text-align: start;
}

.laptop-base {
  width: 100%;
  aspect-ratio: 36 / 1;
  min-height: 14px;
  background: linear-gradient(
    90deg,
    #b7c0d2 0%,
    #e5e9f2 6%,
    #f5f7fb 50%,
    #e5e9f2 94%,
    #b7c0d2 100%
  );
  border: 1.5px solid #c3cad9;
  border-top: 1px solid #8f98ae;
  border-radius: 3px 3px 16px 16px;
  position: relative;
  z-index: 3;
  box-shadow:
    inset 0 -3px 5px rgba(110, 120, 145, 0.28),
    0 8px 18px rgba(32, 42, 74, 0.22);
  overflow: hidden;
}

.laptop-hinge {
  width: 82%;
  height: 3px;
  margin: 0 auto;
  background: linear-gradient(90deg, #4b5469 0%, #6f7991 18%, #6f7991 82%, #4b5469 100%);
  border-radius: 0 0 2px 2px;
}

.laptop-notch {
  width: 78px;
  height: 5px;
  background: linear-gradient(180deg, #98a2b9 0%, #cbd3e3 100%);
  border-radius: 0 0 7px 7px;
  margin: 0 auto;
  box-shadow: inset 0 1px 2px rgba(24, 30, 48, 0.28);
}

.laptop-shadow {
  width: 94%;
  height: 18px;
  margin: -3px auto 0;
  background: radial-gradient(
    ellipse at center,
    rgba(22, 29, 52, 0.38) 0%,
    rgba(22, 29, 52, 0.16) 50%,
    transparent 76%
  );
  filter: blur(5px);
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.laptop-board-area {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 12px 18px 4px;
  overflow: hidden;
  direction: ltr;
}

.laptop-scene {
  position: absolute;
  inset: 10px 16px 4px;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
  overflow: hidden;
}

.laptop-scene.active {
  opacity: 1;
}

.laptop-pen {
  position: absolute;
  width: 28px;
  height: 28px;
  pointer-events: none;
  z-index: 8;
  transition: transform 0.25s ease-out, opacity 0.25s ease;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.18));
}

.laptop-bottom-ui {
  padding: 6px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, transparent 0%, var(--cream-board) 38%);
}

.laptop-scene .wb-table th,
.laptop-scene .wb-table td {
  padding: 6px 12px;
}

.laptop-subtitle-pill {
  background: var(--surface-glass);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  max-width: 90%;
  margin: 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-soft);
}

.laptop-chat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 5px 8px 5px 14px;
  gap: 10px;
  max-width: 72%;
  width: 100%;
  margin: 0 auto;
  box-shadow: var(--shadow-soft);
}

.laptop-chat-text {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  min-height: 1.2em;
}

.laptop-mic-pulse {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.laptop-mic-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.55);
  animation: pulseRing 1.5s infinite ease-out;
}

@keyframes pulseRing {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* Use Cases 2x2 Grid */
.section {
  padding: 56px 20px 72px;
}

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  font-weight: 900;
  margin: 0 0 32px;
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 920px;
  margin: 0 auto;
}

.use-case-card {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.use-case-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-primary);
}

.use-case-illus {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(155deg, #fffdf8 0%, #f6f2e8 100%);
  display: block;
}

html[data-theme="dark"] .use-case-illus {
  background: linear-gradient(155deg, #1b2336 0%, #141b2c 100%);
  border-color: rgba(148, 163, 184, 0.18);
}

.use-case-illus svg {
  width: 100%;
  height: 100%;
  display: block;
}

.use-case-illus text {
  user-select: text;
}

.use-case-card h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
}

.use-case-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Sign-in Split Page */
.signin-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.18fr;
}

.signin-left {
  background: var(--surface);
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
}

.signin-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.signin-form-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 24px;
}

.signin-form-box {
  max-width: 380px;
  width: 100%;
  margin-inline: auto;
  text-align: center;
}

.signin-heading {
  font-size: clamp(1.75rem, 2.2vw, 2rem);
  font-weight: 900;
  margin: 0 0 10px;
  color: var(--ink-strong);
  text-align: center;
}

.signin-sub {
  color: var(--muted);
  margin: 0 0 26px;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.auth-btn {
  width: 100%;
  height: 56px;
  padding-inline: 20px;
  border-radius: 16px;
  border: none;
  background: #ffffff;
  color: #1e2438;
  font-weight: 800;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] .auth-btn {
  background: var(--surface-elevated);
  color: var(--ink-strong);
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.34);
}

html[data-theme="dark"] .auth-btn:hover {
  background: var(--surface-subtle);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.45);
}

.signin-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 16px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.signin-divider::before,
.signin-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.signin-email-form {
  margin-top: 12px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  display: none;
  flex-direction: column;
  gap: 10px;
  text-align: start;
}

.signin-email-form.open {
  display: flex;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.input-field::placeholder {
  color: var(--placeholder);
}

.input-field:focus {
  border-color: var(--accent-primary);
}

.signin-terms {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 18px;
  margin-bottom: 0;
  line-height: 1.55;
}

.signin-terms button {
  background: none;
  border: none;
  color: var(--accent-text);
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline;
}

.signin-right {
  background: var(--bg-gradient);
  padding-block: 36px;
  padding-inline-start: 0;
  padding-inline-end: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}

.signin-showcase {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.signin-laptop-stage {
  width: 92%;
  max-width: 720px;
  margin-inline-start: -56px;
  position: relative;
  z-index: 2;
}

.signin-caption-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-glass);
}

.signin-caption-start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.signin-pause-pill {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.signin-caption-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signin-mic-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.signin-feature-stack {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 12;
  width: 248px;
}

.signin-feature-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--border-soft);
  text-align: start;
}

html[data-theme="dark"] .signin-feature-card {
  background: var(--surface-glass);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.42);
}

.signin-feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.signin-feature-icon.is-purple {
  background: rgba(105, 200, 255, 0.2);
  color: #0277bd;
}

.signin-feature-icon.is-pink {
  background: rgba(145, 217, 255, 0.24);
  color: #0284c7;
}

.signin-feature-icon.is-blue {
  background: rgba(181, 232, 255, 0.34);
  color: #0369a1;
}

html[data-theme="dark"] .signin-feature-icon.is-purple { color: #91D9FF; }
html[data-theme="dark"] .signin-feature-icon.is-pink { color: #B5E8FF; }
html[data-theme="dark"] .signin-feature-icon.is-blue { color: #69C8FF; }

.signin-feature-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink-strong);
  line-height: 1.25;
}

.signin-feature-desc {
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

/* Home Page */
.home-main {
  max-width: 900px;
  margin: 24px auto 64px;
  padding: 0 20px;
  text-align: center;
}

.home-greeting {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  font-weight: 900;
  margin: 12px 0 28px;
}

.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.mode-card {
  padding: 24px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 2px solid transparent;
}

.mode-card:hover {
  transform: translateY(-3px);
}

.mode-card.selected {
  border-color: #69C8FF;
  box-shadow: 0 0 0 5px rgba(105, 200, 255, 0.22), 0 20px 44px rgba(145, 217, 255, 0.26);
  transform: translateY(-4px);
}

.mode-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(105, 200, 255, 0.22), rgba(181, 232, 255, 0.32));
  color: var(--accent-text);
}

.mode-card h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
}

.mode-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.composer-card {
  padding: 26px;
  text-align: start;
  display: none;
  animation: fadeSlideUp 0.28s ease;
}

.composer-card.open {
  display: block;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.upload-dropzone {
  border: 2px dashed #b9c5e2;
  border-radius: 22px;
  padding: 22px;
  background: #f9fbff;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-bottom: 18px;
}

.upload-dropzone.dragover {
  border-color: var(--accent-primary);
  background: var(--surface-tint);
}

.upload-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.url-inline-row {
  display: none;
  gap: 8px;
  margin-top: 12px;
  max-width: 520px;
  margin-inline: auto;
}

.url-inline-row.open {
  display: flex;
}

.attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.86rem;
  font-weight: 700;
}

.attachment-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
  font-size: 1rem;
  padding: 0 2px;
}

.composer-textarea {
  width: 100%;
  min-height: 110px;
  border-radius: 20px;
  border: 1.5px solid var(--border-soft);
  padding: 16px;
  font-size: 1rem;
  resize: vertical;
  outline: none;
  margin-bottom: 16px;
  background: var(--surface-elevated);
  color: var(--ink);
}

.composer-textarea:focus {
  border-color: var(--accent-primary);
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Avatar & Icon Button */
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--surface-glass);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: var(--surface);
}

.avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--pill-gradient);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(14, 86, 138, 0.24);
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(105, 200, 255, 0.3), 0 2px 8px rgba(145, 217, 255, 0.18);
}

/* Slide-out Drawer & Modal */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop-modal);
  backdrop-filter: blur(3px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.side-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: min(340px, 88vw);
  background: var(--surface);
  color: var(--ink);
  z-index: 100;
  padding: 22px;
  box-shadow: var(--shadow-card);
  transform: translateX(-105%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

html[dir="rtl"] .side-drawer {
  transform: translateX(105%);
}

.side-drawer.open {
  transform: translateX(0) !important;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: var(--surface-elevated);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: start;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.history-item:hover {
  border-color: var(--accent-primary);
  background: var(--surface-tint);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop-modal);
  backdrop-filter: blur(4px);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  padding: 28px;
  max-height: 86vh;
  overflow-y: auto;
  animation: fadeSlideUp 0.22s ease;
}

/* =========================================================
   TUTOR SESSION PAGE (Themeable Whiteboard Canvas)
   ========================================================= */
body.tutor-page {
  background: var(--cream-board);
  background-image: radial-gradient(var(--wb-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--wb-ink);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tutor-topbar {
  position: fixed;
  top: 14px;
  inset-inline: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
  pointer-events: none;
}

.tutor-topbar > * {
  pointer-events: auto;
}

.tutor-right-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-glass);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.tutor-pill-btn {
  border: none;
  background: transparent;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s ease;
}

.tutor-pill-btn:hover {
  background: var(--surface-subtle);
}

.more-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  padding: 8px;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 60;
}

.more-dropdown.open {
  display: flex;
}

.more-dropdown button {
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: start;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.more-dropdown button:hover {
  background: var(--surface-subtle);
}

/* Board Viewport */
.board-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 72px 44px 136px;
  display: flex;
  flex-direction: column;
}

.board-page-indicator {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  z-index: 30;
  pointer-events: none;
}

.demo-banner {
  background: var(--demo-banner-bg);
  color: var(--demo-banner-text);
  border: 1px solid var(--demo-banner-border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  direction: ltr;
  box-shadow: var(--shadow-soft);
}

.demo-banner[hidden] {
  display: none;
}

.board-grid {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 44px;
  row-gap: 16px;
  align-content: start;
  transition: opacity 0.35s ease;
}

.board-grid.fading-out {
  opacity: 0;
}

.board-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.board-notice {
  margin: 18vh auto 0;
  max-width: 520px;
  text-align: center;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--wb-ink);
}

#studentInkCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 25;
  pointer-events: none;
}

#studentInkCanvas.drawing-active {
  pointer-events: auto;
  cursor: crosshair;
}

/* Collapsed Student Pen Button & Popover */
.pen-tool-wrap {
  position: fixed;
  top: 70px;
  inset-inline-end: 18px;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.pen-popover {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--surface-glass);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: var(--shadow-soft);
}

.pen-popover.open {
  display: flex;
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
  cursor: pointer;
}

.color-dot.active {
  box-shadow: 0 0 0 2px #69C8FF;
  transform: scale(1.15);
}

/* Freehand Board Block Types (No Cards, No Boxes, No Badges) */
.wb-block {
  width: 100%;
  animation: wbBlockIn 0.28s ease forwards;
}

@keyframes wbBlockIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 1. Heading with Marker Highlighter Stroke */
.wb-heading-line {
  position: relative;
  display: inline-block;
  font-family: 'Cairo', 'Nunito', sans-serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 2.1vw, 1.68rem);
  line-height: 1.35;
  color: var(--wb-ink);
  padding: 1px 10px;
  margin: 2px 0;
}

.board-viewport[dir="ltr"] .wb-heading-line {
  font-family: 'Nunito', sans-serif;
}

.board-viewport[dir="rtl"] .wb-heading-line {
  font-family: 'Cairo', sans-serif;
}

.wb-heading-line::before {
  content: '';
  position: absolute;
  inset: 22% -2px 6% -2px;
  background: var(--wb-highlight);
  border-radius: 6px 10px 5px 8px;
  transform: rotate(-0.6deg) scaleX(0);
  transform-origin: left center;
  animation: markerSweep 0.65s ease forwards;
  z-index: -1;
}

.board-viewport[dir="ltr"] .wb-heading-line::before {
  transform-origin: left center;
}

.board-viewport[dir="rtl"] .wb-heading-line::before {
  transform-origin: right center;
}

@keyframes markerSweep {
  to { transform: rotate(-0.6deg) scaleX(1); }
}

/* 2. Short Handwritten Text */
.wb-text-line {
  font-family: 'Caveat', 'Nunito', cursive;
  font-size: 1.48rem;
  font-weight: 500;
  line-height: 1.38;
  color: var(--wb-ink);
  white-space: pre-line;
  text-align: start;
}

.board-viewport[dir="ltr"] .wb-text-line {
  font-family: 'Caveat', 'Nunito', cursive;
  font-size: 1.48rem;
  line-height: 1.38;
}

.board-viewport[dir="rtl"] .wb-text-line {
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 1.14rem;
  line-height: 1.65;
}

/* 3. Red Handwriting Formulas + Hand-Drawn Red Circle */
.wb-formula-line {
  font-family: 'Caveat', cursive;
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--wb-red);
  line-height: 1.35;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  padding: 4px 10px;
}

.wb-circle-target {
  position: relative;
  display: inline-block;
  padding: 2px 12px;
}

.wb-red-circle-svg {
  position: absolute;
  inset: -4px -6px;
  width: calc(100% + 12px);
  height: calc(100% + 8px);
  pointer-events: none;
  overflow: visible;
}

.wb-red-circle-path {
  fill: none;
  stroke: var(--wb-red);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 640;
  stroke-dashoffset: 640;
  animation: drawStroke 0.9s ease forwards 0.15s;
}

@keyframes drawStroke {
  to { stroke-dashoffset: 0; }
}

/* 4. Thin Line SVG Diagrams (No Filled Boxes) */
.wb-diagram-svg {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  margin: 4px 0;
  direction: ltr;
  overflow: visible;
  color: var(--wb-ink);
}

html[data-theme="dark"] .wb-diagram-svg [stroke="#181c28"],
html[data-theme="dark"] .wb-diagram-svg [stroke="#1e2438"],
html[data-theme="dark"] .wb-diagram-svg [stroke="#000"],
html[data-theme="dark"] .wb-diagram-svg [stroke="#000000"],
html[data-theme="dark"] .wb-diagram-svg [stroke="black"],
html[data-theme="dark"] .wb-diagram-svg [stroke="currentColor"] {
  stroke: var(--wb-ink) !important;
}

html[data-theme="dark"] .wb-diagram-svg [fill="#181c28"],
html[data-theme="dark"] .wb-diagram-svg [fill="#1e2438"],
html[data-theme="dark"] .wb-diagram-svg [fill="#000"],
html[data-theme="dark"] .wb-diagram-svg [fill="#000000"],
html[data-theme="dark"] .wb-diagram-svg [fill="black"],
html[data-theme="dark"] .wb-diagram-svg text:not([fill]),
html[data-theme="dark"] .wb-diagram-svg text[fill="#181c28"],
html[data-theme="dark"] .wb-diagram-svg text[fill="#1e2438"] {
  fill: var(--wb-ink) !important;
}

.wb-diagram-svg .wb-stroke-anim {
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation: drawStroke 0.9s ease forwards;
}

/* 5. Thin Handwritten Grid Table */
.wb-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 0.98rem;
  color: var(--wb-ink);
}

.board-viewport[dir="ltr"] .wb-table {
  font-family: 'Caveat', 'Nunito', cursive;
  font-size: 1.28rem;
}

.board-viewport[dir="rtl"] .wb-table {
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 0.98rem;
}

.wb-table th,
.wb-table td {
  border-bottom: 1.2px solid var(--wb-table-border);
  border-inline-end: 1.2px solid var(--wb-table-border);
  padding: 6px 10px;
  text-align: start;
}

.wb-table th:last-child,
.wb-table td:last-child {
  border-inline-end: none;
}

.wb-table tr:last-child td {
  border-bottom: none;
}

.wb-table th {
  font-weight: 800;
  border-bottom: 1.8px solid var(--wb-table-head-border);
}

.wb-table tbody tr {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.wb-table tbody tr.visible {
  opacity: 1;
}

/* 6. Underline / Arrow / Check Accents */
.wb-accent-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--wb-teal);
}

.board-viewport[dir="ltr"] .wb-accent-wrap {
  font-family: 'Caveat', 'Nunito', cursive;
  font-size: 1.4rem;
}

.board-viewport[dir="rtl"] .wb-accent-wrap {
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 1.06rem;
}

.wb-underline-text {
  display: inline-block;
  position: relative;
  padding-bottom: 4px;
}

.wb-underline-svg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  width: 100%;
  height: 8px;
}

/* Practice Problems Written Plainly on the Board */
.board-col {
  text-align: start;
}

.wb-practice-line {
  font-family: 'Nunito', sans-serif;
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--wb-ink);
  margin-bottom: 10px;
  text-align: start;
}

.board-viewport[dir="rtl"] .wb-practice-line {
  font-family: 'Tajawal', 'Cairo', sans-serif;
}

.board-viewport[dir="ltr"] .wb-practice-line {
  font-family: 'Nunito', sans-serif;
}

.wb-answer-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--wb-teal);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

.wb-answer-reveal {
  display: none;
  color: var(--wb-red);
  font-family: 'Caveat', 'Tajawal', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 3px;
}

.wb-answer-reveal.visible {
  display: block;
}

/* Tutor Bottom Dock */
.tutor-dock {
  position: fixed;
  bottom: 16px;
  inset-inline: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  z-index: 40;
  pointer-events: none;
}

.tutor-dock > * {
  pointer-events: auto;
}

.dock-left {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.icon-btn.is-active {
  border-color: rgba(249, 115, 22, 0.55);
  color: #f97316;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.18);
}

.icon-btn.is-muted {
  color: var(--muted);
}

.dock-volume-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  inset-inline-end: 0;
  width: 228px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  z-index: 60;
  animation: dockVolumePop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-volume-popover[hidden] {
  display: none;
}

.dock-volume-popover::after {
  content: "";
  position: absolute;
  bottom: -6px;
  inset-inline-end: 15px;
  width: 11px;
  height: 11px;
  background: var(--surface-glass);
  border-inline-end: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  transform: rotate(45deg);
}

@keyframes dockVolumePop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dock-volume-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.dock-volume-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink);
}

.dock-volume-pct {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ea580c;
  background: var(--streak-bg);
  border: 1px solid var(--streak-border);
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.dock-volume-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.dock-volume-mute-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--surface-elevated);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.dock-volume-mute-btn:hover {
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.45);
  transform: scale(1.06);
}

.dock-volume-mute-btn .icon {
  width: 15px;
  height: 15px;
}

.dock-volume-slider {
  --vol-pct: 80%;
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  width: 100%;
  height: 6px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(to right, #f97316 var(--vol-pct), rgba(148, 163, 184, 0.3) var(--vol-pct));
  outline: none;
  cursor: pointer;
}

.dock-volume-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.dock-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #f97316;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
  cursor: pointer;
  transition: transform 0.14s ease, background-color 0.14s ease;
}

.dock-volume-slider::-webkit-slider-thumb:hover {
  background: #ea580c;
  transform: scale(1.12);
}

.dock-volume-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
}

.dock-volume-slider::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #f97316;
}

.dock-volume-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #f97316;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
  cursor: pointer;
}

.dock-center {
  flex: 1;
  min-width: 0;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 2px;
}

.subtitle-plain {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  width: fit-content;
  max-width: min(100%, 540px);
  padding: 8px 16px;
  border-radius: 18px;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.5;
  max-height: 4.9em;
  overflow-y: auto;
  scrollbar-width: thin;
  word-break: break-word;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.subtitle-plain[dir="rtl"] {
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 0.96rem;
  line-height: 1.58;
}

.subtitle-plain:empty {
  display: none;
}

.subtitle-plain::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 0.48em;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0.72;
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.subtitle-plain.is-speaking {
  border-color: rgba(249, 115, 22, 0.38);
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.14);
}

.subtitle-plain.is-speaking::before {
  background: #f97316;
  opacity: 1;
  animation: subtitleDotPulse 1.2s ease-in-out infinite;
}

.subtitle-plain.is-listening {
  border-color: rgba(229, 57, 53, 0.42);
  box-shadow: 0 8px 22px rgba(229, 57, 53, 0.14);
}

.subtitle-plain.is-listening::before {
  background: #e53935;
  opacity: 1;
  animation: subtitleDotPulse 1s ease-in-out infinite;
}

.subtitle-plain.is-thinking::before {
  background: var(--accent-primary);
  opacity: 1;
  animation: subtitleDotPulse 1.4s ease-in-out infinite;
}

.subtitle-plain.is-error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.subtitle-plain.is-error::before {
  background: var(--danger-text);
  opacity: 1;
}

@keyframes subtitleDotPulse {
  0%, 100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.35);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 0 5px rgba(249, 115, 22, 0);
  }
}

.dock-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.mic-btn-big {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: #e53935;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(229, 57, 53, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mic-btn-big:hover {
  transform: scale(1.06);
}

.mic-btn-big.listening {
  animation: pulseRing 1.3s infinite;
  box-shadow: 0 0 0 10px rgba(229, 57, 53, 0.24), 0 12px 28px rgba(229, 57, 53, 0.45);
}

.keyboard-popover {
  position: fixed;
  bottom: 92px;
  inset-inline-end: 20px;
  width: min(380px, calc(100vw - 40px));
  background: var(--surface);
  color: var(--ink);
  border-radius: 22px;
  padding: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
  display: none;
  gap: 8px;
  z-index: 50;
}

.keyboard-popover.open {
  display: flex;
}

@media (max-width: 960px) {
  .board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .board-viewport {
    padding: 68px 20px 164px;
    overflow-y: auto;
  }
  .board-grid {
    grid-template-columns: 1fr;
  }
  .subtitle-plain {
    max-width: 100%;
    font-size: 0.88rem;
    padding: 7px 13px;
    border-radius: 16px;
  }
}

.chat-drawer {
  position: fixed;
  bottom: 96px;
  inset-inline-start: 18px;
  width: min(360px, calc(100vw - 36px));
  max-height: 56vh;
  background: var(--surface);
  color: var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
  display: none;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}

.chat-drawer.open {
  display: flex;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 88%;
}

.chat-bubble.tutor {
  background: var(--surface-subtle);
  color: var(--ink);
  align-self: flex-start;
}

.chat-bubble.student {
  background: var(--user-bubble-bg);
  color: var(--ink);
  align-self: flex-end;
  font-weight: 700;
}

.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--ink-strong);
  color: var(--surface);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .signin-split {
    grid-template-columns: 1fr;
  }
  .signin-left {
    padding: 20px 18px;
  }
  .signin-right {
    display: none;
  }
  .use-cases-grid,
  .mode-cards {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  .tutor-dock {
    flex-wrap: wrap;
    justify-content: center;
  }
  .dock-center {
    order: -1;
    flex-basis: 100%;
  }
}

/* =========================================================
   HOME PAGE LIGHT CHAT LAYOUT (Scoped to body.home-light)
   ========================================================= */
body.home-light {
  background: var(--bg-home);
  background-attachment: fixed;
  color: var(--ink);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.home-light-topbar {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.mobile-only-topbar {
  display: none;
}

.home-shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px 12px;
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  box-sizing: border-box;
}

body.home-light.home-chat-active .home-shell {
  justify-content: flex-end;
  gap: 12px;
}

.home-hero-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  max-height: 440px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease, max-height 0.32s ease, margin 0.28s ease;
}

body.home-light.home-chat-active .home-hero-head {
  opacity: 0;
  transform: translateY(-10px);
  max-height: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

body.home-light.home-chat-active .home-chips-section {
  display: none;
}

.home-mascot-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-greeting-title {
  margin: 0;
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.65rem, 3.2vw, 2.25rem);
  line-height: 1.28;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* Scrollable Conversation View */
.home-chat-thread {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 4px 12px;
  flex-direction: column;
  gap: 14px;
}

body.home-light.home-chat-active .home-chat-thread {
  display: flex;
}

.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 86%;
  animation: fadeSlideUp 0.2s ease;
}

.chat-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-row.ai {
  align-self: flex-start;
}

.chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}

.chat-msg-bubble {
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 0.98rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-row.user .chat-msg-bubble {
  background: var(--user-bubble-bg);
  color: var(--ink);
  font-weight: 700;
  border-end-end-radius: 6px;
}

.chat-msg-row.ai .chat-msg-bubble {
  background: var(--surface-glass);
  color: var(--ink);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  border-end-start-radius: 6px;
}

.chat-msg-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 700;
}

/* Compact Gemini-Style Input Pill */
.home-input-dock {
  width: 100%;
  flex-shrink: 0;
}

.home-pill-bar {
  width: 100%;
  max-width: 100%;
  background: var(--surface);
  border-radius: 28px;
  padding: 8px 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
  overflow: hidden;
}

.home-pill-bar.dragover,
.home-pill-bar:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-card);
}

.home-attachments-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-attachments-row:not(:empty) {
  margin-bottom: 8px;
  padding: 0 4px;
}

.home-url-row {
  display: none;
  gap: 8px;
  margin-bottom: 8px;
}

.home-url-row.open {
  display: flex;
}

.home-pill-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.home-pill-textarea {
  flex: 1 1 0%;
  width: 0;
  min-width: 80px;
  min-height: 26px;
  max-height: 132px;
  padding: 7px 6px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow-y: auto;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 600;
}

.home-pill-textarea::placeholder {
  color: var(--placeholder);
}

.home-toolbar-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding-bottom: 2px;
}

.home-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.home-tool-btn .icon {
  width: 18px;
  height: 18px;
}

.home-tool-btn:hover {
  background: var(--surface-subtle);
  color: var(--ink);
  transform: translateY(-1px);
}

.home-tool-btn:active {
  transform: scale(0.94);
}

.home-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-bottom: 1px;
}

.home-speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--surface-elevated);
  color: var(--ink);
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.home-speak-btn:hover {
  background: var(--surface-tint);
  border-color: var(--accent-primary);
}

.home-speak-btn.listening {
  background: #ffebee;
  border-color: #ef4444;
  color: #c62828;
}

.home-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--pill-gradient);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(105, 200, 255, 0.32), 0 2px 8px rgba(145, 217, 255, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.home-send-btn:hover:not(:disabled) {
  background: var(--pill-gradient-hover);
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(105, 200, 255, 0.42), 0 3px 10px rgba(145, 217, 255, 0.26);
}

.home-send-btn:disabled,
.home-send-btn.is-disabled {
  background: var(--border-strong);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* Neat Row of Equal-Sized Chips */
.home-chips-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.home-chips-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.home-chip {
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--surface-glass);
  border: 1px solid var(--border-soft);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-hover);
}

.home-chip.selected {
  border-color: var(--accent-primary);
  background: var(--surface-tint);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-soft);
}

.chip-dot-purple { color: #0284c7; }
.chip-dot-green  { color: #16a34a; }
.chip-dot-orange { color: #ea580c; }
.chip-dot-red    { color: #dc2626; }
.chip-dot-blue   { color: #0284c7; }
.chip-dot-amber  { color: #d97706; }

.extra-chips-row {
  width: 100%;
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  animation: fadeSlideUp 0.2s ease;
}

.extra-chips-row.open {
  display: flex;
}

.home-demo-note {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 16px 12px;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .home-shell {
    padding: 12px 16px 8px;
  }
  .home-pill-row {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .home-pill-textarea {
    order: -1;
    flex: 1 1 100%;
    width: 100%;
    padding: 4px 6px;
  }
  .home-toolbar-tools {
    margin-inline-end: auto;
  }
  .chat-msg-row {
    max-width: 94%;
  }
  .home-chip {
    height: 36px;
    padding: 0 12px;
    font-size: 0.84rem;
  }
}

/* =========================================================
   COLLAPSIBLE RIGHT-SIDE RTL SIDEBAR (فهيم)
   ========================================================= */
body.home-light.has-fahim-sidebar {
  flex-direction: row;
}

.home-main-column {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-menu-trigger {
  display: none;
}

.fahim-sidebar {
  width: 262px;
  height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: blur(12px);
  border-inline-end: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  transition: width 0.24s ease, transform 0.26s ease;
  z-index: 60;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 6px;
}

.sidebar-collapse-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fahim-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.fahim-nav-item:hover {
  background: rgba(105, 200, 255, 0.12);
  color: var(--ink);
}

.fahim-nav-item.active {
  background: var(--surface-tint);
  color: var(--accent-text);
  font-weight: 800;
}

.fahim-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-create-btn {
  margin-top: 8px;
  padding: 10px 16px;
  font-size: 0.92rem;
  width: 100%;
  box-shadow: 0 8px 20px rgba(105, 200, 255, 0.28), 0 2px 8px rgba(145, 217, 255, 0.18);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(120, 136, 180, 0.14);
}

.sidebar-pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: var(--surface-tint);
  color: var(--accent-text);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 800;
}

.sidebar-promo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-promo);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 10px 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-promo-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.sidebar-promo-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-promo-copy strong {
  font-size: 0.86rem;
  color: var(--ink);
}

.sidebar-promo-copy span {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-promo-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}

.sidebar-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.sidebar-profile-row:hover {
  background: rgba(120, 136, 180, 0.08);
}

.sidebar-profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-profile-info strong {
  font-size: 0.88rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-info span {
  font-size: 0.75rem;
  color: var(--muted);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 46, 0.34);
  backdrop-filter: blur(2px);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Desktop Collapsed (Icons Only) */
body.sidebar-collapsed .fahim-sidebar {
  width: 74px;
  padding: 16px 10px;
  align-items: center;
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .fahim-nav-label,
body.sidebar-collapsed .sidebar-create-label,
body.sidebar-collapsed .sidebar-footer-text,
body.sidebar-collapsed .sidebar-promo-card,
body.sidebar-collapsed .sidebar-profile-info {
  display: none;
}

body.sidebar-collapsed .sidebar-head {
  flex-direction: column;
  gap: 10px;
}

body.sidebar-collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed .fahim-nav-item {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed .sidebar-create-btn {
  width: 42px;
  height: 42px;
  padding: 0;
}

body.sidebar-collapsed .sidebar-pro-badge {
  align-self: center;
  padding: 4px 8px;
}

/* Tablet: Auto-collapse to icons only */
@media (max-width: 980px) and (min-width: 701px) {
  .fahim-sidebar {
    width: 74px;
    padding: 16px 10px;
    align-items: center;
  }
  .sidebar-brand-text,
  .fahim-nav-label,
  .sidebar-create-label,
  .sidebar-footer-text,
  .sidebar-promo-card,
  .sidebar-profile-info,
  .sidebar-collapse-btn {
    display: none;
  }
  .fahim-nav-item {
    justify-content: center;
    padding: 10px;
  }
  .sidebar-create-btn {
    width: 42px;
    height: 42px;
    padding: 0;
  }
  .sidebar-pro-badge {
    align-self: center;
    padding: 4px 8px;
  }
}

/* Mobile: Slide-in drawer triggered by hamburger button */
@media (max-width: 700px) {
  .mobile-only-topbar {
    display: flex;
    padding: 12px 14px 0;
  }
  .mobile-menu-trigger {
    display: inline-flex;
  }
  .fahim-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(280px, 82vw);
    transform: translateX(-105%);
  }
  [dir="rtl"] .fahim-sidebar {
    transform: translateX(105%);
  }
  .fahim-sidebar.mobile-open {
    transform: translateX(0) !important;
  }
}

/* Placeholder Page */
.section-placeholder-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.section-placeholder-card {
  max-width: 480px;
  width: 100%;
  padding: 34px 28px;
  text-align: center;
}

/* Slim Single-Line Whiteboard Question Input Bar (tutor.html) */
.wb-slim-ask-bar {
  width: 100%;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-glass);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding-block: 4px;
  padding-inline: 14px 6px;
  box-shadow: var(--shadow-soft);
}

.wb-slim-ask-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 6px;
}

.wb-slim-ask-input::placeholder {
  color: var(--placeholder);
}

.wb-slim-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--pill-gradient);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.16s ease;
}

.wb-slim-send-btn:hover {
  transform: scale(1.06);
}

/* ==========================================================================
   Gamification Top Bar, Modals (Timer & Streak) & Leaderboard
   Uses CSS logical properties so RTL & LTR mirror cleanly.
   ========================================================================== */

.home-light-topbar.gamification-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 12px;
  padding-inline: 22px;
  width: 100%;
  position: relative;
  z-index: 25;
}

.topbar-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
  flex-wrap: nowrap;
}

.topbar-pill,
.topbar-icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.14s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-pill {
  padding-inline: 12px;
}

.topbar-icon-pill {
  width: 36px;
  padding: 0;
}

.topbar-pill:hover,
.topbar-icon-pill:hover {
  transform: translateY(-1px);
}

.topbar-pill:active,
.topbar-icon-pill:active {
  transform: scale(0.97);
}

.topbar-pill-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.xp-pill {
  background: var(--xp-bg);
  border-color: var(--xp-border);
  color: var(--xp-text);
  box-shadow: var(--shadow-soft);
}

.xp-pill .topbar-pill-icon {
  fill: currentColor;
  stroke: currentColor;
}

.xp-pill.is-bumping {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.24);
}

.streak-pill {
  background: var(--streak-bg);
  border-color: var(--streak-border);
  color: var(--streak-text);
  box-shadow: var(--shadow-soft);
}

.streak-pill .topbar-pill-icon {
  fill: currentColor;
  stroke: currentColor;
}

.timer-pill-btn {
  background: var(--surface-glass);
  border-color: var(--border-soft);
  color: var(--ink-secondary);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.timer-pill-btn.is-timer-running {
  background: var(--surface-tint);
  border-color: var(--accent-primary);
  color: var(--accent-text);
}

.timer-pill-btn.is-timer-running::after {
  content: "";
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.topbar-volume-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding-inline: 8px 10px;
  border-radius: 999px;
  background: var(--surface-glass);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  direction: ltr;
  flex-shrink: 0;
}

.topbar-volume-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.14s ease, transform 0.14s ease;
}

.topbar-volume-btn:hover {
  color: #f97316;
  transform: scale(1.06);
}

.topbar-volume-wrap.is-muted .topbar-volume-btn {
  color: var(--muted);
}

.topbar-volume-slider {
  --vol-pct: 80%;
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 5px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(to right, #f97316 var(--vol-pct), rgba(148, 163, 184, 0.3) var(--vol-pct));
  outline: none;
  cursor: pointer;
}

.topbar-volume-slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: transparent;
}

.topbar-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #f97316;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
  cursor: pointer;
  transition: transform 0.14s ease, background-color 0.14s ease;
}

.topbar-volume-slider::-webkit-slider-thumb:hover {
  background: #ea580c;
  transform: scale(1.12);
}

.topbar-volume-slider::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
}

.topbar-volume-slider::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: #f97316;
}

.topbar-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f97316;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
  cursor: pointer;
}

.topbar-volume-slider:focus-visible,
.topbar-volume-btn:focus-visible {
  outline: 2px solid rgba(249, 115, 22, 0.5);
  outline-offset: 2px;
}

.action-pill {
  background: var(--surface-glass);
  border-color: var(--border-soft);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.action-pill:hover {
  background: var(--surface);
  border-color: var(--accent-primary);
}

/* Animated Sun / Moon Theme Toggle */
.theme-toggle-btn {
  background: var(--surface-glass);
  border-color: var(--border-soft);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn:hover {
  background: var(--surface);
  border-color: var(--accent-primary);
}

.theme-toggle-icons {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon-sun,
.theme-icon-moon {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.theme-icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

html[data-theme="dark"] .theme-icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

html[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.topbar-lang-pill {
  font-size: 0.78rem;
  font-weight: 800;
  min-width: 40px;
}

/* Floating +XP notification */
.xp-float-badge {
  z-index: 400;
  pointer-events: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pill-gradient);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(14, 86, 138, 0.24);
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(105, 200, 255, 0.34);
  transform: translateX(-50%);
  animation: xpFloatUp 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes xpFloatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 4px) scale(0.9);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -4px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -30px) scale(0.96);
  }
}

/* Gamification Modals (Study Timer & Streak) */
.gami-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: var(--backdrop-modal);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gami-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gami-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 26px;
  padding-block: 26px;
  padding-inline: 28px;
  box-shadow: var(--shadow-card);
  transform: scale(0.95) translateY(8px);
  transition: transform 0.22s ease;
  color: var(--ink);
}

.gami-modal-backdrop.is-open .gami-modal-card {
  transform: scale(1) translateY(0);
}

.gami-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.gami-modal-title {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--ink-strong);
}

.gami-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--surface-elevated);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gami-close-btn:hover {
  background: var(--surface-subtle);
  color: var(--ink-strong);
}

.gami-primary-pill {
  width: 100%;
  min-height: 46px;
  border-radius: 999px;
  border: none;
  padding-inline: 20px;
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(14, 86, 138, 0.24);
  background: var(--pill-gradient);
  box-shadow: 0 10px 24px rgba(105, 200, 255, 0.34), 0 3px 10px rgba(145, 217, 255, 0.2);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.16s ease, background 0.18s ease;
}

.gami-primary-pill:hover {
  background: var(--pill-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(105, 200, 255, 0.44), 0 5px 14px rgba(145, 217, 255, 0.26);
}

.gami-secondary-pill,
.gami-danger-pill {
  flex: 1;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  padding-inline: 16px;
}

.gami-secondary-pill {
  border: 1.5px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--ink);
}

.gami-danger-pill {
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
}

/* Study Timer Dial */
.timer-dial-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 8px auto 22px;
  user-select: none;
  touch-action: none;
}

.timer-dial-svg {
  display: block;
  width: 240px;
  height: 240px;
  cursor: grab;
  outline: none;
}

.timer-dial-svg:active {
  cursor: grabbing;
}

.timer-dial-svg.is-locked {
  cursor: default;
}

.timer-track-circle {
  fill: none;
  stroke: var(--surface-tint);
  stroke-width: 12;
}

.timer-progress-arc {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.18s linear;
}

.timer-tick {
  stroke: var(--border-strong);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.timer-tick.is-major {
  stroke: var(--muted);
  stroke-width: 2.2;
}

.timer-knob-halo {
  fill: var(--focus-ring);
}

.timer-knob-dot {
  fill: var(--accent-primary);
  stroke: var(--surface);
  stroke-width: 2.5;
}

.timer-center-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.timer-clock-value {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}

.timer-min-sub {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}

.timer-active-actions {
  display: flex;
  gap: 10px;
}

.timer-active-actions[hidden],
.timer-start-btn[hidden] {
  display: none;
}

/* Streak Dialog */
.streak-modal-card {
  text-align: center;
}

.streak-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.streak-dialog-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink-secondary);
}

.streak-freeze-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--xp-bg);
  border: 1px solid var(--xp-border);
  color: var(--xp-text);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: help;
}

.streak-freeze-icon {
  width: 17px;
  height: 17px;
}

/* Pure CSS Accessible Tooltip */
.gami-tooltip-host {
  position: relative;
}

.gami-tooltip-host[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 220px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

[dir="rtl"] .gami-tooltip-host[data-tooltip]::after {
  transform: translateX(50%) translateY(4px);
}

.gami-tooltip-host[data-tooltip]:hover::after,
.gami-tooltip-host[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[dir="rtl"] .gami-tooltip-host[data-tooltip]:hover::after,
[dir="rtl"] .gami-tooltip-host[data-tooltip]:focus-visible::after {
  transform: translateX(50%) translateY(0);
}

.streak-freeze-badge.gami-tooltip-host[data-tooltip]::after,
[dir="rtl"] .streak-freeze-badge.gami-tooltip-host[data-tooltip]::after {
  inset-inline-start: 0;
  transform: translateY(4px);
  text-align: start;
}

.streak-freeze-badge.gami-tooltip-host[data-tooltip]:hover::after,
.streak-freeze-badge.gami-tooltip-host[data-tooltip]:focus-visible::after,
[dir="rtl"] .streak-freeze-badge.gami-tooltip-host[data-tooltip]:hover::after,
[dir="rtl"] .streak-freeze-badge.gami-tooltip-host[data-tooltip]:focus-visible::after {
  transform: translateY(0);
}

.streak-flame-hero {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.streak-flame-glow {
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.34), rgba(249, 115, 22, 0) 70%);
  filter: blur(6px);
}

.streak-flame-svg {
  position: relative;
  z-index: 1;
}

.streak-hero-number {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.05;
  color: var(--ink-strong);
  margin-top: 4px;
}

.streak-hero-label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--streak-text);
  margin-bottom: 18px;
}

.streak-days-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 20px;
}

.streak-day-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.streak-day-item.is-future-item {
  opacity: 0.52;
}

.streak-day-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.streak-day-circle .icon {
  width: 17px;
  height: 17px;
}

.streak-day-circle.is-missed {
  background: var(--surface);
  border-color: var(--border-strong);
}

.streak-day-circle.is-future {
  background: var(--surface-elevated);
  border-color: var(--border-soft);
}

.streak-day-circle.is-completed {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  border-color: #ea580c;
  color: #ffffff;
}

.streak-day-circle.is-frozen {
  background: var(--xp-bg);
  border-color: var(--xp-border);
  color: var(--xp-text);
}

.streak-day-circle.is-today {
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.22);
}

.streak-day-circle.is-today:not(.is-completed) {
  background: var(--streak-bg);
}

.streak-day-circle.is-bonus {
  border-color: #eab308;
  background: rgba(250, 204, 21, 0.16);
  color: #eab308;
  cursor: help;
}

.streak-day-circle.is-bonus .icon {
  fill: #facc15;
  stroke: #ca8a04;
}

.streak-day-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.streak-day-item.is-today-item .streak-day-name {
  color: var(--streak-text);
  font-weight: 800;
}

.streak-body-copy {
  margin: 0 0 20px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.streak-go-btn {
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 10px 24px rgba(234, 88, 12, 0.25);
}

/* Leaderboard Page */
.leaderboard-shell {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding-inline: 20px;
  padding-top: 8px;
  padding-bottom: 36px;
}

.leaderboard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.leaderboard-page-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--ink-strong);
}

.leaderboard-tabs {
  display: inline-flex;
  background: var(--surface-glass);
  border: 1px solid var(--border-soft);
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
}

.leaderboard-tab-btn {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.leaderboard-tab-btn.is-active {
  background: var(--pill-gradient);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(14, 86, 138, 0.24);
  box-shadow: 0 4px 12px rgba(105, 200, 255, 0.28);
}

.leaderboard-empty-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--xp-bg);
  border: 1px solid var(--xp-border);
  color: var(--xp-text);
  font-size: 0.92rem;
  font-weight: 700;
}

.leaderboard-empty-banner[hidden] {
  display: none;
}

.leaderboard-empty-banner .icon {
  width: 18px;
  height: 18px;
  fill: #3b82f6;
  stroke: #1d4ed8;
  flex-shrink: 0;
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.podium-card {
  background: var(--surface-glass);
  border: 1.5px solid var(--border-soft);
  border-radius: 22px;
  padding: 16px 10px 14px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.24s ease;
}

.podium-card.is-gold {
  padding-top: 24px;
  border-color: #facc15;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.16) 0%, var(--surface) 55%);
}

.podium-card.is-silver {
  border-color: var(--border-strong);
}

.podium-card.is-bronze {
  border-color: #fdba74;
}

.podium-card.is-current-user {
  box-shadow: 0 0 0 2px var(--accent-primary), var(--shadow-soft);
}

.podium-card.is-current-user .podium-avatar,
.leaderboard-row.is-current-user .leaderboard-avatar {
  text-shadow: 0 1px 2px rgba(14, 86, 138, 0.24);
}

.podium-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.podium-crown-svg {
  position: absolute;
  top: -22px;
  width: 26px;
  height: 26px;
}

.podium-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-soft);
}

.podium-card.is-gold .podium-avatar {
  width: 62px;
  height: 62px;
  font-size: 1.15rem;
}

.podium-rank-pill {
  position: absolute;
  bottom: -6px;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--ink-strong);
  color: var(--surface);
  font-size: 0.74rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}

.podium-card.is-gold .podium-rank-pill {
  background: #eab308;
  color: #0f172a;
}

.podium-card.is-silver .podium-rank-pill {
  background: #64748b;
  color: #ffffff;
}

.podium-card.is-bronze .podium-rank-pill {
  background: #ea580c;
  color: #ffffff;
}

.podium-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

.podium-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink-strong);
}

.podium-xp {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-text);
  margin-top: 3px;
}

.podium-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--streak-text);
  margin-top: 4px;
}

.leaderboard-flame-svg {
  width: 14px;
  height: 14px;
  fill: #f97316;
  stroke: #ea580c;
}

.leaderboard-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.leaderboard-list-scroll {
  max-height: 410px;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-elevated);
  border: 1px solid transparent;
  transition: transform 0.25s ease, background-color 0.2s ease;
}

.leaderboard-row.is-current-user {
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: var(--surface-tint);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-soft);
}

.leaderboard-row.is-rank-up,
.podium-card.is-rank-up {
  animation: rankClimbPulse 0.75s ease;
}

@keyframes rankClimbPulse {
  0% {
    transform: translateY(10px);
    box-shadow: 0 0 0 0 rgba(105, 200, 255, 0.45);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 0 0 6px rgba(105, 200, 255, 0.16);
  }
  100% {
    transform: translateY(0);
    box-shadow: none;
  }
}

.leaderboard-row-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.leaderboard-rank-num {
  min-width: 24px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}

.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.leaderboard-user-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-you-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
}

.leaderboard-row-end {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.leaderboard-row-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--streak-text);
}

.leaderboard-row-xp {
  min-width: 72px;
  text-align: end;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-text);
}

.leaderboard-demo-note {
  margin-top: 10px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

@media (max-width: 700px) {
  .home-light-topbar.gamification-topbar {
    padding-inline: 12px;
    gap: 8px;
  }

  .topbar-pills-row {
    gap: 6px;
  }

  .topbar-pill {
    padding-inline: 9px;
    height: 34px;
  }

  .topbar-icon-pill {
    width: 34px;
    height: 34px;
  }

  .topbar-volume-wrap {
    height: 34px;
    padding-inline: 6px 8px;
    gap: 4px;
  }

  .topbar-volume-slider {
    width: 64px;
  }

  .topbar-pill-label,
  .xp-pill .topbar-pill-unit {
    display: none;
  }

  .gami-modal-card {
    max-width: none;
    width: calc(100% - 12px);
    padding-block: 22px;
    padding-inline: 24px;
    border-radius: 22px;
  }

  .streak-day-circle {
    width: 32px;
    height: 32px;
  }

  .leaderboard-shell {
    padding-inline: 12px;
  }

  .leaderboard-podium {
    gap: 8px;
  }

  .podium-card {
    padding: 12px 6px;
  }

  .podium-avatar {
    width: 44px;
    height: 44px;
    font-size: 0.92rem;
  }

  .podium-card.is-gold .podium-avatar {
    width: 50px;
    height: 50px;
  }
}

.sidebar-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-pro-badge.is-pro-active {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #92400e;
}

.home-profile-sub {
  margin-top: -10px;
  margin-bottom: 12px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

/* Post Sign-Up Class Selection Popup */
.class-popup-card {
  max-width: 500px;
  max-height: 90dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cp-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cp-mascot-slot {
  flex-shrink: 0;
}

.cp-subtitle {
  margin: 4px 0 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.45;
}

.cp-skip-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.cp-levels-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cp-level-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1.8px solid var(--border-soft);
  background: var(--surface-elevated);
  color: var(--ink-strong);
  font-size: 0.92rem;
  font-weight: 800;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cp-level-card.is-selected {
  border-color: var(--accent-primary);
  background: var(--surface-tint);
  color: var(--accent-text);
}

.cp-level-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cp-level-icon .icon {
  width: 17px;
  height: 17px;
}

.cp-level-label {
  flex: 1;
}

.cp-check-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.cp-level-card.is-selected .cp-check-badge {
  opacity: 1;
}

.cp-check-badge .icon,
.cp-chip-check .icon {
  width: 12px;
  height: 12px;
}

.cp-sublevel-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

.cp-sub-heading {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink-secondary);
}

.cp-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.6px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.cp-chip.is-selected {
  border-color: var(--accent-primary);
  background: var(--surface-tint);
  color: var(--accent-text);
}

.cp-chip-check {
  display: none;
}

.cp-chip.is-selected .cp-chip-check {
  display: inline-flex;
}

.cp-text-input {
  width: 100%;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface-elevated);
  color: var(--ink);
  outline: none;
}

.cp-text-input:focus {
  border-color: var(--accent-primary);
}

.cp-age-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
}

.cp-age-stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.cp-age-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.6px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--ink-strong);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.cp-age-val {
  min-width: 30px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent-text);
}

.cp-parent-note {
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.cp-save-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =========================================================
   COMPLETE LANDING PAGE SECTIONS
   ========================================================= */
html {
  scroll-behavior: smooth;
}

body.landing-page {
  position: relative;
  overflow-x: hidden;
}

body.landing-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 68% 42% at 50% 8%, rgba(105, 200, 255, 0.22) 0%, transparent 70%),
    radial-gradient(circle 380px at 84% 26%, rgba(145, 217, 255, 0.18) 0%, transparent 72%),
    radial-gradient(circle 340px at 16% 68%, rgba(181, 232, 255, 0.18) 0%, transparent 72%);
}

body.landing-page > main,
body.landing-page > .landing-footer,
body.landing-page > .landing-topbar-wrap {
  position: relative;
  z-index: 1;
}

/* How It Works 3-Step Strip */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 980px;
  margin-inline: auto;
}

.how-card {
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.how-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.how-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pill-gradient);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(14, 86, 138, 0.24);
  font-size: 0.88rem;
  font-weight: 900;
}

.how-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-tint);
  color: var(--accent-text);
}

.how-icon-wrap .icon {
  width: 24px;
  height: 24px;
}

.how-card h3 {
  margin: 4px 0 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--ink-strong);
}

.how-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* FAQ Accordion */
.faq-list {
  max-width: 780px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  transition: border-color 0.2s ease;
}

.faq-item.is-open {
  border-color: var(--accent-primary);
}

.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border: none;
  background: transparent;
  color: var(--ink-strong);
  font-size: 1.02rem;
  font-weight: 800;
  text-align: start;
  cursor: pointer;
}

.faq-chevron {
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 0.22s ease, color 0.2s ease;
  flex-shrink: 0;
}

.faq-item.is-open .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.24s ease;
}

.faq-item.is-open .faq-panel {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  overflow: hidden;
}

.faq-panel-inner p {
  margin: 0;
  padding-inline: 22px;
  padding-bottom: 18px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

/* Final Call-to-Action Band */
.final-cta-card {
  max-width: 920px;
  margin-inline: auto;
  padding: 40px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--surface-promo);
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}

.final-cta-title {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--ink-strong);
}

.final-cta-sub {
  margin: 0 0 8px;
  max-width: 540px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 600;
}

/* Footer */
.landing-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--surface-glass);
  margin-top: 24px;
}

.landing-footer-inner {
  max-width: 1180px;
  margin-inline: auto;
  padding: 26px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.landing-footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.landing-footer-link {
  background: none;
  border: none;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.16s ease;
}

.landing-footer-link:hover {
  color: var(--ink-strong);
}

.landing-footer-copy {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .how-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .landing-topbar-wrap .topbar {
    padding-inline: 14px;
    padding-block: 11px;
    gap: 8px;
  }

  .landing-topbar-wrap .brand-name {
    font-size: 1.12rem;
  }

  .landing-topbar-wrap .brand-badge {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .landing-topbar-wrap .topbar-group {
    gap: 6px;
  }

  .landing-topbar-wrap .lang-select-wrap {
    padding: 4px 8px;
  }

  .landing-topbar-wrap #getStartedBtn {
    padding: 8px 13px;
    font-size: 0.84rem;
  }

  .section {
    padding: 38px 14px 48px;
  }

  .use-case-card,
  .how-card,
  .final-cta-card {
    padding: 22px 18px;
  }

  .landing-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .faq-chevron,
  .faq-panel,
  .use-case-card,
  .home-hero-head {
    transition: none;
  }

  }
