/* ══════════════════════════════════════════════════════
   ai-chat-screen.css — paper aesthetic, Claude-inspired
   Shares palette with startup-screen.css + main-screen.css
   ══════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  /* paper palette */
  --paper:    #f4ead6;
  --paper-2:  #ecddbe;
  --paper-3:  #e6d2ad;
  --paper-soft: #fffaf0;

  /* ink */
  --ink:       #1a1410;
  --ink-soft:  #4a3f37;
  --ink-mid:   #6e5f53;
  --ink-light: #8a7a6e;

  /* accents */
  --accent:    #c89456;
  --accent-2:  #d6533c;
  --accent-3:  #6d8268;

  --line:      rgba(26, 20, 16, 0.18);
  --line-soft: rgba(26, 20, 16, 0.10);
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
  width: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  filter: url(#noise);
  mix-blend-mode: multiply;
  opacity: 0.45;
}

a { color: inherit; text-decoration: none; }

/* ── Ambient background doodles ───────────────────── */
.pg-doodle {
  position: fixed;
  z-index: 0;
  opacity: 0.10;
  pointer-events: none;
  user-select: none;
  mix-blend-mode: multiply;
}
.pg-doodle--1 { width: 130px; top: 16%;   left: 1.5%;  transform: rotate(-8deg); }
.pg-doodle--2 { width:  60px; top: 46%;   left: 1%;    transform: rotate(14deg); }
.pg-doodle--3 { width:  78px; bottom:14%; right: 2%;   transform: rotate(-6deg); }
.pg-doodle--4 { width:  54px; top: 20%;   right: 1.5%; transform: rotate(-18deg); }
.pg-doodle--5 { width: 110px; bottom: 6%; left: 36%;   transform: rotate(3deg); opacity: 0.07; }

/* ══════════════════════════════════════════════════════
   NAVBAR — matches startup/main
   ══════════════════════════════════════════════════════ */
.top-info {
  display: flex; align-items: center;
  padding: 13px 38px;
  position: fixed; top: 0; left: 0;
  width: 100%; z-index: 100;
  background: rgba(244, 234, 214, 0.68);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--line-soft);
  transition: padding 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.35s ease;
}
.top-info.is-scrolled { padding: 9px 38px; background: rgba(244, 234, 214, 0.82); }

.logo {
  font-weight: 700; font-size: 26px;
  color: var(--ink); margin-right: auto;
  letter-spacing: -0.015em; position: relative;
  transition: letter-spacing 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.logo:hover { letter-spacing: 0.04em; transform: translateY(-1px); }
.logo::after {
  content: "*"; display: inline-block; margin-left: 4px;
  color: var(--accent-2); font-size: 16px;
  vertical-align: super; font-weight: 400;
  transform: rotate(-12deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo:hover::after { transform: rotate(12deg) scale(1.2); }

.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }

.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px 9px 18px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-mid);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  position: relative;
  transition: color 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nav-link::after {
  content: ""; position: absolute;
  left: 16px; right: 12px; bottom: 4px;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.6,0,0.2,1);
}
.nav-link::before {
  content: ""; position: absolute; top: 50%; left: 6px;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent-2);
  transform: translateY(-50%) scale(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-link:hover { color: var(--ink); transform: translateY(-1px); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link:hover::before { transform: translateY(-50%) scale(1); }
.nav-link .icon {
  width: 17px; height: 17px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-link:hover .icon { transform: rotate(-8deg) scale(1.1); }

.main-menu-dropdown { position: relative; margin-left: 8px; }
.main-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}
.main-menu-trigger:hover { transform: translateY(-1px); background: var(--accent-2); }
.main-menu-trigger .icon { width: 18px; height: 18px; color: var(--paper); }

.main-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--surface-menu);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px -10px rgba(26,20,16,0.18), 0 2px 6px rgba(26,20,16,0.05);
  min-width: 220px;
  display: none;
}
.main-menu-panel.is-open { display: block; }
.mmenu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.25s ease;
}
.mmenu-item:hover { background: var(--paper-2); color: var(--ink); transform: translateX(2px); }
.mmenu-item .icon, .mmenu-item svg { width: 16px; height: 16px; }
.mmenu-divider { height: 1px; background: var(--line-soft); margin: 6px 4px; list-style: none; }

