:root {
  --blue-900: #0a2a63;
  --blue-800: #0e3a8a;
  --blue-700: #1451c4;
  --blue-600: #1a5fe0;
  --blue-500: #2f6fef;
  --blue-100: #e8f0fe;
  --blue-50: #f3f7ff;
  --white: #ffffff;
  --ink: #16233f;
  --gray-600: #5b667a;
  --gray-400: #8994a8;
  --gray-200: #e3e8f2;
  --gray-100: #f1f4fa;
  --green: #17a673;
  --amber: #e8a13c;
  --red: #e14a5e;
  --purple: #7c5cf2;
  --gold: #c9971f;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 40, 90, 0.06);
  --shadow-md: 0 8px 30px rgba(20, 40, 90, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--gray-100);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Topbar ---------- */
.topbar {
  height: 64px;
  background: linear-gradient(90deg, var(--blue-800), var(--blue-600));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  color: var(--white);
  box-shadow: 0 2px 12px rgba(10, 30, 80, 0.18);
}

.topbar-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.logo { font-size: 19px; font-weight: 700; color: var(--white); letter-spacing: 0.2px; }
.logo span { font-weight: 400; opacity: 0.85; }

.topbar-search {
  flex: 1;
  max-width: 520px;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;
}
.topbar-search:focus-within { background: var(--white); }
.topbar-search:focus-within input { color: var(--ink); }
.topbar-search:focus-within .search-icon { filter: none; opacity: 0.5; }
.search-icon { font-size: 14px; opacity: 0.8; margin-right: 6px; }
.topbar-search input {
  border: none; outline: none; background: transparent;
  color: var(--white); font-size: 14px; width: 100%;
}
.topbar-search input::placeholder { color: rgba(255,255,255,0.75); }
.topbar-search:focus-within input::placeholder { color: var(--gray-400); }

.search-results {
  position: absolute; top: 46px; left: 0; right: 0;
  background: var(--white); border-radius: 10px; box-shadow: var(--shadow-md);
  padding: 6px; max-height: 320px; overflow-y: auto; z-index: 50;
}
.search-results a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--ink); font-size: 13.5px; }
.search-results a:hover { background: var(--blue-50); }
.search-results .sr-type { color: var(--gray-400); font-size: 11.5px; margin-left: 6px; }
.search-results .sr-empty { padding: 14px 10px; color: var(--gray-400); font-size: 13px; }

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }

.lang-switch { display: flex; background: rgba(255,255,255,0.14); border-radius: 8px; padding: 3px; }
.lang-btn { background: transparent; border: none; color: rgba(255,255,255,0.8); font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px; }
.lang-btn.active { background: var(--white); color: var(--blue-700); }

.icon-btn {
  position: relative; background: rgba(255,255,255,0.14); border: none; color: var(--white);
  width: 38px; height: 38px; border-radius: 10px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.24); }
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px; background: var(--red); color: var(--white);
  font-size: 10px; font-weight: 700; border-radius: 20px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 2px solid var(--blue-700);
}

.mobile-only { display: none; }

.user-chip {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.14);
  border: none; border-radius: 10px; padding: 4px 10px 4px 4px; color: var(--white);
}
.user-chip:hover { background: rgba(255,255,255,0.24); }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%; background: var(--white); color: var(--blue-700);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0;
  position: relative; border: 2px solid transparent;
}
.user-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-info strong { font-size: 12.5px; }
.user-info small { font-size: 11px; opacity: 0.8; }
.chev { font-size: 10px; opacity: 0.8; }

.dropdown-wrap { position: relative; }
.dropdown {
  position: absolute; top: 48px; right: 0; background: var(--white); border-radius: 12px;
  box-shadow: var(--shadow-md); width: 300px; padding: 8px; z-index: 160; color: var(--ink);
}
.dropdown-title { font-size: 13px; font-weight: 700; padding: 8px 10px 4px; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.4px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; }
.notif-item:hover { background: var(--blue-50); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); margin-top: 6px; flex-shrink: 0; }
.notif-text { font-size: 13px; }
.notif-time { font-size: 11.5px; color: var(--gray-400); margin-top: 2px; }
.dropdown-menu-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; font-size: 13.5px; }
.dropdown-menu-item:hover { background: var(--blue-50); }
.dropdown-sep { height: 1px; background: var(--gray-200); margin: 6px 4px; }

/* ---------- Layout ---------- */
.app-body { display: flex; min-height: calc(100vh - 64px); position: relative; }

