/* ===========================
   PREMIUM LIGHT DESIGN SYSTEM
   Apple / Notion / Stripe inspired
   =========================== */
:root {
  --app-height: 100vh;
  --app-offset-top: 0px;

  /* Core Backgrounds */
  --bg-base: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-input-focus: #FFFFFF;
  --bg-nav: rgba(255, 255, 255, 0.82);

  /* Accent Colors */
  --accent-blue: #3B82F6;
  --accent-violet: #8B5CF6;
  --emerald: #10B981;
  --amber: #F59E0B;
  --danger: #EF4444;
  --accent-gradient: linear-gradient(135deg, #3B82F6, #8B5CF6);
  --emerald-gradient: linear-gradient(135deg, #10B981, #059669);

  /* Text Colors - Jet Black Update */
  --text-heading: #000000;
  --text-primary: #000000;
  --text-secondary: #000000;
  --text-muted: #4B5563;
  --text-faint: #9CA3AF;

  /* Borders */
  --border: #E5E7EB;
  --border-light: #F1F1F1;
  --border-focus: #3B82F6;

  /* Shadows — Apple-style multi-layer */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06), 0 20px 48px rgba(0, 0, 0, 0.1);
  --shadow-btn-blue: 0 4px 14px rgba(59, 130, 246, 0.3);
  --shadow-btn-green: 0 4px 14px rgba(16, 185, 129, 0.3);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --tracking-tight: -0.02em;
  --tracking-normal: -0.01em;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms var(--ease);
  --t-base: 250ms var(--ease);
  --t-slow: 350ms var(--ease);
}

/* ===========================
   RESET & BASE
   =========================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===========================
   APP LOADER
   =========================== */
#app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

#app-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loader-logo {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.18);
}

.loader-brand {
  font-size: 17px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.02em;
}

.loader-progress {
  width: 130px;
  height: 3px;
  background: #E5E7EB;
  border-radius: 99px;
  overflow: hidden;
}

.loader-progress-fill {
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, #3B82F6, #8B5CF6);
  border-radius: 99px;
  animation: loader-sweep 1.1s ease-in-out infinite;
}

@keyframes loader-sweep {
  0%   { transform: translateX(-130%); }
  100% { transform: translateX(290%); }
}

body.chat-open {
  overflow: hidden;
}

/* Subtle warm gradient wash at top of page */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: -200px;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -100px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--text-heading);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
}

/* ===========================
   UTILITY CLASSES
   =========================== */
.glass {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-xl);
  transition: all var(--t-base);
}

.glass:hover {
  box-shadow: var(--shadow-card-hover);
}

/* ===========================
   BUTTONS
   =========================== */
.btn-gradient {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 12px 28px;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--r-full);
  border: none;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
  letter-spacing: var(--tracking-normal);
}

.btn-gradient:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: var(--shadow-btn-blue);
}

.btn-gradient:active {
  transform: translateY(0) scale(0.98);
}

.btn-gradient.emerald {
  background: var(--emerald-gradient);
}

.btn-gradient.emerald:hover {
  box-shadow: var(--shadow-btn-green);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--t-base);
}

.btn-outline:hover {
  background: var(--bg-base);
  border-color: var(--text-muted);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 20px;
  background: transparent;
  color: var(--danger);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--r-full);
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.06);
}

/* ===========================
   FORM ELEMENTS
   =========================== */
.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all var(--t-fast);
}

.input-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.form-group {
  margin-bottom: var(--s-5);
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--s-2);
  letter-spacing: var(--tracking-normal);
}

.form-group.error .input-field {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

/* ===========================
   AUTH PAGE
   =========================== */
.auth-page {
  display: none;
  min-height: 100vh;
}

.auth-page.active {
  display: flex;
}

/* Split layout */
.auth-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--s-16);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #EEF2FF 0%, #F0F4FF 30%, #FAF5FF 70%, #FDF2F8 100%);
}

/* Soft decorative gradient blobs */
.auth-visual::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle at 30% 40%, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.1), transparent 60%);
  animation: floatOrb 12s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floatOrb {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

.auth-visual .hero-tagline {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-heading);
  text-align: center;
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  max-width: 480px;
  z-index: 1;
}

.auth-visual .hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  margin-top: var(--s-4);
  text-align: center;
  z-index: 1;
}

.auth-visual .hero-logo {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-10);
  z-index: 1;
}

.auth-visual .hero-logo i {
  width: 24px;
  height: 24px;
  color: var(--accent-blue);
}

.auth-visual .hero-logo span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Auth form panel */
.auth-form-panel {
  width: 480px;
  min-width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--s-16) var(--s-12);
  background: var(--bg-card);
  position: relative;
}

.auth-form-panel .logo-small {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-10);
}

.auth-form-panel .logo-small svg,
.auth-form-panel .logo-small i {
  color: var(--text-heading);
  width: 24px;
  height: 24px;
}

.auth-logo-img {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  object-fit: cover;
}

.auth-form-panel .logo-small span {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-heading);
  letter-spacing: var(--tracking-tight);
}

/* Form Row for multi-column layout */
.form-row {
  display: flex;
  gap: var(--s-4);
  width: 100%;
}

.form-row .form-group {
  flex: 1;
}

