/* CHAT_CSS_CLEANUP_V1 (11-10, Dimas "bersihin kode lama"): the 11 old chat theme layers merged in their old
   cascade order. Declarations that never won the cascade in any of 11 UI states (overridden) and rules for
   elements that no longer exist were removed. Originals: authstatic/*.css (still used by preview pages) +
   chat.html.bak-cssclean-*. */

/* ===== from mobile-patch.css ===== */
/* ══════════════════════════════════════════════════════════════
   MOBILE OPTIMIZATION PATCH - 35 items
   Inject before closing </style>
   ══════════════════════════════════════════════════════════════ */

/* ── #2: 100dvh fix for iOS/Android address bar ── */
html, body, .app {
  height: 100vh;
  height: 100dvh;
}

/* ── #19: Safe area insets for notch/home indicator ── */

.input-area { padding-bottom: calc(4px + max(var(--safe-b), env(safe-area-inset-bottom))); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
.sb { padding-bottom: env(safe-area-inset-bottom); }

/* ── #18: Smooth momentum scrolling ── */
.msg-wrap, .sb-list, .modal-body, .reason-steps, .chips-row {
  -webkit-overflow-scrolling: touch;
}

/* ══════════════════ MOBILE ONLY (≤768px) ══════════════════ */
@media (max-width: 768px) {

  /* ── #2: dvh body ── */
  .app { height: 100dvh; overflow: hidden; }

  /* ── #3: Prevent iOS auto-zoom on input focus ── */
  #msgIn, .prompt-input, .sb-search input, .ci-input, .field-input, .s-grp textarea, .s-grp select, #imgPrompt, #inlineEditTa, .img-gen-dd input {
    font-size: 16px !important;
  }

  /* ── Settings: native full-screen on mobile ── */
  #setModal .modal-bg {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  #setModal .modal {
  max-height: 95dvh !important;
  margin: 0 !important;
  animation: sheetUp .25s var(--ease) !important;
}
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

  
  
  

  
  
  
  

  /* Header: compact, prominent X */
  #setModal .modal-head {
    padding: 16px 16px 8px !important;
    border-bottom: none !important;
  }
  #setModal .modal-title {
    font-size: 1.2rem !important;
  }
  

  /* Content area */
  #setModal .modal-head + div {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #setModal .modal-head + div > div:first-child {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px 80px !important;
  }

  
  
  

  /* Footer: auto-save style - hide footer, or make sticky minimal */
  #setModal .modal-foot {
    padding: 12px 16px !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: var(--bg-1) !important;
    border-top: 1px solid var(--brd) !important;
    border-radius: 0 !important;
    z-index: 10 !important;
  }

  /* Model cards */
  .model-card {
    padding: 14px !important;
    margin-bottom: 10px !important;
  }
  .model-card .mc-name { font-size: .88rem !important; }
  .model-card .mc-desc { font-size: .78rem !important; line-height: 1.5 !important; }
  .model-card .mc-dot { width: 12px !important; height: 12px !important; }

  
  
  

  /* ── #4: Image gen dropdown overflow fix ── */
  .img-gen-dd {
    width: calc(100vw - 40px) !important;
    max-width: 300px !important;
    left: 0 !important;
    right: auto !important;
  }
  /* Reposition if overflows right */
  .img-gen-btn { position: static !important; }
  .input-tools { position: relative; }

  /* ── #5: Share modal footer buttons ── */
  #shareModal .modal-foot {
    flex-direction: column !important;
    gap: 8px !important;
  }
  #shareModal .modal-foot > div {
  width: 100% !important;
}
  #shareModal .modal-foot .btn {
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* ── #6 & #7: Inline edit + keyboard + retry lite ── */
  #inlineEditTa {
    max-height: 40vh !important;
    font-size: 16px !important;
  }
  

  /* ── #8: Swipe-to-close sidebar (CSS part - JS handles touch) ── */
  .sb {
    transition: transform .28s cubic-bezier(.4,0,.2,1) !important;
    will-change: transform;
  }

  /* ── #9: Share button icon-only on mobile ── */
  .top-btn span { display: none !important; }
  .top-btn { padding: 0 8px !important; width: 34px; justify-content: center; }

  /* ── #10: Message actions - tap to reveal on mobile ── */
  .m-acts {
    /* opacity controlled by .msg.tapped in chat.html */
    flex-wrap: wrap;
  }
  .m-act {
    padding: 8px !important;
    min-height: 40px;
    min-width: 40px;
  }
  

  

  /* ── #12: Reasoning steps word-break ── */
  .reason-label, .reason-steps-inner {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* ── #13: Code blocks smooth horizontal scroll ── */
  .m-txt pre code {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }
  .m-txt pre {
    max-width: calc(100vw - 60px);
  }

  /* ── #14: Lightbox - better mobile sizing ── */
  .lightbox img {
    max-width: 96vw !important;
    max-height: 85vh !important;
    object-fit: contain;
  }

  /* ── #15: Search results dropdown constrain ── */
  .sb-search-results {
    max-height: 50vh !important;
    max-width: calc(100vw - 32px);
  }

  /* ── #16: Model badge + timestamp overlap fix ── */
  .m-head {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .m-time {
    width: 100%;
    margin-left: 0 !important;
  }

  /* ── #17: Active touch feedback ── */
  .sb-item:active, .chip:active, .m-act:active, .sb-btn:active, .top-ico:active, .top-btn:active, .in-tool:active, .send-btn:active, .btn:active, .cmd-i:active {
    opacity: 0.7 !important;
    transform: scale(0.97) !important;
    transition: transform 0.08s, opacity 0.08s !important;
  }

  /* ── #20: Keyboard push - reserve space (JS sets --vvh) ── */
  .input-area {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
}

  /* ── #21: System font scaling guard ── */
  .topbar, .input-box, .send-btn, .m-acts {
    font-size: initial;
  }

  /* ── #22: Disable drag overlay on mobile (touch) ── */
  .drag-ov { display: none !important; }

  

  /* ── #26: Landscape orientation ── */
  @media (orientation: landscape) {
    .welcome { min-height: 30vh; margin-top: 1vh; }
    .wel-logo { width: 48px; height: 48px; margin-bottom: 12px; }
    .wel-title { font-size: 1.3rem; }
    
    
    .msg-wrap { padding-top: 48px; }
    .topbar { height: calc(48px + var(--safe-t)); padding-top: var(--safe-t); }
    .input-box { padding: 8px 10px; }
  }

  /* ── #27: Loading skeleton / flash guard ── */
  .msg-inner:empty::before {
    content: "";
    display: block;
    height: 200px;
  }

  /* ── #29: Hidden chips - don't affect layout when hidden ── */
  #chipsArea[style*="display:none"],
  #chipsArea[style*="display: none"] {
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* ── #31: Voice indicator bigger ── */
  .voice-indicator {
    font-size: .82rem !important;
    padding: 6px 12px !important;
  }
  .voice-dot {
    width: 8px !important;
    height: 8px !important;
  }
  #voiceBtn.recording {
    width: 40px !important;
    height: 40px !important;
  }

  /* ── #34: Scroll-to-bottom FAB size/position ── */
  .scroll-fab {
    width: 44px !important;
    height: 44px !important;
    right: 12px !important;
    bottom: calc(140px + env(safe-area-inset-bottom)) !important;
  }
  .scroll-fab svg { width: 20px; height: 20px; }

  /* ── #35: Toast above keyboard ── */
  .toast {
    bottom: calc(160px + env(safe-area-inset-bottom)) !important;
    max-width: calc(100vw - 40px) !important;
    font-size: .82rem !important;
  }

  /* Topbar: tighter, cleaner - height/padding handled by mobile-native.css (safe-area aware) */
  .topbar {
    gap: 8px !important;
  }
  .topbar-title { font-size: .92rem !important; }
  
  

  /* Message wrap: adjust for topbar (52px content + safe-area-inset-top) */
  .msg-wrap {
    padding-top: calc(52px + var(--safe-t)) !important;
  }

  

  
  

  

  /* Input area: cleaner spacing */
  .input-area {
    padding: 0 12px calc(4px + var(--safe-b)) !important;
  }

  

  /* Input tools (attach, voice etc): tighter */
  
  .in-tool svg {
    width: 20px !important;
    height: 20px !important;
  }

  /* Sidebar: slightly wider, smoother */
  .sb {
    width: 290px !important;
  }

  

  /* Welcome screen: compact like PWA */
  .welcome {
    gap: 14px !important;
    padding: 24px 16px !important;
  }
  .wel-logo {
  border-radius: 14px !important;
}
  
  

  

  

  /* Thinking indicator: cleaner */
  .thinking {
    font-size: .88rem !important;
  }

}

/* ── #23: Suppress long-press context menu on interactive elements ── */
.m-act, .chip, .sb-item, .send-btn, .in-tool, .top-ico, .top-btn {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* But allow text selection in messages */
.m-txt {
  -webkit-user-select: text;
  user-select: text;
}

/* Safari on iPhone: tighter bottom spacing (PWA_REMOVED_V1: standalone-mode rules dropped 2026-11-06) */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 768px) {
    .msg-wrap {
      padding-bottom: calc(110px + var(--safe-b)) !important;
    }
    .input-area {
      padding: 0 10px calc(4px + var(--safe-b)) !important;
    }
    .input-foot {
      padding: 6px 12px 0 !important;
      font-size: .65rem !important;
    }
  }
}

/* SETTINGS-MOBILE-REDESIGN-v1 */
@media (max-width: 768px) {

  /* ===== MODAL SHELL ===== */
  #setModal .modal {
    background: var(--bg-1) !important;
    border-radius: 16px 16px 0 0 !important;
    border: none !important;
    box-shadow: 0 -4px 40px rgba(0,0,0,0.5) !important;
  }

  /* ===== HEADER - compact with drag indicator ===== */
  #setModal .modal-head {
    padding: 10px 16px 0 !important;
    border-bottom: none !important;
    min-height: 44px !important;
    position: relative !important;
  }

  #setModal .modal-head::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
  }

  #setModal .modal-title {
    font-family: var(--font-d) !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    padding-top: 8px !important;
  }

  #setModal .modal-x {
    width: 30px !important;
    height: 30px !important;
    background: rgba(255,255,255,0.08) !important;
    border-radius: 50% !important;
    margin-top: 8px !important;
  }
  #setModal .modal-x:active {
    background: rgba(255,255,255,0.15) !important;
  }

  

  
  
  

  /* Hide keyboard shortcuts + close nav items */
  #navShortcuts { display: none !important; }

  /* ===== CONTENT AREA ===== */
  #setModal .modal-head + div > div:first-child {
    padding: 8px 0 24px !important;
    scrollbar-width: none !important;
  }
  #setModal .modal-head + div > div:first-child::-webkit-scrollbar {
    display: none !important;
  }

  /* ===== SECTION GROUPS - iOS style ===== */
  #setModal .s-grp {
  overflow: hidden !important;
}

  #setModal .s-grp > label,
  #setModal .s-label {
  display: block !important;
}

  #setModal .s-grp select {
  -webkit-appearance: none !important;
  cursor: pointer !important;
}
  #setModal .s-grp select:focus {
  box-shadow: none !important;
}

  
  

  
  

  
  
  
  

  /* ===== MODEL CARDS - compact radio rows ===== */
  #setModal .model-card {
    display: flex !important;
    align-items: flex-start !important;
    padding: 12px 16px !important;
    gap: 12px !important;
    cursor: pointer !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    min-height: 48px !important;
    margin: 0 !important;
    box-shadow: none !important;
  }
  #setModal .model-card:active {
    background: rgba(255,255,255,0.04) !important;
  }
  #setModal .model-card + .model-card {
    border-top: 0.5px solid var(--brd) !important;
  }

  /* Selected state - subtle tint */
  #setModal .model-card.selected {
    background: rgba(154,137,104,0.06) !important;
    border: none !important;
    box-shadow: none !important;
  }
  #setModal .model-card.selected[data-model="adaptive"] {
    background: var(--adaptive-dim) !important;
    border: none !important;
  }
  #setModal .model-card.selected[data-model="lyt"] {
    background: var(--lyt-dim) !important;
    border: none !important;
  }
  #setModal .model-card.selected[data-model="omni"] {
    background: var(--omni-dim) !important;
    border: none !important;
  }

  #setModal .mc-dot {
    width: 10px !important;
    height: 10px !important;
    margin-top: 5px !important;
  }
  #setModal .mc-name {
    font-size: .88rem !important;
    font-weight: 600 !important;
  }
  #setModal .mc-desc {
    font-size: .72rem !important;
    color: var(--tx-3) !important;
    line-height: 1.4 !important;
    margin-top: 2px !important;
  }

  /* ===== TEXTAREAS - clean, borderless in group ===== */
  
  #setModal textarea:focus,
  #setModal .field-input:focus {
  color: var(--tx) !important;
  border: none !important;
}

  /* ===== ACCOUNT PROFILE CARD ===== */
  #setTab_account > div:first-child {
    border-radius: 12px !important;
    padding: 14px !important;
    margin-bottom: 14px !important;
  }

  /* ===== FOOTER - slim, safe area ===== */
  #setModal .modal-foot {
    padding: 10px 16px !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    border-top: 0.5px solid var(--brd) !important;
    background: var(--bg-1) !important;
    gap: 10px !important;
  }
  #setModal .modal-foot .btn {
    flex: 1 !important;
    padding: 11px 0 !important;
    border-radius: 10px !important;
    font-size: .9rem !important;
    font-weight: 500 !important;
    text-align: center !important;
    justify-content: center !important;
  }
  #setModal .modal-foot .btn-ghost {
    background: rgba(255,255,255,0.08) !important;
    color: var(--tx-2) !important;
  }
  #setModal .modal-foot .btn-primary {
    background: var(--ac) !important;
    color: #fff !important;
  }
  #setModal .modal-foot .btn-primary:active {
    background: var(--ac-3) !important;
  }

  

  /* ===== TAB CONTENT TRANSITION ===== */
  #setModal .set-tab-content {
    animation: settingsFadeIn 0.2s ease !important;
  }
  @keyframes settingsFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  
}

