/* ============================================
   EXPLAINABLES · CLASS 8 · WILD NATURE
   Day = golden sun + jungle green
   Night = deep moon + dark forest
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sb-w: 260px; --tb-h: 58px;
  --font: 'Nunito', sans-serif;
  --font-display: 'Lora', serif;
  --font-hand: 'Caveat', cursive;
  --tr: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── DAY MODE ────────────────────────────── */
body.day-mode {
  --bg: #0d1f0a; --surface: #122008; --border: #1e3d10;
  --text: #e8f5e2; --muted: #5a8050;
  --a1: #7dce5a; --a2: #ffc436; --a3: #ff6b35; --a4: #4ecdc4;
  --sun: #ffd700; --moon: transparent;
}

/* ── NIGHT MODE ──────────────────────────── */
body.night-mode {
  --bg: #030810; --surface: #060f18; --border: #0d2240;
  --text: #c8dff8; --muted: #3a6080;
  --a1: #4ecdc4; --a2: #7b9fff; --a3: #ff6b9d; --a4: #ffd93d;
  --sun: transparent; --moon: #c8dff8;
}

/* ── CURSOR ──────────────────────────────── */
html { cursor: none !important; }
* { cursor: inherit !important; }
.fire-cursor {
  position: fixed; width: 20px; height: 30px;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -80%);
  font-size: 24px; line-height: 1;
  will-change: transform;
  contain: layout size style;
  filter: drop-shadow(0 0 4px rgba(255,100,0,0.6));
}
.fire-trail {
  position: fixed; pointer-events: none; z-index: 9998;
  transform: translate(-50%, -80%);
  font-size: 16px; opacity: 0.5;
  will-change: transform;
}

/* ── BG CANVAS ───────────────────────────── */
#bgCanvas8, #rainCanvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#rainCanvas { z-index: 1; }
.rain-layer { }

/* ── MUTE BTN ────────────────────────────── */
.mute-btn-8 {
  position: fixed; top: 68px; right: 140px; z-index: 500;
  background: rgba(125,206,90,0.12); border: 1px solid var(--a1);
  border-radius: 8px; width: 38px; height: 38px; font-size: 17px;
  color: var(--a1); transition: transform 0.3s, opacity 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 10px rgba(125,206,90,0.2);
}
.mute-btn-8:hover { transform: scale(1.12); box-shadow: 0 0 20px var(--a1); }

/* ── LAYOUT ──────────────────────────────── */
body { font-family: var(--font); background: var(--bg); color: var(--text); height: 100vh; overflow: hidden; display: flex; position: relative; }

/* ── SIDEBAR ─────────────────────────────── */
.sidebar-8 {
  position: fixed; top: 0; bottom: 0; width: var(--sb-w);
  background: rgba(13,31,10,0.97); backdrop-filter: blur(8px);
  z-index: 200; display: flex; flex-direction: column;
  transition: transform 0.4s var(--tr); overflow: hidden;
}
body.night-mode .sidebar-8 { background: rgba(3,8,16,0.96); }
.left-sb8 { left: 0; border-right: 1px solid rgba(125,206,90,0.12); }
.right-sb8 { right: 0; border-left: 1px solid rgba(125,206,90,0.12); }
.sidebar-8.col-left8 { transform: translateX(calc(-1 * var(--sb-w))); }
.sidebar-8.col-right8 { transform: translateX(var(--sb-w)); }

.sb-header-8 {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(125,206,90,0.08);
}
.sb-logo-8 { display: flex; align-items: center; gap: 9px; }
.sb-logo-img-8 { width: 34px; height: 34px; border-radius: 50%; animation: logoNature 5s ease infinite; }
@keyframes logoNature {
  0%,100% { filter: drop-shadow(0 0 8px var(--a1)); }
  50% { filter: drop-shadow(0 0 18px var(--a2)); transform: scale(1.06); }
}
.sb-brand-8 {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  font-style: italic; color: var(--a1);
}
.sb-toggle-8 { background: rgba(125,206,90,0.08); border: 1px solid rgba(125,206,90,0.2); border-radius: 6px; color: var(--a1); width: 44px; height: 44px; font-size: 14px; /* was 26×26 — raised to WCAG AA */ transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; display: flex; align-items: center; justify-content: center; }
.sb-toggle-8:hover { background: rgba(125,206,90,0.15); box-shadow: 0 0 8px rgba(125,206,90,0.3); }

