/* ═══════════════════════════════════════════════════════════════════
   PrabeshGPT — style.css  (Grok-inspired redesign)

   STRUCTURE:
     1.  CSS Variables
     2.  Reset & Base
     3.  Logo
     4.  Landing Page
     5.  Chat Page Layout
     6.  Sidebar
     7.  Chat Main Area
     8.  Messages & Bubbles
     9.  Copy Button & Streaming Cursor
    10.  Input Area
    11.  Sidebar Toggle
    12.  Responsive — Tablet (≤900px)
    13.  Responsive — Mobile (≤640px)
    14.  Responsive — Tiny phones (≤380px)
    15.  Safe area insets
    16.  Touch & tap improvements
═══════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════
   1. CSS VARIABLES
════════════════════════════════════════════ */
:root {
  /* Core palette — true Grok black */
  --bg:         #000000;
  --bg2:        #0d0d0d;
  --bg3:        #161616;
  --bg4:        #1e1e1e;
  --border:     rgba(255,255,255,0.07);
  --border-hi:  rgba(255,255,255,0.14);
  --border-act: rgba(255,255,255,0.22);

  /* Accent — Grok uses a warm near-white, not green */
  --accent:     #ffffff;
  --accent-dim: rgba(255,255,255,0.12);
  --accent2:    #a8a8a8;

  /* Text */
  --text:       #ffffff;
  --text-dim:   #888888;
  --text-mid:   #b0b0b0;
  --text-sub:   #d0d0d0;

  /* Semantic */
  --red:        #ef4444;
  --yellow:     #f59e0b;
  --green:      #22c55e;

  /* Message surfaces */
  --user-msg:   #111111;
  --ai-msg:     #000000;

  /* Typography — editorial pairing */
  --font-display: 'DM Sans', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Layout */
  --radius:     8px;
  --radius-lg:  14px;
  --sidebar-w:  280px;
  --touch-min:  44px;
}


/* ═══════════════════════════════════════════
   2. RESET & BASE
════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Very subtle grain — toned right down */
.noise-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px;
}


/* ═══════════════════════════════════════════
   3. LOGO
════════════════════════════════════════════ */
.logo-mark {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  user-select: none;
}
.logo-mark.small { font-size: 0.95rem; }
.logo-dot { color: var(--text-mid); }


/* ═══════════════════════════════════════════
   4. LANDING PAGE
════════════════════════════════════════════ */
.landing-body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Header */
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.header-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
}

/* Main hero */
.landing-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 3rem;
  position: relative;
  z-index: 1;
}

/* Subtle radial glow — very restrained, Grok-style */
.landing-main::before {
  content: '';
  position: absolute;
  width: 700px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.025) 0%, transparent 65%);
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
  max-width: 1080px;
  width: 100%;
}

/* Eyebrow label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

/* Hero title */
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* Accent line — thin underline-like treatment */
.title-accent {
  color: var(--text);
  position: relative;
  display: inline-block;
}
.title-accent::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.5), transparent);
}

.hero-sub {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.75;
  max-width: 400px;
  margin-bottom: 2.75rem;
  letter-spacing: 0.01em;
}