/* SETTINGS-SIZE-TUNE-v2 */
@media (max-width: 768px) {

  
  

  /* Header title */
  #setModal .modal-title {
    font-size: 1.25rem !important;
  }

  

  

  
  
  

  /* Model cards */
  #setModal .model-card {
    padding: 16px 16px !important;
    min-height: 58px !important;
    gap: 14px !important;
  }
  #setModal .mc-name {
    font-size: .95rem !important;
    font-weight: 700 !important;
  }
  #setModal .mc-desc {
    font-size: .8rem !important;
    margin-top: 3px !important;
    line-height: 1.45 !important;
  }
  #setModal .mc-dot {
    width: 12px !important;
    height: 12px !important;
  }

  
  
  

  

  

  /* Account profile */
  #setTab_account > div:first-child {
    padding: 16px !important;
  }
  
  

  /* Footer buttons */
  #setModal .modal-foot .btn {
    padding: 14px 0 !important;
    font-size: .95rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
  }

  /* KB grid items (if visible) */
  #setModal .kb-item {
  font-size: .88rem !important;
}
}

/* TEXT-SIZE-TUNE-v1 */
@media (max-width: 768px) {

  

  
  

  
  
  

  /* Settings sign-in required / locked content */
  #setModal [style*="Sign in"] {
    font-size: .95rem !important;
  }
  /* Generic bold text inside settings tabs */
  #setModal .set-tab-content b,
  #setModal .set-tab-content strong {
    font-size: .95rem !important;
  }
  /* Description text in settings locked state */
  #setModal .set-tab-content p,
  #setModal .set-tab-content div[style*="color:var(--tx-3)"],
  #setModal .set-tab-content div[style*="color:var(--tx-4)"] {
    font-size: .88rem !important;
    line-height: 1.5 !important;
  }
  

  /* Sidebar text */
  
  .sb a[href*="register"], .sb a[href*="sign"] {
    font-size: .92rem !important;
  }
  
  /* Sidebar footer login/register buttons */
  .sb-foot .btn,
  .sb-foot a {
    font-size: .88rem !important;
    padding: 10px 18px !important;
  }
}

/* ===== from mobile-global.css ===== */
/* ══════════════════════════════════════════════════════════════
   IsonAI Global Mobile Optimization
   Link from ALL pages: <link rel="stylesheet" href="/authstatic/mobile-global.css">
   ══════════════════════════════════════════════════════════════ */

/* ── dvh fix for all pages ── */
html, body { height: 100vh; height: 100dvh; }

/* ── Disable double-tap zoom globally ── */
* { touch-action: manipulation; }

/* ── Safe area insets ── */
.page, .hero, body { padding-bottom: env(safe-area-inset-bottom); }
.nav { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* ── Momentum scroll ── */
.page, .modal-body, .sb-list, .services {
  -webkit-overflow-scrolling: touch;
}

/* ── Suppress long-press on interactive ── */
button, a, .btn {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Allow text selection in content ── */
p, .sub, .meta {
  -webkit-user-select: text;
  user-select: text;
}

/* ══════════════════ MOBILE (≤768px) ══════════════════ */
@media (max-width: 768px) {

  /* ── Prevent iOS auto-zoom on input focus ── */
  input, textarea, select, .field-input {
    font-size: 16px !important;
  }

  /* ── Touch feedback on interactive elements ── */
  button:active, a:active, .btn:active, .feat:active, .svc:active {
    opacity: 0.7 !important;
    transform: scale(0.97) !important;
    transition: transform 0.08s, opacity 0.08s !important;
  }

  /* ── NAV: mobile optimized ── */
  .nav {
    padding: 10px 12px !important;
    gap: 6px;
  }
  
  
  
  

  /* ── HERO: tighter on mobile ── */
  .hero {
    padding: 80px 16px 40px !important;
    min-height: auto !important;
  }
  
  
  
  
  
  

  /* ── FEATURES grid: single column ── */
  .features {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 32px !important;
    max-width: 100% !important;
  }
  .feat {
    padding: 18px 16px !important;
  }
  

  /* ── STATS: compact ── */
  .stats {
    gap: 20px !important;
    margin-top: 32px !important;
  }
  

  /* ── CARDS (auth pages): full width ── */
  .card {
    padding: 24px 18px !important;
    border-radius: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .card h1 { font-size: 1.4rem !important; }
  .card .sub { font-size: .85rem !important; margin-bottom: 20px !important; }
  
  
  

  
  

  
  
  

  /* ── PROFILE page ── */
  .page { padding: 20px 12px !important; }
  .container { max-width: 100%; }
  
  .section {
    padding: 18px 16px !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
  }
  
  .avatar {
    width: 52px !important;
    height: 52px !important;
    font-size: 1.3rem !important;
  }
  
  
  

  /* ── STATUS page ── */
  
  .overall { font-size: .82rem; }
  .svc {
    padding: 14px 16px !important;
    gap: 10px !important;
  }
  
  .meta { font-size: .72rem; padding: 12px 14px !important; }

  /* ── MODAL: full-width on mobile ── */
  .modal-bg .modal, .modal {
  width: 96% !important;
  max-width: 100% !important;
  padding: 24px 18px !important;
  max-height: 90dvh;
  overflow-y: auto;
}

  /* ── FOOTER ── */
  .footer {
    padding: 24px 16px;
    gap: 16px;
    font-size: .72rem;
  }

  /* ── Landscape ── */
  @media (orientation: landscape) {
    .hero { min-height: auto; padding-top: 60px !important; padding-bottom: 30px !important; }
    .features { grid-template-columns: repeat(3, 1fr) !important; }
    
  }
}

/* ── Very small screens (≤360px) ── */
@media (max-width: 360px) {
  
  
  .card { padding: 20px 14px !important; }
}

/* ===== from mobile-native.css ===== */
/* ══════════════════════════════════════════════════════════════
   MOBILE NATIVE ENHANCEMENTS - IsonAI test.html
   Marker: MOBILE_NATIVE_V1
   ══════════════════════════════════════════════════════════════ */

/* ── GLOBAL: overscroll kill (no pull-to-refresh) ── */
html, body { overscroll-behavior: none; }

/* ── Sidebar: backdrop blur overlay ── */
.sb-ov.show {
  backdrop-filter: blur(4px) saturate(120%);
  -webkit-backdrop-filter: blur(4px) saturate(120%);
  background: rgba(0,0,0,0.45) !important;
}

/* ── Skeleton shimmer ── */
.skeleton-msg { display: flex; gap: 12px; margin-bottom: 20px; padding: 0 16px; }
.skeleton-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-3); flex-shrink: 0;
}
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 400px 100%;
  animation: shimmerAnim 1.6s ease-in-out infinite;
}
@keyframes shimmerAnim {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.skeleton-wrap { padding: 20px 0; }
.skeleton-wrap.hide { display: none; }

@media (max-width: 768px) {

  /* ── Touch targets: minimum 44px ── */
  .top-menu, .top-ico, .top-btn, .sb-btn,
  .send-btn, .input-tools button, .scroll-fab {
    min-width: 44px; min-height: 44px;
  }

  /* ── Hide scrollbars on mobile ── */
  .msg-wrap::-webkit-scrollbar,
  .sb-list::-webkit-scrollbar,
  .chips-row::-webkit-scrollbar,
  .followup-area::-webkit-scrollbar {
    display: none;
  }
  .msg-wrap, .sb-list, .chips-row, .followup-area {
    scrollbar-width: none;
  }

  /* ── Followup chips: horizontal scroll on mobile ── */
  .followup-area {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px !important;
  }

  /* ── Sidebar: smoother transition (no !important - JS sets 'none' during swipe tracking) ── */
  
  .sb-ov:not(.swiping) {
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
  }

  /* ── Bottom sheet ── */
  #mobileSheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--bg-2);
    border-radius: 18px 18px 0 0;
    z-index: 600;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    max-height: 70dvh;
    overflow-y: auto;
  }
  #mobileSheet.open { transform: translateY(0); }
  #mobileSheet .sheet-handle {
    display: flex; justify-content: center; padding: 12px 0 8px;
    cursor: grab;
  }
  #mobileSheet .sheet-handle:active { cursor: grabbing; }
  #mobileSheet .sheet-handle:active .sheet-bar { background: var(--tx-4); width: 48px; }
  #mobileSheet .sheet-bar {
    width: 40px; height: 4px; border-radius: 2px;
    background: var(--bg-4); transition: width .15s, background .15s;
  }
  #mobileSheet .sheet-body { padding: 4px 20px 24px; }
  #mobileSheet .sheet-title {
    font-size: 16px; font-weight: 600; margin-bottom: 12px;
    color: var(--tx);
  }
  #mobileSheet .sheet-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 10px; border-radius: 12px;
    font-size: 14px; color: var(--tx);
    cursor: pointer; transition: background 0.15s;
    border: none; background: none; width: 100%;
    font-family: var(--font-b); text-align: left;
  }
  #mobileSheet .sheet-item:hover,
  #mobileSheet .sheet-item:active { background: var(--bg-3); }
  #mobileSheet .sheet-item.danger { color: var(--red); }
  #mobileSheet .sheet-item.active { color: var(--ac); }
  #mobileSheet .sheet-item.active svg { stroke: var(--ac) !important; }
  #mobileSheet .sheet-item svg {
    width: 20px; height: 20px; flex-shrink: 0;
    stroke-width: 1.8; stroke-linecap: round; fill: none;
  }

  #mobileSheetBackdrop {
    position: fixed; inset: 0; z-index: 599;
    background: rgba(0,0,0,0.5);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  #mobileSheetBackdrop.show { opacity: 1; pointer-events: auto; }

  /* ── Message entrance animation ── */
  .msg { animation: msgSlideIn 0.25s ease both; }
  @keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ── Input area: smoother transitions ── */
  .input-area {
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1),
                bottom 0.3s cubic-bezier(0.16,1,0.3,1) !important;
  }

  /* ── Stream resume banner ── */
  #streamResumeBanner {
    display: none; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 16px;
    background: var(--ac-dim); border-radius: 10px;
    margin: 8px 16px; font-size: 13px; color: var(--ac);
    font-weight: 500; animation: fadeUp 0.3s ease;
    cursor: pointer;
  }
  #streamResumeBanner.show { display: flex; }
  #streamResumeBanner svg { width: 16px; height: 16px; flex-shrink: 0; }
}