/* ══════════════════════════════════════════════════════
   CHAT PAGE LAYOUT
   ══════════════════════════════════════════════════════ */
.chat-page {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  padding-top: 64px;
  display: grid;
  grid-template-columns: 300px 1fr;
  z-index: 2;
  transition: grid-template-columns 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-page.is-sidebar-collapsed { grid-template-columns: 0px 1fr; }
.chat-page.is-sidebar-collapsed .chat-sidebar {
  transform: translateX(-100%); opacity: 0; visibility: hidden;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════ */
.chat-sidebar {
  display: flex; flex-direction: column;
  min-height: 0;
  padding: 22px 16px 14px;
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 250, 240, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  position: relative;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.25s ease, visibility 0.25s;
}

.sidebar-toggle {
  position: absolute;
  top: 16px; right: -14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
  box-shadow: 0 2px 6px rgba(26,20,16,0.08);
  transition: transform 0.25s ease, color 0.2s;
}
.sidebar-toggle:hover { color: var(--ink); transform: translateX(-2px); }

.sidebar-head { margin-bottom: 18px; padding: 0 4px; }
.sidebar-eyebrow {
  display: block;
  font-size: 10.5px; font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-light);
  margin-bottom: 6px;
}
.sidebar-title {
  font-family: "Caveat", "Ubuntu", cursive;
  font-size: 26px; font-weight: 600;
  color: var(--ink);
  margin: 0; line-height: 1.1;
}

.new-chat-btn {
  display: inline-flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 11px 14px;
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 999px;
  font-family: inherit;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s;
  margin-bottom: 14px;
}
.new-chat-btn:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(26,20,16,0.45);
}
.new-chat-btn svg { flex-shrink: 0; }

