/* =============================================
   SAMAD VETERAS 4.1 — CSS
   Bordeaux Noir: deep burgundy & champagne-gold
   dark luxury theme, consistent across all pages
   ============================================= */

:root {
  /* Bordeaux Noir palette -- deep burgundy dark theme */
  --bg: #0B0406;
  --bg2: #150708;
  --bg3: #1D0B0E;
  --surface: #241014;
  --surface2: #32151B;
  --border: rgba(154, 32, 61, 0.22);
  --border2: rgba(154, 32, 61, 0.38);
  --blue: #7A1330;        /* primary burgundy */
  --blue-light: #D1637E;  /* rose-burgundy, used for accent text/links */
  --cyan: #C9A15A;        /* champagne gold, secondary accent */
  --gold: #C9A15A;
  --grad-solid: linear-gradient(135deg, #93173C, #4A0B1B);
  --success: #6FA98A;
  --danger: #C25450;
  --text: #F3E7E7;
  --text2: #BB9BA1;
  --text3: #7E5C62;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- NOISE TEXTURE OVERLAY ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.018;
  pointer-events: none;
  z-index: 999;
}

/* ===================== NAVBAR ===================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(6, 12, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon svg { width: 32px; height: 32px; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-accent { color: var(--blue-light); }

.brand-version {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--grad-solid);
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

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

.nav-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(122, 19, 48, 0.1);
}

.nav-cta {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
  padding: 8px 20px;
  background: var(--grad-solid);
  border-radius: 8px;
  transition: all 0.2s;
  margin-left: 8px;
}

.nav-cta:hover { opacity: 0.85; transform: translateY(-1px); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: 0.3s;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: var(--text2);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 700px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

/* ===================== SECTIONS ===================== */
.section {
  min-height: 100vh;
  padding-top: 64px;
  animation: fadeIn 0.4s ease;
}
.hidden { display: none !important; }

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

/* ===================== HERO ===================== */
.hero-area {
  position: relative;
  text-align: center;
  padding: 72px 24px 48px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(122, 19, 48, 0.18) 0%, rgba(201, 161, 90, 0.08) 50%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--blue-light);
  background: rgba(122, 19, 48, 0.1);
  border: 1px solid var(--border2);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 28px;
  letter-spacing: 0.04em;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: #6FA98A;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-subtitle-inline {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  color: var(--text2);
  font-weight: 600;
}

.gradient-text {
  background: linear-gradient(135deg, var(--blue-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text2);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.chip {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text2);
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.chip:hover {
  color: var(--text);
  border-color: var(--blue);
  background: rgba(122, 19, 48, 0.08);
  transform: translateY(-2px);
}

/* ===================== CHAT ===================== */
.chat-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chat-messages {
  min-height: 200px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--surface2);
  border-radius: 4px;
}

/* Welcome message */
.welcome-msg {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.5s ease;
}

.welcome-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.welcome-text strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--blue-light);
  display: block;
  margin-bottom: 6px;
}

.welcome-text p { color: var(--text2); font-size: 0.95rem; }

/* Message bubbles */
.msg {
  display: flex;
  gap: 12px;
  animation: msgIn 0.3s ease;
}

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

.msg.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg.user .msg-avatar {
  background: var(--grad-solid);
  color: white;
  font-weight: 700;
  font-family: var(--font-display);
}

.msg.ai .msg-avatar {
  background: var(--bg2);
  border: 1px solid var(--border);
}

.msg-bubble {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.65;
}