@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  gap: var(--s-6);
  margin-bottom: var(--s-8);
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding-bottom: var(--s-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
  margin-bottom: -1px;
}

.auth-tab.active {
  color: var(--text-heading);
  border-bottom-color: var(--accent-blue);
}

.auth-tab:hover {
  color: var(--text-secondary);
}

/* Auth forms */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeUp 0.3s var(--ease);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-form h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--s-2);
}

.auth-form .auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--s-8);
}

.forgot-link {
  text-align: center;
  margin-top: var(--s-5);
}

.forgot-link a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--t-fast);
}

.forgot-link a:hover {
  color: var(--accent-blue);
}

/* ===========================
   DASHBOARD PAGE
   =========================== */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}

/* Top Nav */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: none;
  padding: 0 var(--s-6);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-violet), var(--emerald));
  opacity: 0.5;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.nav-logo-img {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  object-fit: cover;
}

.nav-logo i,
.nav-logo svg {
  width: 24px;
  height: 24px;
  color: var(--text-heading);
}

.nav-logo span {
  font-weight: 700;
  font-size: 18px;
  color: #000000;
  letter-spacing: var(--tracking-tight);
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  position: relative;
}

.nav-right .nav-name {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
}

.nav-right .avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #EEF2FF, #F0F4FF);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-heading);
  transition: all var(--t-fast);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.nav-right:hover .avatar {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: var(--s-2);
  display: none;
  z-index: 200;
  animation: dropIn 0.2s var(--ease);
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-dropdown.open {
  display: block;
}

/* Announcement Bell */
.nav-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-full);
  color: var(--text-secondary);
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.nav-bell:hover {
  background: var(--bg-hover);
  color: var(--text-heading);
}

.nav-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: #EF4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Announcement Popup */
.announcement-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: min(84vh, 760px);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg), 0 10px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  display: none;
  flex-direction: column;
  z-index: 300;
  animation: dropIn 0.2s var(--ease);
  overflow-x: hidden;
  overflow-y: auto;
}

.announcement-popup.open {
  display: flex;
}

.announcement-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-primary);
}

.announcement-popup-header span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
}

.announcement-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.announcement-popup-close:hover {
  background: var(--bg-hover);
  color: var(--text-heading);
}

/* Expand/Collapse icon */
.announcement-popup-expand-icon {
  transition: transform 0.3s ease;
}

.announcement-popup.collapsed .announcement-popup-expand-icon {
  transform: rotate(180deg);
}

.announcement-popup-list {
  flex: 0 0 auto;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
}

.announcement-popup-item {
  padding: 12px;
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-fast);
  margin-bottom: 4px;
}

.announcement-popup-item:hover {
  background: var(--bg-hover);
}

.announcement-popup-item:last-child {
  margin-bottom: 0;
}

.announcement-popup-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
  line-height: 1.3;
}

.announcement-popup-item-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.announcement-popup-item-date {
  font-size: 11px;
  color: var(--text-muted);
}

.announcement-popup-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  .announcement-popup {
    width: min(360px, calc(100vw - 20px));
    max-height: 70vh;
    right: 0;
  }
}

@media (max-width: 480px) {
  .announcement-popup {
    width: calc(100vw - 16px);
    right: -4px;
  }

  .announcement-popup-header {
    padding: 12px 14px;
  }

  .announcement-popup-item {
    padding: 10px;
  }
}

/* Bell Popup Overlay */
.nav-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-full);
  transition: background var(--t-fast);
}

.nav-profile:hover {
  background: var(--bg-hover);
}

.profile-dropdown a {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
}

.profile-dropdown a i {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.profile-dropdown a:hover {
  background: var(--bg-base);
  color: var(--text-heading);
}

.profile-dropdown .dd-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--s-2) 0;
}

.profile-dropdown a.dd-danger {
  color: var(--danger);
}

.profile-dropdown a.dd-danger i {
  color: var(--danger);
}

/* Dashboard Content */
.dashboard-content {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--s-10) var(--s-6) var(--s-20);
  position: relative;
  z-index: 1;
}

/* ===========================
   HERO / WELCOME SECTION
   =========================== */
.welcome-section {
  margin-bottom: var(--s-12);
  animation: fadeUp 0.5s var(--ease);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04), rgba(139, 92, 246, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  box-shadow: var(--shadow-card);
}

.welcome-section h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  margin-bottom: var(--s-3);
}

.welcome-section .welcome-sub {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: var(--s-2);
}

.welcome-section .welcome-date {
  font-size: 13px;
  color: var(--text-muted);
}

.welcome-divider {
  margin-top: var(--s-6);
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ===========================
   SECTION HEADERS
   =========================== */
.section-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--s-5);
}

.dashboard-section {
  margin-bottom: var(--s-12);
}

/* ===========================
   BOT CARDS
   =========================== */
.bot-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  margin-bottom: var(--s-6);
}

.bot-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-8);
  position: relative;
  overflow: hidden;
  transition: all var(--t-base);
}

/* Accent top line */
.bot-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  border-radius: 0 0 var(--r-full) var(--r-full);
}

.bot-card.fluent::before {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-violet));
}