.sidebar-search { position: relative; margin-bottom: 18px; }
.sidebar-search svg {
  position: absolute; top: 50%; left: 12px;
  transform: translateY(-50%); color: var(--ink-light);
}
.sidebar-search input {
  width: 100%;
  padding: 9px 12px 9px 32px;
  font-family: inherit; font-size: 12.5px;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.sidebar-search input::placeholder { color: var(--ink-light); }
.sidebar-search input:focus { border-color: var(--line); background: #fff; }

.chat-history {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(26,20,16,0.18) transparent;
}
.chat-history::-webkit-scrollbar { width: 6px; }
.chat-history::-webkit-scrollbar-thumb { background: rgba(26,20,16,0.16); border-radius: 8px; }

.history-section { margin-bottom: 16px; }
.history-label {
  display: block;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-light);
  padding: 0 6px;
  margin-bottom: 6px;
}
.history-list { list-style: none; padding: 0; margin: 0; }

.history-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.2s ease;
  position: relative;
}
.history-item:hover { background: rgba(214, 83, 60, 0.05); }
.history-item.is-active {
  background: var(--paper-soft);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.history-dot {
  width: 7px; height: 7px;
  flex-shrink: 0;
  margin-top: 6px;
  color: var(--ink-light);
  fill: currentColor;
}
.history-item.is-active .history-dot { color: var(--accent-2); }

.history-meat {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.history-title {
  font-size: 13px; font-weight: 500;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-snippet {
  font-size: 11.5px; color: var(--ink-light);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-menu {
  background: none; border: none;
  color: var(--ink-light);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  padding: 0 4px;
  transition: opacity 0.2s;
}
.history-item:hover .history-menu { opacity: 1; }

.sidebar-foot {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  padding: 10px 12px 4px;
  font-size: 11px;
  color: var(--ink-light);
  font-weight: 500;
  letter-spacing: 0.04em;
  border-top: 1px dashed var(--line-soft);
}

/* ══════════════════════════════════════════════════════
   CHAT AREA
   ══════════════════════════════════════════════════════ */
.chat-area {
  display: flex; flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.chat-welcome {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 56px 40px 24px;
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

/* `hidden` attr must override display:flex / display:block above */
.chat-welcome[hidden],
.chat-stream[hidden],
.welcome-doodles[hidden] { display: none !important; }
.chat-welcome::-webkit-scrollbar { width: 8px; }
.chat-welcome::-webkit-scrollbar-thumb { background: rgba(26,20,16,0.14); border-radius: 8px; }

.welcome-eyebrow {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-light);
  margin-bottom: 14px;
}

.welcome-title {
  font-family: "Caveat", "Ubuntu", cursive;
  font-size: 56px; font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 18px;
  position: relative;
}
.welcome-title em {
  font-style: normal;
  color: var(--accent-2);
}
.welcome-star {
  display: inline-block;
  width: 30px; height: auto;
  vertical-align: middle;
  margin-left: 8px;
  transform: rotate(-12deg);
  mix-blend-mode: multiply;
  opacity: 0.78;
  position: relative;
  top: -6px;
}

.welcome-lede {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 0 36px;
}

/* Ambient doodles — pinned to chat-area (NOT inside the scrolling welcome) */
.welcome-doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  transition: opacity 0.35s ease;
}
.welcome-doodles.is-hidden { opacity: 0; }
.wd {
  position: absolute;
  opacity: 0.13;
  mix-blend-mode: multiply;
  user-select: none;
}
.wd--cloud-l { width: 110px;  top: 58%;  left: 8%;   --rot:-6deg;  opacity: 0.11; animation: wdFloatA 11s ease-in-out infinite; }
.wd--heart   { width:  64px;  bottom:24%; right:12%;  --rot: 8deg;  opacity: 0.14; animation: wdFloatB  9s ease-in-out infinite; }
.wd--wave    { width: 140px;  bottom:14%; left: 24%;  --rot:-3deg;  opacity: 0.09; animation: wdSway   13s ease-in-out infinite; }
.wd--star-r  { width:  52px;  top: 38%;  right: 14%; --rot:-18deg; opacity: 0.16; animation: wdSpin   18s ease-in-out infinite; }
.wd--spark   { width:  38px;  top: 64%;  left:  52%; --rot:20deg;  opacity: 0.13; animation: wdFloatA  8s ease-in-out infinite reverse; }

@keyframes wdFloatA {
  0%, 100% { transform: rotate(var(--rot)) translate(0, 0); }
  50%      { transform: rotate(calc(var(--rot) + 3deg)) translate(4px, -8px); }
}
@keyframes wdFloatB {
  0%, 100% { transform: rotate(var(--rot)) translate(0, 0); }
  50%      { transform: rotate(calc(var(--rot) - 4deg)) translate(-5px, -6px); }
}
@keyframes wdSway {
  0%, 100% { transform: rotate(var(--rot)) translate(0, 0); }
  50%      { transform: rotate(calc(var(--rot) + 2deg)) translate(8px, 0); }
}
@keyframes wdSpin {
  0%, 100% { transform: rotate(var(--rot)); }
  50%      { transform: rotate(calc(var(--rot) + 14deg)); }
}
@media (prefers-reduced-motion: reduce) {
  .wd { animation: none !important; }
}

/* welcome scroll area sits above the doodles */
.chat-welcome { position: relative; z-index: 1; }
.chat-stream  { position: relative; z-index: 1; }
.chat-composer{ position: relative; z-index: 3; }

/* History empty state */
.history-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 28px 12px;
  color: var(--ink-light);
}
.history-empty svg { color: var(--ink-light); opacity: 0.6; margin-bottom: 10px; }
.history-empty p { margin: 0; font-size: 12.5px; line-height: 1.5; }

/* Avatar image (when user has avatar_url) */
.avatar-img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
  display: block;
}
.msg-avatar { overflow: hidden; }

/* Typing indicator */
.typing { display: inline-flex; gap: 4px; align-items: center; height: 14px; }
.typing i {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-light);
  opacity: 0.5;
  animation: typingBlink 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingBlink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40%           { opacity: 1;    transform: translateY(-2px); }
}

/* Reopen sidebar floating button (visible when collapsed) */
.sidebar-reopen {
  position: fixed;
  top: 84px; left: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 30;
  box-shadow: 0 6px 16px -8px rgba(26,20,16,0.25);
  opacity: 0; visibility: hidden;
  transform: translateX(-12px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0.25s, color 0.2s, background 0.2s;
}
.chat-page.is-sidebar-collapsed .sidebar-reopen {
  opacity: 1; visibility: visible; transform: translateX(0);
}
.sidebar-reopen:hover { color: var(--ink); background: #fff; transform: translateX(2px); }

/* ══════════════════════════════════════════════════════
   LIVE MESSAGE STREAM
   ══════════════════════════════════════════════════════ */
.chat-stream {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 36px 64px 24px;
  display: flex; flex-direction: column;
  gap: 18px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}
.chat-stream::-webkit-scrollbar { width: 8px; }
.chat-stream::-webkit-scrollbar-thumb { background: rgba(26,20,16,0.14); border-radius: 8px; }

.msg {
  display: flex; gap: 12px;
  align-items: flex-start;
  animation: msgIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Caveat", cursive;
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 4px;
}
.msg--you .msg-avatar { background: var(--ink); color: var(--paper); }
.msg--ai  .msg-avatar { background: rgba(214, 83, 60, 0.12); color: var(--accent-2); }

.msg-bubble { flex: 1; min-width: 0; }
.msg-who {
  display: block;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-light);
  margin-bottom: 4px;
}
.msg-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg--ai .msg-text { color: var(--ink-soft); }

/* ══════════════════════════════════════════════════════
   COMPOSER
   ══════════════════════════════════════════════════════ */
.chat-composer {
  padding: 14px 40px 22px;
  background: linear-gradient(to top, var(--paper) 70%, transparent);
  position: relative;
  z-index: 3;
}
.composer-card {
  max-width: 1080px;
  margin: 0 auto;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px 10px;
  box-shadow:
    0 2px 8px rgba(26,20,16,0.04),
    0 18px 40px -22px rgba(26,20,16,0.22);
  transition: border-color 0.2s, box-shadow 0.25s;
}
.composer-card:focus-within {
  border-color: var(--ink-soft);
  box-shadow:
    0 2px 8px rgba(26,20,16,0.06),
    0 22px 48px -22px rgba(26,20,16,0.28);
}

.composer-input {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  padding: 6px 2px 4px;
  max-height: 240px;
  overflow-y: auto;
}
.composer-input::placeholder { color: var(--ink-light); font-style: italic; }

.composer-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.composer-tools { display: inline-flex; gap: 6px; }
.ctool {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ctool:hover {
  background: rgba(244, 234, 214, 0.7);
  color: var(--ink);
  border-color: var(--line);
}
.ctool .ctool-check {
  width: 0; opacity: 0;
  margin-left: 0;
  color: var(--accent-3);
  transition: width 0.22s ease, opacity 0.22s ease, margin-left 0.22s ease;
}
.ctool[aria-pressed="true"] {
  background: rgba(109, 130, 104, 0.14);
  color: #4d5e4a;
  border-color: rgba(109, 130, 104, 0.35);
}
.ctool[aria-pressed="true"] .ctool-check {
  width: 12px; opacity: 1;
  margin-left: 2px;
}

/* Mood dropdown */
.mood-wrap { position: relative; }
.mood-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  list-style: none;
  margin: 0; padding: 6px;
  min-width: 140px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px -14px rgba(26,20,16,0.25);
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}
.mood-menu[hidden] { display: none; }
.mood-menu .mood-opt {
  background: none; border: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.mood-menu .mood-opt em { color: var(--ink-light); font-style: italic; }
.mood-menu .mood-opt:hover { background: rgba(214, 83, 60, 0.08); color: var(--ink); }
.mood-menu .mood-opt.is-active { background: rgba(214, 83, 60, 0.14); color: var(--accent-2); }

.send-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  background: var(--ink); color: var(--paper);
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, opacity 0.2s;
}
.send-btn:hover:not(:disabled) {
  background: var(--accent-2);
  transform: translateY(-1px);
}
.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--ink-mid);
}
.send-btn svg { transition: transform 0.2s; }
.send-btn:hover:not(:disabled) svg { transform: translateX(2px); }