.sidebar {
  width: 264px; flex-shrink: 0; background: var(--white); border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column; position: sticky; top: 64px; height: calc(100vh - 64px);
  overflow-y: auto; z-index: 40;
}
.sidebar-user { padding: 22px 18px; text-align: center; border-bottom: 1px solid var(--gray-200); }
.avatar-lg {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; background: var(--blue-600);
  color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px;
  border: 3px solid transparent; position: relative;
}

/* ---------- Level frames (avatar changes by gamification level) ---------- */
.level-badge-icon {
  position: absolute; bottom: -3px; right: -3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--white); display: flex; align-items: center; justify-content: center; font-size: 11px;
  box-shadow: 0 1px 4px rgba(20,40,90,0.25); border: 1.5px solid var(--white);
}
.avatar-sm .level-badge-icon { display: none; }
.frame-lvl1 { border-color: #b9c2d6; box-shadow: 0 0 0 4px var(--gray-100); }
.frame-lvl2 { border-color: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-50); }
.frame-lvl3 { border-color: #0e9aa7; box-shadow: 0 0 0 4px #e3f6f7; }
.frame-lvl4 { border-color: var(--purple); box-shadow: 0 0 0 4px #f0ecfd; }
.frame-lvl5 { border-color: var(--gold); box-shadow: 0 0 0 4px #fbf3df; }
.frame-lvl6 { border-color: var(--white); box-shadow: 0 0 0 3px var(--purple), 0 0 0 6px #f0ecfd; }
.frame-lvl7 { border-color: var(--white); box-shadow: 0 0 0 3px var(--blue-600), 0 0 0 6px var(--gold); animation: framePulse 2.2s ease-in-out infinite; }
@keyframes framePulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--blue-600), 0 0 0 6px var(--gold); }
  50% { box-shadow: 0 0 0 4px var(--blue-600), 0 0 0 8px var(--gold); }
}
.avatar-sm.frame-lvl1 { box-shadow: 0 0 0 2px var(--gray-100); }
.avatar-sm.frame-lvl2 { box-shadow: 0 0 0 2px var(--blue-50); }
.avatar-sm.frame-lvl3 { box-shadow: 0 0 0 2px #e3f6f7; }
.avatar-sm.frame-lvl4 { box-shadow: 0 0 0 2px #f0ecfd; }
.avatar-sm.frame-lvl5 { box-shadow: 0 0 0 2px #fbf3df; }
.avatar-sm.frame-lvl6 { box-shadow: 0 0 0 2px var(--purple), 0 0 0 4px #f0ecfd; }
.avatar-sm.frame-lvl7 { box-shadow: 0 0 0 2px var(--blue-600), 0 0 0 4px var(--gold); animation: none; }

/* ---------- Confetti (level-up celebration) ---------- */
.confetti-piece { position: fixed; top: -30px; font-size: 22px; z-index: 400; pointer-events: none; animation: confettiFall linear forwards; }
@keyframes confettiFall { to { transform: translateY(110vh) rotate(360deg); opacity: 0.15; } }

/* ---------- XP demo action buttons ---------- */
.xp-action-btn { background: var(--white); border: 1px solid var(--gray-200); border-radius: 20px; padding: 7px 13px; font-size: 12px; font-weight: 700; color: var(--blue-700); }
.xp-action-btn:hover { border-color: var(--blue-500); background: var(--blue-50); }

/* ---------- Level preview strip ---------- */
.level-strip-item { text-align: center; flex: 1; min-width: 76px; }
.level-strip-item.locked { opacity: 0.4; }
.level-strip-avatar { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; font-size: 17px; background: var(--white); position: relative; border: 3px solid transparent; }
.level-strip-name { font-size: 10.5px; font-weight: 700; line-height: 1.3; }
.level-strip-lv { font-size: 9.5px; color: var(--gray-400); }
.sidebar-user-name { font-weight: 700; font-size: 14.5px; }
.sidebar-user-role { font-size: 12.5px; color: var(--gray-600); margin-top: 2px; }
.sidebar-user-status { font-size: 11.5px; color: var(--green); display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 6px; }
.dot-online { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sidebar-edit-link { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--blue-600); font-weight: 600; }
.sidebar-edit-link:hover { text-decoration: underline; }

.sidebar-nav { padding: 10px 12px; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  font-size: 13.8px; color: var(--ink); font-weight: 500; margin-bottom: 2px;
}
.sidebar-nav a:hover { background: var(--blue-50); }
.sidebar-nav a.active { background: var(--blue-600); color: var(--white); font-weight: 600; }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--red); color: var(--white); font-size: 10.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 20px;
}
.sidebar-nav a.active .nav-badge { background: rgba(255,255,255,0.35); }
.nav-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-400); padding: 14px 12px 6px; }

.sidebar-ai-promo {
  margin: 14px; padding: 16px; border-radius: 14px;
  background: linear-gradient(135deg, var(--blue-700), var(--purple));
  color: var(--white);
}
.sidebar-ai-promo strong { font-size: 13.5px; }
.sidebar-ai-promo p { font-size: 12px; opacity: 0.9; margin: 4px 0 10px; }

.sidebar-overlay { display: none; }

.content { flex: 1; padding: 26px 30px 60px; max-width: 1180px; }

/* ---------- Generic components ---------- */
.page-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.page-subtitle { color: var(--gray-600); font-size: 13.5px; margin: 0 0 22px; }

.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; border: 1px solid var(--gray-200);
}

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 10px;
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: transform .05s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--white); color: var(--blue-700); }
.btn-primary:hover { background: var(--blue-50); }
.btn-solid { background: var(--blue-600); color: var(--white); }
.btn-solid:hover { background: var(--blue-700); }
.btn-outline { background: var(--white); color: var(--blue-600); border: 1.5px solid var(--blue-200, var(--gray-200)); }
.btn-outline { border: 1.5px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--blue-500); }
.btn-ghost { background: transparent; color: var(--blue-600); padding: 8px 10px; }
.btn-ghost:hover { background: var(--blue-50); }
.btn-light-sm { background: rgba(255,255,255,0.92); color: var(--blue-700); font-size: 12.5px; padding: 8px 12px; width: 100%; justify-content: center; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; background: var(--blue-100); color: var(--blue-700);
}
.chip-green { background: #e4f7ef; color: var(--green); }
.chip-amber { background: #fdf1de; color: var(--amber); }
.chip-red { background: #fbe7ea; color: var(--red); }
.chip-gray { background: var(--gray-100); color: var(--gray-600); }
.chip-purple { background: #f0ecfd; color: var(--purple); }

.progress-bar { height: 9px; background: var(--gray-200); border-radius: 20px; overflow: hidden; }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--blue-700)); border-radius: 20px; }
.progress-bar.thin { height: 6px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--gray-200); padding-bottom: 0; }
.tab-btn {
  background: transparent; border: none; padding: 10px 4px; margin-right: 18px; font-size: 13.5px;
  font-weight: 600; color: var(--gray-600); border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--blue-700); border-bottom-color: var(--blue-600); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-pill {
  background: var(--white); border: 1px solid var(--gray-200); padding: 7px 14px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; color: var(--gray-600);
}
.filter-pill.active { background: var(--blue-600); border-color: var(--blue-600); color: var(--white); }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.dash-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }

/* ---------- Dashboard ---------- */
.banner {
  background: linear-gradient(120deg, var(--blue-800) 0%, var(--blue-600) 55%, var(--blue-500) 100%);
  border-radius: 18px; padding: 30px 34px; color: var(--white); position: relative; overflow: hidden;
  margin-bottom: 20px; min-height: 260px;
}
.banner::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.banner-text { position: relative; z-index: 1; max-width: 56%; }
/* Character illustration tied to the user's gamification level (LEVELS_META[n].illustration) —
   fills the whole right block of the banner, cropped to cover it; only a narrow strip on its
   left edge fades into the banner background so it doesn't look like a pasted rectangle. */
.banner-illustration {
  position: absolute; right: 0; top: 0; bottom: 0; width: 42%; height: 100%;
  object-fit: cover; object-position: top; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 14%);
  mask-image: linear-gradient(to right, transparent 0%, black 14%);
}
@media (max-width: 1000px) { .banner-illustration { width: 36%; } .banner-text { max-width: 64%; } }
@media (max-width: 900px) { .banner-illustration { display: none; } .banner-text { max-width: none; } .banner { min-height: 0; } }
.banner h1 { font-size: 24px; margin: 0 0 8px; position: relative; }
.banner p { font-size: 14px; opacity: 0.92; max-width: 480px; line-height: 1.55; margin: 0 0 14px; position: relative; }
.banner-quote {
  font-style: italic; font-size: 12.5px; opacity: 0.88; max-width: 460px; line-height: 1.5;
  margin: 0 0 18px; padding-left: 12px; border-left: 2px solid rgba(255,255,255,0.5); position: relative;
}
.banner-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; }
.banner-pill {
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.32); color: var(--white);
  font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 20px;
}
.banner-pill:hover { background: rgba(255,255,255,0.28); }
.banner-streak {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255,209,102,0.16);
  border: 1px solid rgba(255,209,102,0.55); color: #ffd166; font-size: 12.5px; font-weight: 700;
  padding: 6px 12px; border-radius: 20px; margin-bottom: 12px; position: relative;
}

