/* =========================================================
   PANDALION AI — chat assistant page
   ========================================================= */
.ai-page { background: var(--cream); height: 100dvh; overflow: hidden; }
.ai-app { display: grid; grid-template-columns: 290px minmax(0, 1fr); height: 100dvh; }

/* ---------- sidebar ---------- */
.ai-side {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 16px;
  background: linear-gradient(180deg, #eaf6e6 0%, #fdf3df 100%);
  border-right: 2px solid var(--line);
  min-height: 0;
}
.side-top { display: flex; align-items: center; justify-content: space-between; }
.ai-side .logo-mark { height: 44px; }
.ai-side .logo-word { font-size: 22px; }
.logo-word em { font-style: normal; font-size: .62em; vertical-align: 4px; margin-left: 2px; padding: 2px 8px; border-radius: 999px; background: var(--peach); color: #fff; }
.side-close { display: none; border: 0; background: #fff; width: 38px; height: 38px; border-radius: 50%; font-weight: 900; }
.new-chat { width: 100%; padding: 12px 18px; font-size: 16px; }
.side-label { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 0 6px; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-top: -6px; }
.chat-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px; border: 0; border-radius: 14px;
  background: transparent; text-align: left; font-weight: 700; font-size: 14px; color: var(--ink);
  transition: background .2s, transform .25s var(--bounce);
}
.chat-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item:hover { background: rgba(255,255,255,.7); transform: translateX(3px); }
.chat-item.on { background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.05); }
.chat-item .del { opacity: 0; border: 0; background: transparent; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.chat-item:hover .del, .chat-item.on .del { opacity: .7; }
.chat-item .del:hover { opacity: 1; background: var(--pink-soft); }
.chat-empty { padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.side-bottom { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 2px dashed rgba(0,0,0,.08); }
.engine-select { width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 14px; }
.engine-note { font-size: 12px; font-weight: 700; color: var(--ink-soft); line-height: 1.4; padding: 0 4px; }
.side-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.side-links a { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.75); font-weight: 800; font-size: 12px; transition: transform .25s var(--bounce); }
.side-links a:hover { transform: translateY(-2px); background: #fff; }
.side-scrim { display: none; }

/* ---------- main ---------- */
.ai-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100dvh; }
.ai-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 2px solid var(--line); background: rgba(255, 250, 240, .9); backdrop-filter: blur(8px); }
.ai-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ai-title b { font-family: var(--font-head); font-weight: 600; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #5cc77a; box-shadow: 0 0 0 3px rgba(92,199,122,.22); }
.status .dot.busy { background: var(--honey); box-shadow: 0 0 0 3px rgba(247,198,92,.3); animation: pulse 1s infinite; }
.status .dot.off { background: #e0806a; box-shadow: 0 0 0 3px rgba(224,128,106,.25); }
.icon-round { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 17px; display: grid; place-items: center; transition: transform .3s var(--bounce), background .2s; }
.icon-round:hover { transform: rotate(-8deg) scale(1.06); background: var(--honey-soft); }
#sideOpen { display: none; }

/* ---------- thread ---------- */
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 26px max(20px, calc((100% - 820px) / 2)) 20px; display: flex; flex-direction: column; gap: 22px; scroll-behavior: smooth; }

.welcome { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 20px 0; animation: popIn .6s var(--bounce); }
.duo { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 170px; }
.duo img { height: 160px; width: auto; filter: drop-shadow(0 10px 12px rgba(0,0,0,.1)); }
.duo-panda { animation: sway 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.duo-lion { height: 150px !important; margin-left: -18px; animation: sway 2.6s ease-in-out infinite .5s; transform-origin: 50% 100%; }
.duo-heart { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); color: #ff7d9c; font-size: 26px; animation: pulse 1.4s infinite; }
.welcome h1 { font-size: clamp(32px, 4.6vw, 48px); font-weight: 700; }
.welcome h1 span { color: var(--sage-dark); }
.welcome p { max-width: 560px; color: var(--ink-soft); font-weight: 600; font-size: 17px; }
.starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(100%, 640px); margin-top: 8px; }
.starter {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px 16px; border-radius: var(--r-md);
  border: 2px solid var(--line); background: #fff; text-align: left;
  transition: transform .3s var(--bounce), border-color .2s, box-shadow .2s;
}
.starter:hover { transform: translateY(-4px) rotate(-.5deg); border-color: #ffc2d2; box-shadow: var(--shadow-soft); }
.starter b { font-size: 15px; }
.starter span { font-size: 13px; font-weight: 700; color: var(--ink-soft); }

/* messages */
.row { display: flex; gap: 12px; animation: popIn .35s var(--bounce); }
.row.user { justify-content: flex-end; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.avatar img { width: 34px; height: auto; }
.bubble { max-width: min(680px, 88%); font-size: 16px; line-height: 1.62; overflow-wrap: anywhere; }
.row.user .bubble { background: var(--sage); color: #fff; padding: 11px 16px; border-radius: 22px 22px 6px 22px; font-weight: 600; white-space: pre-wrap; }
.row.bot .bubble { padding-top: 6px; color: var(--ink); min-width: 0; }
.row.bot .bubble > *:first-child { margin-top: 0; }
.row.bot .bubble > *:last-child { margin-bottom: 0; }
.bubble p { margin: 0 0 12px; }
.bubble h1, .bubble h2, .bubble h3 { font-size: 1.2em; margin: 16px 0 8px; }
.bubble ul, .bubble ol { margin: 0 0 12px; padding-left: 24px; }
.bubble li { margin: 3px 0; }
.bubble a { color: #c2456a; text-decoration: underline; text-underline-offset: 2px; }
.bubble blockquote { margin: 0 0 12px; padding: 6px 14px; border-left: 4px solid var(--honey); background: var(--honey-soft); border-radius: 0 12px 12px 0; }
.bubble code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; background: var(--cream-2); padding: 2px 6px; border-radius: 6px; }
.bubble table { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.bubble th { background: var(--cream-2); }
.code-wrap { position: relative; margin: 0 0 12px; border-radius: 14px; overflow: hidden; background: #2f2a3a; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: #3b3449; color: #d9d0ea; font-size: 12px; font-weight: 800; }
.code-head button { border: 0; background: rgba(255,255,255,.12); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.code-wrap pre { margin: 0; padding: 12px 14px; overflow-x: auto; }
.code-wrap code { background: none; padding: 0; color: #f3eefc; font-size: 13.5px; line-height: 1.55; }

.msg-tools { display: flex; gap: 4px; margin-top: 6px; opacity: 0; transition: opacity .2s; }
.row.bot:hover .msg-tools, .row.bot:focus-within .msg-tools, .row.bot.last .msg-tools { opacity: 1; }
.msg-tools button { border: 0; background: transparent; padding: 5px 8px; border-radius: 10px; font-size: 13px; font-weight: 800; color: var(--ink-soft); transition: background .2s, transform .25s var(--bounce); }
.msg-tools button:hover { background: var(--cream-2); transform: translateY(-1px); }

.thinking { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-soft); font-size: 15px; }
.thinking .dots { display: inline-flex; gap: 4px; }
.thinking .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); animation: typingDot 1.1s ease-in-out infinite; }
.thinking .dots i:nth-child(2) { animation-delay: .15s; background: var(--honey); }
.thinking .dots i:nth-child(3) { animation-delay: .3s; background: var(--peach); }
@keyframes typingDot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }
.cursor::after { content: "▍"; color: var(--sage); animation: blink 1s steps(2) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }

.ai-image { display: block; width: min(100%, 460px); border-radius: 18px; box-shadow: var(--shadow-soft); background: linear-gradient(135deg, var(--pink-soft), var(--sky-soft)); min-height: 200px; }
.img-caption { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-top: 6px; }
.err { padding: 12px 14px; border-radius: 14px; background: #fff3ee; border: 2px solid #f6c4b6; color: #9a4630; font-weight: 700; font-size: 15px; }
.err button { margin-top: 8px; }
.progress-line { width: 100%; max-width: 360px; height: 10px; border-radius: 999px; background: #f0e7d6; overflow: hidden; margin-top: 8px; }
.progress-line span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--honey)); transition: width .3s; }

/* ---------- composer ---------- */
.composer { padding: 10px max(16px, calc((100% - 820px) / 2)) 14px; background: linear-gradient(180deg, rgba(255,250,240,0), var(--cream) 30%); }
.mode-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.mode-chip { border: 2px solid var(--line); background: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--ink-soft); transition: transform .25s var(--bounce), background .2s; }
.mode-chip:hover { transform: translateY(-2px); }
.mode-chip.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.mode-chip[data-mode="image"].on { background: var(--peach); border-color: var(--peach); }
.cooldown { margin-left: auto; font-size: 12px; font-weight: 800; color: #9a6b10; background: var(--honey-soft); padding: 4px 10px; border-radius: 999px; }
.compose-box { display: flex; align-items: flex-end; gap: 8px; padding: 8px; background: #fff; border: 2px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-soft); transition: border-color .2s, box-shadow .2s; }
.compose-box:focus-within { border-color: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft), var(--shadow-soft); }
.compose-box textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; padding: 10px 6px; font-size: 16px; line-height: 1.45; max-height: 200px; background: transparent; }
.mic { border: 0; background: var(--cream-2); }
.mic.listening { background: #ff8f8f; color: #fff; animation: pulse 1s infinite; }
.send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--peach); color: #fff; font-size: 18px; box-shadow: 0 4px 0 #e2785a; transition: transform .25s var(--bounce), opacity .2s; }
.send:hover { transform: translateY(-2px) rotate(-8deg); }
.send:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.send.stop { background: var(--ink); box-shadow: 0 4px 0 #000; font-size: 14px; }
.fineprint { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-top: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .ai-app { grid-template-columns: minmax(0, 1fr); }
  .ai-side { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(86vw, 310px); transform: translateX(-105%); transition: transform .35s var(--bounce); box-shadow: 10px 0 40px -20px rgba(0,0,0,.4); }
  .ai-side.open { transform: none; }
  .side-close, #sideOpen { display: grid; place-items: center; }
  .side-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(47,58,46,.35); opacity: 0; pointer-events: none; transition: opacity .3s; display: block; }
  .side-scrim.open { opacity: 1; pointer-events: auto; }
  .ai-top { padding: 10px 12px; }
  .thread { padding: 18px 14px; }
  .starters { grid-template-columns: minmax(0, 1fr); }
  .starter:nth-child(n+4) { display: none; }
  .duo { height: 130px; } .duo img { height: 120px; } .duo-lion { height: 112px !important; }
  .welcome p { font-size: 15px; }
  .bubble { max-width: 100%; font-size: 15.5px; }
  .avatar { width: 32px; height: 32px; } .avatar img { width: 28px; }
  .composer { padding: 8px 10px 10px; }
}

/* =========================================================
   Attachments
   ========================================================= */
.attach-wrap { position: relative; flex: none; }
.attach { border: 0; background: var(--sage-soft); color: var(--sage-dark); font-size: 22px; font-weight: 900; }
.attach[aria-expanded="true"] { background: var(--sage); color: #fff; transform: rotate(45deg); }
.attach-menu {
  position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 2px; min-width: 250px;
  padding: 8px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-pop);
  animation: popIn .3s var(--bounce);
}
.attach-menu button { border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 12px; font-weight: 800; font-size: 14px; transition: background .2s; }
.attach-menu button:hover { background: var(--cream-2); }

.attach-tray { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.chip-att {
  position: relative; flex: none;
  display: flex; align-items: center; gap: 8px;
  height: 64px; padding: 6px 30px 6px 6px; max-width: 240px;
  background: #fff; border: 2px solid var(--line); border-radius: 16px;
  animation: popIn .3s var(--bounce);
}
.chip-att img { width: 50px; height: 50px; object-fit: cover; border-radius: 11px; background: var(--cream-2); }
.chip-att .f-icon { width: 50px; height: 50px; border-radius: 11px; display: grid; place-items: center; font-size: 24px; background: var(--honey-soft); flex: none; }
.chip-att .f-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.chip-att .f-meta b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-att .f-meta span { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.chip-att.loading .f-meta span::after { content: " ⏳"; }
.chip-att .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; line-height: 1; }
.chip-att.img-only { padding-right: 6px; }
.chip-att.img-only img { width: 52px; height: 52px; }
.chip-att .vid-badge { position: absolute; left: 10px; bottom: 9px; font-size: 13px; }

/* attachments inside messages */
.row.user .bubble.has-att { background: transparent; padding: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.row.user .bubble.has-att .txt { background: var(--sage); color: #fff; padding: 11px 16px; border-radius: 22px 22px 6px 22px; white-space: pre-wrap; }
.att-grid { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-end; gap: 6px; max-width: 420px; }
.att-grid img { width: 130px; height: 130px; object-fit: cover; border-radius: 16px; border: 3px solid #fff; box-shadow: var(--shadow-soft); cursor: zoom-in; transition: transform .25s var(--bounce); }
.att-grid img:hover { transform: scale(1.03) rotate(-1deg); }
.att-grid .one { width: 240px; height: auto; max-height: 300px; }
.att-file { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border: 2px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 800; font-size: 13px; max-width: 280px; }
.att-file span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-vid { position: relative; display: inline-block; }
.att-vid::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 30px; text-shadow: 0 2px 10px rgba(0,0,0,.5); pointer-events: none; }

/* zoom viewer */
.zoom { position: fixed; inset: 0; z-index: 300; background: rgba(20, 20, 20, .85); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: popIn .25s ease; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* drag & drop */
.drop-overlay { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; background: rgba(127, 176, 125, .25); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drop-overlay.show { opacity: 1; }
.drop-overlay > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 50px; background: #fff; border: 4px dashed var(--sage); border-radius: 30px; box-shadow: var(--shadow-pop); text-align: center; }
.drop-overlay span { font-size: 54px; animation: bob 1.6s ease-in-out infinite; }
.drop-overlay b { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
.drop-overlay small { font-weight: 700; color: var(--ink-soft); }

@media (max-width: 860px) {
  .attach-menu { min-width: 230px; }
  .att-grid img { width: 104px; height: 104px; }
  .att-grid .one { width: 200px; }
  .compose-box { gap: 6px; padding: 6px; }
  .compose-box .icon-round { width: 38px; height: 38px; }
}

/* =========================================================
   Grok-style extras: personality, Search, Think, Video
   ========================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* personality pill */
.persona-pill { flex: none; position: relative; }
.persona-pill select {
  appearance: none; -webkit-appearance: none;
  height: 42px; padding: 0 32px 0 14px; border-radius: 999px;
  border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 14px; color: var(--ink); cursor: pointer;
  transition: transform .25s var(--bounce), border-color .2s;
}
.persona-pill::after { content: "▾"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-soft); pointer-events: none; }
.persona-pill select:hover { transform: translateY(-1px); border-color: var(--peach); }
body[data-persona="fun"] .persona-pill select { border-color: var(--honey); }
body[data-persona="roast"] .persona-pill select { border-color: #ff7a59; }

/* mode row: toggles + small selects */
.mode-sep { width: 2px; height: 22px; background: var(--line); border-radius: 2px; margin: 0 2px; }
.tog-chip { border: 2px solid var(--line); background: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--ink-soft); transition: transform .25s var(--bounce), background .2s, border-color .2s, color .2s; }
.tog-chip:hover { transform: translateY(-2px); }
.tog-chip.on { background: var(--sky-soft); border-color: #5aa9e6; color: #1d5f8f; }
.tog-chip[data-toggle="think"].on { background: #f1eaff; border-color: #9b7bff; color: #5a3fb5; }
.mode-chip[data-mode="video"].on { background: #9b7bff; border-color: #9b7bff; }
.mini-select { border: 2px solid var(--line); background: #fff; color: var(--ink); padding: 5px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; cursor: pointer; }

/* 🧠 thinking box */
.thoughts { margin: 0 0 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--cream-2); overflow: hidden; }
.thoughts summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13.5px; font-weight: 800; color: var(--ink-soft); user-select: none; }
.thoughts summary::-webkit-details-marker { display: none; }
.thoughts summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
.thoughts[open] summary::after { transform: rotate(180deg); }
.thoughts-body { padding: 2px 16px 12px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); border-top: 2px dashed var(--line); max-height: 320px; overflow-y: auto; }
.thoughts-body p { margin: 8px 0; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 🌐 sources */
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.sources-label { font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-right: 2px; }
.bubble .sources a {
  display: inline-flex; align-items: center; gap: 6px; max-width: 250px;
  padding: 5px 10px 5px 5px; border-radius: 999px; border: 2px solid var(--line); background: #fff;
  color: var(--ink); text-decoration: none; font-size: 12.5px; font-weight: 800; transition: transform .25s var(--bounce), border-color .2s;
}
.bubble .sources a:hover { transform: translateY(-2px); border-color: #5aa9e6; }
.sources a b { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--sky-soft); color: #1d5f8f; font-size: 11px; }
.sources a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources a small { flex: none; font-size: 11px; color: var(--ink-soft); font-weight: 700; }

/* 🎬 videos + taller pictures */
.ai-video { display: block; width: min(100%, 520px); border-radius: 18px; background: #000; box-shadow: var(--shadow-soft); }
.ai-video.tall, .ai-image.tall { width: min(100%, 300px); }
.ai-image { cursor: zoom-in; }
.video-note { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-top: 4px; }
.video-gone { display: flex; flex-direction: column; gap: 8px; width: min(100%, 360px); padding: 10px; border-radius: 18px; border: 2px dashed var(--line); font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.video-gone img { border-radius: 12px; opacity: .7; }
.thinking .timer { font-weight: 800; opacity: .7; }

@media (max-width: 860px) {
  .persona-pill select { height: 38px; padding: 0 26px 0 10px; font-size: 13px; }
  .persona-pill::after { right: 9px; }
  .ai-top { gap: 8px; }
  .mode-row { gap: 6px; }
  .mode-chip, .tog-chip { padding: 5px 11px; font-size: 12.5px; }
  .mode-sep { display: none; }
}
@media (max-width: 420px) {
  #clearChat { display: none; }
}

/* =========================================================
   🌙 Dark look (Grok style): sleek black, white accents
   ========================================================= */
body.dark {
  color-scheme: dark;
  --cream: #0d0d0f;
  --cream-2: #1b1b1f;
  --paper: #161619;
  --ink: #ececf1;
  --ink-soft: #9a9aa5;
  --line: #2a2a31;
  --honey-soft: #2a2414;
  --pink-soft: #2e1a21;
  --sage-soft: #18261b;
  --sky-soft: #132331;
  --shadow-soft: 0 10px 30px -14px rgba(0,0,0,.7);
  --shadow-pop: 0 18px 40px -12px rgba(0,0,0,.8);
}
body.dark .ai-side { background: #111114; border-right-color: #1f1f24; }
body.dark .chat-item:hover { background: rgba(255,255,255,.05); }
body.dark .chat-item.on { background: #1f1f24; box-shadow: none; }
body.dark .side-bottom { border-top-color: rgba(255,255,255,.08); }
body.dark .side-close, body.dark .engine-select, body.dark .icon-round, body.dark .starter, body.dark .avatar,
body.dark .mode-chip, body.dark .tog-chip, body.dark .mini-select, body.dark .persona-pill select,
body.dark .compose-box, body.dark .attach-menu, body.dark .chip-att, body.dark .att-file,
body.dark .bubble .sources a, body.dark .drop-overlay > div { background: var(--paper); color: var(--ink); }
body.dark .side-links a { background: rgba(255,255,255,.06); }
body.dark .side-links a:hover { background: rgba(255,255,255,.12); }
body.dark .icon-round:hover { background: #24242a; }
body.dark .ai-top { background: rgba(13,13,15,.85); border-bottom-color: #1f1f24; }
body.dark .welcome h1 span { color: #fff; background: linear-gradient(90deg, #ffd27a, #ff9fb8); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.dark .starter:hover { border-color: #4a4a55; }
body.dark .row.user .bubble, body.dark .row.user .bubble.has-att .txt { background: #26262c; color: #f4f4f6; }
body.dark .row.user .bubble.has-att { background: transparent; }
body.dark .att-grid img { border-color: #26262c; }
body.dark .bubble a { color: #ff9fb8; }
body.dark .bubble .sources a { color: var(--ink); }
body.dark .sources a b { color: #8fc8ff; }
body.dark .composer { background: linear-gradient(180deg, rgba(13,13,15,0), var(--cream) 30%); }
body.dark .compose-box:focus-within { border-color: #4a4a55; box-shadow: 0 0 0 4px rgba(255,255,255,.05), var(--shadow-soft); }
body.dark .mode-chip.on { background: #f4f4f6; border-color: #f4f4f6; color: #111; }
body.dark .tog-chip.on { background: rgba(90,169,230,.15); border-color: #5aa9e6; color: #9fd0ff; }
body.dark .tog-chip[data-toggle="think"].on { background: rgba(155,123,255,.16); border-color: #9b7bff; color: #cbb8ff; }
body.dark .send { background: #f4f4f6; color: #111; box-shadow: none; }
body.dark .send.stop { background: #3a3a42; color: #fff; }
body.dark .chip-att .x { background: #3a3a42; }
body.dark .attach { background: #1f2a20; color: #9fd49c; }
body.dark .attach[aria-expanded="true"] { background: var(--sage); color: #fff; }
body.dark .err { background: #2a1714; border-color: #5a2a20; color: #ffb4a2; }
body.dark .progress-line { background: #2a2a31; }
body.dark .cooldown { color: #f7c65c; }
body.dark .bubble blockquote { border-left-color: #f7c65c; }
body.dark .bubble code { background: #24242a; }
body.dark .thoughts { background: #141418; }
body.dark .drop-overlay { background: rgba(0,0,0,.5); }
body.dark .duo img { filter: drop-shadow(0 10px 18px rgba(0,0,0,.6)); }
body.dark .logo-word span { color: #9fd49c; }
body.dark .logo-mark { filter: drop-shadow(0 0 1px rgba(255,255,255,.4)); }
body.dark .side-scrim.open { background: rgba(0,0,0,.6); }
body.dark .toast { background: #f4f4f6; color: #111; }