/* ── Hide Share + Settings from topbar on mobile (in bottom sheet) ── */
@media (max-width: 768px) {
  .top-right .top-btn,
  .top-right .top-ico[onclick*="openSettings"] {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE NATIVE V2 - Pull-refresh, Offline, Longpress, Swipe-reply, Pinch-zoom
   Marker: MOBILE_NATIVE_V2
   ══════════════════════════════════════════════════════════════ */

/* ── Pull-to-refresh ── */
#pullRefreshIndicator {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  height: 0; overflow: hidden;
  transition: height 0.25s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}
#pullRefreshIndicator .ptr-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid var(--bg-4);
  border-top-color: var(--ac);
  transition: transform 0.2s, opacity 0.2s;
  opacity: 0;
}
#pullRefreshIndicator.pulling .ptr-spinner { opacity: 1; }
#pullRefreshIndicator.refreshing .ptr-spinner {
  opacity: 1; animation: ptrSpin 0.7s linear infinite;
}
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* ── Offline banner ── */
#offlineBanner {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--red-dim);
  border-bottom: 1px solid var(--red);
  color: var(--red); font-size: 13px; font-weight: 500;
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
}
#offlineBanner.show { transform: translateY(0); }
#offlineBanner svg { width: 16px; height: 16px; flex-shrink: 0; }
#onlineToast {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%) translateY(-60px);
  z-index: 9001;
  padding: 8px 20px; border-radius: 20px;
  background: var(--green-dim); border: 1px solid var(--green);
  color: var(--green); font-size: 13px; font-weight: 500;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}