.bot-card.khushi::before {
  background: linear-gradient(90deg, var(--emerald), #059669);
}

.bot-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.bot-card .bot-avatar-img {
  float: right;
  width: 72px;
  height: 72px;
  border-radius: var(--r-full);
  object-fit: cover;
  margin-left: var(--s-4);
  margin-bottom: var(--s-2);
  border: 3px solid #FFFFFF;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.bot-card .bot-icon-wrap {
  /* No margin needed when icon is replaced by floated image */
  display: none;
}

.bot-card .bot-icon-wrap i {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

.bot-card.fluent .bot-icon-wrap i {
  color: var(--accent-blue);
}

.bot-card.khushi .bot-icon-wrap i {
  color: var(--emerald);
}

.bot-card .bot-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--s-1);
}

.bot-card .bot-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--s-4);
}

.bot-card .bot-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--s-6);
}

.bot-card .bot-last-used {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--s-3);
}

/* Feature Input Mode Pills */
.feature-pills {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-base);
  border-radius: var(--r-full);
  letter-spacing: 0.01em;
}

/* ===========================
   STATS ROW
   =========================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}

.stat-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: all var(--t-base);
}

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

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1;
  margin-bottom: var(--s-2);
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  display: inline-block;
  flex-shrink: 0;
}

.stat-dot.blue {
  background: var(--accent-blue);
}

.stat-dot.green {
  background: var(--emerald);
}

.stat-dot.gradient {
  background: var(--accent-gradient);
}

/* ===========================
   CHART SECTION
   =========================== */
.chart-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-xl);
  padding: var(--s-8);
}

.chart-wrapper {
  position: relative;
  max-height: 280px;
  margin-bottom: var(--s-4);
}

.chart-note {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ===========================
   SESSION CARD
   =========================== */
.session-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-xl);
  padding: var(--s-6);
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-4);
}

.session-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-full);
  letter-spacing: var(--tracking-normal);
}

.session-badge.blue {
  color: var(--accent-blue);
  background: #EFF6FF;
}

.session-badge.green {
  color: var(--emerald);
  background: #ECFDF5;
}

.session-date {
  font-size: 12px;
  color: var(--text-muted);
}

.session-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--s-5);
}

.session-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.tag {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: #F3F4F6;
  border-radius: var(--r-full);
}

/* ===========================
   ANNOUNCEMENT CARD
   =========================== */
.announcement-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-left: 3px solid rgba(245, 158, 11, 0.5);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

.announcement-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--s-2);
}

.announcement-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===========================
   ANNOUNCEMENT BAR
   =========================== */
.announcement-bar {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--amber);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-6);
  margin-bottom: var(--s-8);
  animation: fadeUp 0.5s var(--ease);
  transition: all 0.3s ease;
}

/* Collapsed state for announcement bar */
.announcement-bar.collapsed {
  padding: var(--s-4) var(--s-6);
  margin-bottom: var(--s-4);
}

.announcement-bar.collapsed .announcement-list {
  display: none;
}

.announcement-bar.collapsed .announcement-expand-icon {
  transform: rotate(0deg);
}

.announcement-expand-icon {
  transition: transform 0.3s ease;
}

.announcement-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-3);
}

.announcement-bar-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
}

.announcement-dot {
  width: 8px;
  height: 8px;
  background: var(--amber);
  border-radius: var(--r-full);
  display: inline-block;
}

.announcement-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  border-radius: var(--r-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}

.announcement-dismiss:hover {
  background: var(--bg-base);
  color: var(--text-heading);
}

.announcement-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  max-height: 200px;
  overflow-y: auto;
}

.announcement-item {
  padding: var(--s-3) var(--s-4);
  background: var(--bg-base);
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
}

.announcement-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--s-1);
}

.announcement-item-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.announcement-item-date {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: var(--s-2);
}

/* ===========================
   CALENDAR - APPLE STYLE
   =========================== */
.announcement-popup .announcement-calendar-card {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border-light);
  border-radius: 0;
  box-shadow: none;
  background: var(--bg-primary);
  padding: 14px 14px 16px;
}

.announcement-popup .calendar-nav {
  margin-bottom: 10px;
}

.announcement-popup .calendar-weekdays span {
  padding: 6px 0;
}

.announcement-popup .calendar-day {
  min-height: 38px;
  font-size: 15px;
}

.calendar-card {
  padding: 20px 16px 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 4px;
}

.calendar-month-label {
  font-size: 18px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.3px;
}

.calendar-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: #007AFF;
  cursor: pointer;
  transition: background 0.2s ease;
}

.calendar-nav-btn:hover {
  background: rgba(0, 122, 255, 0.1);
}

.calendar-nav-btn:active {
  background: rgba(0, 122, 255, 0.15);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 8px;
}

.calendar-weekdays span {
  font-size: 11px;
  font-weight: 500;
  color: #8E8E93;
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  min-height: 44px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 400;
  color: #000;
  cursor: default;
  transition: all 0.2s ease;
}

.calendar-day.other-month {
  color: #C7C7CC;
}

.calendar-day.today {
  background: none;
  color: #007AFF;
  font-weight: 600;
}

.calendar-day.today::before {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  background: #007AFF;
  border-radius: 50%;
  z-index: 0;
}

