/* ════════ VARIABLES ════════ */
:root {
  --bg: #0d0d0f;
  --surface: #161618;
  --surface2: #1e1e22;
  --surface3: #26262c;
  --border: rgba(255,255,255,0.07);
  --accent: #19c37d;
  --accent2: #1a7cff;
  --text: #f0f0f0;
  --text-muted: #7a7a8a;
  --text-dim: #4a4a5a;
  --sidebar-w: 260px;
  --header-h: 58px;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}
[data-theme="light"] {
  --bg: #F5F7F8;
  --surface: #ffffff;
  --surface2: #eceef0;
  --surface3: #e0e3e6;
  --border: rgba(0,0,0,0.08);
  --text: #111114;
  --text-muted: #6b6b7a;
  --text-dim: #a0a0b0;
}

/* ════════ RESET ════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body); background: var(--bg); color: var(--text);
  height: 100dvh; display: flex; flex-direction: column;
  overflow: hidden; transition: background 0.3s, color 0.3s;
}

/* ════════ ANIMATIONS ════════ */
@keyframes fadeUp { from{opacity:0;transform:translateY(14px);}to{opacity:1;transform:translateY(0);} }
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1);}50%{opacity:0.5;transform:scale(0.7);} }
@keyframes bounce-dot{0%,80%,100%{transform:translateY(0);opacity:0.4;}40%{transform:translateY(-6px);opacity:1;}}
@keyframes mic-ring{0%,100%{box-shadow:0 0 0 0 rgba(25,195,125,0.4);}50%{box-shadow:0 0 0 6px rgba(25,195,125,0);}}
@keyframes menuPop { from{opacity:0;transform:translateY(8px) scale(0.96);}to{opacity:1;transform:translateY(0) scale(1);} }
@keyframes glow-pulse {
  0%,100%{filter:drop-shadow(0 0 10px rgba(25,195,125,0.4)) drop-shadow(0 0 20px rgba(25,195,125,0.2));}
  50%{filter:drop-shadow(0 0 22px rgba(25,195,125,0.8)) drop-shadow(0 0 40px rgba(25,195,125,0.4));}
}

/* ════════════════════════════════════════════════════════════════
   INTRO SCREEN — updated colors #19c37d + #E4E4D7
   ════════════════════════════════════════════════════════════════ */
#introScreen {
  position: fixed; inset: 0; z-index: 9999;
  background: #0d0d0f;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 28px;
}

@keyframes introFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes introLineGrow {
  from { width: 0; }
  to   { width: 40px; }
}
@keyframes introExit {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.03); }
}
@keyframes introDraw {
  0%   { opacity: 1; stroke-dasharray: 0 380; stroke-dashoffset: 0; }
  65%  { opacity: 1; stroke-dasharray: 380 0; stroke-dashoffset: 0; }
  100% { opacity: 1; stroke-dasharray: 380 0; stroke-dashoffset: 0; }
}
@keyframes introDrawO {
  0%   { opacity: 1; stroke-dasharray: 0 380; stroke-dashoffset: 0; rotate: -180deg; }
  65%  { opacity: 1; stroke-dasharray: 380 0; stroke-dashoffset: 0; rotate: 0deg; }
  100% { opacity: 1; stroke-dasharray: 380 0; stroke-dashoffset: 0; rotate: 0deg; }
}

.intro-logo-text {
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.18); margin-bottom: -8px;
  opacity: 0;
  animation: introFadeUp 0.4s ease 0.1s forwards;
}
.intro-tagline {
  font-family: var(--font-body); font-size: 0.78rem;
  color: rgba(255,255,255,0.28); letter-spacing: 0.08em;
  opacity: 0;
  animation: introFadeUp 0.4s ease 1.8s forwards;
}
.intro-accent-line {
  width: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #19c37d, transparent);
  animation: introLineGrow 0.5s ease 1.8s forwards;
}
.hero-intro-loader {
  display: flex; align-items: center; gap: 3px;
  opacity: 0;
  animation: introFadeUp 0.3s ease 0.15s forwards;
}
.hero-intro-loader svg { display: inline-block; overflow: visible; }
.intro-letter {
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-width: 7;
  stroke-dasharray: 0 380;
  opacity: 0;
  animation: introDraw 1s ease forwards;
  animation-fill-mode: forwards;
}
.intro-letter-o {
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-width: 9;
  stroke-dasharray: 0 380;
  opacity: 0;
  transform-origin: center;
  animation: introDrawO 1s ease forwards;
  animation-fill-mode: forwards;
}