#onlineToast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 768px) {

  /* ── Long-press: suppress text selection on messages during hold ── */
  .msg.lp-active { user-select: none; -webkit-user-select: none; }
  /* MOBILE_NO_LP_SCALE_V1 - removed transform:scale(0.97) on long-press; user disliked the "mendelep" press dent.
     Haptic vibration + bottom sheet are enough feedback. */

  /* ── Swipe-to-reply indicator (DISABLED) ── */
  /* 
  .msg { position: relative; }
  .msg .swipe-reply-icon {
    position: absolute; right: -36px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--ac-dim); color: var(--ac);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.15s;
  }
  .msg.swiping .swipe-reply-icon { opacity: 1; }

  /* ── Reply quote bar ── */
  #replyQuoteBar {
    display: none; align-items: center; gap: 10px;
    padding: 8px 14px; margin: 0;
    background: var(--bg-2); border-left: 3px solid var(--ac);
    border-radius: 0 8px 8px 0;
    font-size: 12px; color: var(--tx-2); line-height: 1.4;
    max-height: 60px; overflow: hidden;
  }
  #replyQuoteBar.show { display: flex; }
  #replyQuoteBar .rq-text { flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  #replyQuoteBar .rq-close {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--tx-3); cursor: pointer;
  }
  #replyQuoteBar .rq-close:hover { background: var(--bg-3); }
  */

  /* ── Pinch-to-zoom overlay ── */
  #pinchZoomOverlay {
    position: fixed; inset: 0; z-index: 8000;
    background: rgba(0,0,0,0.85);
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  }
  #pinchZoomOverlay.show { display: flex; }
  #pinchZoomOverlay img {
    max-width: 95vw; max-height: 90vh; object-fit: contain;
    border-radius: 8px; touch-action: pinch-zoom;
    transition: transform 0.2s ease;
  }
  #pinchZoomOverlay .pz-close {
    position: absolute; top: 16px; right: 16px;
    top: calc(16px + env(safe-area-inset-top, 0px));
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    color: #fff; cursor: pointer;
  }
}
/* ══════════════════════════════════════════════════════════════
   MOBILE UX V3 - Slim topbar, model badge, dropdown, research, cleanup
   Marker: MOBILE_UX_V3
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Slim topbar: 38px ── */
  .topbar {
  padding-top: var(--safe-t) !important;
  align-items: center !important;
}
  
  
  .top-right { align-items: center !important; }

  /* ── Hide ALL top-right children except badge + three-dot ── */
  
  
  .mn.hide-model-sel .top-right > #mobModelBadge,
  .mn.hide-model-sel #mobModelDd { display: none !important; }
  .top-right > [data-v3-dots] { display: flex !important; }

  /* ── Hide model pill from input bar ── */
  .mode-wrap { display: none !important; }

  /* ── Kill pull-to-refresh ── */
  #pullRefreshIndicator { display: none !important; }

  /* ── Force hide pinch-zoom close button (leaks through display:none parent) ── */
  #pinchZoomOverlay:not(.show) { visibility: hidden !important; }

  /* ── Hide old research banner ── */
  #researchBanner.research-banner { display: none !important; }

  /* ── Model badge ── */
  #mobModelBadge {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  line-height: 24px;
  max-height: 24px;
  flex-shrink: 0;
  overflow: hidden;
  margin-top: auto;
  margin-bottom: auto;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
  #mobModelBadge:active { background: var(--bg-4); }
  #mobModelBadge .badge-sub {
  margin-left: 2px;
}
  #mobModelBadge.thinking .badge-sub { display: flex; align-items: center; }
  #mobModelBadge.thinking {
    background: rgba(245,158,11,0.15);
    color: var(--amber, #f59e0b);
  }
  #mobModelBadge .badge-chev {
    width: 10px; height: 10px; opacity: 0.5;
    transition: transform 0.2s;
  }
  #mobModelBadge.open .badge-chev { transform: rotate(180deg); }

  /* ── Dropdown ── */
  #mobModelDd {
    position: fixed; z-index: 700;
    background: var(--bg-2); border: 1px solid var(--bg-4);
    border-radius: 12px; padding: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    min-width: 180px;
    opacity: 0; transform: translateY(-8px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
  }
  #mobModelDd.open {
    opacity: 1; transform: translateY(0);
    pointer-events: auto;
  }
  #mobModelDd .dd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    font-size: 13px; color: var(--tx); cursor: pointer;
    border: none; background: none; width: 100%;
    font-family: var(--font-b); text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  #mobModelDd .dd-item:active { background: var(--bg-3); }
  #mobModelDd .dd-item.active { font-weight: 600; }
  #mobModelDd .dd-item.disabled { opacity: 0.35; }
  /* ── Colored dot indicator ── */
  #mobModelDd .dd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
  #mobModelDd .dd-item.active .dd-dot {
    transform: scale(1.25);
  }
  #mobModelDd .dd-item[data-model="lyt"] .dd-dot { background: var(--lyt); }
  #mobModelDd .dd-item[data-model="omni"] .dd-dot { background: var(--omni); }
  #mobModelDd .dd-item[data-model="prme"] .dd-dot { background: var(--prme); } /* PRME_INTEGRATION_V1: token already defined in chat.html :root, just wiring the selector */
  #mobModelDd .dd-item[data-model="adaptive"] .dd-dot { background: var(--adaptive); }
  #mobModelDd .dd-item.active[data-model="lyt"] .dd-dot { box-shadow: 0 0 8px var(--lyt-dim); }
  #mobModelDd .dd-item.active[data-model="omni"] .dd-dot { box-shadow: 0 0 8px var(--omni-dim); }
  #mobModelDd .dd-item.active[data-model="prme"] .dd-dot { box-shadow: 0 0 8px var(--prme-dim); } /* PRME_INTEGRATION_V1 */
  #mobModelDd .dd-item.active[data-model="adaptive"] .dd-dot { box-shadow: 0 0 8px var(--adaptive-dim); }
  /* ── Active item tinted bg ── */
  #mobModelDd .dd-item.active[data-model="lyt"] { background: var(--lyt-dim); color: var(--lyt); }
  #mobModelDd .dd-item.active[data-model="omni"] { background: var(--omni-dim); color: var(--omni); }
  #mobModelDd .dd-item.active[data-model="prme"] { background: var(--prme-dim); color: var(--prme); } /* PRME_INTEGRATION_V1 */
  #mobModelDd .dd-item.active[data-model="adaptive"] { background: var(--adaptive-dim); color: var(--adaptive); }
  
  #mobModelDd .dd-tag {
    font-size: 10px; padding: 1px 6px; border-radius: 4px;
    margin-left: auto;
  }
  #mobModelDd .dd-item[data-model="lyt"] .dd-tag { background: var(--lyt-dim); color: var(--lyt); }
  #mobModelDd .dd-item[data-model="omni"] .dd-tag { background: var(--omni-dim); color: var(--omni); }
  #mobModelDd .dd-item[data-model="prme"] .dd-tag { background: var(--prme-dim); color: var(--prme); } /* PRME_INTEGRATION_V1 */
  #mobModelDd .dd-item[data-model="adaptive"] .dd-tag { background: var(--adaptive-dim); color: var(--adaptive); }
  #mobModelDd .dd-item.disabled .dd-tag { background: var(--bg-4); color: var(--tx-3); }
  #mobModelDd .dd-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  #mobModelDd .dd-label { font-size: 13px; }
  #mobModelDd .dd-desc { font-size: 10px; color: var(--tx-3); font-weight: 400; line-height: 1.2; }
  #mobModelDd .dd-div { height: 1px; background: var(--bg-4); margin: 4px 8px; }
  
  
  /* MOBILE_DEEP_THINK_PARITY_V1 - label+desc stack matches desktop ext-think-section */
  
  #mobModelDd .dd-toggle-label { font-size: 13px; font-weight: 700; color: var(--tx); }
  #mobModelDd .dd-toggle-desc { font-size: 10px; color: var(--tx-3); font-weight: 400; line-height: 1.2; }
  
  
  
  
  #mobModelDd .dd-reason { padding: 8px 10px 10px; }
  /* EXTRA_DEEP_MOBILE_V1: flex row (not a 3-track grid) so a 4th pro/admin-only button
     (display:none-toggled in JS) is accommodated automatically - no column-count class
     to keep in sync from JS, works for 3 or 4 visible items on narrow screens alike. */
  #mobModelDd .dd-reason-seg {
    display: flex; gap: 3px;
    margin-top: 7px; padding: 3px; border: 1px solid var(--brd);
    border-radius: 8px; background: var(--bg-1);
  }
  #mobModelDd .dd-reason-seg button {
    flex: 1 1 0; min-width: 0;
    padding: 6px 4px; border-radius: 5px; color: var(--tx-3);
    font-size: 11px; font-weight: 700;
  }
  #mobModelDd .dd-reason-seg button.on { color: var(--tx); background: var(--bg-3); }
  /* ── Dropdown backdrop (transparent, just catches taps) ── */
  #mobDdBd {
    position: fixed; inset: 0; z-index: 699;
    background: transparent; display: none;
  }
  #mobDdBd.show { display: block; }

  /* ── Research mode topbar ── */
  .topbar.research-active {
    background: rgba(245,158,11,0.12) !important;
  }
  .topbar .research-lbl {
    display: none; font-size: 12px; font-weight: 600;
    color: var(--amber, #f59e0b); align-items: center; gap: 6px;
    white-space: nowrap; margin-left: 4px; margin-right: auto;
  }
  .topbar.research-active .research-lbl { display: flex; }
  .research-lbl .res-exit {
    font-size: 11px; padding: 2px 8px; border-radius: 4px;
    background: rgba(245,158,11,0.2); color: var(--amber, #f59e0b);
    cursor: pointer; border: none; font-weight: 600;
    font-family: var(--font-b);
    -webkit-tap-highlight-color: transparent;
  }
  .research-lbl .res-exit:active { background: rgba(245,158,11,0.35); }

  
}

/* ===== from chat-refine.css ===== */
/* ═══════════════════════════════════════════════════════
   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.
   ═══════════════════════════════════════════════════════ */

/* ── SIDEBAR: darker, wider, more breathing room ── */
.sb {
  width: 270px;
  background: var(--bg-1);
}

/* 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 img {
  border-radius: 0;
}
.sb-top .logo-text {
  display: inline !important;
  position: relative;
}

/* PURPLE_CLEANUP_V2 */

.sb-new:hover {
  border-color: rgba(154,137,104,0.3);
}
.sb-search {
  border-radius: 10px;
}
.sb-list {
  gap: 3px;
}

/* GLASS_TOPBAR_V1: pronounced frosted-glass topbar (blur + saturate + sheen) */
.topbar {
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.topbar-title {
  font-size: 15px;
}

/* ── CHAT MESSAGES: constrained width, generous spacing ── */

.msg-inner {
  margin: 0 auto;
}

/* User bubble: copper tint, rounder */

[data-theme="dark"] .msg.user .m-body {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* AI response: spacious typography */

.msg.assistant .m-head {
  margin-bottom: 6px;
}

/* ── INPUT AREA: pill shape, constrained width ── */

.input-wrap {
  max-width: 840px;
  margin: 0 auto;
}

[data-theme="dark"] .input-box {
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

/* Input tools: rounded hover zones */

.in-tool:hover {
  background: rgba(255,255,255,0.06);
}

/* ── MESSAGE ACTIONS: cleaner ── */

.m-acts button:hover {
  background: rgba(255,255,255,0.05);
}

/* ── WELCOME / SUGGESTIONS: match constrained width ── */
.msg-inner > .welcome {
  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);
}

/* ── RESPONSIVE: don't break mobile ── */
@media (max-width: 768px) {
  
  
  .input-wrap {
    max-width: 100%;
  }
  
  
  
}

/* REFINE_WELCOME_V1 - hide suggestion boxes, push welcome down */

.welcome {
  min-height: 40vh;
}

/* ASSISTANT_DARK_WHITE_V1 + WARM_STONE_CHARCOAL_V1: warm soft-white chat text
   instead of harsh glaring #FFFFFF. Light mode keeps semantic --tx ramp. */

/* ── GEMINI_ELEGANCE_V1: Welcome Gradient Ink & Subtle Aura ── */
[data-theme="dark"] .wel-title {
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
[data-theme="dark"] .wel-logo img {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

[data-theme="dark"] .wel-sub {
  line-height: 1.65;
}

[data-theme="light"] .wel-title {
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
[data-theme="light"] .wel-logo img {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

[data-theme="light"] .wel-sub {
  line-height: 1.65;
}

/* ── GEMINI_ELEGANCE_V1: Thinking & Streaming Polish ── */
[data-theme="dark"] #thinkInd {
  border: 1px solid rgba(154, 137, 104, 0.22);
  background: rgba(30, 29, 25, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
}
[data-theme="dark"] .think-toggle {
  transition: background 0.2s ease, color 0.2s ease;
}
[data-theme="dark"] .think-toggle:hover {
  background: rgba(154, 137, 104, 0.10);
  color: #f4f0e6;
}
[data-theme="dark"] .thinking {
  background: rgba(154, 137, 104, 0.08);
  border: 1px solid rgba(154, 137, 104, 0.22);
  box-shadow: 0 0 18px rgba(154, 137, 104, 0.08);
}
[data-theme="dark"] .think-bar {
  background: linear-gradient(180deg, #c8b593, var(--ac));
}

[data-theme="light"] #thinkInd {
  border: 1px solid rgba(44, 74, 111, 0.16);
  background: rgba(253, 251, 246, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(31, 24, 18, 0.04);
}
[data-theme="light"] .think-toggle:hover {
  background: rgba(44, 74, 111, 0.06);
  color: #1F1812;
}
[data-theme="light"] .thinking {
  background: rgba(44, 74, 111, 0.05);
  border: 1px solid rgba(44, 74, 111, 0.18);
  box-shadow: 0 0 16px rgba(44, 74, 111, 0.06);
}
[data-theme="light"] .think-bar {
  background: linear-gradient(180deg, #3B5D86, #2C4A6F);
}

/* ── RICH_PANELS_V4 ── */
.adm-box {
  margin: 14px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,.025);
}
.adm-title {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 5px;
  display: block;
  opacity: .85;
}
.adm-content {
  font-size: inherit;
  line-height: 1.7;
  color: var(--tx-2);
}
.adm-content p { margin-bottom: 8px; }
.adm-content p:last-child { margin-bottom: 0; }

[data-theme="light"] .adm-box { background: rgba(0,0,0,.02); }

/* ── Timeline ── */
.tl-box { margin: 14px 0; }

.tl-row {
  display: grid; grid-template-columns: 64px 1fr;
  gap: 0 12px; padding: 10px 0;
  border-top: 1px solid var(--brd);
}
.tl-row:first-of-type { border-top: none; }
.tl-time {
  font-family: var(--font-m); font-size: .72rem; font-weight: 600;
  color: var(--tx-3); padding-top: 2px; white-space: nowrap;
}
.tl-body { min-width: 0; }
.tl-title {
  font-size: .88rem; font-weight: 600; color: var(--tx);
  margin-bottom: 2px;
}
.tl-desc {
  font-size: .85rem; color: var(--tx-2); line-height: 1.6;
}

/* ── Card Grid ── */
.card-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin: 14px 0;
}
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }
.card-item {
  padding: 14px 16px; border-radius: 8px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--brd);
}
.card-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px; gap: 8px;
}
.card-source {
  font-size: .75rem; font-weight: 700; color: var(--tx);
  text-transform: uppercase; letter-spacing: .5px;
}
.card-meta {
  font-size: .62rem; color: var(--tx-4);
  font-style: italic; white-space: nowrap;
}
.card-body {
  font-size: .85rem; color: var(--tx-2); line-height: 1.6;
}

[data-theme="light"] .card-item { background: rgba(0,0,0,.02); }

/* ===== from chat-neutral-dark-v3.css ===== */
/*
  CHAT_TOPBAR_NEUTRAL_V1
  Topbar-only visual override for /chat.

  Scope:
  - Topbar background/border/spacing
  - Model pill
  - Share/settings/incognito/topbar icon buttons
  - Topbar dropdown surfaces

  Rollback:
  Remove the chat-neutral-dark-v3.css <link> from auth/authstatic/chat.html.
*/

[data-theme="dark"] {
  --topbar-neutral-bg: rgba(34,33,29,.75);  /* GLASS_TOPBAR_V1 + WARM_STONE_CHARCOAL_V1 */
  --topbar-neutral-hover: rgba(255,255,255,.08);
  --topbar-neutral-border: rgba(255,255,255,.09);
  --topbar-neutral-text: #c2bcaf;
  --topbar-neutral-text-strong: #f4f0e6;
  --topbar-neutral-muted: #948d7e;
  --topbar-neutral-dot: #9aa59a;
}

.topbar {
  padding: 0 18px;
  padding-top: var(--safe-t);
  gap: 8px;
}

.mode-wrap {
  margin: 0;
}

.mode-pill {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--topbar-neutral-text, var(--tx-2));
  padding: 0 9px;
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.mode-pill:hover,
.mode-pill.open {
  background: var(--topbar-neutral-hover, var(--bg-3));
  border-color: transparent;
  color: var(--topbar-neutral-text-strong, var(--tx));
}

.mode-pill .chev {
  display: none;
}

.topbar .model-dot {
  width: 7px;
  height: 7px;
  box-shadow: none !important;
}

.topbar .model-dot.adaptive {
  background: var(--topbar-neutral-dot, var(--adaptive));
}

.top-right {
  gap: 4px;
}

.top-btn,
.top-ico,
.top-menu,
.top-expand {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--topbar-neutral-text, var(--tx-2));
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.top-btn {
  padding: 0 9px;
}

.top-btn:hover,
.top-ico:hover,
.top-menu:hover,
.top-expand:hover {
  background: var(--topbar-neutral-hover, var(--bg-3));
  border-color: transparent;
  color: var(--topbar-neutral-text-strong, var(--tx));
}

.top-btn svg,
.top-ico svg,
.top-menu svg,
.top-expand svg {
  color: currentColor;
}

.mode-dd {
  background: var(--bg-1);
  border-color: var(--brd);
  border-radius: 12px;
  box-shadow: var(--sh-lg);
}

.mode-opt:hover,
.mode-opt.on {
  background: var(--bg-2);
}

.mo-label {
  color: var(--tx);
  font-weight: 600;
}

.mo-sub {
  color: var(--tx-3);
}

/* ===== from chat-color-font-preview.css ===== */
/*
  CHAT_COLOR_FONT_TOKENS_V1
  Color + font tokens for the existing /chat UI.
  No layout, spacing, radius, component structure, or button geometry changes.

  Rollback:
  Remove the chat-color-font-preview.css <link> from auth/authstatic/chat.html.
*/

@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;450;500;600;700&display=swap");

[data-theme="dark"] {
  --adaptive: #879582;
  --adaptive-dim: rgba(135,149,130,.12);
  --lyt: #b8aa87;
  --lyt-dim: rgba(184,170,135,.12);
  --prme: #83a69f;
  --prme-dim: rgba(131,166,159,.12);
  --code-bg: #141514;
  --code-hd: #1f201e;
  --sh-sm: 0 1px 3px rgba(0,0,0,.28);
  --sh-md: 0 8px 28px rgba(0,0,0,.28);
  --sh-lg: 0 18px 54px rgba(0,0,0,.38);
}

[data-theme="light"] {
  --adaptive: #7A4E2D;
  --adaptive-dim: rgba(122,78,45,.10);
  --lyt: #8A5A2B;
  --lyt-dim: rgba(138,90,43,.10);
  --prme: #41684F;
  --prme-dim: rgba(65,104,79,.10);
  --code-bg: #1F1812;
  --code-hd: #2A2118;
  --sh-sm: 0 1px 2px rgba(31,24,18,.06);
  --sh-md: 0 8px 28px rgba(31,24,18,.10);
  --sh-lg: 0 18px 54px rgba(31,24,18,.14);
}

[data-theme="light"] .input-box {
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

[data-theme="light"] .msg.user .m-body {
  color: #1F1812;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .sb-new:hover {
  border-color: rgba(44,74,111,.20);
}

html,
body,
button,
input,
textarea,
select {
  font-family: var(--font-b);
  letter-spacing: 0;
}

.m-txt,
#msgIn {
  font-family: var(--font-b);
}

/* ASSISTANT_TURN_POLISH_V1: clear document hierarchy without turning answers
   into oversized article cards. Data blocks keep the full reading width. */

/* CALLOUT_LEGACY_STYLE_V1: keep RICH_PANELS_V4 callouts on their original
   compact rhythm; the assistant document-spacing rules above must not leak
   into [!TIP]/[!NOTE]/other admonition boxes. */
.msg.assistant .m-txt > .adm-box:first-child {
  margin-top: 14px;
}

.msg.assistant .m-txt .adm-content p {
  margin-bottom: 8px !important;
}

.msg.assistant .m-txt .adm-content p:last-child {
  margin-bottom: 0 !important;
}

/* ===== from chat-editorial.css ===== */
/*
  CHAT_EDITORIAL_V1 (PREVIEW) - polish /chat ke arah editorial.
  Dimuat PALING AKHIR, sesudah chat-color-font-preview.css.
  Font: Inter (badan/chrome) + Outfit (judul sambutan) + Source Serif 4 (aksen italic, judul jawaban).
  Rollback: hapus <link> chat-editorial.css.
*/

:root {
  --ed-ease: cubic-bezier(.2, .7, .2, 1);
}

/* Light: aksen copper (sama dgn dark & landing), bukan navy Epithre */

html, body, button, input, textarea, select { font-feature-settings: "cv11", "ss01"; }

/* Bayangan panel kanvas bocor ke tepi kanan walau panel tertutup */
.canvas-panel:not(.open) { box-shadow: none !important; }

/* ── Sidebar ── */

.sb-new:hover { background: var(--bg-2) !important; }

/* ── Sambutan ── */
.welcome { margin-top: 16vh; }
.wel-logo img,
[data-theme="dark"] .wel-logo img,
[data-theme="light"] .wel-logo img { filter: none !important; transform: none !important; opacity: .92; }
[data-theme="dark"] .wel-logo img:hover,
[data-theme="light"] .wel-logo img:hover { filter: none !important; transform: none !important; }

.wel-title,
[data-theme="dark"] .wel-title,
[data-theme="light"] .wel-title {
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  max-width: 640px;
  margin-bottom: 14px !important;
  text-wrap: balance;
}

.wel-sub,
[data-theme="dark"] .wel-sub,
[data-theme="light"] .wel-sub {
  margin-bottom: 36px !important;
}

/* ── Composer ── */

[data-theme="dark"] .input-box:focus-within {
  background: #2c2b26 !important;
}

/* Tombol kirim: lingkaran tinta + panah, bukan logo */
.send-btn {
  transition: opacity .15s ease, transform .15s var(--ed-ease) !important;
}
.send-btn:hover { filter: none !important; transform: translateY(-1px) !important; background: var(--tx) !important; box-shadow: none !important; }
.send-btn svg { width: 18px !important; height: 18px !important; }

.send-btn.stop svg { width: 12px !important; height: 12px !important; }

/* Kartu Turnstile (hanya muncul bila Cloudflare minta interaksi) */
#guestTs:not(:empty) {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 14px 10px;
  background: var(--bg-2);
  border: 1px solid var(--brd);
  border-radius: 14px;
  box-shadow: var(--sh-md);
}
#guestTs:not(:empty)::before {
  content: attr(data-caption);
  font-size: 12.5px; color: var(--tx-3);
}

/* kolom baca = lebar composer (dulu 760 terlalu sempit); layar besar sedikit lebih lega */
.msg-inner { max-width: 840px !important; }

.msg.assistant .m-txt,
.msg.assistant .m-txt p,
.msg.assistant .m-txt li {
  font-size: 16.5px !important;
  line-height: 1.72 !important;
}

.m-txt blockquote {
  background: none !important;
  border-left: 2px solid var(--ac) !important;
  border-radius: 0 !important;
  padding: 2px 0 2px 18px !important;
  font-family: var(--font-s);
  font-size: 1.06em;
  color: var(--tx-2) !important;
}

.msg.assistant .m-txt table { font-variant-numeric: tabular-nums; }

/* Bubble user: tenang, tanpa bayangan/garis terang */
.msg.user .m-body,
[data-theme="dark"] .msg.user .m-body,
[data-theme="light"] .msg.user .m-body {
  border-radius: 20px 20px 6px 20px !important;
}

/* Sitasi inline: teks aksen kecil, bukan pil */
.icite {
  height: auto !important;
  padding: 0 3px !important;
  margin: 0 1px 0 3px !important;
  top: -0.35em !important;
  font-size: 11px !important;
  border: none !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: var(--ac-2) !important;
}
[data-theme="light"] .icite { color: var(--ac) !important; }
.icite:hover, .icite:focus-visible { background: var(--ac-dim) !important; }
/* Sitasi inline = favicon (maks 3 bertumpuk) */

.icite-pop-fav { object-fit: contain; border-radius: 3px !important; background: transparent !important; }

/* Footer jawaban: aksi + "N sumber" satu garis tengah */
.assistant-foot { align-items: flex-start !important; }  /* aksi 28px = tinggi tombol sumber; tetap di atas saat daftar dibuka */
.msg.assistant .assistant-foot .m-acts { margin-top: 0 !important; align-items: center; }
.msg.assistant .assistant-foot .ws-sources-wrap { margin: 0 !important; }
.ws-sources-inner {
  gap: 0 !important;
  padding-top: 4px !important;
}
.ws-src-row { border-radius: 0 !important; padding: 8px 2px !important; border-bottom: 1px solid var(--brd); font-size: 13px !important; }
.ws-src-row:hover { background: transparent !important; }
.ws-src-row:hover .ws-src-title { color: var(--tx-2); }
.ws-src-idx {
  width: auto !important; height: auto !important; min-width: 18px;
  background: none !important; border: none !important; border-radius: 0 !important;
  font-family: var(--font-s); font-size: 13px !important; font-weight: 600 !important;
  color: var(--ac-2) !important; font-variant-numeric: tabular-nums;
}
[data-theme="light"] .ws-src-idx { color: var(--ac) !important; }
.ws-src-fav { width: 16px !important; height: 16px !important; object-fit: contain; border-radius: 3px !important; background: transparent !important; }
.ws-src-domain { font-weight: 500 !important; color: var(--tx-2); }

/* Pratinjau domain progresif: tanpa pil */
.ws-prog-chip, .ws-prog-more {
  border-radius: 6px !important;
  background: transparent !important;
}

/* Tindak lanjut: tombol sudut tumpul berjajar (bukan kapsul, bukan baris tab) */
.followup-area { gap: 6px !important; margin: -4px 0 16px !important; }
.followup-chip {
  min-height: 32px !important; padding: 6px 12px !important;
  border-radius: 9px !important; border: 1px solid var(--brd-2) !important;
  background: transparent !important; color: var(--tx-2) !important;
  font-size: 13px !important; text-align: left; transform: none !important;
  transition: background .15s ease, border-color .15s ease, color .15s ease !important;
}
.followup-chip:hover { background: var(--bg-2) !important; border-color: var(--brd-3) !important; color: var(--tx) !important; transform: none !important; }

@media (max-width: 768px) {
  .welcome { margin-top: 10vh; }
  
  
}

/* Banner tamu: di desktop dulu tertutup topbar kaca (terlihat sbg "glow"); taruh di bawah topbar */
.guest-banner.show {
  position: absolute;
  top: calc(44px + var(--safe-t, 0px));
  left: 0;
  right: 0;
  z-index: 9;
  padding: 7px 16px !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  font-size: 13px !important;
}
.guest-banner a {
  background: none !important;
  padding: 0 !important;
  margin-left: 10px !important;
  text-underline-offset: 3px;
}

[data-theme="light"] .guest-banner.show { background: rgba(255,255,255,.72) !important; }
@media (max-width: 768px) {
  .guest-banner.show { top: calc(40px + var(--safe-t, 0px)); font-size: 12px !important; padding: 6px 12px !important; }
}

/* Tabel: garis horizontal saja, tanpa kotak */
@media screen {
.msg.assistant .m-txt table, .msg.assistant .m-txt .table-wrap {
  border: none !important; border-radius: 0 !important; box-shadow: none !important; background: none !important;
}
.msg.assistant .m-txt th,
.msg.assistant .m-txt td {
  background: none !important;
}

}

@media (max-width: 768px) {
  .followup-chip { flex-shrink: 0 !important; white-space: nowrap !important; max-width: none !important; }
}
.fav-letter {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: var(--bg-3) !important;
  color: var(--tx-2);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

/* ── CODE_WARM_INK_V1: blok kode sepalet IsonAI (tanpa ungu, label bukan mono kapital) ── */
@media screen {
:root { --ink-bg: #1a1916; --ink-hd: #1f1e1a; --ink-tx: #e8e2d6; }
[data-theme="light"] { --ink-bg: #1f1b16; --ink-hd: #26211b; --ink-tx: #ece5d8; }

.m-txt pre {
  background: var(--ink-bg) !important;
  box-shadow: none !important;
  margin: 18px 0 !important;
}

.m-txt pre .code-head {
  background: var(--ink-hd) !important;
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
  padding: 7px 10px 7px 16px !important;
}
.m-txt pre .code-lang {
  font-family: var(--font-b) !important; text-transform: none !important; letter-spacing: 0 !important;
  font-size: 12px !important; font-weight: 500 !important; color: #a39c8e !important;
}
.m-txt pre .code-copy, .m-txt pre .code-canvas, .m-txt pre .code-run {
  font-family: var(--font-b) !important; font-size: 12px !important; font-weight: 500 !important;
  background: transparent !important; border: 1px solid transparent !important;
  color: #a39c8e !important; padding: 3px 9px !important; border-radius: 7px !important;
}
.m-txt pre .code-copy:hover, .m-txt pre .code-canvas:hover, .m-txt pre .code-run:hover {
  background: rgba(255,255,255,.06) !important; color: #efe8da !important;
}
.m-txt pre code, .m-txt pre code.hljs {
  color: var(--ink-tx) !important; background: transparent !important;
  font-size: 13.5px !important; line-height: 1.7 !important; padding: 16px 18px !important;
  tab-size: 4;
}

.m-txt pre code::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14) !important; }

/* kode sebaris: tint copper halus, tanpa bingkai */
.m-txt :not(pre) > code {
  color: var(--tx) !important;
}

}

/* ── ANN_V3_SINGLE_V1: tur fitur satu slide, gaya editorial ── */
.ann-modal.ann-v3 {
  max-width: 540px; padding: 40px 40px 32px;
  background: var(--bg-1); border: 1px solid var(--brd-2); border-radius: 20px;
}
.ann-v3 .ann-close { top: 14px; right: 14px; }
.ann-v3 .ann-title {
  font-family: var(--font-h); font-size: 1.9rem; font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.15; margin: 0 28px 22px 0; color: var(--tx);
}
.ann-v3 .ann-title em {
  font-family: var(--font-s); font-style: italic; font-weight: 400; color: var(--ac-2);
}
[data-theme="light"] .ann-v3 .ann-title em { color: var(--ac); }
.ann-v3 .ann-list { list-style: none; margin: 0 0 26px; padding: 0; border-top: 1px solid var(--brd); }
.ann-v3 .ann-list li {
  padding: 13px 0; border-bottom: 1px solid var(--brd);
  font-size: 14.5px; line-height: 1.6; color: var(--tx-2);
}
.ann-v3 .ann-list strong { color: var(--tx); font-weight: 600; }
.ann-v3 .ann-list a { color: var(--ac-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
[data-theme="light"] .ann-v3 .ann-list a { color: var(--ac); }
.ann-v3 .ann-actions { justify-content: flex-end; }
.ann-v3 .ann-btn { padding: 10px 26px; border-radius: 10px; font-family: var(--font-b); }
.ann-v3 .ann-btn-primary { background: var(--tx); color: var(--bg-0); }
.ann-v3 .ann-btn-primary:hover { background: var(--tx); opacity: .88; }
@media (max-width: 640px) {
  .ann-modal.ann-v3 {
  padding: 30px 22px 22px;
}
  .ann-v3 .ann-title { font-size: 1.55rem; margin-right: 34px; }
  .ann-v3 .ann-list li { font-size: 14px; padding: 11px 0; }
  .ann-v3 .ann-actions { justify-content: stretch; }
  .ann-v3 .ann-btn { width: 100%; }
}

/* ANN_V3_VISUAL_V1: hero + ikon + baris masuk bertahap */
.ann-modal.ann-v3 {
  padding-top: 0;
}
/* ANN_V3_FIT_V1 (2026-11-06, Dimas): the overflow:hidden above also beat the mobile max-height/overflow-y:auto rule,
   so on short phones (375x667) the list + 'Mulai' button were cut off with no scroll. Fit the card to the VISIBLE
   viewport (dvh = without the Safari address bar; overlay has 20px padding) and scroll inside it on every size. */
.ann-modal.ann-v3 {
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
@media (max-height: 560px) {
  /* higher specificity than the base .ann-v3 .ann-hero/.ann-logo rules declared further down */
  .ann-modal.ann-v3 .ann-hero { height: 88px; margin-bottom: 18px; }
  .ann-modal.ann-v3 .ann-logo { width: 44px; height: 44px; }
}
.ann-v3 .ann-hero {
  position: relative; height: 150px; margin: 0 -40px 26px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 85% at 50% 50%, rgba(184,150,96,.30) 0%, rgba(184,150,96,.08) 55%, transparent 80%),
    var(--bg-2);
  border-bottom: 1px solid var(--brd);
}
[data-theme="light"] .ann-v3 .ann-hero {
  background:
    radial-gradient(ellipse 60% 85% at 50% 50%, rgba(184,150,96,.26) 0%, rgba(184,150,96,.07) 55%, transparent 80%),
    #F6F2EA;
}
.ann-v3 .ann-logo {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
}
@keyframes annFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ann-v3 .ann-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid rgba(184,150,96,.75);
  transform: translate(-50%, -50%) scale(.8);
}

@keyframes annRing {
  0%   { transform: translate(-50%, -50%) scale(.8); opacity: .9; }
  100% { transform: translate(-50%, -50%) scale(4.4); opacity: 0; }
}
.ann-v3 .ann-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  align-items: start;
}
@keyframes annRowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ann-v3 .ann-ic { width: 20px; height: 20px; margin-top: 2px; color: var(--ac-2); }
[data-theme="light"] .ann-v3 .ann-ic { color: var(--ac); }
@media (max-width: 640px) {
  .ann-v3 .ann-hero { height: 120px; margin: 0 -22px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .ann-v3 .ann-logo, .ann-v3 .ann-ring, .ann-v3 .ann-list li { animation: none !important; }
  .ann-v3 .ann-ring { opacity: 0; }
}

/* CHAT_INLINE_CITE_V1 (Dimas 10-26 "samain kaya chatgpt"): source chip at the end of a supported sentence =
   ChatGPT's grey rounded chip with the site name (+N); the accent-text rule above stays for other .icite uses. */
.icite.icite-chip {
  height: 20px !important; padding: 0 8px !important; margin: 0 2px 0 5px !important; top: -1px !important;
  font-size: 12px !important; font-weight: 500; border-radius: 9999px !important;
  background: var(--bg-3) !important; color: var(--tx-2) !important; vertical-align: baseline;
}
[data-theme="light"] .icite.icite-chip { color: var(--tx-2) !important; }
.icite.icite-chip:hover, .icite.icite-chip:focus-visible { background: var(--brd-2) !important; color: var(--tx) !important; }

/* CHAT_INLINE_CITE_V1 favicon chip (Dimas 10-26 "tampilin faviconnya aja"): up to 3 favicons in the grey chip */
.icite.icite-chip { gap: 3px !important; padding: 0 6px !important; vertical-align: middle; top: -0.1em !important; }
.icite.icite-chip .icite-fav { display: inline-block !important; width: 14px !important; height: 14px !important;
  border-radius: 3px !important; background: transparent !important; object-fit: contain; }
/* CHAT_INLINE_CITE_V1: letter fallback (favicon 404) keeps a small box inside the chip (0f report 10-26) */
.icite.icite-chip .icite-fav.fav-letter { display: inline-flex !important; align-items: center; justify-content: center;
  width: 14px !important; height: 14px !important; border-radius: 3px !important; background: var(--brd-2) !important;
  color: var(--tx-2); font-size: 9px; font-weight: 600; line-height: 1; }
.icite.icite-chip .icite-fav.fav-pending { display: none !important; }   /* _icFavLazy: beats the chip's inline-block rule */

/* ===== from chat-core-fx.css ===== */
/*
  CORE_IGNITION_FX_V1 (PREVIEW) - efek "menyala" saat pindah ke mode Core.
  html.core-on     = mode Core aktif (ambient tipis, persisten)
  html.core-ignite = sekuens sekali jalan ~1,6 dtk saat baru masuk Core
  Rollback: hapus <link> chat-core-fx.css + blok skrip CORE_IGNITION_FX_V1.
*/

:root {
  --core-glow: 184, 150, 96;   /* copper */
}

/* Aura: lapisan tetap di atas kanvas, tembus klik */
.core-aura {
  position: absolute; left: 0; right: 0; top: 0; height: 70vh;
  pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse 70% 55% at 50% -8%,
    rgba(var(--core-glow), .34) 0%, rgba(var(--core-glow), .10) 45%, transparent 72%);
  opacity: 0; transform-origin: 50% 0;
  transition: opacity .9s ease;
  mix-blend-mode: screen;
}
html[data-theme="light"] .core-aura { mix-blend-mode: multiply; }
[data-theme="light"] .core-aura {
  background: radial-gradient(ellipse 70% 55% at 50% -8%,
    rgba(var(--core-glow), .30) 0%, rgba(var(--core-glow), .08) 45%, transparent 72%);
}
html.core-on .core-aura { opacity: .55; }

/* Pil mode: badge Core copper penuh */
html.core-on .mode-pill .think-badge.deep {
  background: rgba(var(--core-glow), .22); color: #e8d3ad;
}
html.core-on[data-theme="light"] .mode-pill .think-badge.deep { color: #6b5634; background: rgba(var(--core-glow), .20); }
.mode-pill { position: relative; overflow: hidden; }
.mode-pill::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 236, 200, .55) 50%, transparent 80%);
  transform: translateX(-120%); opacity: 0;
}

/* Composer: garis copper tipis selama Core */
html.core-on .input-box {
  border-color: rgba(var(--core-glow), .45) !important;
}

/* ── Sekuens nyala ── */
html.core-ignite .core-aura { animation: coreAuraIgnite 1.6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes coreAuraIgnite {
  0%   { opacity: 0;   transform: scaleY(.55) scaleX(.8); }
  30%  { opacity: 1;   transform: scaleY(1.2) scaleX(1.05); }
  100% { opacity: .55; transform: scaleY(1)   scaleX(1); }
}

html.core-ignite .mode-pill::after { animation: corePillSweep .9s .15s ease-out both; }
@keyframes corePillSweep {
  0%   { transform: translateX(-120%); opacity: 1; }
  100% { transform: translateX(120%);  opacity: 1; }
}
html.core-ignite .mode-pill { animation: corePillPulse 1.2s ease-out both; }
@keyframes corePillPulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--core-glow), .55); }
  100% { box-shadow: 0 0 0 10px rgba(var(--core-glow), 0); }
}

