:root {
  /* --- Primary Brand Color --- */
  --leonardo-blue: #0071e3;
  --leonardo-blue-hover: #005ce6;
  --leonardo-blue-light: #e5f1fb;

  /* --- Accents (For UI Feedback) --- */
  --success-green: #34c759;
  --warning-orange: #ff9f0a;
  --pro-purple: #5e5ce6;
  --danger-red: #df1b41;

  /* --- Backgrounds --- */
  --bg-color: #ffffff;
  --sidebar-bg: #fbfbfd;
  --input-bg: #ffffff;
  --gradient: radial-gradient(circle at center, #f5f5f7 0%, #ffffff 60%);

  /* --- Text & Borders --- */
  --text-main: #1d1d1f;
  --text-muted: #86868b;
  --border-color: #e5e5ea;

  /* --- Font Stacks --- */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-stack: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-stack);
  background: var(--gradient);
  background-attachment: fixed;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  display: flex; 
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

h1, h2, h3, h4,
.brand-text,
.nav-brand,
.mobile-brand,
.voice-status-title,
.mastery-val-display,
.stat-time {
  font-family: var(--font-display);
}

code, pre,
.terminal-loader-container,
.custom-code-wrapper code,
.custom-code-header,
.pro-badge,
.trial-badge,
.paywall-card .modal-badge,
.dash-email,
.chip-filename,
.sent-attachment-bubble,
.status-text,
.log-badge.alert,
.log-date,
.log-stats,
.calendar-weekday,
.calendar-day,
.exam-date,
.exam-days,
.exam-detail-badge,
.stat-subj {
  font-family: var(--font-mono);
}

/* Authentic Terminal RAG Loader */
.terminal-loader-container {
    background-color: #0c0c0e;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 8px 0 16px 0;
    max-width: 85%;
    font-size: 0.78rem;
    color: #a1a1aa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terminal-line {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: terminalFadeIn 0.1s forwards;
}

/* Color coding for different backend processes */
.terminal-line .status-info { color: #0071e3; font-weight: 600; } /* Blue - I/O */
.terminal-line .status-rag { color: #a855f7; font-weight: 600; }  /* Purple - Firestore */
.terminal-line .status-sys { color: #f59e0b; font-weight: 600; }  /* Yellow - System */
.terminal-line .status-llm { color: #22c55e; font-weight: 600; }  /* Green - Claude */
.terminal-line .process { color: #e5e7eb; }

/* Authentic staggered delay to mimic API latency */
.terminal-line:nth-child(1) { animation-delay: 0.1s; }
.terminal-line:nth-child(2) { animation-delay: 0.8s; }
.terminal-line:nth-child(3) { animation-delay: 1.5s; }
.terminal-line:nth-child(4) { animation-delay: 2.2s; }
.terminal-line:nth-child(5) { animation-delay: 2.9s; }

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

/* Blinking terminal cursor */
.terminal-cursor {
    display: inline-block;
    width: 6px;
    height: 12px;
    background-color: #e5e7eb;
    animation: terminalBlink 1s step-end infinite;
    margin-left: 4px;
    vertical-align: middle;
}

@keyframes terminalBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

button:focus, input:focus, textarea:focus { outline: none; }

/* --- SIDEBAR --- */
.sidebar { width: 260px; background-color: var(--sidebar-bg); display: flex; flex-direction: column; justify-content: space-between; padding: 20px 16px; border-right: 1px solid var(--border-color); flex-shrink: 0; }
.sidebar-top { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 8px 24px; }
.logo-icon { font-size: 20px; color: var(--leonardo-blue); }
.brand-text { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; color: #0071e3; }
.mobile-drawer-close { display: none; background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.new-chat-btn { font-family: var(--font-stack); width: 100%; background: #ffffff; border: 1px solid var(--border-color); padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; margin-bottom: 24px; transition: all 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.02); flex-shrink: 0; }
.new-chat-btn:hover { background: #f5f5f7; border-color: #d2d2d7; }
.chat-history-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; max-height: 60vh; }
.chat-history-item { display: flex; align-items: center; gap: 4px; width: 100%; }
.sidebar-chat-btn { font-family: var(--font-stack); flex: 1; background: transparent; border: none; padding: 10px 12px; border-radius: 8px; text-align: left; font-size: 14px; color: var(--text-main); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.2s; }
.sidebar-chat-btn:hover { background: #e5e5ea; }
.sidebar-chat-btn.active { background: var(--leonardo-blue-light); font-weight: 600; color: var(--leonardo-blue); }
.rename-btn { background: none; border: none; cursor: pointer; font-size: 12px; padding: 8px; border-radius: 6px; opacity: 0; transition: opacity 0.2s, background 0.2s; flex-shrink: 0; }
.chat-history-item:hover .rename-btn { opacity: 1; }
.rename-btn:hover { background: #d1d1d6; color: var(--text-main); }
.sidebar-bottom { border-top: 1px solid var(--border-color); padding-top: 16px; flex-shrink: 0; }
.user-profile { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; transition: background 0.2s; cursor: pointer; }
.user-profile:hover { background: #e5e5ea; }
.user-avatar { font-family: var(--font-display); width: 32px; height: 32px; border-radius: 50%; background: var(--text-main); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.pro-badge { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--leonardo-blue); }

/* --- MAIN CONTENT & CHAT LAYOUT --- */
.main-content { flex: 1; display: flex; flex-direction: column; position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.icon-btn { background: none; border: none; font-size: 18px; cursor: pointer; padding: 8px; border-radius: 50%; transition: background-color 0.2s; color: var(--text-muted); }
.icon-btn:hover { background-color: rgba(0,0,0,0.05); color: var(--leonardo-blue); }
.hero-section { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; transition: opacity 0.3s ease, transform 0.3s ease; }
.hero-section h1 { font-size: 38px; font-weight: 700; margin-bottom: 140px; color: var(--text-main); letter-spacing: -0.03em; }

.chat-section { flex: 1; display: none; flex-direction: column; align-items: center; padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.chat-messages { width: 100%; max-width: 750px; display: flex; flex-direction: column; gap: 24px; padding-bottom: 120px; }

/* --- MESSAGE FORMATTING --- */
.message { display: flex; flex-direction: column; max-width: 100%; line-height: 1.65; overflow-wrap: anywhere; word-break: normal; font-size: 15.5px; scroll-margin-top: 20px; scroll-margin-bottom: 100px; }
.message.user { align-self: flex-end; max-width: 85%; background-color: var(--leonardo-blue); color: #ffffff; padding: 12px 18px; border-radius: 20px; border-bottom-right-radius: 4px; }
.message.ai { align-self: flex-start; }
.message p { margin-bottom: 12px; }
.message p:last-child { margin-bottom: 0; }
.message ul, .message ol { margin-left: 24px; margin-bottom: 12px; }
.message li { margin-bottom: 6px; }
.message strong { font-weight: 600; color: inherit; }

/* --- INPUT CONTAINER --- */
.input-container { position: absolute; bottom: 50%; left: 50%; transform: translate(-50%, 50%); width: 100%; max-width: 750px; padding: 0 20px; transition: all 0.5s cubic-bezier(0.2, 0, 0, 1); z-index: 20; }
.input-container.chat-active { bottom: 30px; transform: translate(-50%, 0); }
.input-bar { display: flex; align-items: center; background-color: var(--input-bg); border-radius: 24px; padding: 8px 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.06); border: 1px solid var(--border-color); transition: border-color 0.2s; }
.input-bar:focus-within { border-color: var(--leonardo-blue); box-shadow: 0 8px 24px rgba(0, 113, 227, 0.1); }
.input-bar textarea { font-family: var(--font-stack); flex: 1; border: none; outline: none; font-size: 15px; padding: 10px; background: transparent; color: var(--text-main); }
.input-controls { display: flex; align-items: center; gap: 8px; }
.input-controls .icon-btn { color: var(--leonardo-blue); }
.input-controls .icon-btn:hover { color: var(--leonardo-blue-hover); background-color: var(--leonardo-blue-light); }

/* --- FILE ATTACHMENT CHIP --- */
.attachment-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--leonardo-blue-light); border: 1px solid var(--leonardo-blue); padding: 6px 12px; border-radius: 12px; margin-bottom: 8px; max-width: 280px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04); animation: chipPop 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes chipPop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chip-content { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.chip-icon { font-size: 14px; color: var(--leonardo-blue); display: flex; align-items: center; }
.chip-icon svg { width: 16px; height: 16px; }
.chip-filename { font-size: 12.5px; font-weight: 500; color: var(--leonardo-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-close-btn { background: none; border: none; font-size: 11px; cursor: pointer; color: var(--leonardo-blue); padding: 2px 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.15s ease; }
.chip-close-btn:hover { background: rgba(0, 113, 227, 0.15); }

/* --- HIGHLIGHTER TOOL UI --- */
.highlighter-picker { position: absolute; bottom: 45px; right: 45px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 12px; padding: 8px; display: flex; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); animation: chipPop 0.2s cubic-bezier(0.16, 1, 0.3, 1); z-index: 30; }
.hl-color-btn { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.15s; }
.hl-color-btn:hover { transform: scale(1.15); }
.hl-color-btn.active { border-color: var(--text-main); transform: scale(1.15); }
.highlighter-btn.active-mode { background-color: var(--warning-orange); }
.highlighter-btn.active-mode svg { color: white !important; }
.hl-yellow { background-color: rgba(255, 235, 59, 0.4); }
.hl-green  { background-color: rgba(76, 175, 80, 0.3); }
.hl-pink   { background-color: rgba(233, 30, 99, 0.25); }
.hl-blue   { background-color: rgba(33, 150, 243, 0.25); }
mark.custom-highlight { color: inherit; border-radius: 4px; padding: 2px 0; transition: background-color 0.2s; }
body.highlighting-mode .chat-section { cursor: text; }
body.highlighting-mode .message * { cursor: text !important; }

/* Modal Styles */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 3000; }
.modal-content { background: var(--bg-color); width: 92%; max-width: 480px; max-height: 90vh; overflow-y: auto; border-radius: 24px; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,0.15); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.025em; color: var(--text-main); }
.settings-section h3 { font-size: 0.98rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-main); margin-bottom: 12px; }
.settings-divider { border: 0; border-top: 1px solid var(--border-color); margin: 20px 0; }

.form-row { display: flex; gap: 12px; }
.form-group { flex: 1; margin-bottom: 14px; }
.form-group label { font-size: 0.82rem; color: #6e6e73; font-weight: 500; display: block; margin-bottom: 6px; }
.optional-label { font-size: 0.75rem; color: #a1a1a6; }
.form-group input { font-family: var(--font-stack); width: 100%; padding: 10px 12px; border: 1px solid #d2d2d7; border-radius: 10px; font-size: 14px; color: var(--text-main); outline: none; transition: border-color 0.15s ease; }
.form-group input:focus { border-color: var(--leonardo-blue); }

.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 0.9rem; }
.setting-label { color: var(--text-muted); }
.setting-val { font-weight: 600; color: var(--text-main); }
.status-text { font-size: 0.78rem; margin-top: 6px; min-height: 18px; }
.status-text.success { color: var(--success-green); }
.status-text.error { color: var(--danger-red); }

.btn-secondary-action { font-family: var(--font-stack); width: 100%; padding: 10px 16px; background: #f5f5f7; color: var(--text-main); border: none; border-radius: 10px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-secondary-action:hover { background: #e5e5ea; }

/* Toggles & Privacy UI */
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toggle-text-group { max-width: 80%; }
.setting-title { font-size: 0.9rem; font-weight: 600; color: var(--text-main); display: block; margin-bottom: 2px; }
.setting-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.3; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #d2d2d7; transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--success-green); }
input:checked + .slider:before { transform: translateX(20px); }

.gdpr-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.btn-outline { font-family: var(--font-stack); width: 100%; padding: 10px 16px; background: var(--bg-color); border: 1px solid #d2d2d7; border-radius: 10px; font-size: 0.88rem; font-weight: 500; cursor: pointer; text-align: left; transition: all 0.2s; display: flex; align-items: center; gap: 8px; }
.btn-outline:hover { background: #f5f5f7; border-color: var(--text-muted); }
.btn-danger-outline { font-family: var(--font-stack); width: 100%; padding: 10px 16px; background: #fffafa; border: 1px solid #ffccd2; color: var(--danger-red); border-radius: 10px; font-size: 0.88rem; font-weight: 500; cursor: pointer; text-align: left; transition: all 0.2s; display: flex; align-items: center; gap: 8px; }
.btn-danger-outline:hover { background: #ffebeb; }

.legal-links { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 12px; }
.legal-links a { color: var(--text-muted); text-decoration: underline; }
.btn-danger { font-family: var(--font-stack); width: 100%; padding: 12px; background: #fff0f0; color: var(--danger-red); border: none; border-radius: 12px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-danger:hover { background: #ffe0e0; }

/* =========================================
   COOKIE BANNER (Sleek Bottom-Right Layout)
   ========================================= */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
  transform: none;
  width: calc(100% - 48px);
  max-width: 380px; 
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 113, 227, 0.12); 
  border: 1px solid var(--border-color, #e5e5ea);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 9999;
  animation: slideUpRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cookie-content h4 { 
  font-size: 1.05rem; 
  font-weight: 700; 
  color: var(--text-main, #111827); 
  margin-bottom: 6px; 
  letter-spacing: -0.02em; 
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-content h4::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--leonardo-blue, #0071e3);
}

.cookie-content p { 
  font-size: 0.85rem; 
  color: var(--text-muted, #6b7280); 
  line-height: 1.5; 
}

.cookie-actions { 
  display: flex; 
  gap: 10px; 
  width: 100%; 
}

.cookie-actions button { 
  font-family: var(--font-stack);
  flex: 1; 
  padding: 10px; 
  font-size: 0.85rem; 
  border-radius: 10px; 
  cursor: pointer; 
  font-weight: 600; 
  transition: all 0.2s ease; 
}

.cookie-actions .btn-outline { 
  background: #f9fafb; 
  border: 1px solid var(--border-color, #e5e5ea); 
  color: var(--text-main, #111827); 
}
.cookie-actions .btn-outline:hover { 
  background: #f3f4f6; 
  border-color: #d1d5db; 
}

.cookie-actions .btn-submit { 
  background: var(--leonardo-blue, #0071e3); 
  border: none; 
  color: #ffffff; 
}
.cookie-actions .btn-submit:hover { 
  background: var(--leonardo-blue-hover, #005ce6); 
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2);
}

/* --- VOICE MODE OVERLAY (AZURE BLUE THEME) --- */
.voice-mode-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: radial-gradient(circle at center, #111d2e 0%, #060b14 100%); z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(12px); }
.close-voice-btn { position: absolute; top: 24px; right: 30px; color: var(--text-muted); background: rgba(255, 255, 255, 0.08); border-radius: 50%; padding: 10px 14px; border: 1px solid rgba(255, 255, 255, 0.1); cursor: pointer; transition: all 0.2s; }
.close-voice-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.visualizer-container { position: relative; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; margin-bottom: 40px; }
.voice-center-orb { width: 65px; height: 65px; border-radius: 50%; background: var(--leonardo-blue); box-shadow: 0 0 40px rgba(0, 113, 227, 0.6), inset 0 0 12px rgba(255, 255, 255, 0.6); z-index: 2; animation: orbThrob 2s infinite alternate ease-in-out; }
.pulse-ring { position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid rgba(0, 113, 227, 0.4); animation: radarPulse 3s infinite linear; }
.pulse-ring.delay-1 { animation-delay: 1s; }
.pulse-ring.delay-2 { animation-delay: 2s; }
@keyframes radarPulse { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(2.6); opacity: 0; border-width: 0px; } }
@keyframes orbThrob { 0% { transform: scale(0.95); opacity: 0.85; box-shadow: 0 0 25px rgba(0, 113, 227, 0.5); } 100% { transform: scale(1.06); opacity: 1; box-shadow: 0 0 60px rgba(0, 113, 227, 0.8); } }
.voice-status-title { color: #ffffff; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 12px; }  
.voice-hint { color: var(--text-muted); font-size: 14px; }

/* AI Typing / Loading Indicator Bubble */
.typing-indicator { display: inline-flex; align-items: center; gap: 5px; padding: 14px 18px; background-color: #f2f2f7; border-radius: 18px; border-bottom-left-radius: 4px; width: fit-content; margin: 8px 0; animation: fadeIn 0.2s ease-in-out; }
.typing-dot { width: 7px; height: 7px; background-color: var(--text-muted); border-radius: 50%; opacity: 0.4; animation: typingPulse 1.4s infinite ease-in-out both; }
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }
@keyframes typingPulse { 0%, 80%, 100% { transform: scale(0.75); opacity: 0.3; } 40% { transform: scale(1.1); opacity: 1; background-color: var(--text-main); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* --- INIZIO STILI BLOCCO CODICE (Markdown) --- */
.custom-code-wrapper { background-color: #1e1e1e; border-radius: 8px; margin: 12px 0; overflow: hidden; font-family: var(--font-stack); box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.custom-code-header { display: flex; justify-content: space-between; align-items: center; background-color: #2d2d2d; padding: 8px 16px; color: #b3b3b3; font-size: 12px; font-weight: 500; }
.code-copy-btn { font-family: var(--font-mono); background: none; border: none; color: #b3b3b3; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 8px; border-radius: 4px; transition: all 0.2s ease; }
.code-copy-btn:hover { background-color: #3d3d3d; color: #ffffff; }
.custom-code-wrapper pre { margin: 0 !important; padding: 16px; background-color: #1e1e1e; color: #d4d4d4; overflow-x: auto; }
.custom-code-wrapper code { font-size: 13.5px; line-height: 1.5; }

/* --- AI FEEDBACK BUTTONS --- */
.message-actions { display: flex; gap: 8px; margin-top: 12px; padding-left: 2px; }
.feedback-btn { background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.feedback-btn:hover:not(:disabled) { background-color: var(--leonardo-blue-light); color: var(--leonardo-blue); border-color: var(--leonardo-blue-light); }
.feedback-btn:disabled { cursor: default; opacity: 0.5; }
.feedback-btn.active-up { color: var(--success-green); background-color: #e8f8ec; border-color: #e8f8ec; opacity: 1; }
.feedback-btn.active-down { color: var(--danger-red); background-color: #fffafa; border-color: #ffccd2; opacity: 1; }

/* --- SENT ATTACHMENT BUBBLE --- */
.sent-attachment-bubble { display: inline-flex !important; align-items: center !important; gap: 8px !important; background-color: rgba(255, 255, 255, 0.2) !important; border: 1px solid rgba(255, 255, 255, 0.4) !important; padding: 6px 12px !important; border-radius: 8px !important; margin-bottom: 12px !important; font-size: 13px !important; font-weight: 600 !important; color: #ffffff !important; width: max-content !important; }
.sent-attachment-bubble span { display: flex !important; align-items: center !important; }
.sent-attachment-bubble svg { width: 18px !important; height: 18px !important; flex-shrink: 0 !important; }
.sent-attachment-bubble span:first-child svg { width: 18px !important; height: 18px !important; margin-top: 2px !important; }

/* --- FREE TRIAL COUNTER --- */
.trial-badge { background: rgba(0, 113, 227, 0.1); color: var(--leonardo-blue); padding: 6px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; border: 1px solid rgba(0, 113, 227, 0.2); }

/* --- PAYWALL MODAL (Redesigned) --- */
.paywall-card { background: #fff; width: 92%; max-width: 520px; border-radius: 28px; padding: 44px 36px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,0.25); position: relative; animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes modalScaleUp { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.paywall-card .modal-badge { background: var(--warning-orange); color: white; padding: 6px 16px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; display: inline-block; margin-bottom: 20px; }
.paywall-card h2 { margin: 0 0 12px; font-size: 26px; font-weight: 700; color: var(--text-main); letter-spacing: -0.025em; }
.paywall-card p { color: var(--text-muted); font-size: 16px; margin-bottom: 32px; line-height: 1.6; }
.paywall-card .modal-actions { display: flex; flex-direction: column; gap: 14px; }
.paywall-card .btn-primary { font-family: var(--font-stack); background: var(--leonardo-blue); color: white; padding: 16px; border-radius: 16px; text-decoration: none; font-weight: 600; font-size: 16px; transition: all 0.2s ease; }
.paywall-card .btn-primary:hover { background: var(--leonardo-blue-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 113, 227, 0.3); }
.paywall-card .btn-secondary { font-family: var(--font-stack); background: transparent; color: var(--text-muted); border: none; font-size: 14px; cursor: pointer; text-decoration: underline; padding: 8px; transition: color 0.2s; }
.paywall-card .btn-secondary:hover { color: var(--text-main); }

/* =========================================
   CUSTOM ORGANIZER MODAL (RENAME CHAT)
   ========================================= */
.custom-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 1; transition: opacity 0.2s ease; }
.custom-modal.hidden { display: none; opacity: 0; pointer-events: none; }
.modal-content-organizer { background: var(--bg-color); padding: 24px; border-radius: 16px; width: 90%; max-width: 340px; box-shadow: 0 20px 50px rgba(0,0,0,0.15); font-family: var(--font-stack); animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-content-organizer h3 { margin: 0 0 20px 0; color: var(--text-main); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-content-organizer label { font-family: var(--font-mono); display: block; margin: 15px 0 8px 0; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.modal-content-organizer input { font-family: var(--font-stack); width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 10px; font-size: 14px; color: var(--text-main); box-sizing: border-box; outline: none; transition: border-color 0.15s ease; }
.modal-content-organizer input:focus { border-color: var(--leonardo-blue); }
.color-options { display: flex; gap: 12px; }
.color-circle { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all 0.15s ease; }
.color-circle:hover { transform: scale(1.1); }
.color-circle.selected { border: 2px solid var(--text-main); transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.bg-blue   { background-color: #0071e3; }
.bg-orange { background-color: #ff9500; }
.bg-red    { background-color: #ff3b30; }
.bg-purple { background-color: #af52de; }
.bg-green  { background-color: #34c759; }
.bg-gray   { background-color: #8e8e93; }
.modal-content-organizer .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.modal-content-organizer .btn-secondary { font-family: var(--font-stack); background: #f5f5f7; border: none; padding: 10px 16px; border-radius: 10px; cursor: pointer; color: var(--text-main); font-weight: 600; }
.modal-content-organizer .btn-secondary:hover { background: #e8e8ed; }
.modal-content-organizer .btn-primary { font-family: var(--font-stack); background: var(--leonardo-blue); border: none; padding: 10px 16px; border-radius: 10px; cursor: pointer; color: white; font-weight: 600; }
.modal-content-organizer .btn-primary:hover { background: var(--leonardo-blue-hover); }

/* =========================================
   APP TOP NAVIGATION (TUTOR / OS TABS)
   ========================================= */
.app-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  height: 76px;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { flex: 1; font-weight: 700; color: var(--leonardo-blue); font-size: 1.35rem; letter-spacing: -0.03em; }
.nav-tabs { flex: 2; display: flex; justify-content: center; gap: 8px; }
.nav-tab { text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 8px; transition: all 0.2s; }
.nav-tab:hover { background: #f5f5f7; color: var(--text-main); }
.nav-tab.active { background: var(--text-main); color: #fff; }
.nav-user { flex: 1; display: flex; justify-content: flex-end; }
.dash-email { font-size: 12px; color: var(--text-muted); font-weight: 500; background: var(--border-color); padding: 6px 12px; border-radius: 20px; }

/* =========================================
   STUDY OS DASHBOARD SPECIFICS
   ========================================= */
.dashboard-body { background: var(--sidebar-bg); display: flex; flex-direction: column; height: 100vh; overflow-y: auto; }
.dashboard-main-container { max-width: 1200px; margin: 0 auto; padding: 40px 24px; width: 100%; }
.dashboard-header { margin-bottom: 32px; }
.dashboard-header h1 { font-size: 2.1rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.03em; margin-bottom: 8px; }
.dashboard-header p { color: var(--text-muted); font-size: 15px; }

.dashboard-grid-full { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; }
.dash-card { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 20px; padding: 32px; box-shadow: 0 4px 24px rgba(0,0,0,0.04); }
.dash-card h3 { font-size: 1.35rem; font-weight: 700; color: var(--text-main); margin-bottom: 24px; letter-spacing: -0.025em; }
.dash-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.form-row-double { display: flex; gap: 16px; }
.form-row-double .form-group { flex: 1; }

.dash-input { font-family: var(--font-stack); width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-color); font-size: 14px; background: var(--sidebar-bg); outline: none; color: var(--text-main); transition: border-color 0.2s; }
.dash-input:focus { border-color: var(--leonardo-blue); }
textarea.dash-input { resize: vertical; min-height: 80px; }
.mastery-val-display { text-align: center; font-weight: 700; letter-spacing: -0.02em; color: var(--leonardo-blue); font-size: 24px; margin-top: 16px; }

/* =========================================
   STUDY OS CALENDAR
   ========================================= */
.consistency-grid-full {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 12px;
  background: transparent;
  border: none;
  justify-content: center;
}

.calendar-month {
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  width: 100%;
  max-width: 320px;
  min-width: 260px;
  flex: 0 0 auto;
}

.calendar-month h4 {
  text-align: center;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

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

.calendar-weekday {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  background-color: #ebedf0;
  color: #86868b;
  cursor: crosshair;
  transition: all 0.2s ease;
}

.calendar-day.empty { background-color: transparent; cursor: default; }
.calendar-day.future-day { opacity: 0.3; cursor: default; background-color: transparent; border: 1px dashed #d2d2d7;}

.calendar-day.has-data { 
  color: white; 
  box-shadow: 0 2px 6px rgba(0,0,0,0.1); 
  border: none;
}
.calendar-day.activity-level-1 { background-color: #9be9a8; color: #1d1d1f; }
.calendar-day.activity-level-2 { background-color: #40c463; }
.calendar-day.activity-level-3 { background-color: #30a14e; }
.calendar-day.activity-level-4 { background-color: #216e39; }

.calendar-day:hover:not(.empty):not(.future-day) { 
  transform: scale(1.15); 
  z-index: 10; 
}

.consistency-legend {
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 12px;
}
.consistency-legend .calendar-day { width: 14px; height: 14px; cursor: default; border-radius: 4px; font-size: 0; aspect-ratio: unset;}
.consistency-legend .calendar-day:hover { transform: none; box-shadow: none; z-index: 1; }

/* Radar Chart */
.chart-card { display: flex; flex-direction: column; }
.chart-container { flex: 1; min-height: 350px; position: relative; display: flex; justify-content: center; align-items: center; }
.chart-footer { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-color); font-size: 13px; color: var(--text-muted); }

/* Recent Logs Feed */
.recent-logs-list { display: flex; flex-direction: column; gap: 16px; max-height: 400px; overflow-y: auto; padding-right: 8px; }
.log-item { background: var(--sidebar-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 16px; }
.log-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.log-title-group { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: 15px; }
.log-color-dot { width: 12px; height: 12px; border-radius: 50%; }
.log-date { font-size: 11.5px; color: var(--text-muted); }
.log-badge.alert { background: #fffafa; color: var(--danger-red); border: 1px solid #ffccd2; padding: 2px 8px; border-radius: 12px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.log-stats { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 12px; }
.log-reflection { font-size: 14px; color: var(--text-main); font-style: italic; background: var(--bg-color); padding: 12px; border-radius: 10px; border-left: 3px solid var(--border-color); margin: 0; line-height: 1.5; }

/* =========================================
   DASHBOARD FIXES (SLIDER, BUTTONS, EXAMS)
   ========================================= */
.btn-primary {
  font-family: var(--font-stack);
  background: var(--leonardo-blue);
  color: white;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-primary:hover { background: var(--leonardo-blue-hover); }

.slider-container {
  height: 46px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.view-scale-toggle {
  display: flex;
  gap: 4px;
  background: #f5f5f7;
  padding: 4px;
  border-radius: 10px;
}
.scale-btn {
  font-family: var(--font-mono);
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.scale-btn.active {
  background: white;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* --- Tutor Persona Slider Styles --- */
.custom-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: var(--border-color, #e5e5ea);
  outline: none;
  margin-top: 8px;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--leonardo-blue, #0071e3);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.1s;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.custom-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--leonardo-blue, #0071e3);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted, #86868b);
  margin-top: 6px;
  font-weight: 500;
}

.slider-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main, #1d1d1f);
  margin-bottom: 2px;
  display: block;
}

/* =========================================
   EXAM CHIPS, ICONS & ACTIONS
   ========================================= */
.exams-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.exam-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 12px;
}
.exam-info { display: flex; flex-direction: column; gap: 4px; }
.exam-info strong { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-main); }
.exam-date { font-size: 11.5px; color: var(--text-muted); }

.exam-right-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.exam-actions {
  display: flex;
  gap: 8px;
}

.exam-action-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.exam-action-btn:hover {
  background: var(--bg-color);
  color: var(--text-main);
  border-color: var(--text-main);
}
.exam-action-btn.delete-btn:hover {
  color: var(--danger-red);
  border-color: #ffccd2;
  background: #fffafa;
}

.exam-days { 
  font-size: 11.5px; 
  font-weight: 600; 
  color: var(--leonardo-blue); 
  background: var(--leonardo-blue-light); 
  padding: 4px 10px; 
  border-radius: 12px; 
}
.exam-days.urgent { 
  color: var(--danger-red); 
  background: #fffafa; 
  border: 1px solid #ffccd2; 
}
.exam-days.past { 
  color: var(--text-muted); 
  background: #f5f5f7; 
  border: 1px solid var(--border-color); 
}

.exam-details-row { 
  display: flex; 
  gap: 8px; 
  margin-top: 6px; 
}

.exam-detail-badge { 
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px; 
  background: var(--bg-color); 
  border: 1px solid var(--border-color); 
  padding: 3px 8px; 
  border-radius: 8px; 
  color: var(--text-muted); 
  font-weight: 600;
}

.exam-detail-badge svg {
  color: var(--leonardo-blue);
  opacity: 0.8;
}

/* =========================================
   MONTHLY STATS BANNER
   ========================================= */
.monthly-stats-card {
  margin-top: 10px;
  padding: 24px 32px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.monthly-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.monthly-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 16px;
  flex: 1;
  min-width: 200px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.stat-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-subj {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-time {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

/* =========================================
   DYNAMIC ACTION BANNER & LOG STYLES
   ========================================= */
.dynamic-action-banner {
  background: var(--leonardo-blue);
  color: white;
  padding: 18px 24px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.25);
  transition: background-color 0.3s ease;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
}

.banner-icon { 
  font-size: 24px; 
}

.banner-cta {
  background: white;
  color: var(--leonardo-blue);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.2s;
  white-space: nowrap;
}
.banner-cta:hover { transform: scale(1.05); }

.log-next-action {
  font-size: 14px;
  color: var(--leonardo-blue);
  background: var(--leonardo-blue-light);
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.log-next-action svg {
  flex-shrink: 0;
}

/* =========================================
   CHEAT SHEET COMPACT & PDF PRINT RULES
   ========================================= */
.cheat-sheet-container,
#cheatsheet-output,
#cheatsheet-content {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-main);
}

/* 1. Prevent equations, headers, and list items from being sliced across PDF pages */
.cheat-sheet-container li,
.cheat-sheet-container .katex-display,
.cheat-sheet-container p,
#cheatsheet-output li,
#cheatsheet-output .katex-display,
#cheatsheet-content li,
#cheatsheet-content .katex-display,
.katex-display {
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

.cheat-sheet-container h1,
.cheat-sheet-container h2,
#cheatsheet-output h1,
#cheatsheet-output h2,
#cheatsheet-content h1,
#cheatsheet-content h2 {
  page-break-after: avoid !important;
  break-after: avoid !important;
}

/* 2. Compress vertical whitespace so 20 formulas fit on 1-2 pages instead of 7 */
.cheat-sheet-container h1,
#cheatsheet-output h1,
#cheatsheet-content h1 {
  font-size: 20px;
  margin: 0 0 10px 0 !important;
  padding-bottom: 6px !important;
}

.cheat-sheet-container h2,
#cheatsheet-output h2,
#cheatsheet-content h2 {
  font-size: 15px !important;
  margin: 12px 0 6px 0 !important;
  padding: 2px 0 2px 8px !important;
  color: var(--leonardo-blue);
  border-left: 3px solid var(--leonardo-blue);
}

.cheat-sheet-container ul,
#cheatsheet-output ul,
#cheatsheet-content ul {
  margin: 2px 0 8px 0 !important;
  padding-left: 18px !important;
}

.cheat-sheet-container li,
#cheatsheet-output li,
#cheatsheet-content li {
  margin-bottom: 4px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

/* 3. Compact KaTeX Display Equation Boxes */
.cheat-sheet-container .katex-display,
#cheatsheet-output .katex-display,
#cheatsheet-content .katex-display {
  margin: 4px 0 6px 0 !important;
  padding: 6px 10px !important;
  background-color: #f4f7fb !important;
  border-left: 3px solid var(--leonardo-blue) !important;
  border-radius: 6px !important;
  overflow-x: auto;
  font-size: 0.95em !important;
}

@media print {
  .katex-display, li, h2, h3 {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  h1, h2, h3 {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
}

/* =========================================
   📱 RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================= */
.mobile-header { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 1024px) {
  .chat-section { padding: 20px 8%; }
  .message { max-width: 90%; }
}

@media (max-width: 900px) {
  .dashboard-grid-full { grid-template-columns: 1fr; gap: 24px; }
  .dash-nav { padding: 16px 20px; }
  .dash-email { display: none; }
  .chart-container { min-height: 300px; }
  .form-row-double { flex-direction: column; gap: 16px; }
  .nav-user { display: none; }
}

@media (max-width: 768px) {
  body {
    height: 100vh;
    height: 100dvh;
  }

  .sidebar { 
    position: fixed !important; 
    top: 0 !important; 
    left: -320px !important; 
    width: 280px !important; 
    max-width: 80vw !important; 
    height: 100dvh !important; 
    padding-bottom: 90px !important; 
    z-index: 2000 !important; 
    box-shadow: 8px 0 24px rgba(0,0,0,0.18) !important; 
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; 
    background: #ffffff !important; 
    display: flex !important; 
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
  }
  .sidebar.open { left: 0 !important; }

  .mobile-drawer-close { display: flex; align-items: center; justify-content: center; }

  .rename-btn { 
    opacity: 1 !important; 
    font-size: 14px;
    padding: 8px 10px;
    background: #f5f5f7;
    border-radius: 8px;
  }

  .sidebar-overlay.active { 
    display: block !important; 
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important; 
    width: 100vw !important; 
    height: 100vh !important; 
    background: rgba(0, 0, 0, 0.5) !important; 
    backdrop-filter: blur(2px) !important; 
    z-index: 1999 !important; 
  }

  .mobile-header { 
    display: flex !important; 
    justify-content: space-between !important; 
    align-items: center !important; 
    padding: 14px 20px !important; 
    background: var(--bg-color) !important; 
    border-bottom: 1px solid var(--border-color) !important; 
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    width: 100vw !important;
    box-sizing: border-box !important;
  }

  .mobile-brand { 
    font-weight: 700 !important; 
    color: var(--leonardo-blue) !important; 
    font-size: 16px !important; 
    letter-spacing: -0.02em !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .main-content {
    height: calc(100dvh - 56px) !important;
    width: 100vw !important;
  }

  .chat-section { padding: 16px 12px; }
  .message { max-width: 95%; font-size: 14.5px; }
  
  .hero-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
  }
  .hero-section h1 { 
    font-size: 26px; 
    text-align: center; 
    margin-bottom: 0; 
  }

  .input-container { 
    padding: 0 12px 16px 12px !important; 
    max-width: 100% !important; 
  }
  
  .input-bar { padding: 6px 8px; border-radius: 20px; }
  .input-bar textarea { font-size: 16px; padding: 8px; outline: none; -webkit-appearance: none; box-shadow: none; }
  .attachment-chip { max-width: 220px; }
  .paywall-card { padding: 32px 24px; }
  
  .cookie-banner {
    bottom: 16px;
    right: 16px;
    width: calc(100% - 32px);
    max-width: 100%;
    padding: 20px;
  }
}