.calendar-day.today span {
  position: relative;
  z-index: 1;
  color: #fff;
}

.calendar-day.has-announcement {
  cursor: pointer;
  background: rgba(255, 149, 0, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 149, 0, 0.35);
  font-weight: 600;
}

.calendar-day.has-announcement:hover {
  background: rgba(255, 149, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 149, 0, 0.55);
}

.calendar-day.has-announcement.today:hover::before {
  background: #0066CC;
}

.calendar-day.selected {
  background: rgba(0, 122, 255, 0.1);
}

.calendar-day.selected::after {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  border: 2px solid #007AFF;
  border-radius: 50%;
  z-index: 0;
}

.calendar-day.selected.today::after {
  border-color: #fff;
}

.calendar-day-dot {
  width: 6px;
  height: 6px;
  background: #FF9500;
  border-radius: 50%;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.calendar-day.has-announcement .calendar-day-dot {
  box-shadow: 0 0 0 2px rgba(255, 149, 0, 0.22);
}

.calendar-day.today .calendar-day-dot {
  background: #fff;
}

.calendar-detail {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #E5E5EA;
  animation: fadeUp 0.25s ease;
}

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

.calendar-detail-date {
  font-size: 15px;
  font-weight: 600;
  color: #000;
}

.calendar-detail-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: #F2F2F7;
  border-radius: 8px;
  color: #8E8E93;
  cursor: pointer;
  transition: all var(--t-fast);
}

.calendar-detail-close:hover {
  background: #E5E5EA;
  color: #3C3C43;
}

.calendar-detail-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-detail-item {
  padding: 14px 16px;
  background: #F2F2F7;
  border-radius: 12px;
  border-left: 3px solid #FF9500;
}

.calendar-detail-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  margin-bottom: 4px;
}

.calendar-detail-item-message {
  font-size: 13px;
  color: #3C3C43;
  line-height: 1.5;
}

/* Calendar mobile responsive */
@media (max-width: 480px) {
  .calendar-card {
    padding: 16px 12px 20px;
    border-radius: 14px;
  }

  .calendar-month-label {
    font-size: 16px;
  }

  .calendar-nav-btn {
    width: 28px;
    height: 28px;
  }

  .calendar-day {
    min-height: 38px;
    font-size: 15px;
  }

  .calendar-day.today::before,
  .calendar-day.selected::after {
    width: 28px;
    height: 28px;
  }

  .calendar-weekdays span {
    font-size: 10px;
  }
}

/* ===========================
   GRAMMAR TIP
   =========================== */
.tip-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-left: 3px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

.tip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.tip-title .tip-dot {
  width: 8px;
  height: 8px;
  background: var(--amber);
  border-radius: var(--r-full);
  display: inline-block;
}

.tip-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===========================
   DAILY VOCABULARY CARD
   =========================== */
.vocab-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-left: 3px solid rgba(139, 92, 246, 0.5);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

.vocab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-5);
}

.vocab-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.vocab-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-violet);
  border-radius: var(--r-full);
  display: inline-block;
}

.vocab-date {
  font-size: 12px;
  color: var(--text-muted);
}

.vocab-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.vocab-item {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  padding: 10px 14px;
  background: var(--bg-base);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  animation: fadeUp 0.4s var(--ease) both;
}

.vocab-item:nth-child(1) {
  animation-delay: 0.05s;
}

.vocab-item:nth-child(2) {
  animation-delay: 0.10s;
}

.vocab-item:nth-child(3) {
  animation-delay: 0.15s;
}

.vocab-item:nth-child(4) {
  animation-delay: 0.20s;
}

.vocab-item:nth-child(5) {
  animation-delay: 0.25s;
}

.vocab-item:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(59, 130, 246, 0.05));
  transform: translateX(4px);
}

.vocab-word {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-violet);
  min-width: 130px;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.vocab-dash {
  color: var(--text-muted);
  font-weight: 300;
  flex-shrink: 0;
}

.vocab-meaning {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===========================
   ACTIVITY PAGE
   =========================== */
.activity-page {
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
}

.activity-page .top-nav {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border-light);
}

.activity-page .nav-logo,
.activity-page .nav-logo i,
.activity-page .activity-nav-title {
  color: var(--text-heading);
}

.activity-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.activity-page .container {
  max-width: 700px;
  margin: 0 auto;
}

.activity-page .card {
  background: var(--bg-card);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 32px;
  margin-bottom: 24px;
}

.activity-page h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-heading);
}

.activity-page .subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.progress-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}

#activity-badge {
  background: rgba(59, 130, 246, 0.08);
  border-radius: 12px;
  padding: 6px 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  font-weight: 600;
}

#activity-badge.completed {
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
}

.progress-badge {
  background: rgba(59, 130, 246, 0.08);
  border-radius: 12px;
  padding: 8px 16px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
}

.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-violet) 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.context-badge {
  display: inline-block;
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 24px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-text {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 32px;
  color: var(--text-heading);
}

.question-passage {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-blue);
  background: var(--bg-base);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

#answer-widget {
  margin-bottom: 16px;
}

.answer-options {
  display: grid;
  gap: 10px;
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all var(--t-fast);
}

.answer-option:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
}

.answer-option input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--accent-blue);
}