.msg.user .msg-bubble {
  background: linear-gradient(135deg, rgba(122, 19, 48, 0.2), rgba(201, 161, 90, 0.15));
  border: 1px solid rgba(122, 19, 48, 0.3);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

.msg.ai .msg-bubble {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

/* Markdown in AI messages */
.msg.ai .msg-bubble strong { color: var(--blue-light); }
.msg.ai .msg-bubble em { color: var(--text2); font-style: italic; }
.msg.ai .msg-bubble ul, .msg.ai .msg-bubble ol {
  padding-left: 20px;
  margin: 8px 0;
}
.msg.ai .msg-bubble li { margin-bottom: 4px; }
.msg.ai .msg-bubble code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(122, 19, 48, 0.12);
  border: 1px solid rgba(122, 19, 48, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--cyan);
}
.msg.ai .msg-bubble pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  margin: 10px 0;
}
.msg.ai .msg-bubble pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88rem;
  color: var(--text);
}
.msg.ai .msg-bubble h1, .msg.ai .msg-bubble h2, .msg.ai .msg-bubble h3 {
  font-family: var(--font-display);
  margin: 12px 0 6px;
  color: var(--text);
}
.msg.ai .msg-bubble p { margin-bottom: 8px; }
.msg.ai .msg-bubble p:last-child { margin-bottom: 0; }

/* Typing indicator */
.typing-bubble {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  animation: bounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* ===================== CHAT INPUT ===================== */
.chat-input-area {
  margin-top: 16px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.chat-input-area:focus-within {
  border-color: rgba(122, 19, 48, 0.5);
  box-shadow: 0 0 0 3px rgba(122, 19, 48, 0.08);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 14px 14px 14px 20px;
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.97rem;
  line-height: 1.6;
  resize: none;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
}

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

.send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--grad-solid);
  border: none;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  align-self: flex-end;
}
.send-btn:hover { transform: scale(1.05); opacity: 0.9; }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 12px;
  border-top: 1px solid var(--border);
}

.model-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text3);
  letter-spacing: 0.02em;
}

.clear-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text3);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.clear-btn:hover { color: var(--text2); }

/* ===================== ABOUT PAGE ===================== */
.about-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.about-hero {
  position: relative;
  text-align: center;
  margin-bottom: 64px;
  overflow: hidden;
}

.about-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse at center, rgba(122, 19, 48, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.about-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue-light);
  background: rgba(122, 19, 48, 0.1);
  border: 1px solid var(--border2);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.about-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.about-tagline {
  font-size: 1.1rem;
  color: var(--text2);
  margin-bottom: 12px;
}

.about-location {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text3);
}

/* About grid */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.about-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
  animation: fadeIn 0.5s ease;
}

.about-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.about-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text);
}

.about-card p {
  color: var(--text2);
  font-size: 0.95rem;
  line-height: 1.7;
}

.about-card strong { color: var(--blue-light); }

.about-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-card ul li {
  color: var(--text2);
  font-size: 0.93rem;
  padding-left: 20px;
  position: relative;
}

.about-card ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--blue);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--blue-light);
  background: rgba(122, 19, 48, 0.1);
  border: 1px solid rgba(122, 19, 48, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
}

/* Vision section */
.about-vision {
  background: linear-gradient(135deg, rgba(122, 19, 48, 0.1), rgba(201, 161, 90, 0.08));
  border: 1px solid rgba(122, 19, 48, 0.25);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-bottom: 24px;
}

.vision-icon { font-size: 2.5rem; margin-bottom: 16px; }

.about-vision h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.about-vision p {
  color: var(--text2);
  max-width: 580px;
  margin: 0 auto 24px;
  font-size: 1rem;
  line-height: 1.7;
}

.vision-cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: white;
  background: var(--grad-solid);
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.vision-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(122, 19, 48, 0.3); }

/* AI About card */
.about-ai-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.ai-card-inner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.ai-card-icon { font-size: 2.5rem; flex-shrink: 0; }

.ai-card-inner h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--blue-light);
}

.ai-card-inner p { color: var(--text2); font-size: 0.93rem; line-height: 1.7; }

/* ===================== FOOTER ===================== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 32px 24px;
  text-align: center;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.footer-copy { color: var(--text3); font-size: 0.88rem; }
.footer-note { color: var(--text3); font-size: 0.8rem; font-family: var(--font-mono); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 600px) {
  .hero-area { padding: 48px 16px 32px; }
  .chat-container { padding: 0 12px 24px; }
  .about-page { padding: 40px 16px 60px; }
  .about-grid { grid-template-columns: 1fr; }
  .ai-card-inner { flex-direction: column; gap: 12px; }
  .about-vision { padding: 28px 20px; }
  .msg-bubble { max-width: 90%; }
}

/* ===================== SCROLLBAR ===================== */
* { scrollbar-width: thin; scrollbar-color: var(--surface2) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 6px; }

