/* ============================================================
   PROMPT GPT — styles.css
   ============================================================ */

/* ─── DESIGN TOKENS ──────────────────────────────────────── */
:root {
  --cream:       #FAF7F2;
  --cream-2:     #F3EDE3;
  --cream-3:     #EAE0D0;
  --sand:        #D9CCBA;
  --stone:       #9A8F80;
  --ink:         #2C2520;
  --ink-soft:    #6B5F55;
  --amber:       #C8763A;
  --amber-light: #E8A56A;
  --amber-pale:  #F5E0CC;
  --teal:        #3A7C8C;
  --teal-light:  #EAF4F7;
  --success:     #3A8C5C;
  --danger:      #C84A4A;
  --white:       #FFFFFF;

  --sidebar-w:   260px;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --radius-pill: 999px;
  --shadow-sm:   0 1px 4px rgba(44, 37, 32, 0.07);
  --shadow-md:   0 4px 20px rgba(44, 37, 32, 0.10);
  --shadow-lg:   0 12px 40px rgba(44, 37, 32, 0.14);
  --transition:  0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── DARK THEME ─────────────────────────────────────────── */
[data-theme="dark"] {
  --cream:       #1C1815;
  --cream-2:     #252118;
  --cream-3:     #302A22;
  --sand:        #3E3530;
  --stone:       #7A6E65;
  --ink:         #F0EBE3;
  --ink-soft:    #B0A090;
  --amber:       #E8974E;
  --amber-light: #F0B880;
  --amber-pale:  #3A2A18;
  --teal:        #5AB8CC;
  --teal-light:  #1A2E35;
  --white:       #2C2520;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Lato', sans-serif;
  background: var(--cream);
  color: var(--ink);
  display: flex;
  transition: background var(--transition), color var(--transition);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
textarea {
  font-family: inherit;
}

::selection {
  background: var(--amber-pale);
}

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

/* ─── KEYFRAMES ──────────────────────────────────────────── */
@keyframes shimmer      { to { transform: rotate(360deg); } }
@keyframes fadeUp       { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float        { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes typingBounce { 0%, 80%, 100% { transform: translateY(0);  opacity: 0.4; } 40% { transform: translateY(-8px); opacity: 1; } }
@keyframes fadeIn       { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn      { from { opacity: 0; transform: scale(0.93); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse        { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: relative;
  z-index: 10;
  width: var(--sidebar-w);
  background: var(--cream-2);
  border-right: 1px solid var(--cream-3);
  display: flex;
  flex-direction: column;
  transition: width var(--transition), transform var(--transition), background var(--transition);
  flex-shrink: 0;
  overflow: visible;
  clip-path: none;
}

/* Clip inner content but not the protruding toggle button */
.sidebar > *:not(.toggle-btn) {
  overflow: hidden;
}

.sidebar.collapsed { width: 68px; }

/* Logo */
.sidebar-logo {
  padding: 22px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--cream-3);
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(200, 118, 58, 0.35);
  position: relative;
  overflow: hidden;
}

.logo-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, transparent 60%, rgba(255, 255, 255, 0.25) 70%, transparent 80%);
  animation: shimmer 3s linear infinite;
}

.logo-mark svg {
  width: 20px;
  height: 20px;
  fill: white;
  position: relative;
  z-index: 1;
}

.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
  white-space: nowrap;
  transition: opacity var(--transition);
}

.sidebar.collapsed .logo-text { opacity: 0; pointer-events: none; }

/* New Chat Button */
.new-chat-btn {
  margin: 14px 14px 6px;
  padding: 10px 14px;
  background: var(--amber);
  color: white;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(200, 118, 58, 0.30);
}

.new-chat-btn:hover  { background: #B5692F; box-shadow: 0 4px 16px rgba(200, 118, 58, 0.40); transform: translateY(-1px); }
.new-chat-btn:active { transform: translateY(0); }
.new-chat-btn svg    { flex-shrink: 0; }
.new-chat-btn span   { transition: opacity var(--transition); }

.sidebar.collapsed .new-chat-btn span { opacity: 0; width: 0; }
.sidebar.collapsed .new-chat-btn      { justify-content: center; }

/* Nav */
.nav-section { padding: 8px 10px; }

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--stone);
  padding: 6px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar.collapsed .nav-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 400;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover  { background: var(--cream-3); color: var(--ink); }
.nav-item.active { background: var(--amber-pale); color: var(--amber); font-weight: 700; }

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item-label { transition: opacity var(--transition); }
.sidebar.collapsed .nav-item-label { opacity: 0; width: 0; }

/* History list */
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px;
}

.history-list::-webkit-scrollbar       { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 4px; }

.history-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--transition), color var(--transition);
}