/* CTA button — Grok-style: white fill, black text, clean */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--text);
  color: #000000;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  border: none;
  cursor: pointer;
  min-height: var(--touch-min);
  letter-spacing: -0.01em;
}
.cta-btn:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(255,255,255,0.08);
}
@media (hover: none) {
  .cta-btn:hover { transform: none; background: var(--text); }
  .cta-btn:active { background: #cccccc; }
}

/* Arrow nudge — only the SVG moves, button stays still */
@keyframes arrowNudge {
  0%   { transform: translateX(0); }
  40%  { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .cta-btn svg {
    animation: arrowNudge 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }
}

/* Terminal card */
.terminal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 40px 80px rgba(0,0,0,0.7);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg3);
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red    { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green  { background: #22c55e; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-left: auto;
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.9;
}

.t-line { opacity: 0; animation: fadeInLine 0.25s forwards; }
.t-delay-1 { animation-delay: 0.5s; }
.t-delay-2 { animation-delay: 1.0s; }
.t-delay-3 { animation-delay: 1.5s; }
.t-delay-4 { animation-delay: 2.0s; }
@keyframes fadeInLine { to { opacity: 1; } }

.t-prompt   { color: var(--text-sub); margin-right: 8px; }
.t-cmd      { color: var(--text); }
.t-arg      { color: var(--text-mid); }
.t-ok       { color: var(--green); }
.t-dim      { color: var(--text-dim); }
.t-response { color: var(--text-mid); padding-left: 1.5rem; }

.t-blink {
  color: var(--text-sub);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Feature pills */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 1.5rem;
}
.pill {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  background: transparent;
  letter-spacing: 0.02em;
}

/* Footer */
.landing-footer {
  text-align: center;
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  position: relative;
  z-index: 2;
  letter-spacing: 0.03em;
}




/* ═══════════════════════════════════════════
   LANDING PAGE — ENTRANCE ANIMATIONS
   Subtle fade-up only. No bouncing, no scale,
   no color flashes. Professional stagger.
════════════════════════════════════════════ */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: no-preference) {

  .landing-header {
    opacity: 0;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
  }

  .eyebrow {
    opacity: 0;
    animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
  }

  .hero-title {
    opacity: 0;
    animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.28s forwards;
  }

  .hero-sub {
    opacity: 0;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.42s forwards;
  }

  .cta-btn {
    opacity: 0;
    animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.54s forwards;
  }

  .hero-visual {
    opacity: 0;
    animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
  }

  .landing-footer {
    opacity: 0;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.65s forwards;
  }

}

/* ═══════════════════════════════════════════
   5. CHAT PAGE LAYOUT
════════════════════════════════════════════ */
.chat-body {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}


/* ═══════════════════════════════════════════
   6. SIDEBAR
════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  -webkit-overflow-scrolling: touch;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 5;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
  min-height: var(--touch-min);
  padding: 4px 2px;
  letter-spacing: 0.01em;
}
.back-link:hover { color: var(--text); }

.sidebar-section {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.85rem;
}

/* Model dropdown */
.model-selector-wrap { position: relative; }

.model-select {
  width: 100%;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 36px 11px 12px;
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 500;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.18s;
  min-height: var(--touch-min);
  letter-spacing: 0.01em;
}
.model-select:focus { outline: none; border-color: var(--border-act); }

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-dim);
}

.model-meta {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-dim);
  line-height: 1.6;
  word-break: break-all;
  letter-spacing: 0.02em;
}

/* Sidebar actions */
.sidebar-actions {
  padding: 1.1rem 1.25rem;
  margin-top: auto;
}

.action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 11px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  min-height: var(--touch-min);
  letter-spacing: 0.01em;
}
.action-btn.danger:hover { border-color: var(--red); color: var(--red); }
.action-btn.danger:active { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.05); }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 9;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }


/* ═══════════════════════════════════════════
   7. CHAT MAIN AREA
════════════════════════════════════════════ */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  min-width: 0;
  background: var(--bg);
}

/* Top bar */
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

/* Model badge — clean, no pulsing dot for Grok feel */
.active-model-badge {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}


.topbar-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  user-select: none;
  white-space: nowrap;
}
.brand-dot {
  color: var(--yellow);
}

.token-counter {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-dim);
  white-space: nowrap;
  letter-spacing: 0.03em;
}


/* ═══════════════════════════════════════════
   8. MESSAGES & BUBBLES
════════════════════════════════════════════ */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 2.5rem 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.messages-area::-webkit-scrollbar { width: 4px; }
.messages-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 10px;
  padding: 2rem;
}

.empty-icon {
  font-size: 2.2rem;
  color: var(--border-hi);
  animation: spin-slow 25s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.empty-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-mid);
  margin-top: 4px;
}
.empty-sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  max-width: 260px;
  line-height: 1.7;
  font-weight: 400;
}

/* Message row — Grok uses a wider single-column feed */
.message {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  animation: slideIn 0.18s ease;
  padding: 0.85rem 1.75rem;
  border-bottom: 1px solid var(--border);
}
.message:last-child { border-bottom: none; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Avatar */
.message-avatar {
  width: 28px; height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  margin-right: 14px;
  margin-top: 2px;
}
.message.user .message-avatar {
  background: var(--bg3);
  border: 1px solid var(--border-hi);
  color: var(--text-sub);
}
.message.ai .message-avatar {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* Content wrapper */
.message-content {
  flex: 1;
  min-width: 0;
  max-width: 780px;
}

/* Role label */
.message-role {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

/* Message text — NO bubble, just flowing text (Grok style) */
.message-text {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0.008em;
}

/* User messages — slightly dimmer weight */
.message.user .message-text {
  color: var(--text);
  font-weight: 400;
}

/* Markdown elements in AI messages */
.message-text h1,
.message-text h2,
.message-text h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 1.2em 0 0.4em;
  line-height: 1.3;
}
.message-text h1 { font-size: 1.25rem; }
.message-text h2 { font-size: 1.1rem; }
.message-text h3 { font-size: 1rem; }

.message-text p { margin-bottom: 0.75em; }
.message-text p:last-child { margin-bottom: 0; }

.message-text ul,
.message-text ol {
  padding-left: 1.4em;
  margin-bottom: 0.75em;
}
.message-text li { margin-bottom: 0.25em; }

.message-text strong {
  font-weight: 600;
  color: var(--text);
}

.message-text em { color: var(--text-sub); }

.message-text a {
  color: var(--text-sub);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.message-text a:hover { color: var(--text); }

/* Inline code */
.message-text code {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--text-sub);
  word-break: break-all;
}

/* Code blocks */
.message-text pre {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0.75em 0;
  line-height: 1.65;
  color: var(--text-sub);
  -webkit-overflow-scrolling: touch;
}
.message-text pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  word-break: normal;
}

/* Blockquote */
.message-text blockquote {
  border-left: 2px solid var(--border-hi);
  padding-left: 1em;
  color: var(--text-mid);
  margin: 0.75em 0;
}

/* Typing indicator */
.typing-indicator .message-text {
  padding: 0;
  display: flex;
  gap: 5px;
  align-items: center;
}
.typing-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: typingBounce 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-5px); opacity: 1; }
}