.composer-foot {
  max-width: 1080px;
  margin: 8px auto 0;
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: 0.02em;
}
.composer-foot a {
  color: var(--accent-2);
  border-bottom: 1px solid rgba(214, 83, 60, 0.3);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.composer-foot a:hover { color: #a32a1e; border-color: var(--accent-2); }

/* ══════════════════════════════════════════════════════
   DELETE CONFIRMATION MODAL
   ══════════════════════════════════════════════════════ */
.del-backdrop {
  position: fixed; inset: 0;
  background: rgba(26, 20, 16, 0.45);
  display: none;
  align-items: center; justify-content: center;
  z-index: 999;
}
.del-backdrop.is-open { display: flex; }
.del-modal {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px 28px 24px;
  text-align: center;
  width: min(340px, 90vw);
  box-shadow: 0 30px 60px -20px rgba(26, 20, 16, 0.30);
}
.del-icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: rgba(214, 83, 60, 0.10);
  border-radius: 50%;
  color: var(--accent-2);
  margin: 0 auto 12px;
}
.del-title {
  margin: 0 0 8px;
  font-family: "Ubuntu", sans-serif;
  font-size: 17px; font-weight: 600;
  color: var(--ink);
}
.del-desc {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--ink-mid);
}
.del-actions { display: flex; gap: 10px; justify-content: center; }
.del-btn {
  padding: 9px 18px;
  font: inherit; font-size: 13px; font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease;
}
.del-btn--cancel:hover { background: var(--paper-2); transform: rotate(-1deg); }
.del-btn--confirm {
  background: var(--accent-2);
  color: var(--paper);
  border-color: var(--accent-2);
}
.del-btn--confirm:hover { transform: rotate(1deg) translateY(-1px); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .chat-page { grid-template-columns: 240px 1fr; }
  .pg-doodle { display: none; }
}

@media (max-width: 760px) {
  .top-info { padding: 10px 16px; }
  .top-info.is-scrolled { padding: 8px 16px; }
  .nav-link span:last-child { display: none; }
  .chat-page {
    grid-template-columns: 1fr;
    padding-top: 56px;
  }
  .chat-sidebar {
    position: fixed;
    top: 56px; left: 0;
    width: 280px; height: calc(100vh - 56px);
    transform: translateX(-100%);
    z-index: 20;
    border-right: 1px solid var(--line);
    background: var(--paper-soft);
  }
  .chat-page:not(.is-sidebar-collapsed) .chat-sidebar { transform: translateX(0); }
  .chat-welcome { padding: 32px 20px 16px; }
  .welcome-title { font-size: 42px; }
  .welcome-lede { font-size: 14px; }
  .welcome-row { grid-template-columns: 1fr; }
  .prompts-grid { grid-template-columns: 1fr; }
  .chat-composer { padding: 12px 16px 18px; }
  .chat-stream { padding: 24px 16px 16px; }
}

@media (max-width: 460px) {
  .welcome-title { font-size: 36px; }
  .send-label { display: none; }
  .send-btn { padding: 9px 11px; }
  .ctool span { display: none; }
}