/* ===================== NAV ICON BUTTON ===================== */
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-icon-btn:hover {
  color: var(--text);
  border-color: var(--border2);
  background: rgba(122, 19, 48, 0.08);
}

/* ===================== INPUT FOOTER EXTRAS ===================== */
.input-footer {
  flex-wrap: wrap;
  gap: 8px;
}
.retention-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue-light);
  background: rgba(122, 19, 48, 0.08);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.input-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

/* ===================== HISTORY PANEL ===================== */
.history-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 16, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 120;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
.history-backdrop.open { opacity: 1; visibility: visible; }

.history-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 92vw);
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 130;
  padding: 20px 18px 24px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.history-panel.open { transform: translateX(0); }

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.history-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.history-sub {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 4px;
  font-family: var(--font-mono);
}
.history-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.history-close:hover { color: var(--text); border-color: var(--border2); }

.history-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--grad-solid);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.history-new:hover { transform: translateY(-1px); opacity: 0.92; }

.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.history-empty {
  color: var(--text3);
  font-size: 0.88rem;
  text-align: center;
  padding: 24px 8px;
}

.history-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.history-item:hover { border-color: var(--border2); }
.history-item.active {
  border-color: rgba(122, 19, 48, 0.55);
  background: rgba(122, 19, 48, 0.08);
}

.history-item-main {
  flex: 1;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.history-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text3);
}

.history-delete {
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text3);
  width: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.history-delete:hover {
  color: #F87171;
  background: rgba(248, 113, 113, 0.08);
}

@media (max-width: 700px) {
  .nav-icon-btn { display: none; }
  .history-panel { width: 100vw; }
}


/* =============================================
   SAMAD VETERAS 4.1 — PREMIUM FEATURES CSS
   Phase 1-3 enhancements
   ============================================= */

/* ---- NAVBAR ENHANCEMENTS ---- */
.navbar {
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.navbar.scrolled {
  background: rgba(6, 12, 24, 0.96);
  box-shadow: 0 4px 32px rgba(122, 19, 48, 0.08), 0 1px 0 rgba(122, 19, 48, 0.15);
}

.cmd-trigger-btn {
  gap: 8px;
}
.cmd-shortcut-kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(122, 19, 48, 0.12);
  border: 1px solid rgba(122, 19, 48, 0.25);
  color: var(--blue-light);
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

/* ---- HERO ENHANCEMENTS ---- */
.hero-glow-secondary {
  position: absolute;
  top: 20px;
  left: 30%;
  width: 300px;
  height: 250px;
  background: radial-gradient(ellipse at center, rgba(201, 161, 90, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.hero-modes {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-modes-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text3);
  letter-spacing: 0.04em;
}

.hero-mode-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.hero-mode-btn:hover {
  color: var(--text);
  border-color: var(--blue);
  background: rgba(122, 19, 48, 0.1);
  transform: translateY(-1px);
}

.kbd-inline {
  font-family: var(--font-mono);
  font-size: 0.75em;
  background: rgba(122, 19, 48, 0.1);
  border: 1px solid rgba(122, 19, 48, 0.25);
  color: var(--blue-light);
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

/* ---- CHAT TABS BAR ---- */
.chat-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 20px 0;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 780px;
  margin: 0 auto;
}
.chat-tabs-bar::-webkit-scrollbar { display: none; }

.chat-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text3);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 6px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  max-width: 140px;
}
.chat-tab:hover { color: var(--text2); background: var(--bg3); }
.chat-tab.active { color: var(--text); background: var(--bg2); border-color: var(--border2); }
.chat-tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.chat-tab-close {
  opacity: 0;
  color: var(--text3);
  font-size: 1rem;
  line-height: 1;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.chat-tab:hover .chat-tab-close { opacity: 1; }
.chat-tab-close:hover { color: #F87171; }
.chat-tab-new {
  color: var(--blue-light);
  border-style: dashed;
  max-width: none;
}
.chat-tab-new:hover { background: rgba(122, 19, 48, 0.08); }

/* ---- INPUT AREA ENHANCEMENTS ---- */
.chat-input-area {
  position: relative;
}

.drop-hint {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 24, 0.9);
  backdrop-filter: blur(8px);
  border: 2px dashed var(--blue);
  border-radius: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--blue-light);
  font-weight: 600;
  z-index: 10;
  pointer-events: none;
}

.chat-input-area.drag-over .drop-hint { display: flex; }
#dropZone.drag-over { border-color: var(--blue); }

.input-wrapper {
  gap: 6px;
}

.input-action-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.input-action-btn:hover {
  color: var(--text2);
  border-color: var(--border2);
  background: rgba(122, 19, 48, 0.06);
}
.input-action-btn.active {
  color: #6FA98A;
  border-color: #6FA98A;
  background: rgba(111, 169, 138, 0.1);
  animation: pulseGreen 1.5s ease infinite;
}
@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(111, 169, 138, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(111, 169, 138, 0); }
}

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