.history-item:hover { background: var(--cream-3); color: var(--ink); }

.history-item .hi-date {
  font-size: 10px;
  color: var(--stone);
  margin-top: 1px;
  font-family: 'DM Mono', monospace;
}

/* History empty state */
.history-empty {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--stone);
  line-height: 1.6;
  text-align: center;
  transition: opacity var(--transition);
}

.sidebar.collapsed .history-empty { opacity: 0; }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--cream-3);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  transition: opacity var(--transition);
}

.sidebar.collapsed .user-name { opacity: 0; }

/* Toggle button */
.toggle-btn {
  position: absolute;
  top: 22px;
  right: -14px;
  z-index: 20;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--cream);
  border: 1px solid var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background var(--transition);
  color: var(--stone);
  cursor: pointer;
}

.toggle-btn:hover { background: var(--cream-3); }

.toggle-btn svg {
  width: 13px;
  height: 13px;
  transition: transform var(--transition);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.sidebar.collapsed .toggle-btn svg { transform: rotate(180deg); }

/* ============================================================
   MAIN AREA
   ============================================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-3);
  z-index: 5;
  transition: background var(--transition);
}

.topbar-left  { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Model badge (static, non-clickable) */
.model-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--sand);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  user-select: none;
}

.model-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stone);
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition);
}

.model-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(58, 140, 92, 0.20);
}

.model-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(200, 74, 74, 0.20);
}

.model-dot.checking {
  animation: pulse 1.4s ease infinite;
}

/* Icon buttons */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone);
  transition: background var(--transition), color var(--transition);
}

.icon-btn:hover { background: var(--cream-2); color: var(--ink); }

.icon-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Theme pills */
.theme-pills { display: flex; gap: 6px; }

.tpill {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.tpill:hover    { transform: scale(1.15); }
.tpill.selected { border-color: var(--ink); }

/* ============================================================
   AD SYSTEM — Optimized for Revenue + UX
   ============================================================

   Layout summary:
   ┌──────────────┬──────────────────────┬──────────────┐
   │  LEFT COL    │    CHAT CENTRE       │  RIGHT COL   │
   │  300×600     │  messages + in-feed  │  300×600     │
   │  300×250     │  ads every 4th reply │  300×250     │
   └──────────────┴──────────────────────┴──────────────┘
   Desktop ≥1400px: full 3-column layout
   Tablet  <1400px: no sidebars, in-feed ads only
   Mobile  <768px:  no sidebars, in-feed + anchor banner
   ============================================================ */

/* 3-column flex wrapper */
.chat-area {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  overflow: hidden;
}

/* Centre chat column */
.chat-center {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100%;
  padding: 32px 0;
  scroll-behavior: smooth;
}

.chat-center::-webkit-scrollbar       { width: 5px; }
.chat-center::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 5px; }