.answer-option span {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
}

.activity-answer-input {
  width: 100%;
}

.blank {
  display: inline-block;
  min-width: 180px;
  border-bottom: 2px dashed rgba(59, 130, 246, 0.45);
  margin: 0 4px;
  color: var(--accent-blue);
}

/* Inline fill-in-the-blank input */
.inline-blank-input {
  display: inline-block;
  border: none;
  border-bottom: 2.5px solid var(--accent-blue);
  background: transparent;
  font-size: inherit;
  font-family: inherit;
  font-weight: 600;
  color: var(--accent-blue);
  min-width: 210px;
  width: 240px;
  outline: none;
  padding: 0 4px 3px 4px;
  vertical-align: baseline;
  line-height: inherit;
  border-radius: 0;
  transition: border-color 0.2s, background 0.2s;
}
.inline-blank-input:focus {
  border-bottom-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.06);
  border-radius: 4px 4px 0 0;
  box-shadow: none;
}
.inline-blank-input::placeholder {
  color: rgba(59, 130, 246, 0.4);
  font-weight: 400;
}
.inline-blank-input:disabled {
  border-bottom-color: var(--border);
  color: var(--text-muted);
  cursor: default;
  background: transparent;
}

.verb-hint {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.verb-hint span:first-child {
  font-size: 13px;
  color: var(--text-muted);
}

.verb {
  font-size: 16px;
  font-weight: 600;
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 12px;
  border-radius: 6px;
}

.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.activity-page select,
.activity-page input[type="text"]:not(.inline-blank-input) {
  flex: 1;
  min-width: 150px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
}

.activity-page select option {
  background: #ffffff;
  color: var(--text-primary);
}

.activity-page select:focus,
.activity-page input[type="text"]:not(.inline-blank-input):focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

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

.btn {
  padding: 14px 32px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-violet) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.btn-primary:disabled {
  background: #e5e7eb;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-hint {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.hint-box {
  background: rgba(245, 158, 11, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 16px 20px;
  margin-top: 16px;
  font-size: 14px;
  color: #a16207;
}

.result-box {
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.result-correct {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.result-incorrect {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.result-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.result-correct .result-title {
  color: #22c55e;
}

.result-incorrect .result-title {
  color: #ef4444;
}

.result-explanation {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.btn-nav {
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-nav:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.btn-reset {
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.quick-nav-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-nav-btn.current {
  border: 2px solid var(--accent-blue);
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
}

.quick-nav-btn.answered {
  background: #eef2ff;
  color: #4338ca;
}

.quick-nav-btn.correct {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.quick-nav-btn.wrong {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.grammar-ref {
  margin-top: 24px;
}

.grammar-ref h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-heading);
}

.grammar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 8px;
}

.grammar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.grammar-item p {
  font-size: 13px;
  color: var(--text-secondary);
}

.grammar-help {
  color: var(--text-muted);
}

.results-summary {
  text-align: center;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 48px;
  font-weight: 700;
}

.score-excellent {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3);
}

.score-good {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
}

.score-poor {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

.results-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.results-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.review-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-heading);
}

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

.review-item {
  background: var(--bg-base);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
}

.review-correct {
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.review-incorrect {
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.review-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.review-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.review-correct .review-icon {
  background: rgba(34, 197, 94, 0.2);
}

.review-incorrect .review-icon {
  background: rgba(239, 68, 68, 0.2);
}

.review-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.review-answer {
  font-size: 13px;
  color: var(--text-muted);
}

.review-answer span {
  font-weight: 600;
}

.text-correct {
  color: #22c55e;
}

.text-incorrect {
  color: #ef4444;
}

#activity-report-status {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

#activity-report-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

.bg-blue {
  background: rgba(59, 130, 246, 0.1);
}

.text-blue {
  color: #3b82f6;
}

.border-blue {
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.bg-purple {
  background: rgba(168, 85, 247, 0.1);
}

.text-purple {
  color: #a855f7;
}

.border-purple {
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.bg-green {
  background: rgba(34, 197, 94, 0.1);
}

.text-green {
  color: #22c55e;
}

.border-green {
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.bg-red {
  background: rgba(239, 68, 68, 0.1);
}

.text-red {
  color: #ef4444;
}

.border-red {
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.bg-orange {
  background: rgba(249, 115, 22, 0.1);
}

.text-orange {
  color: #f97316;
}

.border-orange {
  border: 1px solid rgba(249, 115, 22, 0.3);
}

/* ===========================
   FEEDBACK SECTION
   =========================== */
/* Floating Feedback Button */
.feedback-fab {
  position: fixed;
  bottom: var(--s-8);
  right: var(--s-8);
  width: 52px;
  height: 52px;
  border-radius: var(--r-full);
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-btn-blue);
  transition: all var(--t-base);
  z-index: 90;
}

.feedback-fab:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.feedback-fab:active {
  transform: scale(0.95);
}

.activity-fab {
  position: fixed;
  bottom: var(--s-8);
  left: var(--s-8);
  width: 52px;
  height: 52px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
  transition: all var(--t-base);
  z-index: 90;
}

.activity-fab:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45);
}

.activity-fab:active {
  transform: scale(0.95);
}

/* Feedback Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}

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

.modal-box {
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  border-radius: var(--r-2xl);
  padding: var(--s-8);
  width: 100%;
  max-width: 460px;
  animation: fadeUp 0.3s var(--ease);
}

.modal-box h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--s-2);
}

.modal-box .modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--s-6);
}

.test-selector-modal-box {
  max-width: 560px;
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
}

.test-selector-content {
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
}

.test-selector-group + .test-selector-group {
  margin-top: var(--s-6);
}

.test-selector-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-3);
}

.modal-actions {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-6);
  justify-content: flex-end;
}

.delete-account-warning {
  padding: var(--s-4);
  border-radius: var(--r-lg);
  border: 1px solid rgba(239, 68, 68, 0.12);
  background: rgba(239, 68, 68, 0.04);
  margin-bottom: var(--s-5);
}

.delete-account-warning p {
  font-size: 13px;
  color: var(--text-secondary);
}

.delete-account-warning ul {
  margin: var(--s-3) 0 var(--s-3) 18px;
  color: var(--text-secondary);
  font-size: 13px;
}

.delete-account-warning li + li {
  margin-top: 6px;
}

.delete-account-note {
  color: var(--text-muted) !important;
}

.delete-account-email {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-heading);
  font-weight: 600;
  word-break: break-word;
}

.delete-account-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: var(--s-2);
  font-size: 13px;
  color: var(--text-secondary);
}

.delete-account-check input {
  margin-top: 3px;
}

.delete-account-submit {
  width: auto;
  min-width: 180px;
}

.test-selector-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-selector-btn {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-base);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  transition: all var(--t-fast);
  color: var(--text-primary);
}

.test-selector-btn:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.06);
  transform: translateY(-1px);
}

.test-selector-btn span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.test-selector-btn strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.4;
}

.test-selector-btn small {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===========================
   CHAT PAGE
   =========================== */
.chat-page {
  display: none;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
  flex-direction: column;
  background: var(--bg-base);
  overflow: hidden;
}

.chat-page.active {
  display: flex;
  position: fixed;
  top: var(--app-offset-top, 0px);
  left: 0;
  right: 0;
  width: 100%;
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
}

.chat-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  min-height: 56px;
}

.chat-nav-left {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.chat-nav-right {
  display: flex;
  justify-content: flex-end;
  min-width: 80px;
}

.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.chat-back {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
}

.chat-back i {
  width: 16px;
  height: 16px;
}

.chat-back:hover {
  color: var(--text-heading);
  background: var(--bg-base);
}

.chat-nav-center {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.chat-nav-center .bot-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--emerald);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-6) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--r-full);
}

.message {
  display: flex;
  max-width: 80%;
  animation: msgSlideIn 0.3s var(--ease);
}

@keyframes msgSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-self: flex-end;
}

.message.bot {
  align-self: flex-start;
}

.msg-bubble {
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.6;
  border-radius: var(--r-lg);
}

.message.user .msg-bubble {
  background: var(--accent-gradient);
  color: #fff;
  border-bottom-right-radius: var(--s-1);
}

.message.bot .msg-bubble {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  border-bottom-left-radius: var(--s-1);
  border: 1.5px solid #9ca3af;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.message.user .msg-time {
  color: rgba(255, 255, 255, 0.5);
}

/* Typing Indicator */
.typing-indicator {
  display: none;
  align-self: flex-start;
  padding: 12px 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border-radius: var(--r-lg);
  border-bottom-left-radius: var(--s-1);
}

.typing-indicator.active {
  display: flex;
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: tBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes tBounce {

  0%,
  80%,
  100% {
    transform: scale(0.5);
    opacity: 0.3;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Chat Input */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  padding-bottom: max(var(--s-3), env(safe-area-inset-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}

.chat-input-bar input {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all var(--t-fast);
}

.chat-input-bar input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: var(--bg-card);
}

.chat-input-bar input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-base);
  border: none;
  cursor: pointer;
}

.send-btn i {
  width: 16px;
  height: 16px;
}

.send-btn:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-btn-blue);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn.emerald {
  background: var(--emerald-gradient);
}

.send-btn.emerald:hover {
  box-shadow: var(--shadow-btn-green);
}

/* ===========================
   MIC BUTTON & VOICE RECORDING
   =========================== */
.mic-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--r-full);
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-base);
  flex-shrink: 0;
}

.mic-btn i {
  width: 18px;
  height: 18px;
}

.mic-btn:hover {
  background: #EFF6FF;
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.mic-btn.recording {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #EF4444;
  animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* Recording UI overlay */
.recording-ui {
  display: none;
  flex: 1;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-4);
  height: 40px;
  background: var(--bg-base);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--r-full);
}

.chat-input-bar.recording .recording-ui {
  display: flex;
}

.chat-input-bar.recording input {
  display: none;
}

.chat-input-bar.recording .mic-btn {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #EF4444;
  animation: micPulse 1.5s ease-in-out infinite;
}

.rec-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  background: #EF4444;
  border-radius: var(--r-full);
  animation: recDotPulse 1s ease-in-out infinite;
}