.input-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- MODE BAR ---- */
.mode-bar {
  position: relative;
  flex-shrink: 0;
}

.mode-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.mode-current:hover { border-color: var(--border2); color: var(--text); }
.mode-icon { font-size: 0.85em; }
.mode-label { white-space: nowrap; }

.mode-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 6px;
  min-width: 260px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(122, 19, 48, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s;
  z-index: 200;
}
.mode-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text2);
}
.mode-option:hover { background: rgba(122, 19, 48, 0.08); color: var(--text); }
.mode-option.active { background: rgba(122, 19, 48, 0.12); color: var(--text); }
.mode-option-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.mode-option-text { display: flex; flex-direction: column; flex: 1; }
.mode-option-label { font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; }
.mode-option-desc { font-size: 0.73rem; color: var(--text3); margin-top: 1px; }
.mode-option-check { color: var(--blue-light); font-weight: 700; font-size: 0.9rem; margin-left: auto; }

/* ---- FILE PREVIEW AREA ---- */
.file-preview-area {
  margin-top: 8px;
  margin-bottom: 4px;
}

.file-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  animation: msgIn 0.3s ease;
}

.file-icon { font-size: 1.6rem; flex-shrink: 0; }

.file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.file-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text3);
}

.file-progress-wrap {
  width: 80px;
  height: 3px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.file-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--grad-solid);
  border-radius: 3px;
  transition: width 1.2s ease;
}

