/* ═══════════════════════════════════════════════════════
   IsonAI Chat Refine v1 - CHAT_REFINE_V1
   Warm dark redesign · Additive CSS override
   Loaded after main styles + mobile patches.
   Revert: remove <link> from chat.html + delete this file.
   ═══════════════════════════════════════════════════════ */

/* ── DARK THEME: warmer, lighter palette ── */
/* sidebar #171915 < chat #1e201b - chat is brighter */
[data-theme="dark"] {
  --bg-0: #000000;   /* CHAT_DARK_BLACK_V1: dark-mode chat reading area = pure black */
  --bg-1: #0A0A0A;   /* CHAT_SIDEBAR_BLACK_V1: sidebar slightly brighter than pure-black chat */
  --bg-2: #272922;
  --bg-3: #2f312a;
  --bg-4: #383a33;
  --bg-user: rgba(154,137,104,0.08);
  --bg-glass: rgba(12,13,9,0.40);  /* GLASS_TOPBAR_V1: was 0.55 - more transparent frosted topbar */
  --tx: #e8e8e0;
  --tx-2: #aaa89e;
  --code-bg: #171915;
  --code-hd: #1d1f1a;
}

/* ── SIDEBAR: darker, wider, more breathing room ── */
.sb {
  width: 270px;
  background: var(--bg-1);
}
.sb-top {
  margin-bottom: 6px;
  padding: 8px 8px 10px;
}
/* SIDEBAR_LOGO_TEXT_V1 + SIDEBAR_LOGO_TYPE_MATCH_V1 - brand lockup is now mark
   PNG + live text so the wordmark takes the theme instead of being baked
   copper-on-blue. Type/metrics reproduce the old lockup PNG exactly (measured
   off it at its 0.48 display scale); only the colour differs.
   Wordmark is Poppins Medium -- NOT var(--font-d); the old CSS claimed Outfit
   but the artwork never was (x/cap 0.797 vs Poppins .791, Outfit .714).
   Tracking +0.26px: old ink/cap 4.2273 vs Poppins natural 4.1571.
   gap 0.88 = 2.88 design gap - 2.00 'I' side bearing; top -1.13 aligns baseline. */
.sb-top .logo {
  gap: 0.88px;
   padding: 4px 0 0 6.96px;
}
.sb-top .logo img {
  width: 34.08px !important;
  height: 34.08px !important;
  border-radius: 0;
}
.sb-top .logo-text {
  display: inline !important;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 500;
  font-size: 26.67px;
  letter-spacing: 0.26px;
  position: relative;
  top: -1.13px;
  color: #ffffff;
}
[data-theme="light"] .sb-top .logo-text {
  color: #000000;
}
/* PURPLE_CLEANUP_V2 */
.sb-new {
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13.5px;
  background: linear-gradient(135deg, rgba(154,137,104,0.1), rgba(142,129,112,0.06));
  border-color: rgba(154,137,104,0.18);
  color: var(--ac);
  margin-bottom: 8px;
}
.sb-new:hover {
  background: linear-gradient(135deg, rgba(154,137,104,0.16), rgba(142,129,112,0.1));
  border-color: rgba(154,137,104,0.3);
}
.sb-search {
  border-radius: 10px;
  margin-bottom: 16px;
}
.sb-list {
  gap: 3px;
}

/* Sidebar active chat item - copper left accent */
.sb-list .c-it.on,
.sb-list .c-it.active,
.sb-list .c-it[class*="active"] {
  border-left: 2px solid rgba(154,137,104,0.4);
  background: rgba(154,137,104,0.07);
  border-radius: 0 10px 10px 0;
}
.sb-list .c-it {
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}

/* Sidebar footer - profile area */
.sb-foot {
  padding-top: 10px;
}
.sb-foot .u-av {
  width: 32px;
  height: 32px;
  font-size: 12px;
  background: linear-gradient(135deg, var(--ac), var(--ac-2));
}

/* ── MAIN AREA ── */
.mn {
  background: var(--bg-0);
}