html.core-ignite .input-box { animation: coreComposerPulse 1.5s .25s ease-out both; }
@keyframes coreComposerPulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--core-glow), .50), 0 12px 32px rgba(0,0,0,.28); }
  40%  { box-shadow: 0 0 0 6px rgba(var(--core-glow), .16), 0 0 38px rgba(var(--core-glow), .30); }
  100% { box-shadow: 0 0 0 0 rgba(var(--core-glow), 0), 0 12px 32px rgba(0,0,0,.28); }
}

/* Cincin gelombang dari logo sambutan */
.wel-logo { position: relative; }
.wel-logo::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 100%; height: 100%; border-radius: 50%;
  border: 1.5px solid rgba(var(--core-glow), .8);
  transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
}
html.core-ignite .wel-logo::after { animation: coreRing 1.3s .1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes coreRing {
  0%   { transform: translate(-50%, -50%) scale(.6); opacity: .9; }
  100% { transform: translate(-50%, -50%) scale(3.2); opacity: 0; }
}
html.core-ignite .wel-logo img { animation: coreLogo 1.3s ease-out both; }
@keyframes coreLogo {
  0%   { filter: drop-shadow(0 0 0 rgba(var(--core-glow), 0)); transform: scale(1); }
  35%  { filter: drop-shadow(0 0 22px rgba(var(--core-glow), .75)); transform: scale(1.06); }
  100% { filter: drop-shadow(0 0 0 rgba(var(--core-glow), 0)); transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  html.core-ignite .core-aura,
  html.core-ignite .mode-pill,
  html.core-ignite .mode-pill::after,
  html.core-ignite .input-box,
  html.core-ignite .wel-logo::after,
  html.core-ignite .wel-logo img { animation: none !important; }
}

/* ── Penguat: sapu cahaya turun ── */
.core-aura::after {
  content: ""; position: absolute; left: 10%; right: 10%; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--core-glow), .9), transparent);
  filter: blur(1px); opacity: 0;
}
html.core-ignite .core-aura::after { animation: coreScan 1.1s .1s cubic-bezier(.3, .6, .2, 1) both; }
@keyframes coreScan {
  0%   { top: 0;    opacity: 0; }
  15%  { opacity: 1; }
  100% { top: 62vh; opacity: 0; }
}