/* Error */
.error-message .message-text {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.79rem;
  opacity: 0.85;
}


/* ═══════════════════════════════════════════
   9. COPY BUTTON & STREAMING CURSOR
════════════════════════════════════════════ */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  padding: 4px 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
  min-height: 28px;
  letter-spacing: 0.04em;
}
.message:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text-sub); border-color: var(--border-hi); }
.copy-btn.copied { color: var(--green); border-color: rgba(34,197,94,0.3); opacity: 1; }

@media (hover: none) {
  .copy-btn { opacity: 1; }
}

/* Streaming cursor */
.streaming-cursor::after {
  content: "▋";
  color: var(--text-dim);
  animation: blink-cursor 0.6s steps(1) infinite;
  margin-left: 1px;
  font-size: 0.85em;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}


/* ═══════════════════════════════════════════
   10. INPUT AREA
════════════════════════════════════════════ */
.input-area {
  padding: 1rem 1.75rem 1.25rem;
  background: var(--bg);
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.input-box-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 10px 10px 16px;
  transition: border-color 0.18s;
}
.input-box-wrap:focus-within {
  border-color: var(--border-act);
}

.message-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  padding: 4px 0;
  resize: none;
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.65;
  letter-spacing: 0.008em;
  outline: none;
  -webkit-overflow-scrolling: touch;
}
.message-input::placeholder {
  color: var(--text-dim);
  font-family: var(--font-body);
}

/* Send button — circle, Grok-style */
.send-btn {
  background: var(--text);
  border: none;
  border-radius: 8px;
  color: #000000;
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  min-width: 38px;
  min-height: 38px;
  align-self: flex-end;
}
.send-btn:hover:not(:disabled) {
  background: #e0e0e0;
}
.send-btn:active:not(:disabled) {
  transform: scale(0.93);
}
.send-btn:disabled { opacity: 0.2; cursor: not-allowed; }

/* Meta row */
.input-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  padding: 0 4px;
}

kbd {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
}


/* ═══════════════════════════════════════════
   11. SIDEBAR TOGGLE (mobile hamburger)
════════════════════════════════════════════ */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
  box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
.sidebar-toggle:hover { border-color: var(--border-hi); }
.sidebar-toggle:active { background: var(--bg3); }


/* ═══════════════════════════════════════════
   12. RESPONSIVE — TABLET (≤900px)
════════════════════════════════════════════ */
@media (max-width: 900px) {
  .landing-header { padding: 1.1rem 2rem; }
  .landing-main   { padding: 3rem 2rem; }
  .hero-grid      { gap: 3.5rem; }
}