@keyframes recDotPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.rec-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.rec-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  justify-content: center;
}

.rec-waveform span {
  width: 3px;
  background: rgba(239, 68, 68, 0.5);
  border-radius: var(--r-full);
  animation: waveBar 0.8s ease-in-out infinite;
}

.rec-waveform span:nth-child(1) {
  height: 12px;
  animation-delay: 0s;
}

.rec-waveform span:nth-child(2) {
  height: 20px;
  animation-delay: 0.1s;
}

.rec-waveform span:nth-child(3) {
  height: 16px;
  animation-delay: 0.2s;
}

.rec-waveform span:nth-child(4) {
  height: 24px;
  animation-delay: 0.3s;
}

.rec-waveform span:nth-child(5) {
  height: 14px;
  animation-delay: 0.4s;
}

@keyframes waveBar {

  0%,
  100% {
    transform: scaleY(0.4);
  }

  50% {
    transform: scaleY(1);
  }
}

.rec-timer {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  min-width: 32px;
}

.rec-cancel-btn {
  display: none;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--r-full);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #EF4444;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.rec-cancel-btn i {
  width: 16px;
  height: 16px;
}

.chat-input-bar.recording .rec-cancel-btn {
  display: flex;
}

.rec-cancel-btn:hover {
  background: rgba(239, 68, 68, 0.12);
}