.new-chat-8 { margin: 10px; padding: 11px; background: linear-gradient(135deg, rgba(125,206,90,0.2), rgba(78,205,196,0.2)); border: 1px solid rgba(125,206,90,0.3); border-radius: 10px; color: var(--a1); font-family: var(--font-display); font-size: 14px; font-style: italic; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; transition: transform 0.3s, opacity 0.3s, box-shadow 0.3s; box-shadow: 0 0 10px rgba(125,206,90,0.1); }
.new-chat-8:hover { box-shadow: 0 0 20px rgba(125,206,90,0.25); transform: scale(1.02); }

.sb-search-8 { padding: 6px 10px; }
.sb-search-8 input { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(125,206,90,0.15); border-radius: 8px; padding: 9px 12px; color: var(--text); font-family: var(--font); font-size: 13px; outline: none; }
.sb-search-8 input:focus { border-color: var(--a1); box-shadow: 0 0 0 2px rgba(125,206,90,0.12); }

.chat-history-8 { flex: 1; overflow-y: auto; padding: 6px 8px; }
.chat-history-8::-webkit-scrollbar { width: 3px; }
.chat-history-8::-webkit-scrollbar-thumb { background: var(--a1); border-radius: 3px; }
.hist-label-8 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 6px 4px 4px; }
.ch-item-8 { padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; margin-bottom: 2px; border: 1px solid transparent; }
.ch-item-8:hover { background: rgba(125,206,90,0.06); border-color: rgba(125,206,90,0.15); }
.ch-item-8.active { border-color: var(--a1); background: rgba(125,206,90,0.1); }
.ch-title-8 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-acts-8 { display: none; gap: 3px; }
.ch-item-8:hover .ch-acts-8 { display: flex; }
.ch-acts-8 button { background: none; border: none; font-size: 13px; border-radius: 4px; transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; }
.ch-acts-8 button:hover { background: rgba(125,206,90,0.1); }