/* ═══════════════════════════════════════════
   13. RESPONSIVE — MOBILE (≤640px)
════════════════════════════════════════════ */
@media (max-width: 640px) {

  .landing-body { overflow-x: hidden; }

  .landing-header { padding: 1rem 1.25rem; }

  .landing-main {
    padding: 2.5rem 1.25rem;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
    max-width: 100%;
  }

  .hero-visual { display: none; }

  .hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .eyebrow { text-align: center; }

  .hero-title {
    font-size: clamp(2.1rem, 9vw, 2.8rem);
    text-align: center;
  }

  .hero-sub {
    font-size: 0.95rem;
    max-width: 100%;
    margin-bottom: 2rem;
    text-align: center;
  }

  .cta-btn {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 1rem;
    border-radius: 12px;
  }

  .landing-footer { padding: 1rem; }

  /* Sidebar drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    box-shadow: 6px 0 40px rgba(0,0,0,0.7);
    width: min(var(--sidebar-w), 88vw);
    min-width: unset;
    z-index: 110;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle.hidden { opacity: 0; pointer-events: none; transition: opacity 0.2s; }

  .sidebar-toggle { display: flex; }
  .chat-main { width: 100%; }

  .chat-topbar {
    height: 68px;
    padding: 0 1rem 0 64px;
  }

  .active-model-badge {
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 55vw;
  }
  .token-counter { font-size: 0.6rem; flex-shrink: 0; }

  .messages-area { padding: 1rem 0; }

  .message {
    padding: 0.75rem 1rem;
  }

  .empty-icon  { font-size: 1.9rem; }
  .empty-title { font-size: 1.1rem; }
  .empty-sub   { font-size: 0.83rem; }

  .message-avatar {
    width: 24px; height: 24px;
    font-size: 0.55rem;
    border-radius: 5px;
    margin-right: 10px;
  }

  .message-text {
    font-size: 0.9rem;
    line-height: 1.75;
  }

  .message-text pre {
    font-size: 0.72rem;
    padding: 12px 14px;
  }
  .message-text code { font-size: 0.75rem; }

  .input-area {
    padding: 0.75rem 1rem;
    padding-bottom: max(0.875rem, env(safe-area-inset-bottom));
  }

  .input-box-wrap { padding: 8px 8px 8px 14px; }

  .input-meta .kbd-hint { display: none; }

  .send-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }

  .error-message .message-text { font-size: 0.75rem; }
}


/* ═══════════════════════════════════════════
   14. RESPONSIVE — TINY PHONES (≤380px)
════════════════════════════════════════════ */
@media (max-width: 380px) {
  .hero-title { font-size: 1.85rem; }
  .active-model-badge { max-width: 45vw; }
  .messages-area { padding: 0.75rem 0; }
  .message { padding: 0.65rem 0.875rem; }
  .message-text { font-size: 0.875rem; }
  .input-area { padding: 0.625rem 0.875rem; }
  .sidebar { width: 92vw; }
}


/* ═══════════════════════════════════════════
   15. SAFE AREA INSETS
════════════════════════════════════════════ */
.landing-header {
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

@media (max-width: 640px) {
  .landing-header {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
  }
}

.input-area {
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  padding-left: max(1.75rem, env(safe-area-inset-left));
  padding-right: max(1.75rem, env(safe-area-inset-right));
}

@media (max-width: 640px) {
  /* Force 16px on inputs — prevents iOS Safari auto-zoom on focus */
  .message-input,
  .model-select,
  input, textarea, select {
    font-size: 16px !important;
  }

  .input-area {
    padding-bottom: max(0.875rem, env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

.sidebar { padding-left: env(safe-area-inset-left); }

.sidebar-toggle {
  left: max(0.75rem, calc(env(safe-area-inset-left) + 0.75rem));
  top: max(0.75rem, env(safe-area-inset-top));
}


/* ═══════════════════════════════════════════
   16. TOUCH & TAP IMPROVEMENTS
════════════════════════════════════════════ */
a, button, select, textarea, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button, a {
  touch-action: manipulation;
}

.action-btn:active,
.back-link:active,
.copy-btn:active {
  opacity: 0.7;
}

.sidebar-toggle,
.send-btn,
.action-btn,
.message-avatar,
.active-model-badge,
.token-counter,
.empty-icon,
.message-role {
  user-select: none;
  -webkit-user-select: none;
}
/* ═══════════════════════════════════════════
   17. VOICE FEATURE
   Append this block to the bottom of style.css
════════════════════════════════════════════ */

/* ── Voice button (sits in input bar) ────── */
.voice-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-width: 38px;
  min-height: 38px;
  align-self: flex-end;
  position: relative;
}
.voice-btn:hover {
  border-color: var(--border-hi);
  color: var(--text-sub);
}
.voice-btn:active {
  background: var(--bg3);
}

/* Recording state */
.voice-btn.recording {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239, 68, 68, 0.08);
  animation: voice-btn-pulse 1.5s ease infinite;
}
@keyframes voice-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* Speaking state (AI is talking) */
.voice-btn.speaking {
  border-color: var(--green);
  color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}

/* Show/hide mic vs stop icon based on state */
.voice-btn .voice-icon-stop { display: none; }
.voice-btn.recording .voice-icon-mic  { display: none; }
.voice-btn.recording .voice-icon-stop { display: block; }

/* Voice status label in input-meta row */
.voice-status {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  transition: color 0.2s;
  flex: 1;
  text-align: center;
}
.voice-status.active   { color: var(--red);   }
.voice-status.speaking { color: var(--green);  }
.voice-status.error    { color: var(--red); opacity: 0.7; }

/* ── Voice overlay (full-screen modal) ────── */
.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.voice-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.voice-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem 2rem;
  text-align: center;
  max-width: 380px;
  width: 100%;
}

/* Orb */
.voice-orb-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-orb {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  position: relative;
  z-index: 1;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

/* Listening state — red pulsing ring */
.voice-orb.listening {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239,68,68,0.06);
}
.voice-orb.listening::before,
.voice-orb.listening::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(239,68,68,0.3);
  animation: orb-ring 1.8s ease-out infinite;
}
.voice-orb.listening::after {
  inset: -20px;
  animation-delay: 0.6s;
}
@keyframes orb-ring {
  0%   { opacity: 1;   transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.35); }
}