/* ── Penguat: cahaya memutari tepi composer sekali ── */
@property --core-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.input-box { position: relative; }
.input-box::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--core-a), transparent 0deg, rgba(var(--core-glow), 1) 40deg, rgba(255, 232, 190, .95) 60deg, transparent 110deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; pointer-events: none;
}
html.core-ignite .input-box::after { animation: coreEdge 1.5s .2s cubic-bezier(.45, .1, .3, 1) both; }
@keyframes coreEdge {
  0%   { --core-a: -60deg; opacity: 0; }
  12%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { --core-a: 300deg; opacity: 0; }
}

/* ── Penguat: tiga cincin berlapis ── */
.wel-logo::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 100%; height: 100%; border-radius: 50%;
  border: 1px solid rgba(var(--core-glow), .6);
  transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
}
html.core-ignite .wel-logo::before { animation: coreRing 1.5s .35s cubic-bezier(.2, .7, .2, 1) both; }
.wel-logo .core-ring3 {
  position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; border-radius: 50%;
  border: 1px solid rgba(var(--core-glow), .4); transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
}
html.core-ignite .wel-logo .core-ring3 { animation: coreRing 1.7s .6s cubic-bezier(.2, .7, .2, 1) both; }

/* Judul Core: masuk halus */
.wel-title.core-swap, .wel-sub.core-swap { animation: coreTitleIn .7s .35s ease-out both; }
@keyframes coreTitleIn {
  0%   { opacity: 0; transform: translateY(6px); filter: blur(4px); }
  100% { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.core-ignite .core-aura::after,
  html.core-ignite .input-box::after,
  html.core-ignite .wel-logo::before,
  html.core-ignite .wel-logo .core-ring3,
  .wel-title.core-swap, .wel-sub.core-swap { animation: none !important; }
}

/* ── V2 penguat (lebih berani) ── */
html.core-ignite .core-aura {
  background: radial-gradient(ellipse 95% 75% at 50% -8%,
    rgba(var(--core-glow), .60) 0%, rgba(var(--core-glow), .18) 45%, transparent 75%);
}
/* kilatan tipis seluruh kanvas */
.core-aura::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 100vh;
  background: rgba(var(--core-glow), .10); opacity: 0;
}
html.core-ignite .core-aura::before { animation: coreFlash .9s ease-out both; }
@keyframes coreFlash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }

html.core-ignite .wel-logo::after { border-width: 2px; border-color: rgba(var(--core-glow), 1); animation-name: coreRingBig; }
html.core-ignite .wel-logo::before { border-width: 1.5px; border-color: rgba(var(--core-glow), .8); animation-name: coreRingBig; }
html.core-ignite .wel-logo .core-ring3 { border-color: rgba(var(--core-glow), .6); animation-name: coreRingBig; }
@keyframes coreRingBig {
  0%   { transform: translate(-50%, -50%) scale(.7); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(5.5); opacity: 0; }
}
html.core-ignite .wel-logo img { animation: coreLogoBig 1.6s ease-out both; }
@keyframes coreLogoBig {
  0%   { filter: drop-shadow(0 0 0 rgba(var(--core-glow), 0)) brightness(1); transform: scale(1); }
  30%  { filter: drop-shadow(0 0 34px rgba(var(--core-glow), 1)) brightness(1.5); transform: scale(1.12); }
  100% { filter: drop-shadow(0 0 0 rgba(var(--core-glow), 0)) brightness(1); transform: scale(1); }
}
.wel-title.core-swap em { animation: coreWordGlow 1.8s .45s ease-out both; }
@keyframes coreWordGlow {
  0%   { text-shadow: 0 0 0 rgba(var(--core-glow), 0); }
  35%  { text-shadow: 0 0 22px rgba(var(--core-glow), .95), 0 0 2px rgba(255, 230, 190, .8); }
  100% { text-shadow: 0 0 0 rgba(var(--core-glow), 0); }
}
html.core-ignite .input-box::after { padding: 2px; }
@keyframes coreComposerPulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--core-glow), .6), 0 12px 32px rgba(0,0,0,.28); }
  40%  { box-shadow: 0 0 0 5px rgba(var(--core-glow), .18), 0 0 60px rgba(var(--core-glow), .45); }
  100% { box-shadow: 0 0 0 0 rgba(var(--core-glow), 0), 0 12px 32px rgba(0,0,0,.28); }
}
@media (prefers-reduced-motion: reduce) {
  html.core-ignite .core-aura::before, .wel-title.core-swap em { animation: none !important; }
}

/* ── CORE_STAGE_TRACK_V1: panel tahapan Core ── */
.msg.core-tracking .reason-wrap,
.msg.core-tracking .typing,
.msg.core-tracking .agentic-indicator,
.msg.core-tracking .deep-badge { display: none !important; }

.core-track { margin: 2px 0 14px; max-width: 520px; animation: ctIn .45s ease-out both; }
@keyframes ctIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ct-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tx-3); }
.ct-mark {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: rgb(var(--core-glow)); box-shadow: 0 0 0 0 rgba(var(--core-glow), .6);
  animation: ctBeat 1.8s ease-out infinite;
}
.core-track.collapsed .ct-mark { animation: none; box-shadow: none; }
@keyframes ctBeat { 0% { box-shadow: 0 0 0 0 rgba(var(--core-glow), .55); } 100% { box-shadow: 0 0 0 9px rgba(var(--core-glow), 0); } }
.ct-title { font-weight: 600; color: var(--tx); letter-spacing: .01em; }
.ct-model { color: var(--tx-3); }
.ct-time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--tx-3); }