.file-remove {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.file-remove:hover { color: #F87171; background: rgba(248, 113, 113, 0.1); }

/* ---- WELCOME MSG KBD ---- */
.welcome-text kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  background: rgba(122, 19, 48, 0.1);
  border: 1px solid rgba(122, 19, 48, 0.25);
  color: var(--blue-light);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---- COMMAND PALETTE ---- */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 24, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(60px, 12vh, 140px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.cmd-palette-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cmd-palette {
  width: min(580px, 92vw);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(122, 19, 48, 0.1), inset 0 1px 0 rgba(255,255,255,0.04);
  overflow: hidden;
  transform: scale(0.96) translateY(-8px);
  transition: transform 0.2s;
}
.cmd-palette-overlay.open .cmd-palette { transform: scale(1) translateY(0); }

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.cmd-search-icon { color: var(--text3); flex-shrink: 0; }
.cmd-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
}
.cmd-input::placeholder { color: var(--text3); }
.cmd-esc-key {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
}

.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.cmd-group-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px 4px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: background 0.12s, color 0.12s;
}
.cmd-item:hover { background: rgba(122, 19, 48, 0.1); color: var(--text); }
.cmd-item-icon { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.cmd-item-label { flex: 1; }
.cmd-empty { color: var(--text3); font-size: 0.88rem; text-align: center; padding: 24px; }

.cmd-footer {
  display: flex;
  gap: 16px;
  padding: 8px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text3);
}

/* ---- NOTIFICATION CENTER ---- */
.notification-center {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.notif {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 260px;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.3s, transform 0.3s;
}
.notif.notif-show { opacity: 1; transform: translateY(0) scale(1); }
.notif.notif-exit { opacity: 0; transform: translateY(-8px) scale(0.97); }
.notif-ai { border-color: rgba(122, 19, 48, 0.4); }
.notif-success { border-color: rgba(111, 169, 138, 0.4); }
.notif-warning { border-color: rgba(245, 158, 11, 0.4); }
.notif-icon { font-size: 1rem; flex-shrink: 0; }
.notif-msg { flex: 1; font-size: 0.85rem; color: var(--text2); line-height: 1.4; }
.notif-close {
  background: none; border: none; color: var(--text3); font-size: 1.1rem;
  cursor: pointer; padding: 0 4px; flex-shrink: 0; transition: color 0.15s;
}
.notif-close:hover { color: var(--text); }

/* ---- VOICE OVERLAY ---- */
.voice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 550;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.voice-overlay.hidden { display: none !important; }
.voice-overlay.open { opacity: 1; }

.voice-panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.voice-animation {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(122, 19, 48, 0.4);
  animation: voiceRing 2s ease-out infinite;
}
.voice-ring-1 { width: 60px; height: 60px; animation-delay: 0s; }
.voice-ring-2 { width: 85px; height: 85px; animation-delay: 0.4s; }
.voice-ring-3 { width: 112px; height: 112px; animation-delay: 0.8s; }
@keyframes voiceRing {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

.voice-core {
  width: 56px; height: 56px;
  background: var(--grad-solid);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; z-index: 1;
  box-shadow: 0 0 24px rgba(122, 19, 48, 0.5);
}

.voice-listening-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.voice-status {
  font-size: 0.9rem;
  color: var(--text2);
  max-width: 280px;
  min-height: 24px;
  line-height: 1.5;
  font-style: italic;
}
.voice-stop-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
  background: rgba(248, 113, 113, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.5);
  padding: 10px 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.voice-stop-btn:hover { background: rgba(248, 113, 113, 0.3); }

/* ---- PROMPT LIBRARY PANEL ---- */
.prompt-backdrop {
  position: fixed; inset: 0;
  background: rgba(3, 7, 16, 0.5);
  backdrop-filter: blur(2px);
  z-index: 120;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s;
}
.prompt-backdrop.open { opacity: 1; visibility: visible; }

.prompt-library-panel {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(360px, 92vw);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.prompt-library-panel.open { transform: translateX(0); }

.prompt-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 18px 0;
  gap: 10px;
}
.prompt-panel-header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.prompt-panel-sub {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 3px;
  font-family: var(--font-mono);
}

.prompt-search-wrap {
  position: relative;
  padding: 0 18px;
}
.prompt-search-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px 9px 34px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.prompt-search-input:focus { border-color: var(--border2); }
.prompt-search-input::placeholder { color: var(--text3); }

.prompt-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prompt-group-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 8px 4px 4px;
}

.prompt-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.prompt-item:hover { border-color: var(--border2); }

.prompt-item-main {
  flex: 1;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.prompt-item-title { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.prompt-item-text { font-size: 0.77rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prompt-item-actions {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
.prompt-fav, .prompt-delete {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 10px;
  transition: color 0.15s, background 0.15s;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prompt-fav { color: var(--text3); }
.prompt-fav:hover, .prompt-fav.active { color: var(--gold); }
.prompt-delete { color: var(--text3); }
.prompt-delete:hover { color: #F87171; background: rgba(248, 113, 113, 0.08); }
.prompt-empty { color: var(--text3); font-size: 0.88rem; text-align: center; padding: 24px; }

.prompt-panel-footer {
  padding: 12px 18px 18px;
  border-top: 1px solid var(--border);
}
.prompt-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(122, 19, 48, 0.1);
  border: 1px dashed rgba(122, 19, 48, 0.3);
  color: var(--blue-light);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.prompt-add-btn:hover { background: rgba(122, 19, 48, 0.15); border-style: solid; }

/* ---- WORKSPACE PAGE ---- */
.workspace-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  animation: fadeIn 0.4s ease;
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.workspace-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--blue-light);
  background: rgba(122, 19, 48, 0.1);
  border: 1px solid var(--border2);
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.workspace-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.workspace-desc { color: var(--text2); font-size: 0.95rem; }

.workspace-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.ws-action-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.ws-action-btn:hover { color: var(--text); border-color: var(--border2); }
.ws-primary-btn {
  background: var(--grad-solid);
  color: white;
  border-color: transparent;
}
.ws-primary-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ---- WORKSPACE STATS ---- */
.ws-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.ws-stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s, transform 0.2s;
}
.ws-stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.ws-stat-icon { font-size: 1.4rem; margin-bottom: 4px; }
.ws-stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.ws-stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text3);
  letter-spacing: 0.03em;
}

/* ---- WORKSPACE GRID ---- */
.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ws-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
  animation: fadeIn 0.4s ease;
}
.ws-card:hover { border-color: var(--border2); }
.ws-card-wide { grid-column: span 2; }

.ws-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}

.ws-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.ws-see-all-btn {
  font-size: 0.78rem;
  color: var(--blue-light);
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: var(--font-body);
}
.ws-see-all-btn:hover { opacity: 0.7; }

.ws-auto-save-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #6FA98A;
  background: rgba(111, 169, 138, 0.1);
  border: 1px solid rgba(111, 169, 138, 0.2);
  padding: 2px 8px;
  border-radius: 20px;
}

/* Recent chats widget */
.ws-recent-chats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text2);
  transition: all 0.15s;
}
.ws-chat-item:hover { border-color: var(--border2); color: var(--text); background: rgba(122, 19, 48, 0.04); }
.ws-chat-dot {
  width: 8px; height: 8px;
  background: var(--grad-solid);
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-chat-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-chat-title { font-size: 0.88rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-chat-meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text3); }
.ws-empty-state { color: var(--text3); font-size: 0.85rem; padding: 16px 0; text-align: center; }