/* Voice Message Bubble */
.voice-bubble {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 16px;
  min-width: 180px;
}

.voice-play-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: all var(--t-fast);
}

.voice-play-btn i {
  width: 14px;
  height: 14px;
}

.voice-play-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.voice-waveform {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}

.voice-waveform span {
  width: 2px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.45);
}

.voice-duration {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

/* ===========================
   PROFILE PAGE
   =========================== */
.profile-page {
  display: none;
  min-height: 100vh;
  background: var(--bg-base);
}

.profile-page.active {
  display: block;
}

.profile-content {
  max-width: 520px;
  margin: 0 auto;
  padding: var(--s-10) var(--s-6) var(--s-20);
}

.profile-top {
  text-align: center;
  margin-bottom: var(--s-10);
}

.profile-avatar-ring {
  width: 84px;
  height: 84px;
  border-radius: var(--r-full);
  background: var(--accent-gradient);
  padding: 2.5px;
  margin: 0 auto var(--s-5);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
  position: relative;
  cursor: pointer;
}

.profile-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-heading);
  overflow: hidden;
}

.profile-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-full);
}

/* Camera overlay on hover */
.profile-avatar-overlay {
  position: absolute;
  inset: 2.5px;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.profile-avatar-ring:hover .profile-avatar-overlay {
  opacity: 1;
}

/* Editable name row */
.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--r-md);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.profile-edit-btn:hover {
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.08);
}

/* Inline name edit form */
.profile-name-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.profile-name-edit .input-field {
  max-width: 200px;
  padding: 8px 14px;
  font-size: 14px;
  text-align: center;
}

.profile-save-btn {
  padding: 8px 16px !important;
  font-size: 13px !important;
  border-radius: var(--r-lg) !important;
}

.profile-cancel-btn {
  padding: 8px 16px !important;
  font-size: 13px !important;
}

.profile-top h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: var(--tracking-tight);
}

.profile-top .profile-email {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  margin-bottom: var(--s-4);
}

.profile-card h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--s-5);
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row .pr-label {
  font-size: 14px;
  color: var(--text-muted);
}

.profile-row .pr-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

.profile-stat-box {
  text-align: center;
  padding: var(--s-5);
  background: var(--bg-base);
  border-radius: var(--r-md);
}

.profile-stat-box .ps-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-heading);
  font-variant-numeric: tabular-nums;
}

.profile-stat-box .ps-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-6);
  align-items: center;
}

.profile-link-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

.profile-link-button {
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.profile-danger-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 12px 18px;
  border-radius: var(--r-xl);
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.06);
  color: var(--danger);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.profile-danger-button:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.32);
}

.profile-danger-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Change Password */
.change-pw-form {
  display: none;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border-light);
  margin-top: var(--s-4);
}

.change-pw-form.open {
  display: block;
}

/* ===========================
   TOAST
   =========================== */
.toast {
  position: fixed;
  bottom: var(--s-8);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 10px 24px;
  background: var(--text-heading);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-full);
  z-index: 1000;
  transition: transform 0.3s var(--ease);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);

  /* Text wrapping improvements */
  white-space: normal;
  text-align: center;
  max-width: 90%;
  width: max-content;
}

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

/* ===========================
   STAGGER ANIMATION
   =========================== */
.fade-in-section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   RESPONSIVE — MOBILE FIRST
   =========================== */