.ct-rail { position: relative; height: 2px; margin: 10px 0 12px; background: var(--brd); border-radius: 2px; overflow: hidden; }
.ct-rail span {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px;
  background: linear-gradient(90deg, rgba(var(--core-glow), .55), rgb(var(--core-glow)));
  transition: width .8s cubic-bezier(.2, .7, .2, 1);
}
.ct-rail span::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 60px; right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 236, 205, .9), transparent);
  animation: ctShine 1.6s ease-in-out infinite;
}
@keyframes ctShine { 0% { transform: translateX(-120px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateX(40px); opacity: 0; } }

.ct-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ct-step { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.35; color: var(--tx-3); transition: color .3s ease; }
.ct-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; border: 1.5px solid var(--tx-4); transition: all .3s ease; }
.ct-step.done { color: var(--tx-2); }
.ct-step.done .ct-dot { background: rgb(var(--core-glow)); border-color: rgb(var(--core-glow)); }
.ct-step.active { color: var(--tx); }
.ct-step.active .ct-dot { border-color: rgb(var(--core-glow)); background: transparent; box-shadow: 0 0 0 3px rgba(var(--core-glow), .18); animation: ctBeat 1.8s ease-out infinite; }
.ct-step.active .ct-label {
  background: linear-gradient(90deg, var(--tx) 0%, var(--tx) 40%, rgb(var(--core-glow)) 50%, var(--tx) 60%, var(--tx) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: ctText 2.4s linear infinite;
}
@keyframes ctText { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.ct-step.pending { color: var(--tx-4); }
.ct-step.failed { color: var(--tx-3); }
.ct-step.failed .ct-dot { border-color: var(--tx-3); }
.ct-note { margin-top: 12px; font-size: 12.5px; color: var(--tx-4); }

/* ringkas sesudah jawaban mulai */
.ct-sum {
  display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 3px 6px 3px 0;
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 13px; color: var(--tx-3);
}
.ct-sum:hover { color: var(--tx); }
.ct-sum svg { width: 12px; height: 12px; transition: transform .2s ease; }
.core-track.open .ct-sum svg { transform: rotate(90deg); }
.core-track.collapsed .ct-steps { display: none; margin-top: 8px; padding-left: 2px; gap: 7px; }
.core-track.collapsed.open .ct-steps { display: flex; }
.core-track.collapsed .ct-step { font-size: 13px; }
.core-track.collapsed { margin-bottom: 8px; }

/* STREAM_SENTENCE_PACE_V1: shorter, lighter fade so a sentence is sharp before the next arrives */
.m-txt .w { animation: wfadeSoft .35s ease-out both; }
.m-txt .w.done { animation: none; }
@keyframes wfadeSoft {
  from { opacity: 0; filter: blur(1.5px); transform: translateY(2px); }
  to   { opacity: 1; filter: blur(0); transform: none; }
}
.streaming-cursor {
  width: 8px !important; height: 8px !important; border-radius: 50% !important;
  margin-left: 4px !important; vertical-align: .05em !important;
  background: rgb(var(--core-glow)) !important;
  animation: cursorSoft 1.4s ease-in-out infinite !important;
}
@keyframes cursorSoft {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1); box-shadow: 0 0 10px rgba(var(--core-glow), .6); }
}

@media (prefers-reduced-motion: reduce) {
  .ct-mark, .ct-step.active .ct-dot, .ct-step.active .ct-label, .ct-rail span::after, .core-track { animation: none !important; }
  .ct-step.active .ct-label { -webkit-text-fill-color: currentColor; background: none; }
  .m-txt .w { animation: none !important; }
  .streaming-cursor { animation: none !important; }
}
/* label "Core" lama redundan bila panel tahapan ada */
.m-body:has(.core-track) .deep-badge { display: none !important; }

/* ===== from chat-sidebar-v2.css ===== */
/* CHAT_SIDEBAR_V2 (preview 2026-10-04): quieter sidebar, list grammar everywhere.
   Loaded last. Desktop only; mobile keeps mobile-patch/mobile-native rules. */
@media (min-width: 900px) {
  /* header: smaller mark so the list starts higher */
  .sb-top {
  margin-bottom: 0 !important;
}
  .sb-top .logo {
  padding: 2px 0 0 4px !important;
}
  
  .sb-top .logo-text {
  top: 0 !important;
}

  /* new chat + search share one 32px row */
  
  #sbSearchBar:not(.sb-search-open) { margin-bottom: 0 !important; }
  #sbSearchBar.sb-search-open { margin: 8px 0 0 !important; padding-bottom: 0 !important; }
  .sb-new {
  padding: 0 11px !important;
  justify-content: flex-start !important;
  gap: 10px !important;
}
  
  

  /* Naya / Research / Iris: rows like the rest of the sidebar, not a tab bar */
  .sb-dock {
  display: flex !important;
  flex-direction: column !important;
  margin: 6px 8px 0 !important;
  border: 0 !important;
}
  .sb-dock-item {
  flex-direction: row !important;
  justify-content: flex-start !important;
  gap: 11px !important;
}
  .sb-dock-item svg {
  flex-shrink: 0;
}
  .sb-dock-item span { font-size: 14px !important; font-weight: 400 !important; letter-spacing: 0 !important; }
  
  

  /* date groups: plain sentence-case caption, no tracked caps, no gold */
  
  
  .sb-group::first-letter { text-transform: uppercase; }
  .sb-list .sb-group:first-child { padding-top: 8px !important; }

  /* rows: lighter, shorter, fade instead of "..." */
  .sb-item {
  display: flex !important;
  align-items: center !important;
  letter-spacing: 0 !important;
}
  .sb-item .ti {
    overflow: hidden; white-space: nowrap; text-overflow: clip !important;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  

  /* active row: a soft filled surface, full-strength text */
  .sb-item.on, [data-theme="dark"] .sb-item.on, [data-theme="light"] .sb-item.on {
  letter-spacing: 0 !important;
}
  [data-theme="dark"] .sb-item.on::before, .sb-item.on::before { content: none !important; }
  
  .sb-item .acts { background: transparent !important; }

  /* folders: same row grammar as conversations */
  .sb-folders { padding: 0 8px 4px !important; }
  .fd-headrow { gap: 2px !important; }
  .fd-head { height: 32px !important; padding: 0 12px !important; border-radius: 8px !important; }
  .fd-head .nm { font-size: 14px !important; font-weight: 400 !important; color: var(--tx-2) !important; }
  .fd-head.scoped .nm { color: var(--tx) !important; font-weight: 500 !important; }
  .fd-gear { width: 32px !important; height: 32px !important; border-radius: 8px !important; }
  .fd-list.open { padding: 2px 0 6px !important; }
  .fd-row { height: 30px !important; padding: 0 12px 0 14px !important; gap: 10px !important; border-radius: 8px !important; font-size: 13.5px !important; font-weight: 400 !important; color: var(--tx-2) !important; }
  .fd-row:hover { background: color-mix(in srgb, var(--bg-2) 55%, transparent) !important; color: var(--tx) !important; }
  .fd-row.on { background: var(--bg-3) !important; color: var(--tx) !important; font-weight: 500 !important; }
  .fd-tick { width: 3px !important; height: 14px !important; border-radius: 2px !important; opacity: .55 !important; }
  .fd-row.on .fd-tick, .fd-head .fd-tick { opacity: 1 !important; }
  .fd-cnt { font-size: 12px !important; color: var(--tx-4) !important; }
}

/* folder manager modal (all widths) */
#fmOverlay { background: rgba(10, 9, 7, .62) !important; backdrop-filter: blur(3px) !important; }
#fmOverlay .fm-box { width: min(460px, 92vw) !important; border-radius: 14px !important; box-shadow: 0 24px 64px -16px rgba(0,0,0,.55) !important; }
#fmOverlay .fm-hdr { padding: 16px 16px 12px 22px !important; border-bottom: 0 !important; }
#fmOverlay .fm-hdr h3 { font-family: "Source Serif 4", Georgia, serif !important; font-size: 22px !important; font-weight: 400 !important; letter-spacing: -.01em !important; font-optical-sizing: auto; }
#fmOverlay .fm-hdr button { width: 32px; height: 32px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
#fmOverlay .fm-body { padding: 0 12px 12px !important; }
#fmOverlay .fm-intro { margin: 0 10px 12px; font-size: 13.5px; line-height: 1.5; color: var(--tx-3); }
#fmOverlay .fm-item { gap: 12px !important; padding: 10px 10px !important; border-radius: 10px !important; align-items: center !important; }
#fmOverlay .fm-item:hover { background: var(--bg-2) !important; }
#fmOverlay .fm-dot { width: 3px !important; min-height: 30px !important; align-self: stretch !important; border-radius: 2px !important; }
#fmOverlay .fm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#fmOverlay .fm-name { font-size: 14.5px !important; font-weight: 500 !important; color: var(--tx) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fmOverlay .fm-star { color: var(--ac); font-size: 11px; margin-right: 6px; }
#fmOverlay .fm-meta { font-size: 12.5px; color: var(--tx-3); }
#fmOverlay .fm-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
#fmOverlay .fm-item:hover .fm-acts, #fmOverlay .fm-item:focus-within .fm-acts { opacity: 1; }
@media (hover: none) { #fmOverlay .fm-acts { opacity: 1; } }
#fmOverlay .fm-act { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--tx-3); font: 500 12.5px/1 var(--font, Inter, sans-serif); cursor: pointer; display: inline-flex; align-items: center; }
#fmOverlay .fm-act:hover { background: var(--bg-3); color: var(--tx); }
#fmOverlay .fm-act-del { width: 28px; padding: 0; justify-content: center; }
#fmOverlay .fm-act-del svg { width: 15px; height: 15px; }
#fmOverlay .fm-act-del:hover { background: rgba(196, 84, 64, .14); color: #C9604A; }
#fmOverlay .fm-archived { opacity: .62; }
#fmOverlay .fm-arch-head { margin: 14px 10px 4px; padding-top: 12px; border-top: 1px solid var(--brd); font-size: 12.5px; font-weight: 500; color: var(--tx-3); }
#fmOverlay .fm-add { margin-top: 4px !important; padding: 10px !important; gap: 12px !important; font-size: 14px !important; font-weight: 500 !important; color: var(--tx-2) !important; width: 100%; border-radius: 10px !important; }
#fmOverlay .fm-add:hover { background: var(--bg-2) !important; color: var(--tx) !important; }
#fmOverlay .fm-plus { width: 3px; display: inline-flex; justify-content: center; font-size: 17px; line-height: 1; color: var(--tx-3); }

/* editor */
#fmOverlay .fm-editor { padding: 2px 10px 6px !important; gap: 18px !important; }
#fmOverlay .fm-field { display: flex; flex-direction: column; gap: 7px; }
#fmOverlay .fm-lab { font-size: 13px; font-weight: 500; color: var(--tx-2); text-transform: none; letter-spacing: 0; }
#fmOverlay .fm-help { margin-top: -3px; font-size: 12.5px; line-height: 1.45; color: var(--tx-3); }
#fmOverlay .fm-editor input:not([type=checkbox]), #fmOverlay .fm-editor textarea { border-radius: 9px !important; font-size: 14px !important; padding: 10px 12px !important; color: var(--tx) !important; }
#fmOverlay .fm-editor textarea::placeholder { color: var(--tx-4); }
#fmOverlay .fm-editor textarea { min-height: 116px; resize: vertical; line-height: 1.5; }
#fmOverlay .fm-colors { gap: 8px !important; }
#fmOverlay .fm-cbox { width: 24px !important; height: 24px !important; border-radius: 50% !important; border: 0 !important; padding: 0; cursor: pointer; }
#fmOverlay .fm-cbox:hover { transform: none !important; box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 3px var(--tx-4) !important; }
#fmOverlay .fm-cbox.on { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 3.5px var(--ac) !important; }
#fmOverlay .fm-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--tx-2); cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; }
#fmOverlay .fm-check input { width: 16px; height: 16px; accent-color: var(--ac); margin: 0; }

/* one way out per view: x closes the list, Save + back arrow in the editor */
#fmOverlay .fm-btn-cancel { display: none !important; }
#fmOverlay .fm-foot { padding: 12px 22px 18px !important; border-top: 0 !important; }
#fmOverlay .fm-foot:has(#fmSaveBtn[style*="none"]) { display: none !important; }
#fmOverlay .fm-btn-done { height: 36px; padding: 0 20px !important; border-radius: 9px !important; font-size: 14px !important; font-weight: 500 !important; background: var(--tx) !important; color: var(--bg-1) !important; }
#fmOverlay .fm-btn-done:hover { opacity: .88; }

/* 2. light sidebar is its own paper surface, a step darker than the white chat area */
@media (min-width: 900px) {
  [data-theme="light"] .sb { background: #F3EEE3 !important; border-right-color: rgba(31,24,18,.08) !important; }
  
  [data-theme="light"] .sb-new:hover { background: #FFFFFF !important; }
  
  
  
}

/* CHAT_ACCOUNTS_V2 (preview): account footer + account menu */
@media (min-width: 900px) {
  .sb-foot {
  gap: 2px !important;
}
  #accountTrigger {
  height: 44px !important;
  padding: 0 8px !important;
  gap: 10px !important;
}
  #accountTrigger:hover, #accountTrigger[aria-expanded="true"] { background: color-mix(in srgb, var(--bg-2) 70%, transparent) !important; }
  [data-theme="light"] #accountTrigger:hover, [data-theme="light"] #accountTrigger[aria-expanded="true"] { background: rgba(31,24,18,.045) !important; }
  #uAv {
  width: 30px !important;
  height: 30px !important;
  font-size: 13px !important;
}
  
  
  .acct-chevron { color: var(--tx-3) !important; }
  .sb-help { width: 32px !important; height: 32px !important; border-radius: 8px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; color: var(--tx-3) !important; }
  .sb-help:hover { background: color-mix(in srgb, var(--bg-2) 70%, transparent) !important; color: var(--tx) !important; }
}

#accountMenu { padding: 6px !important; border-radius: 12px !important; border: 1px solid var(--brd) !important; box-shadow: 0 18px 48px -12px rgba(0,0,0,.45) !important; }
[data-theme="light"] #accountMenu { background: #FFFFFF !important; box-shadow: 0 18px 48px -14px rgba(31,24,18,.22) !important; }
#accountMenu .account-menu-label { text-transform: none !important; letter-spacing: 0 !important; font-size: 12.5px !important; font-weight: 500 !important; color: var(--tx-3) !important; padding: 6px 10px 6px !important; }
#accountMenu .account-row { min-height: 50px !important; padding: 0 10px !important; gap: 11px !important; border-radius: 9px !important; }
#accountMenu .account-row:hover { background: var(--bg-2) !important; }
#accountMenu .account-row.active { background: var(--bg-3) !important; }
[data-theme="light"] #accountMenu .account-row:hover { background: #F6F2EA !important; }
[data-theme="light"] #accountMenu .account-row.active { background: #EFE8DA !important; }
#accountMenu .account-avatar { width: 30px !important; height: 30px !important; font-size: 13px !important; font-weight: 600 !important; color: #fff !important; border: 0 !important; }
#accountMenu .account-name { font-size: 14px !important; font-weight: 500 !important; color: var(--tx) !important; }
#accountMenu .account-email { font-size: 12.5px !important; color: var(--tx-3) !important; }
#accountMenu .account-check { color: var(--ac) !important; font-weight: 600 !important; font-size: 14px !important; }
#accountMenu .account-sep { margin: 6px 4px !important; height: 1px !important; background: var(--brd) !important; }
#accountMenu .account-action { height: 36px !important; padding: 0 10px !important; gap: 11px !important; display: flex !important; align-items: center !important; border-radius: 8px !important; font-size: 14px !important; font-weight: 400 !important; color: var(--tx-2) !important; text-align: left; }
#accountMenu .account-action svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--tx-3); }
#accountMenu .account-action:hover { background: var(--bg-2) !important; color: var(--tx) !important; }
#accountMenu .account-action:hover svg { color: var(--tx-2); }
[data-theme="light"] #accountMenu .account-action:hover { background: #F6F2EA !important; }
/* sign out: a muted brick, not alarm red */
#accountMenu .account-action.danger, #accountMenu .account-action.danger svg { color: #C9735E !important; }
[data-theme="light"] #accountMenu .account-action.danger, [data-theme="light"] #accountMenu .account-action.danger svg { color: #A5503B !important; }
#accountMenu .account-action.danger:hover { background: rgba(196, 96, 74, .12) !important; }
#accountMenu .account-max { font-size: 12.5px !important; color: var(--tx-3) !important; padding: 8px 10px !important; }

/* ===== from chat-polish-v2.css ===== */
/* CHAT_MOBILE_SIDEBAR_V2 + CHAT_MODALS_V2 (2026-10-04). Loaded after chat-sidebar-v2.css.
   Mobile gets the desktop sidebar grammar at touch sizes; every .modal gets the
   Folders/Settings modal treatment. */

/* ── mobile sidebar (<900px): same rules as desktop, touch-sized rows ── */
@media (max-width: 899px) {
  .sb-top { padding: 12px 14px 0 !important; margin-bottom: 0 !important; }
  .sb-top .logo { padding: 2px 0 0 2px !important; gap: 2px !important; }
  .sb-top .logo img { width: 28px !important; height: 28px !important; }
  .sb-top .logo-text { font-size: 22px !important; top: 0 !important; }

  .sb-actions { padding: 14px 14px 0 !important; gap: 8px !important; }
  #sbSearchBar:not(.sb-search-open) { margin-bottom: 0 !important; }
  #sbSearchBar.sb-search-open { margin: 8px 0 0 !important; padding-bottom: 0 !important; }
  .sb-new {
  height: 42px !important;
  padding: 0 14px !important;
  font-size: 15px !important;
  justify-content: flex-start !important;
  gap: 10px !important;
}
  .sb-search-btn {
  width: 42px !important;
  height: 42px !important;
  border-radius: 11px !important;
}

  .sb-dock { display: flex !important; flex-direction: column !important; gap: 1px !important; padding: 0 !important; margin: 8px 10px 0 !important; border: 0 !important; }
  .sb-dock-item {
  flex-direction: row !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  height: 42px !important;
  padding: 0 12px !important;
}
  .sb-dock-item svg { width: 18px !important; height: 18px !important; flex-shrink: 0; opacity: .85; }
  .sb-dock-item span { font-size: 15px !important; font-weight: 400 !important; letter-spacing: 0 !important; }
  .sb-divider { margin: 8px 22px 6px !important; }

  .sb-list { padding: 0 10px !important; }
  .sb-group, [data-theme="dark"] .sb-group {
  padding: 18px 12px 6px !important;
}
  .sb-group::first-letter { text-transform: uppercase; }
  .sb-list .sb-group:first-child { padding-top: 10px !important; }

  .sb-item {
  min-height: 42px !important;
  padding: 0 8px 0 12px !important;
  display: flex !important;
  align-items: center !important;
  font-size: 15px !important;
  letter-spacing: 0 !important;
}
  .sb-item .ti {
    overflow: hidden; white-space: nowrap; text-overflow: clip !important;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }
  .sb-item.on, [data-theme="dark"] .sb-item.on, [data-theme="light"] .sb-item.on {
  letter-spacing: 0 !important;
}
  [data-theme="dark"] .sb-item.on::before, .sb-item.on::before { content: none !important; }
  .sb-item .acts { background: transparent !important; }

  .sb-folders { padding: 0 10px 4px !important; }
  .fd-headrow { gap: 2px !important; }
  .fd-head { height: 42px !important; padding: 0 12px !important; border-radius: 10px !important; }
  .fd-head .nm { font-size: 15px !important; font-weight: 400 !important; color: var(--tx-2) !important; }
  .fd-head.scoped .nm { color: var(--tx) !important; font-weight: 500 !important; }
  .fd-gear { width: 42px !important; height: 42px !important; border-radius: 10px !important; }
  .fd-gear svg { width: 16px !important; height: 16px !important; }
  .fd-list.open { padding: 2px 0 6px !important; max-height: 400px !important; }
  .fd-row { height: 40px !important; padding: 0 12px 0 14px !important; gap: 12px !important; border-radius: 10px !important; font-size: 14.5px !important; font-weight: 400 !important; color: var(--tx-2) !important; }
  .fd-row.on { background: var(--bg-3) !important; color: var(--tx) !important; font-weight: 500 !important; }
  .fd-tick { width: 3px !important; height: 16px !important; border-radius: 2px !important; opacity: .55 !important; }
  .fd-row.on .fd-tick, .fd-head .fd-tick { opacity: 1 !important; }
  .fd-cnt { font-size: 13px !important; color: var(--tx-4) !important; }

  .sb-foot { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)) !important; gap: 4px !important; }
  #accountTrigger { height: 52px !important; padding: 0 8px !important; border-radius: 12px !important; gap: 11px !important; }
  #uAv {
  width: 34px !important;
  height: 34px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}
  #uNm { font-size: 15px !important; font-weight: 500 !important; color: var(--tx) !important; }
  #uEm { font-size: 13px !important; color: var(--tx-3) !important; }
  .acct-chevron { color: var(--tx-3) !important; }
  .sb-help { width: 42px !important; height: 42px !important; border-radius: 10px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; color: var(--tx-3) !important; }

  
  
  
  
  #accountMenu .account-row { min-height: 54px !important; }
  #accountMenu .account-action { height: 44px !important; font-size: 15px !important; }
}