/* ── Sidebar ad columns ──────────────────────────────────── */
.ad-column {
  width: 320px;               /* 300px ad + 10px padding each side */
  flex-shrink: 0;
  display: none;              /* hidden until showAds() fires */
  flex-direction: column;
  align-items: center;
  padding: 28px 10px;
  gap: 20px;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.ad-column::-webkit-scrollbar { display: none; } /* hide scroll on ad cols */

.ad-column.ad-visible {
  display: flex;
  animation: fadeUp 0.4s ease both;
}

/* ── Ad slots ────────────────────────────────────────────── */
.ad-slot {
  width: 300px;
  position: relative;
}

.ad-slot--halfpage  { height: 600px; }
.ad-slot--mrec      { height: 250px; }

/* ── "Ad" label tag ──────────────────────────────────────── */
.ad-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--stone);
  font-family: 'DM Mono', monospace;
  margin-bottom: 4px;
  opacity: 0.6;
}

/* ── Placeholder blocks (replace with real AdSense units) ── */
.ad-placeholder {
  width: 100%;
  height: 100%;
  background: var(--cream-2);
  border: 1.5px dashed var(--sand);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder--300x600 { width: 300px; height: 600px; }
.ad-placeholder--300x250 { width: 300px; height: 250px; }
.ad-placeholder--infeed  { width: 100%; height: 90px; }
.ad-placeholder--mobile  { width: 320px; height: 50px; }

.ad-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--stone);
  font-family: 'DM Mono', monospace;
  opacity: 0.4;
}

/* ── In-feed ads (injected between messages every 4th reply) */
.in-feed-ad {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  animation: fadeUp 0.4s ease both;
}

.in-feed-ad .ad-placeholder--infeed {
  border-radius: var(--radius-md);
}

/* ── Mobile anchor ad (fixed bottom bar, mobile only) ─────── */
.mobile-anchor-ad {
  display: none;              /* shown by JS on mobile after chat starts */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: var(--cream);
  border-top: 1px solid var(--cream-3);
  padding: 4px 0 6px;
  box-shadow: 0 -4px 20px rgba(44, 37, 32, 0.08);
}

.mobile-anchor-ad.ad-visible { display: flex; }

/* Push input area up so anchor ad doesn't cover it on mobile */
@media (max-width: 768px) {
  body.ads-active .input-area { padding-bottom: 70px; }
}

/* ── Breakpoints ─────────────────────────────────────────── */

/* Below 1400px: hide sidebars, in-feed ads carry the load */
@media (max-width: 1399px) {
  .ad-column { display: none !important; }
}

/* Mobile: show anchor ad, hide sidebars */
@media (max-width: 768px) {
  .ad-column        { display: none !important; }
  .in-feed-ad       { padding: 0 16px; }
  .mobile-anchor-ad { display: none; }  /* JS controls visibility */
}

/* ── Override legacy chat-area scroll rule ───────────────── */
/* Base chat area wrapper — scroll and padding now on .chat-center */
.chat-area {
  flex: 1;
  overflow: hidden;
  background: var(--cream);
  transition: background var(--transition);
}

.chat-area::-webkit-scrollbar       { width: 5px; }
.chat-area::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 5px; }

/* Welcome screen */
.welcome {
  max-width: 560px;
  margin: 60px auto 0;
  padding: 0 24px;
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.welcome-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin: 0 auto 22px;
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(200, 118, 58, 0.30);
  animation: float 3s ease-in-out infinite;
}

.welcome-icon svg { width: 36px; height: 36px; fill: white; }

.welcome h1 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 12px;
}

.welcome h1 em { font-style: italic; color: var(--amber); }

.welcome p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 32px;
}

/* Suggestion cards */
.suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
}