.sb-bottom-8 { padding: 10px; border-top: 1px solid rgba(125,206,90,0.08); display: flex; flex-direction: column; gap: 6px; }
.sb-btn-8 { width: 100%; padding: 9px 12px; border-radius: 8px; font-family: var(--font); font-size: 13px; font-weight: 700; text-align: left; transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; }
.upgrade-8 { background: rgba(125,206,90,0.1); border: 1px solid rgba(125,206,90,0.3); color: var(--a1); }
.upgrade-8:hover { border-color: var(--a1); box-shadow: 0 0 12px rgba(125,206,90,0.2); }
.settings-8 { background: transparent; border: 1px solid rgba(255,255,255,0.06); color: var(--muted); }
.settings-8:hover { border-color: var(--muted); color: var(--text); }
.user-row-8 { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; transition: background 0.2s; }
.user-row-8:hover { background: rgba(255,255,255,0.04); }
.user-av-8 { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--a1), var(--a4)); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.user-info-8 { flex: 1; overflow: hidden; }
.user-info-8 span { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-email-8 { font-size: 11px !important; color: var(--muted); }
.user-menu-8 { background: rgba(13,31,10,0.98); border: 1px solid rgba(125,206,90,0.15); border-radius: 8px; padding: 4px; }
body.night-mode .user-menu-8 { background: rgba(3,8,16,0.98); }
.user-menu-8 button { display: block; width: 100%; padding: 8px 10px; border: none; background: none; color: var(--text); font-size: 13px; text-align: left; border-radius: 6px; transition: background 0.2s; }
.user-menu-8 button:hover { background: rgba(125,206,90,0.1); }

.col-btn-8 { position: fixed; top: 50%; transform: translateY(-50%); z-index: 150; width: 28px; height: 54px; background: rgba(13,31,10,0.95); border: 1px solid rgba(125,206,90,0.2); display: none; align-items: center; justify-content: center; font-size: 14px; transition: transform 0.3s, opacity 0.3s, box-shadow 0.3s; box-shadow: 0 0 12px rgba(125,206,90,0.15); }
.left-col8 { left: 0; border-radius: 0 8px 8px 0; border-left: none; }
.right-col8 { right: 0; border-radius: 8px 0 0 8px; border-right: none; }
.col-btn-8:hover { box-shadow: 0 0 20px var(--a1); }

/* ── MAIN ────────────────────────────────── */
.main-8 { position: fixed; left: var(--sb-w); right: var(--sb-w); top: 0; bottom: 0; display: flex; flex-direction: column; will-change: transform; z-index: 10; }

/* ── TOPBAR ──────────────────────────────── */
.topbar-8 { height: var(--tb-h); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: rgba(13,31,10,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(125,206,90,0.08); flex-shrink: 0; z-index: 20; }
body.night-mode .topbar-8 { background: rgba(3,8,16,0.9); border-bottom-color: rgba(78,205,196,0.08); }
.tb-title-8 { font-family: var(--font-display); font-size: 18px; font-weight: 700; font-style: italic; color: var(--a1); }
.tb-sub-8 { font-size: 12px; color: var(--muted); }
.tb-right-8 { display: flex; align-items: center; gap: 8px; }
.q-badge-8 { font-size: 12px; background: rgba(125,206,90,0.1); border: 1px solid rgba(125,206,90,0.25); border-radius: 20px; padding: 5px 12px; color: var(--a1); font-weight: 700; }
.tb-btn-8 { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(125,206,90,0.12); font-size: 16px; display: flex; align-items: center; justify-content: center; transition: transform 0.25s, opacity 0.25s, box-shadow 0.25s; }
.tb-btn-8:hover { background: rgba(125,206,90,0.12); border-color: var(--a1); box-shadow: 0 0 12px rgba(125,206,90,0.2); }
.theme-toggle-8 { font-size: 20px; }
.tb-login-8 { padding: 8px 16px; background: linear-gradient(135deg, var(--a1), var(--a4)); border: none; border-radius: 20px; color: #0d1f0a; font-family: var(--font); font-size: 13px; font-weight: 800; transition: transform 0.3s, opacity 0.3s, box-shadow 0.3s; box-shadow: 0 4px 15px rgba(125,206,90,0.25); }
.tb-login-8:hover { transform: scale(1.04); box-shadow: 0 6px 25px rgba(125,206,90,0.4); }

/* ── HOME ────────────────────────────────── */
.home-8 { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; overflow-y: auto; position: relative; z-index: 5; }
.home-center-8 { text-align: center; margin-bottom: 32px; }
.nature-logo-wrap-8 { position: relative; display: inline-block; width: 110px; height: 110px; margin-bottom: 20px; }
.home-logo-8 { width: 110px; height: 110px; border-radius: 50%; animation: naturePulse 3s ease infinite; }
@keyframes naturePulse {
  0%,100% { filter: drop-shadow(0 0 20px var(--a1)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 40px var(--a2)) brightness(1.2); transform: scale(1.06); }
}
.leaf-ring-8 {
  position: absolute; font-size: 20px;
  animation: leafOrbit 8s linear infinite;
  top: 50%; left: 50%;
}
.leaf-1 { animation-duration: 8s; --angle: 0deg; }
.leaf-2 { animation-duration: 8s; --angle: 90deg; animation-delay: -2s; }
.leaf-3 { animation-duration: 8s; --angle: 180deg; animation-delay: -4s; }
.leaf-4 { animation-duration: 8s; --angle: 270deg; animation-delay: -6s; }
@keyframes leafOrbit {
  from { transform: translate(-50%,-50%) rotate(var(--angle,0deg)) translateX(72px) rotate(calc(-1*var(--angle,0deg))); }
  to { transform: translate(-50%,-50%) rotate(calc(var(--angle,0deg) + 360deg)) translateX(72px) rotate(calc(-1*(var(--angle,0deg) + 360deg))); }
}

.home-subtitle-8 { font-size: 13px; color: var(--a1); margin-bottom: 10px; font-weight: 700; }
.home-greeting-8 { font-family: var(--font-display); font-size: clamp(22px, 4vw, 36px); font-style: italic; font-weight: 700; color: var(--text); text-shadow: 0 0 30px rgba(125,206,90,0.3); animation: greetWave 5s ease infinite; }
@keyframes greetWave { 0%,100%{color:var(--text);} 50%{color:var(--a1);} }

.chips-8 { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 660px; }
.chip-8 { padding: 10px 18px; background: rgba(125,206,90,0.06); border: 1px solid rgba(125,206,90,0.2); border-radius: 50px; font-size: 13px; color: var(--text); font-family: var(--font); font-weight: 600; transition: transform 0.3s var(--tr), opacity 0.3s var(--tr), box-shadow 0.3s var(--tr); }
.chip-8:hover { background: rgba(125,206,90,0.15); border-color: var(--a1); color: var(--a1); transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 20px rgba(125,206,90,0.2); }

/* ── CHAT ────────────────────────────────── */
.chat-8 { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.chat-msgs-8 { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.chat-msgs-8::-webkit-scrollbar { width: 4px; }
.chat-msgs-8::-webkit-scrollbar-thumb { background: var(--a1); border-radius: 4px; }

.msg-8 { display: flex; gap: 10px; max-width: 82%; animation: msgIn8 0.4s var(--tr) both; }
@keyframes msgIn8 { from{opacity:0;transform:translateY(12px);} to{opacity:1;transform:none;} }
.msg-8.user { flex-direction: row-reverse; align-self: flex-end; }
.msg-8.bot { align-self: flex-start; }
.msg-av-8 { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.msg-8.user .msg-av-8 { background: linear-gradient(135deg, var(--a1), var(--a4)); }
.msg-8.bot .msg-av-8 { background: rgba(125,206,90,0.1); border: 1px solid rgba(125,206,90,0.2); }
.msg-bubble-8 { padding: 14px 18px; border-radius: 16px; font-size: 14px; line-height: 1.7; }
.msg-8.user .msg-bubble-8 { background: rgba(125,206,90,0.12); border: 1px solid rgba(125,206,90,0.25); border-top-right-radius: 4px; }
.msg-8.bot .msg-bubble-8 { background: rgba(255,255,255,0.04); border: 1px solid rgba(125,206,90,0.1); border-top-left-radius: 4px; }
.msg-bubble-8 strong { color: var(--a1); }
.msg-bubble-8 em { color: var(--a2); }
.msg-bubble-8 u { text-decoration-color: var(--a3); }
.msg-acts-8 { display: flex; gap: 4px; margin-top: 6px; opacity: 0; transition: opacity 0.2s; }
.msg-8:hover .msg-acts-8 { opacity: 1; }
.mab-8 { padding: 3px 8px; background: rgba(125,206,90,0.06); border: 1px solid rgba(125,206,90,0.15); border-radius: 6px; font-size: 11px; color: var(--muted); transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; position: relative; }
.mab-8:hover { background: rgba(125,206,90,0.12); color: var(--a1); border-color: var(--a1); }
.mab-8[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: rgba(13,31,10,0.95); color: var(--text); font-size: 10px; white-space: nowrap; padding: 4px 8px; border-radius: 6px; border: 1px solid rgba(125,206,90,0.2); pointer-events: none; }
body.night-mode .mab-8[data-tooltip]:hover::after { background: rgba(3,8,16,0.95); }

.thinking-8 { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: rgba(125,206,90,0.04); border: 1px solid rgba(125,206,90,0.1); border-radius: 16px; border-top-left-radius: 4px; font-size: 13px; color: var(--muted); font-style: italic; animation: msgIn8 0.4s var(--tr) both; align-self: flex-start; max-width: 70%; }
.think-dots-8 { display: flex; gap: 4px; }
.think-dots-8 span { width: 6px; height: 6px; border-radius: 50%; background: var(--a1); animation: tDot8 1.2s ease infinite; }
.think-dots-8 span:nth-child(2) { animation-delay: 0.2s; background: var(--a2); }
.think-dots-8 span:nth-child(3) { animation-delay: 0.4s; background: var(--a3); }
@keyframes tDot8 { 0%,80%,100%{transform:scale(0.6);opacity:0.4;} 40%{transform:scale(1);opacity:1;} }

.scroll-btn-8 { position: absolute; bottom: 10px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--a1), var(--a4)); border: none; color: #0d1f0a; font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(125,206,90,0.3); transition: transform 0.3s, opacity 0.3s, box-shadow 0.3s; z-index: 10; }
.scroll-btn-8:hover { transform: scale(1.1); box-shadow: 0 8px 25px rgba(125,206,90,0.5); }

/* ── INPUT ───────────────────────────────── */
.input-area-8 {
  position: relative;
  z-index: 1;
   padding: 10px 14px; border-top: 1px solid rgba(125,206,90,0.08); background: rgba(13,31,10,0.95); backdrop-filter: blur(8px); flex-shrink: 0; z-index: 20; }
body.night-mode .input-area-8 { background: rgba(3,8,16,0.9); }
.disclaimer-8 { font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 8px; }
.exhausted-8 { text-align: center; padding: 9px; background: rgba(255,107,53,0.08); border: 1px solid rgba(255,107,53,0.25); border-radius: 10px; font-size: 13px; color: #ff9966; margin-bottom: 8px; }
.timer-8 { color: var(--a1); font-weight: 800; }
.input-wrap-8 { display: flex; align-items: center; gap: 8px; background: rgba(125,206,90,0.04); border: 1.5px solid rgba(125,206,90,0.2); border-radius: 14px; padding: 7px 10px; transition: border-color 0.3s, box-shadow 0.3s; }
.input-wrap-8:focus-within { border-color: var(--a1); box-shadow: 0 0 0 3px rgba(125,206,90,0.12); }
.input-field-8 { flex: 1; min-height: 24px; max-height: 140px; overflow-y: auto; font-family: var(--font); font-size: 14px; color: var(--text); outline: none; line-height: 1.6; }
.input-field-8:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.input-btn-8 { width: 34px; height: 34px; border-radius: 8px; background: rgba(125,206,90,0.06); border: 1px solid rgba(125,206,90,0.15); font-size: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.25s, opacity 0.25s, box-shadow 0.25s; }
.input-btn-8:hover { border-color: var(--a1); box-shadow: 0 0 10px rgba(125,206,90,0.2); }
.send-btn-8 { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--a1), var(--a4)); border: none; color: #0d1f0a; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.3s var(--tr), opacity 0.3s var(--tr), box-shadow 0.3s var(--tr); box-shadow: 0 4px 15px rgba(125,206,90,0.3); }
.send-btn-8:hover { transform: scale(1.1) rotate(10deg); box-shadow: 0 8px 25px rgba(125,206,90,0.5); }

/* ── LIBRARY ─────────────────────────────── */
.lib-8 { flex: 1; overflow-y: auto; padding: 6px 8px; }
.lib-sec-8 { margin-bottom: 14px; }
.lib-label-8 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 6px 4px 4px; font-weight: 700; }
.lib-item-8 { padding: 8px 10px; border-radius: 7px; font-size: 12px; color: var(--text); background: rgba(125,206,90,0.03); border: 1px solid transparent; transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; display: block; margin-bottom: 3px; }
.lib-item-8:hover { border-color: var(--a1); background: rgba(125,206,90,0.08); transform: translateX(4px); }
.lib-link-8 { padding: 8px 10px; border-radius: 7px; font-size: 12px; color: var(--a4); background: rgba(78,205,196,0.04); border: 1px solid rgba(78,205,196,0.15); text-decoration: none; display: block; margin-bottom: 3px; transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; }
.lib-link-8:hover { border-color: var(--a4); background: rgba(78,205,196,0.1); transform: translateX(4px); }

/* ── MODALS ──────────────────────────────── */
.modal-8 { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.82); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-8.open { opacity: 1; pointer-events: all; }
.modal-box-8 { background: rgba(13,31,10,0.98); border: 1px solid rgba(125,206,90,0.15); border-radius: 20px; padding: 32px; max-width: 500px; width: 100%; position: relative; transform: scale(0.92) translateY(16px); transition: transform 0.4s var(--tr); box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 30px rgba(125,206,90,0.1); }
body.night-mode .modal-box-8 { background: rgba(3,8,16,0.98); box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 30px rgba(78,205,196,0.08); }
.modal-8.open .modal-box-8 { transform: scale(1) translateY(0); }
.modal-close-8 { position: absolute; top: 14px; right: 14px; background: rgba(125,206,90,0.08); border: 1px solid rgba(125,206,90,0.2); color: var(--muted); width: 28px; height: 28px; border-radius: 50%; font-size: 12px; transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; display: flex; align-items: center; justify-content: center; }
.modal-close-8:hover { border-color: var(--a3); color: var(--a3); }

.upgrade-h-8 { text-align: center; margin-bottom: 20px; }
.upgrade-icon-8 { font-size: 48px; margin-bottom: 10px; animation: upgradeNature 2s ease infinite; }
@keyframes upgradeNature { 0%,100%{transform:scale(1)rotate(-5deg);} 50%{transform:scale(1.1)rotate(5deg);} }
.upgrade-h-8 h2 { font-family: var(--font-display); font-size: 24px; font-style: italic; color: var(--a1); margin-bottom: 6px; }
.upgrade-h-8 p { color: var(--muted); font-size: 14px; }
.upgrade-feats-8 { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.uf-8 { padding: 10px 14px; background: rgba(125,206,90,0.05); border: 1px solid rgba(125,206,90,0.12); border-radius: 10px; font-size: 14px; }
.upgrade-cta-8 { width: 100%; padding: 15px; background: linear-gradient(135deg, var(--a1), var(--a4)); border: none; border-radius: 12px; color: #0d1f0a; font-family: var(--font-display); font-size: 16px; font-weight: 700; font-style: italic; cursor: pointer; box-shadow: 0 6px 20px rgba(125,206,90,0.3); margin-bottom: 10px; }
.upgrade-cta-8:hover { transform: scale(1.02); box-shadow: 0 10px 30px rgba(125,206,90,0.5); }
.upgrade-note-8 { text-align: center; font-size: 11px; color: var(--muted); }

.auth-box-8 { max-width: 400px; }
.auth-logo-8 { text-align: center; margin-bottom: 18px; }
.auth-logo-8 img { width: 52px; height: 52px; border-radius: 50%; filter: drop-shadow(0 0 15px var(--a1)); animation: naturePulse 3s ease infinite; margin-bottom: 10px; }
.auth-logo-8 h2 { font-family: var(--font-display); font-size: 22px; font-style: italic; color: var(--a1); margin-bottom: 4px; }
.auth-logo-8 p { color: var(--muted); font-size: 13px; }
.auth-inp-8 { display: block; width: 100%; background: rgba(125,206,90,0.04); border: 1px solid rgba(125,206,90,0.15); border-radius: 10px; padding: 11px 14px; color: var(--text); font-family: var(--font); font-size: 14px; outline: none; transition: border-color 0.2s; margin-bottom: 10px; }
.auth-inp-8:focus { border-color: var(--a1); box-shadow: 0 0 0 2px rgba(125,206,90,0.1); }
.auth-btn-8 { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--a1), var(--a4)); border: none; border-radius: 12px; color: #0d1f0a; font-family: var(--font); font-size: 15px; font-weight: 800; cursor: pointer; margin-bottom: 12px; }
.auth-btn-8:hover { transform: scale(1.02); box-shadow: 0 6px 20px rgba(125,206,90,0.4); }
.auth-div-8 { text-align: center; color: var(--muted); font-size: 12px; position: relative; margin: 10px 0; }
.auth-div-8::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(125,206,90,0.1); }
.auth-div-8 span { background: rgba(13,31,10,0.98); padding: 0 10px; position: relative; }
body.night-mode .auth-div-8 span { background: rgba(3,8,16,0.98); }
.google-btn-8 { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; color: var(--text); font-family: var(--font); font-size: 14px; cursor: pointer; margin-bottom: 12px; }
.google-btn-8:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.18); }
.auth-sw-8 { text-align: center; font-size: 13px; color: var(--muted); }
.auth-sw-8 a { color: var(--a1); text-decoration: none; font-weight: 800; }

.settings-box-8 { max-width: 580px; max-height: 80vh; overflow-y: auto; }
.settings-title-8 { font-family: var(--font-display); font-size: 22px; font-style: italic; color: var(--a1); margin-bottom: 14px; }
.stabs-8 { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.stab-8 { padding: 7px 14px; border-radius: 20px; border: 1px solid rgba(125,206,90,0.15); background: transparent; color: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 700; transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; }
.stab-8.active { background: rgba(125,206,90,0.15); border-color: var(--a1); color: var(--a1); }
.stab-8:hover:not(.active) { color: var(--text); border-color: var(--muted); }
.settings-content-8 { font-size: 14px; }
.setting-row-8 { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(125,206,90,0.06); gap: 10px; }
.setting-row-8:last-child { border-bottom: none; }
.setting-row-8 h4 { font-family: var(--font-display); font-size: 14px; font-weight: 700; font-style: italic; margin-bottom: 2px; }
.setting-row-8 p { font-size: 12px; color: var(--muted); }
.toggle-8 { width: 42px; height: 22px; border-radius: 11px; background: rgba(125,206,90,0.1); border: 1px solid rgba(125,206,90,0.2); position: relative; flex-shrink: 0; transition: transform 0.3s, opacity 0.3s, box-shadow 0.3s; }
.toggle-8.on { background: rgba(125,206,90,0.25); border-color: var(--a1); box-shadow: 0 0 8px rgba(125,206,90,0.2); }
.toggle-8::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.3s; }
.toggle-8.on::after { transform: translateX(20px); background: var(--a1); }

.break-8 { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.85); backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: center; }
.break-inner-8 { background: rgba(13,31,10,0.98); border: 1px solid rgba(125,206,90,0.2); border-radius: 20px; padding: 40px; text-align: center; max-width: 360px; box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 30px rgba(125,206,90,0.12); }
body.night-mode .break-inner-8 { background: rgba(3,8,16,0.98); border-color: rgba(78,205,196,0.2); }
.break-emoji-8 { font-size: 60px; margin-bottom: 14px; animation: naturePulse 2s ease infinite; }
.break-inner-8 h3 { font-family: var(--font-display); font-size: 22px; font-style: italic; color: var(--a1); margin-bottom: 10px; }
.break-inner-8 p { font-size: 14px; color: var(--muted); margin-bottom: 22px; line-height: 1.6; }
.break-inner-8 button { padding: 12px 26px; background: linear-gradient(135deg, var(--a1), var(--a4)); border: none; border-radius: 50px; color: #0d1f0a; font-family: var(--font); font-size: 14px; font-weight: 800; cursor: pointer; transition: transform 0.3s, opacity 0.3s, box-shadow 0.3s; }
.break-inner-8 button:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(125,206,90,0.4); }

.toast-8 { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px); background: rgba(13,31,10,0.98); border: 1px solid rgba(125,206,90,0.3); color: var(--a1); padding: 11px 22px; border-radius: 50px; font-size: 14px; font-weight: 700; z-index: 5000; opacity: 0; pointer-events: none; backdrop-filter: blur(20px); transition: transform 0.35s var(--tr), opacity 0.35s var(--tr), box-shadow 0.35s var(--tr); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
body.night-mode .toast-8 { background: rgba(3,8,16,0.98); }
.toast-8.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.yt-card-8 { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(255,0,0,0.06); border: 1px solid rgba(255,100,100,0.2); border-radius: 10px; text-decoration: none; color: var(--text); transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; margin-top: 8px; }
.yt-card-8:hover { border-color: #ff4444; transform: translateX(4px); }
.yt-thumb-8 { width: 64px; height: 40px; object-fit: cover; border-radius: 6px; }
.yt-title-8 { font-size: 12px; font-weight: 700; display: block; margin-bottom: 2px; }
.yt-meta-8 { font-size: 10px; color: var(--muted); }

.hidden { display: none !important; }


/* ═══════════════════════════════════════════════════════
   FEATURES MODULE STYLES — sticky notes, flashcards etc
   ═══════════════════════════════════════════════════════ */
@keyframes stickyPanelIn {
  from { opacity:0; transform:scale(0.85) translateY(20px); }
  to   { opacity:1; transform:scale(1)    translateY(0);    }
}

/* Sticky note fold effect */
.sticky-note::before {
  content:'';position:absolute;top:0;right:0;width:0;height:0;
  border-style:solid;border-width:0 14px 14px 0;
  border-color:transparent rgba(0,0,0,0.25) transparent transparent;
}

/* Typing indicator */
.typing-indicator-feat {
  align-self:flex-start;
}

/* Streak badge animation */
#streakBadge:hover { transform:scale(1.08); }

/* Feature action buttons hover */
button[onclick*="shareAsImageCard"]:hover,
button[onclick*="generateFlashcard"]:hover,
button[onclick*="readAloud"]:hover {
  opacity:0.85;
  transform:translateY(-1px);
}

/* Scrollbar in deck modal */
#plannerList::-webkit-scrollbar { width:4px; }
#plannerList::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.15);border-radius:2px; }

/* Voice lang options hover */
.vlang-opt:hover { background:rgba(255,255,255,0.06) !important; }

/* ═══ FOCUS MODE CURSOR FIX ═══ */
body.focus-mode * { cursor: auto !important; }

/* ═══ SETTINGS BUTTON VISIBILITY FIX ═══ */
.settings-8 { 
  background: rgba(125,206,90,0.08) !important; 
  border: 1px solid rgba(125,206,90,0.35) !important; 
  color: #a8d890 !important;
  font-size: 13px !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.settings-8:hover { 
  background: rgba(125,206,90,0.18) !important; 
  border-color: var(--a1) !important; 
  color: var(--a1) !important; 
}
body.night-mode .settings-8 { 
  background: rgba(78,205,196,0.08) !important; 
  border-color: rgba(78,205,196,0.35) !important; 
  color: #78e8e0 !important; 
}
body.night-mode .settings-8:hover { border-color: rgba(78,205,196,0.7) !important; color: #9af0ea !important; }

/* Topbar buttons - ensure all visible */
.tb-btn-8 { display: flex !important; visibility: visible !important; opacity: 1 !important; }
.tb-right-8 { overflow: visible !important; flex-wrap: nowrap !important; }


/* ═══════════════════════════════════════════════════════
   PERFORMANCE CRITICAL OVERRIDES  (perf-fix applied)
   GPU compositing, paint containment, rAF-ready cursors
═══════════════════════════════════════════════════════ */

/* Cursor: position via JS transform, not left/top */
.cursor-glow, .cursor-trail,
/* cursor position handled by JS transform only */

/* Canvas: isolated GPU layer, no repaints */
canvas {
  position: fixed;
  will-change: transform;
  contain: strict;
  transform: translateZ(0);
  image-rendering: pixelated;
}

/* Sidebars: transform-only animation */
.sidebar, .left-sidebar, .right-sidebar,
[class*="sidebar-8"], [class*="sidebar-9"], [class*="sidebar-10"],
[class*="sb-left"], [class*="sb-right"],
[class*="left-sb"], [class*="right-sb"] {
  will-change: transform;
  transform: translateZ(0);
  contain: layout style;
  /* Reduce blur cost */
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

/* Modals: lightweight */
.modal-overlay, [class*="modal-8"],
[class*="modal-9"], [class*="modal-10"] {
  will-change: opacity;
  contain: layout style;
}

/* Topbar: GPU layer */
.top-bar, .topbar, [class*="topbar-"] {
  transform: translateZ(0);
  contain: layout style;
  /* Less expensive blur */
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

/* Input area */
.chat-input-area, [class*="input-area-"] {
  transform: translateZ(0);
  will-change: auto;
  /* Remove blur entirely from input area */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Glitter — contained to its own layer */
.glitter-container, [id="glitterContainer"] {
  contain: strict;
  overflow: hidden;
}
.glitter {
  will-change: transform, opacity;
  contain: layout size style;
}

/* Logo animation: use transform only, not filter */
.sb-logo-img, [class*="sb-logo-img"] {
  will-change: filter;
  contain: layout;
  animation-duration: 6s !important;
}

/* Home logo: snap animation */
.home-logo-img, [class*="home-logo"] {
  will-change: transform;
  contain: layout;
}

/* Chat messages: content containment */
.chat-messages, [class*="chat-msgs"],
[class*="msgs-"], [class*="-messages"] {
  contain: content;
  overflow-anchor: auto;
}

/* Buttons: fast GPU-composited hover */
button {
  transform: translateZ(0);
  -webkit-tap-highlight-color: transparent;
}

/* Scrollbars: thin and performant */
* {
  scrollbar-width: thin;
}

/* Reduce excessive animations */
.glitter { animation-duration: 3s; }

/* Aurora beams - transform only */
.aurora-beam {
  will-change: transform, opacity;
  contain: layout style;
}
.aurora-container {
  contain: strict;
  overflow: hidden;
}

/* Particles */
.particle {
  will-change: transform, opacity;
  contain: layout size style;
}

/* Utility */
.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* ── Rain canvas layer ── */
#rainCanvas.rain-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
  will-change: transform;
}
#rainCanvas.rain-layer.hidden {
  display: none;
}

/* ── Chat Background Canvas ── */
.chat-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}


/* ── CHAT CANVAS BACKGROUND ─────────────────────────────── */
#chatCanvas8 { position:absolute; inset:0; z-index:0; pointer-events:none; }
.topbar-8       { position:relative; z-index:20; }
.home-8         { position:relative; z-index:2; }
.chat-8         { position:relative; z-index:2; }
.input-area-8   { position:relative; z-index:5; }
/* Message bubbles */
.msg-bubble-8 {
  background: rgba(4,18,8,0.88) !important;
  backdrop-filter: blur(8px);
}
.msg-8.user .msg-bubble-8 {
  background: rgba(30,150,70,0.22) !important;
  backdrop-filter: blur(8px);
}
.mab-8 {
  background: rgba(4,18,8,0.82) !important;
  border: 1px solid rgba(60,200,100,0.35) !important;
  color: #88eebb !important;
}

/* ── Settings-driven overrides ── */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
body.high-contrast { filter: contrast(1.25); }

/* ── No-anim: suppress typing animation on reload ── */
.msg-8.no-anim .msg-bubble-8,
.msg-8.no-anim .msg-bubble { animation: none !important; }

/* ── Bot action buttons ── */
.msg-acts-8 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0 4px;
  opacity: 1;
}
.msg-8.user .msg-acts-8 { opacity: 0; }
.msg-8.user:hover .msg-acts-8 { opacity: 1; }
.mab-8 {
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.22);
  color: rgba(209,250,229,0.85);
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.18s;
}
.mab-8:hover { background: rgba(34,197,94,0.18); border-color: #22c55e; }