/* ── TOPBAR: cleaner, no heavy border ── */
/* GLASS_TOPBAR_V1: pronounced frosted-glass topbar (blur + saturate + sheen) */
.topbar {
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 0;  /* GLASS_TOPBAR_V1: borderless frosted-glass topbar - no divider/sheen lines (centering stays 7/7) */
  box-shadow: none;
}
[data-theme="light"] {
  --bg-0: #FFFFFF;
  --bg-1: #FDFBF6;
  --bg-2: #F8F3E7;
  --bg-3: #EFE6D2;
  --bg-4: #DED0B3;
  --bg-user: rgba(44,74,111,.075);
  --bg-glass: rgba(253,251,246,.90);
  --tx: #1F1812;
  --tx-2: rgba(31,24,18,.74);
  --ac: #2C4A6F;
  --ac-2: #3B5D86;
  --ac-3: #1F3858;
}
.topbar-title {
  font-size: 15px;
}
.top-btn {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.07);
  padding: 6px 12px;
  font-size: 12px;
}
.top-ico {
  border-radius: 8px;
}

/* ── CHAT MESSAGES: constrained width, generous spacing ── */
.msg-wrap {
  background: var(--bg-0);
}
.msg-inner {
  max-width: 840px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}
.msg {
  margin-bottom: 26px;
}

/* User bubble: copper tint, rounder */
.msg.user .m-body {
  background: var(--bg-user);
  border: 1px solid rgba(154,137,104,0.12);
  border-radius: 22px 22px 6px 22px;
  padding: 14px 22px;
}

/* AI response: spacious typography */
.msg.assistant .m-txt p,
.msg.assistant .m-txt li {
  line-height: 1.7;
}
.msg.assistant .m-txt {
  font-size: 0.94rem;
}
.msg.assistant .m-head {
  margin-bottom: 6px;
}

/* ── INPUT AREA: pill shape, constrained width ── */
.input-area {
  background: linear-gradient(to top, var(--bg-0) 60%, var(--bg-0) 75%, transparent);
}
.input-wrap {
  max-width: 840px;
  margin: 0 auto;
}
.input-box {
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}
[data-theme="dark"] .input-box:focus-within {
  border-color: rgba(154,137,104,0.25);
  box-shadow: 0 0 0 2px rgba(154,137,104,0.06);
}

/* Input tools: rounded hover zones */
.in-tool {
  border-radius: 10px;
  width: 32px;
  height: 32px;
}
.in-tool:hover {
  background: rgba(255,255,255,0.06);
}

/* Send button: gradient purple */
.send-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.send-btn:hover {
  background: rgba(154,137,104,0.1) !important;
  box-shadow: none !important;
}
.send-btn.stop {
  background: var(--red) !important;
  box-shadow: 0 2px 8px var(--red-dim) !important;
}

/* ── MESSAGE ACTIONS: cleaner ── */
.m-acts button {
  border-radius: 8px;
}
.m-acts button:hover {
  background: rgba(255,255,255,0.05);
}

/* ── WELCOME / SUGGESTIONS: match constrained width ── */
.msg-inner > .welcome,
.msg-inner > .sug-area {
  max-width: 100%;
}

/* ── DISCLAIMER FOOTER ── */
.input-foot {
  text-align: center;
  opacity: 0.6;
}

/* ── SCROLLBAR: match warmer palette ── */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--bg-4);
}

/* ── SPARK SIDEBAR BTN: match new rounding ── */
.spark-sidebar-btn {
  border-radius: 10px;
}

/* ── RESPONSIVE: don't break mobile ── */
@media (max-width: 768px) {
  .sb {
    width: 280px;
  }
  .msg-inner {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100%;
  }
  .input-wrap {
    max-width: 100%;
  }
  .msg.user .m-body {
    border-radius: 18px 18px 6px 18px;
  }
  .input-box {
    border-radius: 18px;
  }
}

/* REFINE_WELCOME_V1 - hide suggestion boxes, push welcome down */
.sugs {
  display: none !important;
}
.welcome {
  margin-top: 18vh;
  min-height: 40vh;
}

/* ASSISTANT_DARK_WHITE_V1: keep the preferred crisp white chat text in dark
   mode. Light mode intentionally keeps the semantic --tx ramp. */
[data-theme="dark"] .msg.user .m-txt,
[data-theme="dark"] .msg.assistant .m-txt,
[data-theme="dark"] .msg.assistant .m-txt p,
[data-theme="dark"] .msg.assistant .m-txt li,
[data-theme="dark"] .msg.assistant .m-txt h1,
[data-theme="dark"] .msg.assistant .m-txt h2,
[data-theme="dark"] .msg.assistant .m-txt h3 {
  color: #FFFFFF !important;
}