/* Updated intro colors: alternating #19c37d and #E4E4D7 */
.intro-l-h { animation-delay: 0.25s; stroke: #19c37d; }
.intro-l-e { animation-delay: 0.55s; stroke: #E4E4D7; }
.intro-l-r { animation-delay: 0.85s; stroke: #19c37d; }
.intro-l-o { animation-delay: 1.15s; stroke: #E4E4D7; }
.intro-l-s { animation-delay: 1.45s; stroke: #19c37d; }


/* ════════ AUTH ════════ */
.auth-screen {
  position: fixed; inset: 0; background: var(--bg); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeUp 0.4s ease both;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 44px 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(25,195,125,0.06);
}
.auth-logo {
  font-family: var(--font-head); font-size: 1.4rem; font-weight: 800;
  letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px;
  margin-bottom: 28px; justify-content: center;
}
.auth-logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse-dot 2s ease-in-out infinite; }
.auth-tabs { display: flex; background: var(--surface2); border-radius: 12px; padding: 4px; margin-bottom: 26px; gap: 4px; }
.auth-tab { flex: 1; padding: 9px; border-radius: 9px; border: none; background: transparent; color: var(--text-muted); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: background 0.2s, color 0.2s; }
.auth-tab.active { background: var(--surface3); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-input-group { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.auth-input { background: var(--surface2); border: 1.5px solid var(--border); border-radius: 11px; padding: 11px 14px; color: var(--text); font-family: var(--font-body); font-size: 0.9rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; width: 100%; }
.auth-input:focus { border-color: rgba(25,195,125,0.5); box-shadow: 0 0 0 3px rgba(25,195,125,0.07); }
.auth-input::placeholder { color: var(--text-dim); }
.auth-btn { margin-top: 6px; padding: 12px; background: linear-gradient(135deg, #0f8a55, var(--accent)); color: #000; border: none; border-radius: 12px; font-family: var(--font-head); font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s, transform 0.15s; }
.auth-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { font-size: 0.72rem; color: var(--text-dim); }
.auth-google-btn { padding: 11px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-family: var(--font-body); font-size: 0.88rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; transition: background 0.2s; }
.auth-google-btn:hover { background: var(--surface3); }
.auth-footer { text-align: center; font-size: 0.72rem; color: var(--text-dim); margin-top: 18px; line-height: 1.6; }
.auth-footer a { color: var(--accent); text-decoration: none; }

/* ════════ HEADER ════════ */
header { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: rgba(13,13,15,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: relative; z-index: 100; flex-shrink: 0; transition: background 0.3s; }
[data-theme="light"] header { background: rgba(245,247,248,0.85); }
.logo { font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse-dot 2s ease-in-out infinite; }
.header-right { display: flex; align-items: center; gap: 12px; }

/* ── UI Switch (theme toggle) ── */
.ui-switch {
  --switch-bg: rgba(255,255,255,0.1);
  --switch-width: 48px;
  --switch-height: 20px;
  --circle-diameter: 28px;
  --circle-bg: #19c37d;
  --circle-inset: calc((var(--circle-diameter) - var(--switch-height)) / 2);
  cursor: pointer;
  display: flex;
  align-items: center;
}
[data-theme="light"] .ui-switch { --switch-bg: rgba(0,0,0,0.1); }
.ui-switch input { display: none; }
.ui-switch .slider {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  width: var(--switch-width); height: var(--switch-height);
  background: var(--switch-bg); border-radius: 999px;
  position: relative; cursor: pointer;
  border: 1px solid var(--border);
}
.ui-switch .slider .circle {
  top: calc(var(--circle-inset) * -1); left: 0;
  width: var(--circle-diameter); height: var(--circle-diameter);
  position: absolute; background: var(--circle-bg);
  border-radius: inherit;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHdpZHRoPSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj4KICAgIDxwYXRoIGZpbGw9IiNmZmYiCiAgICAgICAgZD0iTTkuMzA1IDEuNjY3VjMuNzVoMS4zODlWMS42NjdoLTEuMzl6bS00LjcwNyAxLjk1bC0uOTgyLjk4Mkw1LjA5IDYuMDcybC45ODItLjk4Mi0xLjQ3My0xLjQ3M3ptMTAuODAyIDBMMTMuOTI3IDUuMDlsLjk4Mi45ODIgMS40NzMtMS40NzMtLjk4Mi0uOTgyek0xMCA1LjEzOWE0Ljg3MiA0Ljg3MiAwIDAwLTQuODYyIDQuODZBNC44NzIgNC44NzIgMCAwMDEwIDE0Ljg2MiA0Ljg3MiA0Ljg3MiAwIDAwMTQuODYgMTAgNC44NzIgNC44NzIgMCAwMDEwIDUuMTM5em0wIDEuMzg5QTMuNDYyIDMuNDYyIDAgMDExMy40NzEgMTBhMy40NjIgMy40NjIgMCAwMS0zLjQ3MyAzLjQ3MkEzLjQ2MiAzLjQ2MiAwIDAxNi41MjcgMTAgMy40NjIgMy40NjIgMCAwMTEwIDYuNTI4ek0xLjY2NSA5LjMwNXYxLjM5aDIuMDgzdi0xLjM5SDEuNjY2em0xNC41ODMgMHYxLjM5aDIuMDg0di0xLjM5aC0yLjA4NHpNNS4wOSAxMy45MjhMMy42MTYgMTUuNGwuOTgyLjk4MiAxLjQ3My0xLjQ3My0uOTgyLS45ODJ6bTkuODIgMGwtLjk4Mi45ODIgMS40NzMgMS40NzMuOTgyLS45ODItMS40NzMtMS40NzN6TTkuMzA1IDE2LjI1djIuMDgzaDEuMzg5VjE2LjI1aC0xLjM5eiIgLz4KPC9zdmc+");
  background-repeat: no-repeat; background-position: center center;
  transition: left 150ms cubic-bezier(0.4,0,0.2,1) 0ms, transform 150ms cubic-bezier(0.4,0,0.2,1) 0ms;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12);
}
.ui-switch .slider .circle::before {
  content: ""; position: absolute; width: 100%; height: 100%;
  background: rgba(255,255,255,0.75); border-radius: inherit;
  transition: all 500ms; opacity: 0;
}
.ui-switch input:checked + .slider .circle {
  left: calc(100% - var(--circle-diameter));
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHdpZHRoPSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj4KICAgIDxwYXRoIGZpbGw9IiNmZmYiCiAgICAgICAgZD0iTTQuMiAyLjVsLS43IDEuOC0xLjguNyAxLjguNy43IDEuOC42LTEuOEw2LjcgNWwtMS45LS43LS42LTEuOHptMTUgOC4zYTYuNyA2LjcgMCAxMS02LjYtNi42IDUuOCA1LjggMCAwMDYuNiA2LjZ6IiAvPgo8L3N2Zz4=");
}
.ui-switch input:active + .slider .circle::before { transition: 0s; opacity: 1; width: 0; height: 0; }

/* ════════ LAYOUT ════════ */
.main-wrapper { display: flex; flex: 1; overflow: hidden; position: relative; }

/* ════════ SIDEBAR ════════ */
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px 0; flex-shrink: 0; overflow: hidden; transition: transform 0.3s ease, background 0.3s; }
.sidebar-title { font-family: var(--font-head); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px; padding: 0 6px; }
.new-chat-btn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-family: var(--font-body); font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: background 0.2s; margin-bottom: 16px; width: 100%; text-align: left; }
.new-chat-btn:hover { background: var(--surface3); }
.new-chat-btn .nc-icon { width: 22px; height: 22px; background: var(--accent); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #000; font-size: 0.75rem; }
.history-scroll { flex: 1; overflow-y: auto; scrollbar-width: none; }
.history-scroll::-webkit-scrollbar { display: none; }
.history-item { padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.15s, color 0.15s; display: flex; align-items: center; gap: 8px; }
.history-item i { font-size: 0.72rem; opacity: 0.5; flex-shrink: 0; }
.history-item:hover, .history-item.active { background: var(--surface2); color: var(--text); }
.sidebar-user-panel { border-top: 1px solid var(--border); margin: 0 -12px; flex-shrink: 0; }
.user-info-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; transition: background 0.18s; }
.user-info-row:hover { background: var(--surface2); }
.user-avatar { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--accent2), var(--accent)); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 0.85rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.user-details { flex: 1; min-width: 0; }
.user-name { font-family: var(--font-head); font-size: 0.82rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.user-chevron { color: var(--text-dim); flex-shrink: 0; transition: transform 0.2s; font-size: 0.75rem; }
.user-chevron.open { transform: rotate(180deg); }
.user-dropdown { overflow: hidden; max-height: 0; transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.2s; opacity: 0; }
.user-dropdown.open { max-height: 260px; opacity: 1; }
.user-menu-item { display: flex; align-items: center; gap: 11px; padding: 11px 18px; font-size: 0.84rem; color: var(--text-muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.user-menu-item i { width: 15px; text-align: center; font-size: 0.82rem; }
.user-menu-item:hover { background: var(--surface2); color: var(--text); }
.user-menu-item.danger { color: #e05252; }
.user-menu-item.danger:hover { background: rgba(224,82,82,0.08); color: #ff6b6b; }
.user-menu-divider { height: 1px; background: var(--border); margin: 2px 16px; }

/* ════════ CHAT ════════ */
.chat-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.messages { flex: 1; overflow-y: auto; padding: 28px 0; scroll-behavior: smooth; position: relative; z-index: 1; }
.messages::-webkit-scrollbar { width: 5px; }
.messages::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }
.msg-row { display: flex; padding: 6px 24px; max-width: 820px; margin: 0 auto; width: 100%; gap: 14px; animation: fadeUp 0.35s ease both; }

.msg-avatar { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; font-family: var(--font-head); flex-shrink: 0; margin-top: 2px; overflow: hidden; }
.msg-avatar.user { background: var(--accent2); color: #fff; }
.msg-avatar.ai { background: var(--accent); }
.msg-avatar.ai img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; display: block; }

.msg-content { flex: 1; font-size: 0.925rem; line-height: 1.75; color: var(--text); padding-top: 4px; }
.msg-content .sender { font-family: var(--font-head); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 5px; }
.msg-content.user .sender { color: var(--accent2); }
.msg-content.ai .sender { color: var(--accent); }
.msg-content .bubble { display: inline-block; max-width: 100%; word-break: break-word; }
.msg-content .bubble code { background: var(--surface); padding: 2px 6px; border-radius: 5px; font-family: var(--font-head);letter-spacing: 0.4px; font-size: 0.85em; color: #A0D585; }
.msg-content .bubble pre { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin-top: 10px; font-size: 0.85rem; }

/* ════════ TYPING INDICATOR ════════ */
.typing-inline {
  display: flex; align-items: center; gap: 8px; padding: 2px 0;
}
.typing-mode-label {
  font-size: 0.925rem; font-weight: 500; color: var(--text-muted);
  font-family: var(--font-body); line-height: 1;
}
.typing-balls { display: inline-flex; align-items: flex-end; gap: 4px; height: 16px; }
.typing-balls .tb {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: tbBounce 0.5s alternate infinite ease; flex-shrink: 0;
}
.typing-balls .tb:nth-child(1) { animation-delay: 0s; }
.typing-balls .tb:nth-child(2) { animation-delay: 0.17s; }
.typing-balls .tb:nth-child(3) { animation-delay: 0.30s; }
@keyframes tbBounce {
  0%   { transform: translateY(0)   scaleX(1.25) scaleY(0.75); opacity: 0.55; }
  50%  { transform: translateY(-6px) scaleX(1)    scaleY(1);    opacity: 1;    }
  100% { transform: translateY(-8px) scaleX(0.9)  scaleY(1.1);  opacity: 1;    }
}
.typing-dots span { display: inline-block; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; margin: 0 2px; animation: bounce-dot 1.1s infinite ease-in-out; }
.typing-dots span:nth-child(2){animation-delay:0.18s;} .typing-dots span:nth-child(3){animation-delay:0.36s;}

/* ════════ FILE / ATTACH ════════ */
.file-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--surface3); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; }
.img-preview { max-width: 220px; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--border); }

/* ════════ COPY BTN ════════ */
.sender-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.copy-msg-btn { background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--text-dim); padding: 0 4px; line-height: 1; border-radius: 4px; transition: color 0.15s, background 0.15s; }
.copy-msg-btn:hover { color: var(--text); background: var(--surface2); }

/* ════════ INPUT BAR ════════ */
.input-wrap { padding: 16px 24px 20px; background: var(--bg); border-top: 1px solid var(--border); transition: background 0.3s; }

/* Input box row: input-box + speak button side by side */
.input-row-outer {
  max-width: 820px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
}
.input-box {
  flex: 1;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 16px; display: flex; align-items: flex-end; padding: 10px; gap: 8px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.3s;
}
.input-box:focus-within { border-color: rgba(25,195,125,0.5); box-shadow: 0 0 0 3px rgba(25,195,125,0.08); }

/* ── Inline model select inside input box ── */
.inline-model-select {
  appearance: none;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--accent);
  padding: 4px 22px 4px 8px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237a7a8a' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
  height: 28px;
  align-self: flex-end;
  white-space: nowrap;
  min-width: 72px;
}
.inline-model-select:focus { outline: none; border-color: var(--accent); color: var(--text); }
.inline-model-select option { background: var(--surface2); color: var(--text); }

/* Keep old model-select for any fallback */
.model-select { display: none; }

/* ── Talk/Speak button beside input box ── */
.cssbuttons-io-button {
  background: linear-gradient(135deg, #0f8a55, #19c37d);
  color: var(--text);
  font-family: var(--font-body);
  padding: 0.35em;
  padding-left: 1.1em;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0.9em;
  border: none;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  box-shadow: inset 0 0 1.6em -0.6em #0a5c38;
  overflow: visible;
  position: relative;
  height: 2.6em;
  padding-right: 3.0em;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.2s;
  align-self: flex-end;
  margin-bottom: 0px;
  margin-right: 8px;
}
.cssbuttons-io-button:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: inset 0 0 1.6em -0.6em #0a5c38, 0 4px 12px rgba(25,195,125,0.3);
}
.cssbuttons-io-button .icon {
  background: #fff;
  margin-left: 1em;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.0em;
  width: 2.0em;
  border-radius: 0.7em;
  box-shadow: 0.1em 0.1em 0.6em 0.2em rgba(10,92,56,0.4);
  right: 0.3em;
  transition: all 0.3s;
  z-index: 2;
}
.cssbuttons-io-button:hover .icon {
  width: calc(100% - 0.6em);
}
.cssbuttons-io-button .icon svg {
  width: 1em;
  height: 1em;
  transition: transform 0.3s;
  color: #0a5c38;
}
.cssbuttons-io-button:hover .icon svg {
  transform: translateX(0.1em);
}
.cssbuttons-io-button:active .icon {
  transform: scale(0.95);
}

.plus-wrap { position: relative; flex-shrink: 0; }
.plus-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s; font-size: 1.3rem; font-weight: 300; line-height: 1; }
.plus-btn:hover { background: var(--surface3); color: var(--text); border-color: rgba(25,195,125,0.35); }
.plus-btn.open { background: var(--surface3); color: var(--accent); border-color: var(--accent); transform: rotate(45deg); }
.plus-menu { position: absolute; bottom: calc(100% + 10px); left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; min-width: 175px; box-shadow: 0 12px 40px rgba(0,0,0,0.35); display: none; flex-direction: column; gap: 2px; z-index: 200; animation: menuPop 0.18s cubic-bezier(0.34,1.56,0.64,1) both; }
.plus-menu.open { display: flex; }
.plus-menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; font-size: 0.84rem; color: var(--text-muted); cursor: pointer; transition: background 0.15s, color 0.15s; border: none; background: transparent; width: 100%; text-align: left; font-family: var(--font-body); }
.plus-menu-item:hover { background: var(--surface2); color: var(--text); }
.pm-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; }
.pm-icon.attach { background: rgba(26,124,255,0.15); color: var(--accent2); }
.pm-icon.code   { background: rgba(25,195,125,0.15); color: var(--accent); }
.pm-icon.search { background: rgba(245,166,35,0.15); color: #f5a623; }
.plus-menu-divider { height: 1px; background: var(--border); margin: 3px 6px; }
.mode-badge { display: none; align-items: center; gap: 6px; background: var(--surface3); border: 1px solid var(--border); border-radius: 8px; padding: 3px 9px 3px 8px; font-size: 0.74rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: background 0.15s; flex-shrink: 0; align-self: flex-end; height: 28px; }
.mode-badge.visible { display: flex; }
.mode-badge .badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.mode-badge.coding .badge-dot { background: var(--accent); }
.mode-badge.websearch .badge-dot { background: #f5a623; }
.mode-badge.coding { border-color: rgba(25,195,125,0.3); color: var(--accent); }
.mode-badge.websearch { border-color: rgba(245,166,35,0.3); color: #f5a623; }
.mode-badge .badge-x { margin-left: 2px; opacity: 0.6; font-size: 0.68rem; }
.mode-badge .badge-x:hover { opacity: 1; }
.send-btn, .mic-btn { width: 36px; height: 36px; border-radius: 10px; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s, transform 0.15s; flex-shrink: 0; }
.mic-btn { background: transparent; color: var(--text-muted); font-size: 0.9rem; }
.mic-btn:hover { background: var(--surface2); color: var(--accent); }
.mic-btn.listening { background: rgba(25,195,125,0.15); color: var(--accent); animation: mic-ring 1s ease-in-out infinite; }
.send-btn { background: var(--accent); color: #000; font-size: 0.85rem; }
.send-btn:hover { opacity: 0.85; transform: scale(1.06); }
.send-btn:disabled { background: var(--surface3); color: var(--text-dim); cursor: default; transform: none; }
#chatInput { flex: 1; background: transparent; border: none; color: var(--text); font-family: var(--font-body); font-size: 0.925rem; line-height: 1.55; resize: none; max-height: 200px; min-height: 26px; outline: none; scrollbar-width: none; }
#chatInput::placeholder { color: var(--text-dim); }
.attach-preview-row { max-width: 820px; margin: 0 auto 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.attach-chip { display: flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 0.78rem; color: var(--text-muted); max-width: 180px; }
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip .rm-chip { cursor: pointer; color: var(--text-dim); margin-left: auto; font-size: 0.7rem; }
.attach-chip .rm-chip:hover { color: #ff5f5f; }
.input-hint { text-align: center; font-size: 0.72rem; color: var(--text-dim); margin-top: 10px; }

/* ════════ WELCOME ════════ */
.welcome { position: relative; overflow: hidden; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; text-align: center; animation: fadeUp 0.5s ease both; }
.welcome-bg-logo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 0; opacity: 0.07; transition: opacity 0.6s ease; }
.welcome-bg-logo img { width: 340px; max-width: 60vw; filter: blur(1px); animation: bgLogoFloat 6s ease-in-out infinite; }
@keyframes bgLogoFloat { 0%,100%{transform:translateY(0px) scale(1);}50%{transform:translateY(-12px) scale(1.04);} }
.welcome-glow { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; animation: glow-pulse 3s ease-in-out infinite; }
.welcome-glow img { transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), filter 0.35s ease; border-radius: 24px; }
.welcome-glow img:hover { transform: scale(1.12) rotate(-3deg); filter: drop-shadow(0 0 24px rgba(25,195,125,0.6)); }
.welcome h1 { font-family: var(--font-head); font-size: 1.9rem; font-weight: 800; margin-bottom: 10px; position: relative; z-index: 1; }
.welcome p { color: var(--text-muted); font-size: 0.95rem; max-width: 360px; line-height: 1.65; position: relative; z-index: 1; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 28px; position: relative; z-index: 1; }
.chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 8px 16px; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; display: flex; align-items: center; gap: 7px; }
.chip i { font-size: 0.8rem; }
.chip:hover { background: var(--surface3); color: var(--text); border-color: rgba(25,195,125,0.3); }
.welcome.chat-bg { position: absolute; inset: 0; display: flex !important; opacity: 1; z-index: 0; pointer-events: none; }
.welcome.chat-bg .welcome-bg-logo { opacity: 0.04; }
.welcome.chat-bg .welcome-glow,
.welcome.chat-bg h1,
.welcome.chat-bg p,
.welcome.chat-bg .suggestion-chips { opacity: 0; transition: opacity 0.4s ease; }
.voice-msg-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; padding: 2px 8px; border-radius: 6px; margin-bottom: 6px; font-weight: 600; background: rgba(25,195,125,0.12); color: var(--accent); }

/* ════════ TEMP BANNER ════════ */
.temp-banner { display: none; align-items: center; justify-content: center; gap: 8px; padding: 7px 20px; background: rgba(245,166,35,0.1); border-bottom: 1px solid rgba(245,166,35,0.2); font-size: 0.78rem; color: #f5a623; font-weight: 500; flex-shrink: 0; }
.temp-banner.visible { display: flex; }
.temp-banner-x { cursor: pointer; opacity: 0.7; margin-left: 8px; font-size: 0.72rem; }
.temp-banner-x:hover { opacity: 1; }

/* ════════ VOICE ════════ */
.voice-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.88); backdrop-filter: blur(10px); z-index: 500; display: none; align-items: center; justify-content: center; flex-direction: column; }
.voice-overlay.active { display: flex; }
.voice-modal { text-align: center; padding: 40px 30px; }
.voice-title { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.voice-sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 40px; }
.ball-container { position: relative; width: 200px; height: 200px; margin: 0 auto 40px; }
#voiceCanvas { display: block; border-radius: 50%; }
.voice-controls { display: flex; gap: 14px; justify-content: center; align-items: center; }
.v-btn { padding: 11px 26px; border-radius: 12px; border: none; font-family: var(--font-body); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s, transform 0.15s; display: flex; align-items: center; gap: 8px; }
.v-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.v-btn.speak { background: var(--accent); color: #000; }
.v-btn.pause-v { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--border); }
.v-btn.pause-v:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.v-btn.pause-v:disabled:hover { opacity: 0.45; transform: none; }
.v-btn.close-v { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

/* FIX 3: scrollable voice transcript for long AI replies */
.voice-transcript {
  margin-top: 24px;
  max-width: 380px;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  /* scrollable — min 80 px, max 220 px, then scrolls */
  min-height: 80px;
  max-height: 220px;
  overflow-y: auto;
  scroll-behavior: smooth;
  line-height: 1.6;
  text-align: left;
  /* thin scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--surface3) transparent;
}
.voice-transcript::-webkit-scrollbar { width: 4px; }
.voice-transcript::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }

/* FIX 2: toggle animation — ensure the ::after pseudo-element transitions */
.toggle {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--surface3);
  position: relative;
  cursor: pointer;
  transition: background 0.22s, transform 0.12s;
  border: none;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: left 0.22s cubic-bezier(0.4,0,0.2,1), box-shadow 0.22s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on::after {
  left: 21px;
  box-shadow: 0 1px 4px rgba(25,195,125,0.4);
}
.voice-status { font-size: 0.78rem; color: var(--accent); margin-top: 14px; height: 18px; font-weight: 500; letter-spacing: 0.04em; }

/* ════════ MODALS ════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); z-index: 600; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.active { display: flex; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; width: 100%; max-width: 500px; animation: fadeUp 0.3s ease both; box-shadow: 0 24px 80px rgba(0,0,0,0.6); display: flex; flex-direction: column; max-height: 88vh; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px 0; flex-shrink: 0; }
.modal-title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.modal-title i { color: var(--accent); font-size: 1rem; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; background: var(--surface2); border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s; font-size: 0.8rem; }
.modal-close:hover { background: var(--surface3); color: var(--text); }
.p-tabs { display: flex; gap: 2px; padding: 18px 28px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto; scrollbar-width: none; }
.p-tabs::-webkit-scrollbar { display: none; }
.p-tab { padding: 8px 15px; border-radius: 10px 10px 0 0; border: none; background: transparent; color: var(--text-muted); font-family: var(--font-body); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: color 0.2s; position: relative; bottom: -1px; white-space: nowrap; }
.p-tab.active { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-color: var(--surface); }
.modal-body { padding: 22px 28px; overflow-y: auto; flex: 1; }
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }
.p-panel { display: none; }
.p-panel.active { display: block; }
.modal-section { margin-bottom: 22px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.modal-section-label i { font-size: 0.75rem; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 0.875rem; color: var(--text-muted); }
.toggle { width: 40px; height: 22px; border-radius: 11px; background: var(--surface3); position: relative; cursor: pointer; transition: background 0.22s; border: none; flex-shrink: 0; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left 0.22s; }
.toggle.on::after { left: 21px; }
.theme-switcher { display: flex; gap: 10px; margin-bottom: 4px; }
.theme-btn {
  flex: 1; padding: 10px 8px; border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.theme-btn:hover {
  border-color: rgba(25,195,125,0.4);
  color: var(--text);
}
.theme-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface3);
}
.theme-preview {
  width: 42px; height: 28px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0,0,0,0.1);
}
.theme-preview.dark-prev {
  background: #0d0d0f;
}
.theme-preview.light-prev {
  background: #F5F7F8;
}
.theme-preview::before {
  content: '';
  position: absolute;
  top: 5px; left: 6px;
  width: 16px; height: 3px;
  border-radius: 2px;
  background: #19c37d;
}
.theme-preview::after {
  content: '';
  position: absolute;
  top: 12px; left: 6px;
  width: 24px; height: 2px;
  border-radius: 2px;
}
.theme-preview.dark-prev::after {
  background: rgba(255,255,255,0.2);
}
.theme-preview.light-prev::after {
  background: rgba(0,0,0,0.15);
}
.modal-textarea { width: 100%; background: var(--surface2); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--text); font-family: var(--font-body); font-size: 0.875rem; line-height: 1.6; resize: vertical; min-height: 100px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.modal-textarea:focus { border-color: rgba(25,195,125,0.5); box-shadow: 0 0 0 3px rgba(25,195,125,0.07); }
.modal-textarea::placeholder { color: var(--text-dim); }
.field-hint { font-size: 0.74rem; color: var(--text-dim); margin-top: 7px; line-height: 1.55; }
.modal-footer { padding: 16px 28px 22px; flex-shrink: 0; border-top: 1px solid var(--border); }
.modal-save-btn { width: 100%; padding: 11px; background: linear-gradient(135deg, #0f8a55, var(--accent)); color: #000; border: none; border-radius: 11px; font-family: var(--font-head); font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.modal-save-btn:hover { opacity: 0.88; }
.help-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 32px; width: 100%; max-width: 440px; animation: fadeUp 0.3s ease both; box-shadow: 0 24px 80px rgba(0,0,0,0.6); }
.help-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.help-item:last-child { border-bottom: none; }
.help-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; color: var(--accent); }
.help-text-group { flex: 1; }
.help-title { font-weight: 600; font-size: 0.875rem; color: var(--text); margin-bottom: 3px; }
.help-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; }

/* ════════ ABOUT HERO'S MODAL ════════ */
.about-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 36px 32px; width: 100%; max-width: 440px;
  animation: fadeUp 0.3s ease both; box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  text-align: center;
}
.about-logo-wrap { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.about-logo-wrap img { width: 80px; border-radius: 20px; animation: glow-pulse 3s ease-in-out infinite; }
.about-title { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.about-badge { display: inline-block; background: rgba(25,195,125,0.12); color: var(--accent); border: 1px solid rgba(25,195,125,0.25); padding: 4px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 20px; }
.about-desc { color: var(--text-muted); font-size: 0.875rem; line-height: 1.7; margin-bottom: 24px; }
.about-coming-soon {
  background: var(--surface2); border: 1px dashed var(--border);
  border-radius: 14px; padding: 20px; margin-bottom: 20px;
}
.about-coming-soon i { font-size: 1.8rem; color: var(--accent); margin-bottom: 10px; display: block; }
.about-coming-soon h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.about-coming-soon p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; }
.about-version { font-size: 0.72rem; color: var(--text-dim); }

/* ════════ API KEYS MODAL ════════ */
.required-badge { display: inline-block; background: linear-gradient(135deg, #ff6b6b, #ee5a52); color: #fff; font-size: 0.65rem; padding: 3px 8px; border-radius: 6px; margin-left: 8px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.optional-badge { display: inline-block; background: var(--surface3); color: var(--text-muted); font-size: 0.65rem; padding: 3px 8px; border-radius: 6px; margin-left: 8px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--border); }
.api-info-box { display: flex; align-items: flex-start; gap: 12px; background: rgba(25,195,125,0.08); border: 1px solid rgba(25,195,125,0.2); border-radius: 12px; padding: 14px 16px; margin-top: 20px; }
.api-info-box i { color: var(--accent); font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.api-info-box strong { color: var(--text); font-size: 0.875rem; }
.field-hint a { color: var(--accent); text-decoration: none; font-weight: 600; transition: opacity 0.2s; }
.field-hint a:hover { opacity: 0.8; text-decoration: underline; }

/* Code Block Styles - Theme Aware */
[data-theme="dark"] .code-block {
  background: #1e1e1e;
  border: 1px solid #333;
}

[data-theme="dark"] .code-lang-bar {
  background: #2d2d2d;
  border-bottom: 1px solid #444;
}

[data-theme="dark"] .code-block code {
  /* color: #d4d4d4; */
  font-weight: bold;
}

[data-theme="dark"] .inline-code {
  background: rgba(110, 118, 129, 0.4);
  color: #f8c8dc;
}

/* Light Theme - Black text */
[data-theme="light"] .code-block {
  background: #f5f5f5;
  border: 1px solid #ddd;
}

[data-theme="light"] .code-lang-bar {
  background: #e8e8e8;
  border-bottom: 1px solid #ccc;
  color: #333;
}

[data-theme="light"] .code-copy-btn {
  color: #666;
}

[data-theme="light"] .code-copy-btn:hover {
  background: #ddd;
  color: #333;
}

[data-theme="light"] .code-block code {
  color: #0d0d0f;
  font-weight: bold;
}

[data-theme="light"] .inline-code {
  background: rgba(0, 0, 0, 0.08);
  color: #d63384;
}

/* Shared code block styles */
.code-block {
  border-radius: 8px;
  margin: 12px 0;
  overflow: hidden;
}

.code-lang-bar {
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-lang {
  font-size: 0.75rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  text-transform: uppercase;
}

.code-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
}

.inline-code {
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
}

/* ════════ MESSAGE FORMATTING ════════ */
.msg-h1, .msg-h2, .msg-h3 { margin: 14px 0 6px; line-height: 1.3; font-weight: 600; color: var(--text); }
.msg-h1 { font-size: 1.2rem; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.msg-h2 { font-size: 1.05rem; }
.msg-h3 { font-size: 0.95rem; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.msg-list { margin: 6px 0 6px 6px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.msg-list li { font-size: 0.9rem; line-height: 1.6; color: var(--text); }
.msg-ol { list-style-type: decimal; }
.msg-list:not(.msg-ol) { list-style-type: disc; }
.inline-code { background: rgba(25,195,125,0.1); color: var(--accent); padding: 1px 6px; border-radius: 4px; font-family: monospace; font-size: 0.85em; }
/* ════════ URL LINKS IN MESSAGES ════════ */
.msg-link {
  color: var(--accent);              /* #19c37d — green */
  text-decoration: none;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
  display: inline-block;
  word-break: break-word;
  cursor: pointer;
}

.msg-link:hover {
  color: #fff;
  background: rgba(25, 195, 125, 0.15);
  text-decoration: underline;
  transform: translateY(-0.5px);
}

.msg-link:active {
  opacity: 0.85;
  transform: translateY(0);
}

[data-theme="light"] .msg-link {
  color: var(--accent);
}

[data-theme="light"] .msg-link:hover {
  background: rgba(25, 195, 125, 0.12);
  color: #0f8a55;
}

/* ── Code block — styled like the UI reference ── */
.code-block {
  background: #222;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; margin: 10px 0; overflow: hidden;
}
.code-lang-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #1a1a1a; border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 4px 10px 4px 14px;
}
.code-lang {
  color: #5c6370; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.code-copy-btn { background: none; border: none; color: #5c6370; cursor: pointer; font-size: 0.78rem; padding: 3px 6px; border-radius: 4px; transition: color 0.2s, background 0.2s; line-height: 1; }
.code-copy-btn:hover { color: var(--accent); background: rgba(25,195,125,0.1); }
.code-block pre { margin: 0; padding: 14px; overflow-x: auto; }
.code-block code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.85rem; line-height: 1.6; color: #fff;
}
/* Code syntax colours */
.code-block .code-comment  { color: #5c6370; }
.code-block .code-keyword  { color: #c678dd; }
.code-block .code-function { color: #61afef; }
.code-block .code-variable { color: #dcdcaa; }
.code-block .code-string   { color: #98c379; }
.code-block .code-method   { color: #56b6c2; }
.code-block .code-built-in { color: #e5c07b; }

.msg-hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.msg-table-wrap { overflow-x: auto; margin: 10px 0; border-radius: 10px; border: 1px solid var(--border); }
.msg-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 300px; }
.msg-table th { background: var(--surface); color: var(--accent); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.msg-table td { padding: 8px 14px; color: var(--text); border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: top; line-height: 1.5; }
.msg-table tbody tr:last-child td { border-bottom: none; }
.msg-table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ════════ CHAT HISTORY ════════ */
.history-date-header { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); padding: 12px 16px 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.history-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; transition: background 0.2s; position: relative; }
.history-item:hover { background: rgba(255,255,255,0.05); }
.history-item.active { background: rgba(25,195,125,0.12); border-left: 3px solid var(--accent); }
.history-item i { font-size: 0.9rem; color: var(--text-muted); flex-shrink: 0; }
.history-preview { flex: 1; font-size: 0.85rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-delete-btn { opacity: 0; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: all 0.2s; flex-shrink: 0; }
.history-item:hover .history-delete-btn { opacity: 1; }
.history-delete-btn:hover { background: rgba(231,76,60,0.15); color: #e74c3c; }

/* ════════ MISC ════════ */
#fileInput { display: none; }
.menu-toggle { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 8px; font-size: 1rem; }
.menu-toggle:hover { background: var(--surface2); color: var(--text); }
[data-tip] { position: relative; }
[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); background: var(--surface3); color: var(--text); font-size: 0.7rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; border: 1px solid var(--border); z-index: 999; }

/* ════════ RESPONSIVE ════════ */
@media (max-width: 768px) {
  .sidebar { position: absolute; top: 0; left: 0; bottom: 0; z-index: 200; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 6px 0 30px rgba(0,0,0,0.5); }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .header-right { gap: 5px; }
  .cssbuttons-io-button span { display: none; }
  .cssbuttons-io-button { padding: 0.35em; padding-right: 2.6em; padding-left: 0.6em; }
  .input-wrap { padding: 12px 14px 16px; }
  .input-row-outer { gap: 6px; }
  .msg-row { padding: 6px 14px; }
  .auth-card { padding: 32px 24px 28px; }
  .modal-card { max-width: 100%; }
  .p-tab { font-size: 0.75rem; padding: 7px 10px; }
}

/* ════════ NOTIFICATIONS & CONFIRM ════════ */
.custom-notification { position: fixed; top: 20px; right: 20px; padding: 14px 20px; border-radius: 10px; font-size: 0.9rem; font-weight: 500; color: #fff; z-index: 10000; box-shadow: 0 4px 16px rgba(0,0,0,0.3); transform: translateX(400px); opacity: 0; transition: all 0.3s cubic-bezier(0.68,-0.55,0.265,1.55); max-width: 350px; }
.custom-notification.show { transform: translateX(0); opacity: 1; }
.custom-notification.success { background: linear-gradient(135deg, #0f8a55, var(--accent)); }
.custom-notification.error   { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.custom-notification.info    { background: linear-gradient(135deg, #3498db, #2980b9); }
.custom-notification.warning { background: linear-gradient(135deg, #f39c12, #e67e22); }
.custom-confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.custom-confirm-overlay.show { opacity: 1; }
.custom-confirm { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px 28px; max-width: 400px; width: calc(100% - 40px); box-shadow: 0 20px 60px rgba(0,0,0,0.5); transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.custom-confirm-overlay.show .custom-confirm { transform: scale(1); }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; background: rgba(25,195,125,0.15); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; color: var(--accent); font-size: 1.5rem; }
.confirm-message { text-align: center; font-size: 0.95rem; color: var(--text); line-height: 1.6; margin-bottom: 24px; }
.confirm-buttons { display: flex; gap: 10px; }
.confirm-btn { flex: 1; padding: 11px; border-radius: 10px; border: none; font-family: var(--font-body); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s, transform 0.1s; }
.confirm-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.confirm-btn.cancel  { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.confirm-btn.confirm { background: linear-gradient(135deg, #0f8a55, var(--accent)); color: #000; }

/* ════════ CODE CARD STYLING ════════ */
.code-card {
  width: 100%;
  max-width: 500px;
  background: #222;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  margin: 12px 0;
  border: 1px solid rgba(25,195,125,0.15);
}
.code-card-body {
  padding: 0;
}
.code-card-container {
  background-color: #1a1a1e;
  border-radius: 8px;
  padding: 16px 14px;
  position: relative;
}
.code-card-line {
  display: block;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  margin: 2px 0;
  position: relative;
  font-family: 'Fira Code', 'Courier New', monospace;
}
.code-card-comment {
  color: #5c6370;
  font-style: italic;
}
.code-card-keyword {
  color: #c678dd;
  font-weight: 600;
}
.code-card-function {
  color: #61afef;
}
.code-card-variable {
  color: #dcdcaa;
}
.code-card-string {
  color: #98c379;
}
.code-card-method {
  color: #56b6c2;
}
.code-card-built-in {
  color: #e5c07b;
}
.code-card-indent {
  padding-left: 20px;
}
.code-card-number {
  color: #5c6370;
  margin-right: 12px;
  user-select: none;
  font-weight: 500;
}
.code-card .float-animation {
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
 
/* ════════ RESPONSIVE ════════ */
@media (max-width: 768px) {
  .theme-preview {
    width: 36px;
    height: 24px;
  }
  .theme-btn {
    padding: 8px 6px;
    font-size: 0.7rem;
    gap: 4px;
  }
  .cssbuttons-io-button {
    padding: 0.35em;
    padding-left: 0.8em;
    padding-right: 2.4em;
    font-size: 12px;
    height: 2.4em;
  }
  .cssbuttons-io-button .icon {
    height: 1.8em;
    width: 1.8em;
  }
}
 .hdr-temp-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  position: relative;
  gap: 4px;
  padding: 0 6px;
}
.hdr-temp-btn:hover {
  background: var(--surface3);
  color: var(--text);
  border-color: rgba(25,195,125,0.35);
  transform: scale(1.05);
}
.hdr-temp-btn.active {
  background: rgba(25,195,125,0.15);
  border-color: var(--accent);
  color: var(--accent);
}
.hdr-temp-btn .temp-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.hdr-temp-btn.active .temp-dot {
  opacity: 1;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
/* ── FIND this block in style.css and REPLACE with the one below ── */

/* OLD — remove this */
.mute-btn {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.15s;
  flex-shrink: 0; background: transparent; color: var(--text-muted); font-size: 0.9rem;
}
.mute-btn:hover { background: var(--surface2); color: var(--text); }
.mute-btn.muted {
  /* color: #e74c3c; */
  /* background: rgba(231,76,60,0.1); */
}
.mute-btn.muted:hover { background: var(--surface2); color: var(--accent); }


/* NEW — replace with this */
.mute-btn {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.15s;
  flex-shrink: 0;
  /* identical base state to .mic-btn */
  background: transparent; color: var(--text-muted); font-size: 0.9rem;
}
.mute-btn:hover { background: var(--surface2); color: var(--accent); }
/* Active / unmuted state — mirror mic-btn.listening green pill */
.mute-btn.unmuted {
  background: rgba(25,195,125,0.15);
  color: var(--accent);
}
.mute-btn.unmuted:hover { background: rgba(25,195,125,0.25); color: var(--accent); }

/* ════════════════════════════════════════════════════════════════
   INTRO PAGE CSS UPDATES
   Add these to your style.css file
   ════════════════════════════════════════════════════════════════ */

/* Container for the logo image — proper flex layout */
.intro-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;  /* Space between logo and "Hero's AI Powered" text */
}

/* The hero_ai.png image itself — FIXED SIZE 60px × 60px */
.intro-logo-wrap img {
  width: 160px;
  height: 120px;
  border-radius: 14px;
  animation: glow-pulse 3s ease-in-out infinite;
}

/* "Hero's AI Powered" text styling */
.intro-logo-text {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.18);
  margin-bottom: -12px;  /* Negative margin to pull down the HERO'S letters closer */
  opacity: 0;
  animation: introFadeUp 0.4s ease 0.1s forwards;
}

/* Optional: Tagline styling */
.intro-tagline {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.08em;
  opacity: 0;
  animation: introFadeUp 0.4s ease 1.8s forwards;
}

/* Optional: Accent line styling */
.intro-accent-line {
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #19c37d, transparent);
  animation: introLineGrow 0.5s ease 1.8s forwards;
}


/* ════════════════════════════════════════════════════════════════
   WHAT CHANGED FROM THE OLD VERSION:
   
   1. Added .intro-logo-wrap with flex display
   2. Added .intro-logo-wrap img selector with 60px × 60px dimensions
   3. Changed .intro-logo-text margin-bottom from -8px to -12px
      (pulls text closer for tighter spacing)
   4. Added glow-pulse animation to the image
   
   ════════════════════════════════════════════════════════════════ */