/* Quick actions grid */
.ws-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.ws-qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  cursor: pointer;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.18s;
  line-height: 1.3;
}
.ws-qa-btn:hover { border-color: var(--border2); color: var(--text); background: rgba(122, 19, 48, 0.06); transform: translateY(-2px); }
.ws-qa-icon { font-size: 1.4rem; }

/* Notes widget */
.ws-card-notes { grid-row: span 1; }
.ws-notes-area {
  width: 100%;
  min-height: 130px;
  max-height: 200px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  resize: vertical;
  outline: none;
  line-height: 1.6;
  transition: border-color 0.2s;
  scrollbar-width: thin;
}
.ws-notes-area:focus { border-color: var(--border2); }
.ws-notes-area::placeholder { color: var(--text3); }

/* Recommendations */
.ws-recommendations { display: flex; flex-direction: column; gap: 8px; }
.ws-rec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  color: var(--text2);
  transition: all 0.15s;
}
.ws-rec-item:hover { border-color: var(--border2); color: var(--text); background: rgba(122, 19, 48, 0.04); }
.ws-rec-icon { font-size: 1.2rem; flex-shrink: 0; }
.ws-rec-text { display: flex; flex-direction: column; gap: 2px; }
.ws-rec-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.ws-rec-desc { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text3); }

/* Mode card */
.ws-card-mode {}
.ws-mode-display {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(135deg, rgba(122, 19, 48, 0.1), rgba(201, 161, 90, 0.06));
  border: 1px solid rgba(122, 19, 48, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.ws-mode-icon { font-size: 1.4rem; }
.ws-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.ws-mode-btn {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 6px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
  white-space: nowrap;
}
.ws-mode-btn:hover { color: var(--text); border-color: var(--border2); background: rgba(122, 19, 48, 0.08); }

/* ---- FLOATING ASSISTANT ---- */
.float-assistant-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grad-solid);
  color: white;
  border: none;
  border-radius: 28px;
  padding: 12px 20px 12px 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(122, 19, 48, 0.4);
  transition: all 0.25s;
  font-family: var(--font-body);
}
.float-assistant-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(122, 19, 48, 0.5); }
.float-btn-label { font-size: 0.85rem; font-weight: 600; }

.float-panel {
  position: fixed;
  bottom: 88px;
  right: 28px;
  z-index: 300;
  width: min(340px, calc(100vw - 40px));
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transition: all 0.25s;
}
.float-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.float-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}
.float-panel-header button {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.15s;
}
.float-panel-header button:hover { color: var(--text); }