@media (max-width: 1024px) {
  .bot-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  /* Auth */
  .auth-page.active {
    flex-direction: column;
  }

  .auth-visual {
    display: none;
  }

  .auth-form-panel {
    width: 100%;
    min-width: unset;
    padding: var(--s-8) var(--s-5);
  }

  /* Dashboard */
  .dashboard-content {
    padding: var(--s-6) var(--s-4) var(--s-16);
  }

  .welcome-section h1 {
    font-size: 28px;
  }

  .bot-cards-grid {
    grid-template-columns: 1fr;
  }

  .activity-content {
    padding: 24px 16px 72px;
  }

  .activity-page .card {
    padding: 22px;
    border-radius: 18px;
  }

  .question-text {
    font-size: 18px;
    margin-bottom: 24px;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row select,
  .input-row input[type="text"]:not(.inline-blank-input) {
    min-width: 100%;
  }

  .btn-row {
    gap: 10px;
  }

  .btn-row .btn,
  .btn-row .btn-hint {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .nav-row {
    flex-direction: column;
  }

  .nav-row .btn-nav,
  .nav-row .btn-reset {
    width: 100%;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: var(--s-3);
  }

  .top-nav {
    padding: 0 var(--s-4);
  }

  .nav-right .nav-name {
    display: none;
  }

  .bot-card {
    padding: var(--s-6);
  }

  .feedback-fab,
  .activity-fab {
    bottom: 16px;
  }

  .feedback-fab {
    right: 16px;
  }

  .activity-fab {
    left: 16px;
  }

  /* Chat */
  .chat-nav-center {
    position: static;
    transform: none;
  }

  .message {
    max-width: 88%;
  }

  .chat-input-bar input {
    font-size: 16px;
  }

  /* Announcement Bar */
  .announcement-bar {
    padding: var(--s-4) var(--s-5);
  }

  .announcement-list {
    max-height: 160px;
  }

  /* Calendar */
  .calendar-day {
    min-height: 36px;
    font-size: 13px;
  }

  .calendar-weekdays span {
    font-size: 11px;
  }

  /* Profile */
  .profile-content {
    padding: var(--s-6) var(--s-4) var(--s-16);
  }
}

@media (max-width: 480px) {
  .welcome-section h1 {
    font-size: 24px;
  }

  .welcome-section {
    margin-bottom: var(--s-8);
    padding: var(--s-5);
  }

  .stat-card .stat-value {
    font-size: 28px;
  }

  .bot-card .bot-title {
    font-size: 18px;
  }

  .progress-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .results-title {
    font-size: 28px;
  }

  .score-circle {
    width: 104px;
    height: 104px;
    font-size: 38px;
  }

  /* Calendar compact */
  .calendar-day {
    min-height: 32px;
    font-size: 12px;
    padding: var(--s-1) 0;
  }

  .calendar-day-dot {
    width: 4px;
    height: 4px;
  }

  .calendar-month-label {
    font-size: 14px;
  }
}

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--r-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.14);
}


/* ===========================
   COMPACT VOICE MESSAGE BAR
   =========================== */
.voice-msg-container {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* border: 1px solid rgba(255, 255, 255, 0.6); REMOVED */
  border-radius: 24px;
  /* More rounded */
  padding: 8px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  width: fit-content;
  min-width: 220px;
  max-width: 280px;
  display: flex;
  /* Horizontal row */
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  user-select: none;
  height: 48px;
  /* Fixed compact height */
}

[data-theme="dark"] .voice-msg-container {
  background: rgba(30, 41, 59, 0.8);
  /* border: 1px solid rgba(255, 255, 255, 0.08); REMOVED */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Remove default bubble styling when wrapping a voice card */
.message.bot .msg-bubble:has(.voice-msg-container) {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.voice-msg-container:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Play Button */
.voice-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-blue);
  /* Solid or Gradient */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  transition: transform 0.1s ease;
  flex-shrink: 0;
  padding: 0;
}

.voice-play-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  margin-left: 2px;
  /* Center slight offset for play icon */
}

.voice-play-btn.playing {
  background: var(--emerald);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.voice-play-btn.playing svg {
  margin-left: 0;
  /* Center pause icon */
}

.voice-play-btn:active {
  transform: scale(0.95);
}

/* Waveform Box */
.voice-waveform-box {
  flex: 1;
  height: 16px;
  /* Compact height */
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.wave-bar {
  width: 3px;
  background: var(--text-muted);
  border-radius: 2px;
  opacity: 0.4;
  height: 40%;
  transition: height 0.2s ease;
}

.voice-msg-container.playing .wave-bar {
  animation: waveAnim 0.8s ease-in-out infinite;
  background: var(--accent-blue);
  opacity: 1;
}

/* Duration */
.voice-duration {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
}

/* Animation Keyframes */
@keyframes waveAnim {

  0%,
  100% {
    transform: scaleY(0.8);
  }

  50% {
    transform: scaleY(1.5);
  }
}

/* Random heights via nth-child */
.wave-bar:nth-child(odd) {
  height: 60%;
  animation-duration: 0.6s;
}

.wave-bar:nth-child(2n) {
  height: 40%;
  animation-duration: 0.9s;
}

.wave-bar:nth-child(3n) {
  height: 80%;
  animation-duration: 0.7s;
}

.wave-bar:nth-child(4n) {
  height: 50%;
  animation-duration: 0.5s;
}

.wave-bar:nth-child(5n) {
  height: 70%;
  animation-duration: 0.8s;
}

/* ===========================
   TEST SECTION
   =========================== */
.test-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
}

.test-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.test-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: var(--s-4);
}

.test-card-icon-secondary {
  background: linear-gradient(135deg, #10B981, #059669);
}

.test-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--s-2);
}

.test-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--s-4);
  line-height: 1.5;
}

.test-card-meta {
  display: flex;
  gap: var(--s-4);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.test-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