/* Speaking state — green pulsing */
.voice-orb.speaking {
  border-color: var(--green);
  color: var(--green);
  background: rgba(34,197,94,0.06);
  animation: orb-speak 0.8s ease infinite alternate;
}
@keyframes orb-speak {
  from { transform: scale(1);    box-shadow: none; }
  to   { transform: scale(1.04); box-shadow: 0 0 28px rgba(34,197,94,0.2); }
}

/* Processing state — dimmed */
.voice-orb.processing {
  border-color: var(--border-hi);
  color: var(--text-dim);
  opacity: 0.6;
}

.voice-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.voice-transcript {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.7;
  min-height: 2.5em;
  max-width: 320px;
  word-break: break-word;
  font-style: italic;
}

.voice-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 10px 20px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  margin-top: 0.5rem;
  min-height: var(--touch-min);
}
.voice-close-btn:hover {
  border-color: var(--border-hi);
  color: var(--text);
}
.voice-close-btn:active {
  background: var(--bg3);
}

/* Responsive adjustments for voice overlay */
@media (max-width: 640px) {
  .voice-modal { padding: 2rem 1.25rem; gap: 1.25rem; }
  .voice-orb   { width: 80px; height: 80px; }
  .voice-orb svg { width: 26px; height: 26px; }
  .voice-label  { font-size: 0.95rem; }
}
/* ═══════════════════════════════════════════
   VISUAL REFRESH PATCH

   This section only changes visuals.
   No chat logic or backend functionality
   is modified here.
════════════════════════════════════════════ */

/* Center the input area */
.input-area{
  display:flex;
  flex-direction:column;
  align-items:center;
}

/* Smaller Claude-style input width */
.input-box-wrap{
  width:min(820px,100%);
}

/* AI disclaimer */
.ai-disclaimer{
  text-align:center;
  color:var(--text-dim);
  font-family:var(--font-mono);
  font-size:.65rem;
  margin-top:auto;
  margin-bottom:.5rem;
}

/* Model chip — interactive bottom selector */
.model-chip-wrap {
  position: relative;
  margin-left: 12px;
  display: inline-flex;
  align-items: center; /* vertically centres "Model:" label with the chip button */
  gap: 4px;            /* small gap between label and button */
}

/* "Model:" prefix label — static, non-interactive, matches chip font */
.model-chip-label-text {
  font-family: var(--font-mono);  /* matches .input-meta font so it blends in */
  font-size: 0.62rem;             /* same size as the rest of the input-meta row */
  color: var(--text-dim);         /* same muted colour as charCount / kbd-hint */
  white-space: nowrap;
  line-height: 1;                 /* prevents any extra height from pushing it off-centre */
  user-select: none;              /* just a label — not selectable */
}

.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border-hi);
  border-radius: 20px;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.model-chip:hover,
.model-chip[aria-expanded="true"] {
  border-color: var(--border-act);
  color: var(--text);
  background: var(--bg3);
}

.chip-caret {
  opacity: 0.6;
  flex-shrink: 0;
  transition: transform 0.18s;
}
.model-chip[aria-expanded="true"] .chip-caret {
  transform: rotate(180deg);
}

/* Popup */
.model-chip-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--bg3);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  padding: 4px;
  min-width: 150px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  z-index: 200;
}
.model-chip-popup.open {
  display: block;
}

.chip-option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
}
.chip-option:hover {
  background: var(--bg4);
  color: var(--text);
}
.chip-option.active {
  color: var(--text);
  background: var(--bg4);
}

/* Better processing feedback */
.typing-indicator .message-content::before{
  content:"⬡  Thinking...";
  display:block;
  color:var(--text-dim);
  font-family:var(--font-mono);
  margin-bottom:.5rem;
}

/* Mobile compatibility */
@media(max-width:640px){

  .input-box-wrap{
    width:100%;
  }


}