/* ---------- Mascot congratulation toast ---------- */
.mascot-toast {
  display: flex; align-items: flex-start; gap: 10px; background: var(--white); border-radius: 16px;
  padding: 10px 14px 10px 10px; box-shadow: var(--shadow-md); max-width: 290px; border: 1px solid var(--blue-100);
  animation: mascotIn .25s ease;
}
.mascot-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-600), var(--purple)); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.mascot-bubble strong { display: block; font-size: 12px; color: var(--blue-700); margin-bottom: 2px; }
.mascot-bubble span { font-size: 12.5px; color: var(--ink); line-height: 1.4; }
@keyframes mascotIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- Task assistant widget (fixed top-right, suggests what to do next) ---------- */
.assistant-card {
  position: fixed; top: 78px; right: 24px; width: 270px; background: var(--white); border-radius: 16px;
  box-shadow: var(--shadow-md); border: 1px solid var(--blue-100); padding: 16px; z-index: 140;
  animation: assistantIn .3s ease;
}
.assistant-close {
  position: absolute; top: 10px; right: 10px; background: var(--gray-100); border: none;
  width: 22px; height: 22px; border-radius: 50%; font-size: 11px; color: var(--gray-600);
}
.assistant-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-right: 20px; }
.assistant-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-600), var(--purple)); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.assistant-head strong { font-size: 13px; }
.assistant-sub { font-size: 11px; color: var(--gray-600); margin-top: 1px; }
.assistant-body { font-size: 12.5px; color: var(--ink); line-height: 1.5; margin: 0 0 4px; }
.assistant-meta { font-size: 11px; color: var(--gray-600); margin: 0 0 12px; }
/* Collapsed state: icon bubble PLUS a persistent text hint beside it, so the suggestion is
   readable at a glance without having to click anything to open the card. */
.assistant-collapsed {
  position: fixed; top: 78px; right: 24px; z-index: 140;
  display: flex; align-items: center; gap: 8px; animation: assistantIn .3s ease;
}
.assistant-hint {
  background: var(--white); color: var(--ink); font-size: 12px; font-weight: 600; padding: 8px 14px;
  border-radius: 20px; box-shadow: var(--shadow-md); border: 1px solid var(--blue-100);
  white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.assistant-hint:hover { border-color: var(--blue-500); }
.assistant-bubble {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-600), var(--purple)); color: var(--white); border: none;
  font-size: 22px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  cursor: pointer; transition: transform .12s ease;
}
.assistant-bubble:hover { transform: translateY(-2px); }
@keyframes assistantIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 900px) {
  .assistant-card { top: 72px; right: 12px; width: calc(100vw - 24px); max-width: 280px; }
  .assistant-collapsed { top: 72px; right: 12px; }
  .assistant-hint { max-width: 44vw; font-size: 11.5px; padding: 7px 12px; }
  .assistant-bubble { width: 42px; height: 42px; font-size: 19px; }
}

/* ---------- Quiz assistant floating button (bottom-right, expands on hover) ---------- */
.quiz-fab {
  position: fixed; right: 24px; bottom: 24px; height: 58px; border-radius: 29px; padding: 0;
  background: linear-gradient(135deg, var(--blue-600), var(--purple)); color: var(--white); border: none;
  display: flex; align-items: center; box-shadow: var(--shadow-md);
  z-index: 150; cursor: pointer; transition: transform .12s ease;
}
.quiz-fab:hover, .quiz-fab:focus-visible { transform: translateY(-2px); }
.quiz-fab-icon {
  position: relative; width: 58px; height: 58px; flex-shrink: 0; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
}
.quiz-fab-label {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; font-size: 13px; font-weight: 700;
  transition: max-width .25s ease, opacity .2s ease, margin .25s ease; margin-right: 0;
}
.quiz-fab:hover .quiz-fab-label, .quiz-fab:focus-visible .quiz-fab-label { max-width: 160px; opacity: 1; margin-right: 18px; }
.quiz-fab-badge {
  position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--white);
}
@media (max-width: 900px) {
  .quiz-fab { right: 16px; bottom: 16px; height: 50px; }
  .quiz-fab-icon { width: 50px; height: 50px; font-size: 22px; }
}

/* ---------- Daily quiz ---------- */
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  text-align: left; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--gray-200);
  background: var(--white); font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.quiz-opt:hover:not([disabled]) { border-color: var(--blue-500); background: var(--blue-50); }