.float-messages {
  flex: 1;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.float-welcome {
  font-size: 0.85rem;
  color: var(--text2);
  text-align: center;
  padding: 12px 8px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.float-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.float-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  resize: none;
  max-height: 80px;
  line-height: 1.5;
}
.float-input::placeholder { color: var(--text3); }
.float-send-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--grad-solid);
  border: none;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  align-self: flex-end;
}
.float-send-btn:hover { transform: scale(1.05); }

.float-msg {
  font-size: 0.83rem;
  padding: 8px 12px;
  border-radius: 10px;
  line-height: 1.5;
  animation: msgIn 0.25s ease;
}
.float-msg.user {
  background: linear-gradient(135deg, rgba(122, 19, 48, 0.18), rgba(201, 161, 90, 0.12));
  border: 1px solid rgba(122, 19, 48, 0.25);
  color: var(--text);
  align-self: flex-end;
  max-width: 85%;
}
.float-msg.ai {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  align-self: flex-start;
  max-width: 85%;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .ws-stats-row { grid-template-columns: repeat(2, 1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
  .ws-card-wide { grid-column: span 1; }
  .ws-quick-actions { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
  .ws-stats-row { grid-template-columns: repeat(2, 1fr); }
  .ws-quick-actions { grid-template-columns: repeat(2, 1fr); }
  .workspace-page { padding: 32px 16px 60px; }
  .workspace-header { flex-direction: column; }
  .chat-tabs-bar { padding: 6px 12px 0; }
  .float-assistant-btn { bottom: 18px; right: 18px; padding: 11px 16px 11px 12px; }
  .float-panel { right: 10px; bottom: 80px; }
  .notification-center { left: 12px; bottom: 16px; }
  .notif { min-width: 220px; }
  .hero-modes { display: none; }
}

@media (max-width: 700px) {
  .cmd-trigger-btn { display: none; }
  .ws-mode-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===================== ICON MARK (replaces emoji icons everywhere) ===================== */
.icon-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(150deg, rgba(122, 19, 48, 0.28), rgba(201, 161, 90, 0.14));
  border: 1px solid var(--border2);
  color: var(--gold);
}
.icon-mark svg { width: 18px; height: 18px; }
.icon-mark.sm { width: 30px; height: 30px; }
.icon-mark.sm svg { width: 14px; height: 14px; }
.icon-mark.lg { width: 56px; height: 56px; }
.icon-mark.lg svg { width: 24px; height: 24px; }

/* Brand seal mark (used in nav + welcome + hero) */
.seal-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #9c1c3d 0%, #5c0e22 62%, #380815 100%);
  border: 1px solid rgba(201, 161, 90, 0.45);
  box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.12), 0 2px 10px rgba(0,0,0,0.4);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===================== SLOW-REVEAL AI TEXT ===================== */
.msg.ai .msg-bubble.revealing { position: relative; }
.reveal-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--gold);
  margin-left: 2px;
  vertical-align: -0.15em;
  animation: caretBlink 0.85s steps(1) infinite;
}
@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Input frozen while AI is replying */
.chat-input-area.frozen { opacity: 0.55; pointer-events: none; }
.chat-input.frozen-note::placeholder { color: var(--text3); }
.thinking-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text3);
  padding: 0 4px 6px;
  letter-spacing: 0.02em;
}
.thinking-status .status-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.4s infinite;
}

/* ===================== SHARED "PAGE" LAYOUT PRIMITIVES ===================== */
.page-shell { max-width: 1120px; margin: 0 auto; padding: 60px 24px 90px; }
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold);
  background: rgba(201, 161, 90, 0.08);
  border: 1px solid var(--border2);
  padding: 6px 16px;
  border-radius: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 14px;
  color: var(--text);
}
.page-desc {
  color: var(--text2);
  font-size: 1.02rem;
  max-width: 620px;
  line-height: 1.7;
  margin-bottom: 8px;
}
.page-header { margin-bottom: 48px; }
.page-header.centered { text-align: center; }
.page-header.centered .page-desc { margin-left: auto; margin-right: auto; }