.suggestion-card {
  background: var(--white);
  border: 1.5px solid var(--cream-3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  animation: fadeUp 0.6s ease both;
}

.suggestion-card:nth-child(1) { animation-delay: 0.10s; }
.suggestion-card:nth-child(2) { animation-delay: 0.15s; }
.suggestion-card:nth-child(3) { animation-delay: 0.20s; }
.suggestion-card:nth-child(4) { animation-delay: 0.25s; }

.suggestion-card:hover {
  border-color: var(--amber);
  box-shadow: 0 4px 16px rgba(200, 118, 58, 0.15);
  transform: translateY(-2px);
}

.sc-icon  { font-size: 20px; margin-bottom: 8px; }
.sc-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.sc-desc  { font-size: 12px; color: var(--stone); line-height: 1.5; }

/* Messages */
.messages {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.message {
  display: flex;
  gap: 14px;
  animation: fadeUp 0.4s ease both;
}

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

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  margin-top: 2px;
}

.msg-avatar.ai   { background: linear-gradient(135deg, var(--amber), var(--amber-light)); box-shadow: 0 2px 8px rgba(200, 118, 58, 0.30); }
.msg-avatar.user { background: linear-gradient(135deg, var(--teal), #4FA8BC); }
.msg-avatar svg  { width: 17px; height: 17px; fill: white; }

.msg-body { flex: 1; min-width: 0; }

.msg-name {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 6px;
  font-family: 'DM Mono', monospace;
}

.message.user .msg-name { text-align: right; }

.msg-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
  max-width: 100%;
}

.message.ai .msg-bubble {
  background: var(--white);
  border: 1.5px solid var(--cream-3);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.message.user .msg-bubble {
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  color: white;
  border-bottom-right-radius: var(--radius-sm);
  align-self: flex-end;
  box-shadow: 0 3px 12px rgba(200, 118, 58, 0.30);
}

.message.user .msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.msg-time {
  font-size: 11px;
  color: var(--stone);
  margin-top: 6px;
  font-family: 'DM Mono', monospace;
}

.message.user .msg-time { text-align: right; }

/* Code in bubbles */
.msg-bubble pre {
  background: var(--cream-2);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 10px 0;
  overflow-x: auto;
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;       /* wrap long lines instead of scrolling */
  word-break: break-word;      /* break very long words/URLs if needed */
}

.msg-bubble code {
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  background: var(--cream-2);
  padding: 1px 5px;
  border-radius: 4px;
}

.msg-bubble pre code { background: none; padding: 0; }

/* Message actions */
.msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity var(--transition);
}

.message:hover .msg-actions { opacity: 1; }

.msg-action-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone);
  transition: background var(--transition), color var(--transition);
}

.msg-action-btn:hover { background: var(--cream-2); color: var(--ink); }

.msg-action-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 18px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.4;
  animation: typingBounce 1.2s ease infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Error bubble */
.msg-bubble.error-bubble {
  background: #FFF0F0;
  border-color: #F5C5C5;
  color: var(--danger);
}

[data-theme="dark"] .msg-bubble.error-bubble {
  background: #3A1515;
  border-color: #6A2525;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.page-about {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--cream);
  transition: background var(--transition);
  overflow-y: auto;
  padding: 40px 24px 60px;
}

.about-inner {
  max-width: 640px;
  width: 100%;
  text-align: center;
  animation: fadeUp 0.5s ease both;
}

.about-icon {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(200, 118, 58, 0.28);
}

.about-icon svg { width: 40px; height: 40px; fill: white; }

.about-inner h2 {
  font-family: 'Playfair Display', serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 36px;
  line-height: 1.2;
}

/* Content sections */
.about-section {
  background: var(--white);
  border: 1.5px solid var(--cream-3);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.5s ease both;
}

.about-section:nth-child(3) { animation-delay: 0.05s; }
.about-section:nth-child(4) { animation-delay: 0.10s; }
.about-section:nth-child(5) { animation-delay: 0.15s; }

.about-section:hover {
  border-color: var(--amber-light);
  box-shadow: var(--shadow-md);
}

.about-section-icon {
  font-size: 22px;
  margin-bottom: 10px;
}

.about-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.about-section p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.8;
}

/* Founders block */
.about-founders {
  background: var(--amber-pale);
  border: 1.5px solid var(--amber-light);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 28px;
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.20s;
}