.quiz-opt.correct { border-color: var(--green); background: #e4f7ef; color: var(--green); }
.quiz-opt.wrong { border-color: var(--red); background: #fbe7ea; color: var(--red); }
.quiz-opt.disabled { opacity: .55; }
.quiz-explain { font-size: 12.5px; color: var(--gray-600); background: var(--blue-50); padding: 10px 12px; border-radius: 10px; margin-top: 14px; }

/* ---------- Wordle ---------- */
.wordle-board { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.wordle-row { display: flex; gap: 6px; }
.wordle-tile {
  width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; text-transform: uppercase; border: 2px solid var(--gray-200);
  background: var(--white); color: var(--ink); flex-shrink: 0;
}
.wordle-tile.empty { background: var(--gray-100); border-color: var(--gray-200); }
.wordle-tile.green { background: var(--green); border-color: var(--green); color: var(--white); }
.wordle-tile.yellow { background: var(--amber); border-color: var(--amber); color: var(--white); }
.wordle-tile.gray { background: var(--gray-400); border-color: var(--gray-400); color: var(--white); }
.wordle-words { display: flex; flex-wrap: wrap; gap: 8px; }
.wordle-word-btn {
  border: 1.5px solid var(--gray-200); background: var(--white); padding: 9px 14px; border-radius: 10px;
  font-weight: 700; letter-spacing: 1px; font-size: 13px; color: var(--blue-700);
}
.wordle-word-btn:hover:not([disabled]) { border-color: var(--blue-500); background: var(--blue-50); }

/* ---------- City leaderboard ---------- */
.table-scroll { overflow-x: auto; }
.city-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
.city-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-400);
  font-weight: 700; padding: 0 10px 8px; border-bottom: 1px solid var(--gray-200);
}
.city-table td { padding: 11px 10px; border-bottom: 1px solid var(--gray-100); }
.city-table tr:last-child td { border-bottom: none; }
.city-table tr.my-city td { background: var(--blue-50); }
.city-table tr.my-city td:first-child { border-radius: 10px 0 0 10px; }
.city-table tr.my-city td:last-child { border-radius: 0 10px 10px 0; }
.trend-up { color: var(--green); font-weight: 700; }
.trend-down { color: var(--red); font-weight: 700; }
.trend-flat { color: var(--gray-400); font-weight: 700; }
.wordle-word-btn[disabled] { opacity: .4; }

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-value { font-size: 30px; font-weight: 800; color: var(--blue-700); }
.stat-card .stat-label { font-size: 13px; color: var(--gray-600); font-weight: 600; }
.stat-card .stat-cta { margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--blue-600); }
.stat-card .stat-icon { font-size: 20px; }

.task-mini { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.task-mini:last-child { border-bottom: none; }
.task-mini input[type=checkbox] { margin-top: 3px; accent-color: var(--blue-600); width: 16px; height: 16px; }
.task-mini .t-title { font-size: 13.5px; font-weight: 600; }
.task-mini .t-due { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.task-mini.done .t-title { text-decoration: line-through; color: var(--gray-400); }

.level-mini { background: linear-gradient(135deg, var(--blue-50), var(--white)); border: 1px solid var(--blue-100); }
.level-mini-top { display: flex; align-items: center; gap: 12px; }
.level-mini-badge { width: 44px; height: 44px; border-radius: 50%; background: var(--purple); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 18px; border: 2px solid var(--white); box-shadow: 0 0 0 2px var(--purple); flex-shrink: 0; }

/* ---------- Section header ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head h3 { font-size: 15.5px; margin: 0; }
.section-head a, .section-head button.link { font-size: 12.5px; font-weight: 700; color: var(--blue-600); background: none; border: none; }

/* ---------- AI Tools ---------- */
.ai-tool-card { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.ai-tool-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ai-tool-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--blue-100); color: var(--blue-700); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; }
.ai-tool-card h4 { margin: 0 0 4px; font-size: 14.5px; }
.ai-tool-card p { margin: 0; font-size: 12.5px; color: var(--gray-600); line-height: 1.5; }

.chat-box { display: flex; flex-direction: column; height: 460px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 6px 4px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.chat-msg.user { align-self: flex-end; background: var(--blue-600); color: var(--white); border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--blue-50); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chat-suggestion { font-size: 12px; background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); padding: 6px 11px; border-radius: 20px; }
.chat-input-row { display: flex; gap: 8px; margin-top: 12px; }
.chat-input-row input { flex: 1; border: 1px solid var(--gray-200); border-radius: 10px; padding: 11px 14px; font-size: 13.5px; }
.chat-input-row input:focus { outline: none; border-color: var(--blue-500); }

.skill-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.skill-row .skill-name { width: 190px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.skill-row .progress-bar { flex: 1; }
.skill-row .skill-pct { width: 40px; text-align: right; font-size: 13px; font-weight: 700; color: var(--blue-700); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.form-field label { font-size: 12.5px; font-weight: 600; color: var(--gray-600); }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--gray-200); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-family: inherit; background: var(--white);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--blue-500); }