/* ===================== FEATURES PAGE ===================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.feature-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  background: linear-gradient(180deg, var(--bg2), rgba(122,19,48,0.06));
}
.feature-card .icon-mark { margin-bottom: 16px; }
.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  margin-bottom: 8px;
  color: var(--text);
}
.feature-card p { color: var(--text2); font-size: 0.92rem; line-height: 1.65; }
.feature-card .feature-tag {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  width: 100%;
}

.features-cta-band {
  margin-top: 56px;
  background: linear-gradient(135deg, rgba(122,19,48,0.16), rgba(201,161,90,0.06));
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.features-cta-band h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.features-cta-band p { color: var(--text2); font-size: 0.95rem; }

/* ===================== PLANS PAGE ===================== */
.plans-wrap { display: flex; flex-direction: column; align-items: center; gap: 40px; }
.plan-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.plan-card::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(201,161,90,0.14), transparent 70%);
}
.plan-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  display: block;
}
.plan-name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.plan-price { font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; color: var(--text); margin: 10px 0 4px; }
.plan-price span { font-family: var(--font-body); font-size: 0.95rem; color: var(--text3); font-weight: 500; }
.plan-sub { color: var(--text2); font-size: 0.9rem; margin-bottom: 26px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.plan-features li { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 0.92rem; }
.plan-features li .check-mark {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: rgba(201,161,90,0.14); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.plan-features li svg { width: 10px; height: 10px; }
.plan-cta-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--gold));
  border: none;
  color: #150708;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}
.plan-cta-btn:hover { transform: translateY(-2px); opacity: 0.92; }

.plans-faq { width: 100%; max-width: 720px; }
.plans-faq h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; text-align: center; margin-bottom: 22px; color: var(--text); }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg2);
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-question svg { flex-shrink: 0; transition: transform 0.25s; color: var(--text3); }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.faq-item.open .faq-answer { max-height: 220px; }
.faq-answer p { padding: 0 20px 18px; color: var(--text2); font-size: 0.9rem; line-height: 1.65; }

/* ===================== CONTACT PAGE ===================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-form-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.form-row { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.form-row label { font-size: 0.82rem; color: var(--text2); font-weight: 600; }
.form-row input, .form-row textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--border2); }
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--text3); }
.contact-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--gold));
  border: none;
  color: #150708;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}
.contact-submit-btn:hover { transform: translateY(-2px); }
.contact-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.form-status { font-size: 0.85rem; margin-top: 12px; min-height: 18px; }
.form-status.ok { color: var(--gold); }
.form-status.err { color: var(--danger); }

.contact-info-card {
  background: linear-gradient(180deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.contact-info-row { display: flex; align-items: flex-start; gap: 14px; }
.contact-info-row h4 { font-family: var(--font-display); font-size: 0.98rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.contact-info-row p, .contact-info-row a { color: var(--text2); font-size: 0.88rem; text-decoration: none; }
.contact-info-row a:hover { color: var(--blue-light); }

/* ===================== FOOTER NAV (secondary pages) ===================== */
.nav-links .nav-link { white-space: nowrap; }

/* ===================== SVG ICON NORMALIZATION (replaces emoji glyphs) ===================== */
.mode-icon, .mode-option-icon, .cmd-item-icon, .notif-icon,
.ws-stat-icon, .ws-qa-icon, .ws-rec-icon, .ws-mode-icon, .file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}
.mode-option-icon { width: 26px; height: 26px; }
.cmd-item-icon { width: 22px; height: 22px; }
.notif-icon { width: 18px; height: 18px; }
.ws-stat-icon { width: 22px; height: 22px; margin-bottom: 6px; color: var(--gold); }
.ws-qa-icon { width: 22px; height: 22px; color: var(--blue-light); }
.ws-rec-icon { width: 20px; height: 20px; color: var(--gold); }
.ws-mode-icon { width: 20px; height: 20px; }
.file-icon { width: 26px; height: 26px; color: var(--gold); }
.prompt-fav svg { display: block; }
.ws-stat-card { display: flex; flex-direction: column; align-items: flex-start; }