.founders-label {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 18px;
  text-align: center;
}

.founders-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.founder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1.5px solid var(--cream-3);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  flex: 1;
  min-width: 200px;
}

.founder-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(200, 118, 58, 0.25);
}

.founder-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

/* CTA button */
.about-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--amber);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(200, 118, 58, 0.35);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.25s;
}

.about-cta:hover  { background: #B5692F; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(200, 118, 58, 0.40); }
.about-cta:active { transform: translateY(0); }

@media (max-width: 600px) {
  .founders-row    { flex-direction: column; }
  .founder-card    { min-width: unset; }
  .about-inner h2  { font-size: 26px; }
  .about-section   { padding: 18px 20px; }
}

/* ============================================================
   INPUT AREA
   ============================================================ */
.input-area {
  padding: 16px 24px 20px;
  background: var(--cream);
  border-top: 1px solid var(--cream-3);
  transition: background var(--transition);
}

.input-wrapper {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-pale), var(--shadow-md);
}

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

textarea.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  resize: none;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  min-height: 24px;
  max-height: 160px;
  overflow-y: auto;
  padding: 0;
}

textarea.chat-input::placeholder { color: var(--stone); }
textarea.chat-input::-webkit-scrollbar       { width: 3px; }
textarea.chat-input::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 3px; }

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(200, 118, 58, 0.30);
}

.send-btn:hover    { background: #B5692F; transform: scale(1.05); }
.send-btn:active   { transform: scale(0.97); }
.send-btn:disabled { background: var(--sand); box-shadow: none; cursor: not-allowed; transform: none; }

.send-btn svg {
  width: 17px;
  height: 17px;
  stroke: white;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* Input hint */
.input-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--stone);
}

.input-hint svg { flex-shrink: 0; stroke: currentColor; fill: none; }

.char-count {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--stone);
}

/* ============================================================
   SETTINGS PANEL / MODAL
   ============================================================ */
.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(44, 37, 32, 0.35);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.panel-overlay.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel {
  background: var(--cream);
  border-radius: 22px;
  width: 480px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: scaleIn 0.25s ease;
  border: 1px solid var(--cream-3);
}

.panel-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--cream-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.panel-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone);
  transition: background var(--transition);
}

.panel-close:hover { background: var(--cream-3); }

.panel-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.panel-body {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.setting-desc  { font-size: 12px; color: var(--stone); margin-top: 2px; }

/* Toggle switch */
.toggle {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--sand);
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle.on { background: var(--amber); }

.toggle::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: white;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle.on::after { transform: translateX(18px); }

/* Color swatches */
.color-swatches { display: flex; gap: 8px; }

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform var(--transition), border-color var(--transition);
}

.swatch:hover    { transform: scale(1.15); }
.swatch.selected { border-color: var(--ink); }

/* Status dot in settings */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--stone);
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition);
}

.status-dot.online   { background: var(--success); box-shadow: 0 0 0 3px rgba(58, 140, 92, 0.20); }
.status-dot.error    { background: var(--danger);  box-shadow: 0 0 0 3px rgba(200, 74, 74, 0.20); }
.status-dot.checking { animation: pulse 1.4s ease infinite; }

/* Clear button */
.clear-btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--danger);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.clear-btn:hover { background: var(--danger); color: white; }

/* Divider */
.panel-divider {
  height: 1px;
  background: var(--cream-3);
  margin: 0 -26px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
}

.toast.show { opacity: 1; }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.mobile-open { transform: translateX(0); }

  .main        { width: 100%; }
  .suggestions { grid-template-columns: 1fr; }
  .welcome h1  { font-size: 28px; }
  .messages    { padding: 0 16px; }
  .input-area  { padding: 12px 16px 16px; }
  .topbar      { padding: 12px 16px; }

  .mobile-menu-btn { display: flex !important; }
}

.mobile-menu-btn { display: none; }