.plan-month { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.plan-month:last-child { border-bottom: none; }
.plan-month .plan-num { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-600); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }

.question-item { border: 1px solid var(--gray-200); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.question-item .q-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.question-item .q-type { font-size: 11px; color: var(--blue-600); font-weight: 700; }

/* ---------- Course cards ---------- */
.course-card { display: flex; flex-direction: column; gap: 12px; }
.course-cover { height: 92px; border-radius: 12px; background: linear-gradient(135deg, var(--blue-600), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.course-card h4 { margin: 0; font-size: 14.5px; }
.course-meta { font-size: 12px; color: var(--gray-600); }
.course-progress-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-600); }
.course-last-lesson { font-size: 12px; color: var(--gray-600); background: var(--gray-100); padding: 8px 10px; border-radius: 8px; }

/* ---------- Library / book marketplace ---------- */
.wallet-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--gold, #c9971f), #e0b84a); color: var(--white);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px;
}
.wallet-banner .w-label { font-size: 12px; opacity: 0.9; }
.wallet-banner .w-value { font-size: 24px; font-weight: 800; }
.book-card { display: flex; flex-direction: column; gap: 10px; position: relative; }
.book-cover { height: 92px; border-radius: 12px; background: linear-gradient(135deg, var(--gold, #c9971f), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.book-card h4 { margin: 0; font-size: 14px; line-height: 1.3; }
.book-meta { font-size: 11.5px; color: var(--gray-600); }
.book-price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.xp-price { font-weight: 800; color: var(--gold, #c9971f); font-size: 13.5px; }
.book-owned-badge { position: absolute; top: 10px; right: 10px; background: var(--green); color: var(--white); font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 100px; }

/* ---------- Tasks ---------- */
.task-card { display: flex; flex-direction: column; gap: 10px; }
.task-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.task-card h4 { margin: 0; font-size: 14.5px; }
.task-card .task-course { font-size: 12.5px; color: var(--blue-600); font-weight: 600; }
.task-card .task-due { font-size: 12px; color: var(--gray-600); }

/* ---------- Calendar ---------- */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--gray-400); text-align: center; padding-bottom: 6px; }
.cal-cell { min-height: 78px; border: 1px solid var(--gray-100); border-radius: 10px; padding: 6px; font-size: 12px; }
.cal-cell.muted { color: var(--gray-400); background: var(--gray-100); }
.cal-cell.today { border-color: var(--blue-500); background: var(--blue-50); }
.cal-num { font-weight: 700; margin-bottom: 4px; }
.cal-event { font-size: 10.5px; background: var(--blue-100); color: var(--blue-700); border-radius: 6px; padding: 2px 5px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.type-webinar { background: #f0ecfd; color: var(--purple); }
.cal-event.type-deadline { background: #fbe7ea; color: var(--red); }

.agenda-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.agenda-item:last-child { border-bottom: none; }
.agenda-date { width: 60px; flex-shrink: 0; text-align: center; }
.agenda-date .d-num { font-size: 18px; font-weight: 800; color: var(--blue-700); }
.agenda-date .d-mon { font-size: 11px; color: var(--gray-400); text-transform: uppercase; }

/* ---------- Certificates ---------- */
.cert-card { text-align: center; }
.cert-icon { font-size: 34px; margin-bottom: 10px; }
.cert-card h4 { margin: 0 0 10px; font-size: 14px; }
.cert-meta-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--gray-600); border-top: 1px dashed var(--gray-200); border-bottom: 1px dashed var(--gray-200); padding: 10px 0; margin: 10px 0; }
.cert-actions { display: flex; gap: 8px; }

/* ---------- Orders ---------- */
.order-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--gray-100); gap: 14px; flex-wrap: wrap; }
.order-row:last-child { border-bottom: none; }
.order-id { font-size: 11.5px; color: var(--gray-400); }
.order-title { font-weight: 700; font-size: 14px; }
.order-price { font-weight: 800; font-size: 15px; color: var(--blue-700); }
.order-date { font-size: 12px; color: var(--gray-600); }

/* ---------- Messages ---------- */
.messages-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; height: 600px; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.conv-list { border-right: 1px solid var(--gray-200); overflow-y: auto; }
.conv-item { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--gray-100); align-items: center; }
.conv-item:hover { background: var(--blue-50); }
.conv-item.active { background: var(--blue-50); }
.conv-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--blue-600); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.conv-name { font-size: 13.5px; font-weight: 700; }
.conv-role { font-size: 11px; color: var(--gray-400); }
.conv-last { font-size: 12px; color: var(--gray-600); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.conv-unread { margin-left: auto; background: var(--blue-600); color: var(--white); font-size: 10.5px; font-weight: 700; border-radius: 20px; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.chat-panel { display: flex; flex-direction: column; height: 100%; }
.chat-panel-head { padding: 14px 18px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; gap: 10px; }
.chat-panel-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.chat-panel-input { padding: 12px 16px; border-top: 1px solid var(--gray-200); display: flex; gap: 8px; }
.chat-panel-input input { flex: 1; border: 1px solid var(--gray-200); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }
.chat-panel-input input:focus { outline: none; border-color: var(--blue-500); }

/* ---------- Profile ---------- */
.profile-header { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.profile-avatar { width: 76px; height: 76px; border-radius: 50%; background: var(--blue-600); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 26px; border: 4px solid transparent; position: relative; flex-shrink: 0; }
.profile-avatar .level-badge-icon { width: 24px; height: 24px; font-size: 13px; }
.profile-header h2 { margin: 0; font-size: 19px; }
.profile-header .p-role { font-size: 13px; color: var(--gray-600); }

.level-card { background: linear-gradient(135deg, var(--blue-800), var(--purple)); color: var(--white); border: none; }
.level-card .lc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.level-card .lc-frame { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; font-size: 24px; border: 3px solid rgba(255,255,255,0.5); }
.level-card .lc-name { font-size: 16px; font-weight: 800; }
.level-card .lc-sub { font-size: 12px; opacity: 0.85; }
.level-card .progress-bar { background: rgba(255,255,255,0.25); }
.level-card .progress-bar > div { background: var(--white); }
.level-card .lc-checklist { margin-top: 14px; font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }

.badge-card { text-align: center; opacity: 1; }
.badge-card.locked { opacity: 0.55; }
.badge-card .b-icon { font-size: 30px; margin-bottom: 8px; }
.badge-card h5 { margin: 0 0 4px; font-size: 13px; }
.badge-card p { margin: 0 0 8px; font-size: 11.5px; color: var(--gray-600); line-height: 1.4; }

.field-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; }
.field-row:last-child { border-bottom: none; }
.field-row .f-label { color: var(--gray-600); }
.field-row .f-value { font-weight: 600; }

.xp-day { font-size: 11.5px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; margin: 16px 0 6px; }
.xp-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.xp-plus { color: var(--green); font-weight: 800; }
.xp-minus { color: var(--red); font-weight: 800; }

/* ---------- Settings ---------- */
.settings-section { margin-bottom: 10px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--gray-100); gap: 16px; }
.settings-row:last-child { border-bottom: none; }
.settings-row .s-label { font-size: 13.5px; font-weight: 600; }
.settings-row .s-desc { font-size: 12px; color: var(--gray-600); margin-top: 2px; }

.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--gray-200); border-radius: 20px; transition: .15s; cursor: pointer; }
.slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: var(--white); border-radius: 50%; transition: .15s; }
.switch input:checked + .slider { background: var(--blue-600); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }

/* ---------- Empty / states ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-600); }
.empty-state .e-icon { font-size: 40px; margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; margin: 0 0 6px; color: var(--ink); }
.empty-state p { font-size: 13.5px; margin: 0 0 18px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 20, 45, 0.5); display: flex; align-items: center;
  justify-content: center; z-index: 200; padding: 20px;
}
.modal-box {
  background: var(--white); border-radius: 18px; max-width: 560px; width: 100%; max-height: 88vh;
  overflow-y: auto; padding: 26px; box-shadow: var(--shadow-md); position: relative;
}
.modal-close { position: absolute; top: 16px; right: 16px; background: var(--gray-100); border: none; width: 30px; height: 30px; border-radius: 50%; font-size: 15px; color: var(--gray-600); }
.modal-title { font-size: 17px; font-weight: 700; margin: 0 0 16px; padding-right: 30px; }

/* ---------- Toast ---------- */
/* bottom offset cleared above the quiz-fab (58px tall + 24px gap) so they never overlap */
.toast-wrap { position: fixed; bottom: 96px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(90vw, 320px); }
.toast { background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-md); animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px);} to { opacity:1; transform: translateY(0);} }
@media (max-width: 900px) { .toast-wrap { bottom: 82px; right: 16px; } }

.hidden { display: none !important; }

/* ---------- Owl flying animation (played when a dashboard task is checked off) ----------
   Outer element: slow flight path across the screen with a gentle up/down glide.
   Inner element: fast wing-flap loop (squash + tilt), so the flapping reads clearly even
   though the whole flyby takes several seconds. */