/* ── every .modal: serif title, no rules, one quiet primary ── */
.modal-bg .modal { border-radius: 14px !important; box-shadow: 0 24px 64px -16px rgba(0,0,0,.55) !important; }
.modal-bg .modal-head { border-bottom: 0 !important; padding: 18px 16px 6px 24px !important; }
.modal-bg .modal-title {
  font-family: "Source Serif 4", Georgia, serif !important; font-size: 22px !important;
  font-weight: 400 !important; letter-spacing: -.01em !important; font-optical-sizing: auto; gap: 0 !important;
}
.modal-bg .modal-title > svg { display: none !important; }
.modal-bg .modal-x { width: 32px !important; height: 32px !important; }
.modal-bg .modal-foot { border-top: 0 !important; padding: 10px 24px 20px !important; }
.modal-bg .modal .btn { height: 38px; padding: 0 18px !important; border-radius: 9px !important; font-size: 14px !important; font-weight: 500 !important; }
.modal-bg .modal .btn-primary { background: var(--tx) !important; color: var(--bg-1) !important; border-color: var(--tx) !important; filter: none !important; }
.modal-bg .modal .btn-primary:hover { opacity: .88; }
.modal-bg .modal .btn-ghost { background: transparent !important; border: 1px solid var(--brd) !important; color: var(--tx-2) !important; }
.modal-bg .modal .btn-ghost:hover { background: var(--bg-2) !important; color: var(--tx) !important; }
.modal-bg .modal :focus-visible { outline: 2px solid var(--ac) !important; outline-offset: 2px !important; }

/* share: the warning is a note, not an alert box */
#shareModal .share-warn { background: transparent !important; border: 0 !important; border-left: 2px solid var(--ac) !important; border-radius: 0 !important; padding: 2px 0 2px 12px !important; color: var(--tx-2) !important; }

/* what's new: sentence-case tags, no traffic-light pills, no mono dates */
#clModal .cl-version { font-family: "Source Serif 4", Georgia, serif !important; font-weight: 600 !important; font-size: 17px !important; }
#clModal .cl-date { font-family: Inter, system-ui, sans-serif !important; font-weight: 400 !important; font-size: 12.5px !important; color: var(--tx-3) !important; }
#clModal .cl-tag { background: none !important; padding: 0 !important; width: 70px; font-size: 12.5px !important; font-weight: 500 !important; color: var(--tx-3) !important; text-transform: lowercase; }
#clModal .cl-tag::first-letter { text-transform: uppercase; }
#clModal .cl-new { color: var(--ac) !important; }

/* daily limit card */
#limitModal .limit-card { border-radius: 14px !important; }
#limitModal .limit-card > div:first-child:not(:has(a)) { display: none !important; }
#limitModal .limit-card h2 { font-family: "Source Serif 4", Georgia, serif !important; font-weight: 400 !important; font-size: 24px !important; letter-spacing: -.01em !important; }
#limitModal .limit-card .btn-register { padding: 0 22px !important; height: 40px; display: inline-flex !important; align-items: center; border-radius: 10px !important; background: var(--tx) !important; color: var(--bg-1) !important; font-size: 14.5px !important; font-weight: 500 !important; filter: none !important; }

/* mobile: the always-visible ⋮ owns its own space; help icon keeps its size */
@media (max-width: 899px) {
  .sb-item { padding-right: 40px !important; position: relative; }
  .sb-item .acts { right: 6px !important; }
  .sb-help { flex-shrink: 0 !important; }
  .sb-help svg { width: 19px !important; height: 19px !important; min-width: 19px !important; flex-shrink: 0 !important; opacity: 1 !important; }
}

/* small screens: modal buttons never squash or wrap their label */
.modal-bg .modal .btn { white-space: nowrap; }
@media (max-width: 520px) {
  .modal-bg .modal-foot { flex-wrap: wrap !important; gap: 8px !important; padding: 10px 20px 20px !important; }
  .modal-bg .modal-foot > .btn { flex: 1 1 0; height: 44px !important; }
  #shareModal .modal-foot { flex-direction: column-reverse !important; }
  #shareModal .modal-foot > .btn { flex: none !important; width: 100%; }
  #shareModal .modal-foot > div {
  margin-left: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px !important;
}
  #shareModal .modal-foot > div #shareBtn { grid-column: 1 / -1; grid-row: 1; }
  #shareModal .modal-foot .btn { height: 44px !important; width: 100%; font-size: 14px !important; padding: 0 12px !important; }
}