.owl-fly {
  position: fixed; top: 20%; left: -12vw; font-size: 50px; z-index: 500; pointer-events: none;
  animation: owlFlyPath 4s cubic-bezier(.45,.05,.55,.95) forwards;
}
.owl-fly-body { display: inline-block; animation: owlFlap .22s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes owlFlyPath {
  0%   { left: -12vw; transform: translateY(0); }
  20%  { transform: translateY(-34px); }
  40%  { transform: translateY(6px); }
  60%  { transform: translateY(-26px); }
  80%  { transform: translateY(10px); }
  100% { left: 112vw; transform: translateY(-4px); }
}
@keyframes owlFlap {
  0%, 100% { transform: scaleY(1) rotate(0deg); }
  50% { transform: scaleY(0.78) rotate(-6deg); }
}

/* ---------- Mood / status picker (profile) ---------- */
.mood-current { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--blue-700); background: var(--blue-50); padding: 5px 12px; border-radius: 20px; margin-top: 4px; }
.mood-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mood-btn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--gray-200); background: var(--white); font-size: 17px; display: flex; align-items: center; justify-content: center; }
.mood-btn:hover { border-color: var(--blue-500); background: var(--blue-50); }
.mood-btn.active { border-color: var(--blue-600); background: var(--blue-100); box-shadow: 0 0 0 2px var(--blue-100); }

/* ---------- Friends ---------- */
.friend-card { text-align: center; }
.friend-avatar { width: 60px; height: 60px; margin: 0 auto 10px; font-size: 20px; }
.friend-card h4 { margin: 0 0 2px; font-size: 14px; }
.friend-role { font-size: 12px; color: var(--gray-600); margin-bottom: 8px; }
.friend-mood { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--blue-700); background: var(--blue-50); padding: 4px 10px; border-radius: 20px; margin-bottom: 12px; }

/* ---------- Activity feed — posts (LinkedIn-style achievement cards) ---------- */
.feed-avatar { width: 40px; height: 40px; font-size: 14px; flex-shrink: 0; }
.post-card { margin-bottom: 16px; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-name { font-weight: 700; font-size: 13.5px; }
.post-time { font-size: 11.5px; color: var(--gray-600); }
.post-achievement {
  display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--blue-700), var(--purple));
  color: var(--white); border-radius: 14px; padding: 16px; margin-bottom: 12px;
}
.post-ach-icon { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.post-ach-title { font-weight: 800; font-size: 14px; line-height: 1.3; }
.post-ach-sub { font-size: 12px; opacity: .88; margin-top: 2px; }
.post-ach-xp { margin-left: auto; background: rgba(255,255,255,0.2); font-weight: 800; font-size: 12.5px; padding: 6px 10px; border-radius: 20px; flex-shrink: 0; white-space: nowrap; }
.post-actions { display: flex; gap: 8px; border-top: 1px solid var(--gray-100); padding-top: 10px; }
.post-action-btn { flex: 1; background: var(--gray-100); border: none; border-radius: 10px; padding: 9px; font-size: 12.5px; font-weight: 600; color: var(--gray-600); }
.post-action-btn:hover { background: var(--blue-50); color: var(--blue-700); }
.post-action-btn.active { background: var(--blue-100); color: var(--blue-700); }
.post-comments { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.post-comment { font-size: 12.5px; padding: 6px 0; line-height: 1.4; }
.post-comment strong { margin-right: 5px; }
.post-comment-input-row { display: flex; gap: 8px; margin-top: 8px; }
.post-comment-input-row input { flex: 1; border: 1px solid var(--gray-200); border-radius: 20px; padding: 8px 14px; font-size: 12.5px; }
.post-comment-input-row input:focus { outline: none; border-color: var(--blue-500); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .dash-layout { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .topbar-search { display: none; }
  .mobile-only { display: flex; }
  .sidebar {
    position: fixed; left: -280px; top: 0; height: 100vh; z-index: 200; transition: left .2s ease;
    box-shadow: var(--shadow-md); top: 0; padding-top: 64px;
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay.show { display: block; position: fixed; inset: 0; background: rgba(10,20,45,0.4); z-index: 150; }
  .content { padding: 18px 16px 50px; }
  .user-info { display: none; }
  .messages-layout { grid-template-columns: 1fr; height: auto; }
  .conv-list { max-height: 240px; }
}

@media (max-width: 620px) {
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .banner { padding: 22px 20px; }
  .banner h1 { font-size: 20px; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(0,1fr)); font-size: 10px; }
  .cal-cell { min-height: 56px; padding: 4px; }
}
