/* ═══════════════════════════════════════════════════════════════
   KAALIYE AI — style.css (Premium Claude Aesthetic)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --miig:      #7B3F7A;
  --miig-lt:   #a855a8;
  --teal:      #00B5A5;
  --teal-lt:   #00d4c2;
  --teal-dk:   #008f82;
  --accent:    linear-gradient(135deg, var(--teal), var(--miig));

  /* Claude-style Dark Theme (default) */
  --bg:        #191918;
  --bg2:       #1e1e1d;
  --surface:   #222220;
  --surface2:  #2c2b29;
  --surface3:  #353431;
  --border:    rgba(230,228,222,0.08);
  --border2:   rgba(255,255,255,0.05);
  --text:      #e6e4de;
  --text2:     #b5b3ad;
  --muted:     #7c7a72;
  --shadow:    0 8px 32px rgba(0,0,0,0.25);
  --user-bg:   #2c2b29;
  --user-text: #e6e4de;
  --bot-bg:    transparent;
}

[data-theme="light"] {
  /* Claude-style Light Theme */
  --bg:        #f9f8f6;
  --bg2:       #f3f0e9;
  --surface:   #eae6dd;
  --surface2:  #f5f3ef;
  --surface3:  #eae6dd;
  --border:    rgba(123,63,122,0.08);
  --border2:   rgba(0,0,0,0.04);
  --text:      #191919;
  --text2:     #5a5750;
  --muted:     #9b988f;
  --shadow:    0 8px 24px rgba(0,0,0,0.04);
  --user-bg:   #eae6dd;
  --user-text: #191919;
  --bot-bg:    transparent;
}

/* ─── RESET & SMOOTHING ──────────────────────────────────────── */
*, *::before, *::after { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}
html, body { 
  height: 100%; 
  overflow: hidden; 
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* Global transition for theme switching */
body, .app, .sidebar, .main, .chat-header, .input-card, .bubble {
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 50;
}

.sidebar-top {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--miig), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  color: #fff;
}
.logo-text { font-weight: 700; font-size: 15px; color: var(--text); }
.logo-sub  { font-size: 11px; color: var(--muted); }

.new-chat-btn {
  margin: 12px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}
.new-chat-btn:hover {
  background: var(--surface3);
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-1px);
}

/* Sidebar tabs */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  gap: 4px;
}
.sidebar-tab {
  flex: 1;
  padding: 10px 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.sidebar-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}
.sidebar-tab:hover:not(.active) { color: var(--text2); }

/* Sidebar panels */
.sidebar-panel { display: none; flex: 1; overflow-y: auto; flex-direction: column; }
.sidebar-panel.active { display: flex; }
.sidebar-panel::-webkit-scrollbar { width: 4px; }
.sidebar-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* Chat history */
.history-group { padding: 12px 12px 0; }
.history-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted);
  padding: 4px 6px 6px;
}
.session-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  margin-bottom: 2px;
}
.session-item:hover { background: var(--surface2); }
.session-item.active { background: rgba(0,181,165,0.08); }
.session-item.active .session-title { color: var(--teal); font-weight: 600; }
.session-icon { font-size: 14px; flex-shrink: 0; opacity: 0.7; }
.session-info { flex: 1; min-width: 0; }
.session-title {
  font-size: 13px;
  color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.session-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.session-del {
  opacity: 0; background: transparent; border: none;
  color: var(--muted); cursor: pointer; font-size: 14px;
  padding: 2px 4px; border-radius: 4px; transition: all .15s; flex-shrink: 0;
}
.session-item:hover .session-del { opacity: 1; }
.session-del:hover { color: #f87171; }
.no-sessions { text-align: center; color: var(--muted); font-size: 13px; padding: 32px 16px; }

/* Skills panel */
.skills-header {
  padding: 14px 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.skills-header-title { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; }
.add-skill-btn {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--teal);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.add-skill-btn:hover { background: rgba(0,181,165,0.08); border-color: var(--teal); }

.skill-item {
  margin: 4px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.skill-item:hover { border-color: rgba(0,181,165,0.3); background: var(--surface3); }
.skill-item.active { border-color: var(--teal); background: rgba(0,181,165,0.06); }
.skill-icon { font-size: 18px; flex-shrink: 0; }
.skill-info { flex: 1; min-width: 0; }
.skill-name { font-size: 13px; font-weight: 600; color: var(--text); }
.skill-desc { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill-del {
  opacity: 0; background: transparent; border: none;
  color: var(--muted); cursor: pointer; font-size: 13px;
  padding: 2px 4px; border-radius: 4px; transition: .15s;
}
.skill-item:hover .skill-del { opacity: 1; }
.skill-del:hover { color: #f87171; }
.no-skills { text-align: center; color: var(--muted); font-size: 13px; padding: 32px 16px; line-height: 1.7; }

/* Quick topics */
.quick-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  transition: background .15s;
}
.quick-btn:hover { background: var(--surface2); color: var(--text); }
.quick-icon { font-size: 15px; flex-shrink: 0; opacity: 0.8; }
.quick-label { font-weight: 600; font-size: 12px; color: var(--text); }
.quick-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* Sidebar bottom — user profile */
.sidebar-bottom {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--miig), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; overflow: hidden;
  color: #fff;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 11px; }
.plan-free { color: var(--muted); }
.plan-pro  { color: var(--teal); font-weight: 600; }
.plan-business { color: var(--miig-lt); font-weight: 600; }
.settings-btn {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 16px; padding: 4px; border-radius: 6px; transition: .2s;
}
.settings-btn:hover { color: var(--text2); background: var(--surface2); }

/* ─── MAIN AREA ──────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

/* Header */
.chat-header {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(25, 25, 24, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 40;
}
[data-theme="light"] .chat-header {
  background: rgba(249, 248, 246, 0.85);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.menu-btn {
  display: none;
  background: transparent; border: none; color: var(--text2);
  cursor: pointer; padding: 6px; border-radius: 8px; font-size: 18px; transition: .2s;
}
.menu-btn:hover { background: var(--surface2); color: var(--text); }

.agent-info { display: flex; align-items: center; gap: 10px; }
.agent-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--miig), var(--teal));
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  position: relative;
  color: #fff;
}
.agent-dot {
  position: absolute; bottom: 0; right: 0;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); border: 2px solid var(--bg);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.5} }
.agent-name { font-size: 14px; font-weight: 700; color: var(--text); }
.agent-sub  { font-size: 11px; color: var(--muted); }

/* Active skill badge */
.active-skill-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(0,181,165,0.1);
  border: 1px solid rgba(0,181,165,0.2);
  font-size: 12px; color: var(--teal); font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.active-skill-badge:hover { background: rgba(0,181,165,0.15); border-color: var(--teal); }
.active-skill-badge .close-skill { font-size: 14px; opacity: .7; }

.header-right { display: flex; align-items: center; gap: 8px; }

/* Header new chat button (visible on mobile only) */
.header-new-chat-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%;
  align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.header-new-chat-btn:hover {
  background: var(--surface2);
  border-color: var(--teal);
  color: var(--teal);
}

.icon-btn {
  background: transparent; border: 1px solid var(--border2);
  color: var(--text2); cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all .2s;
}
.icon-btn:hover { background: var(--surface2); border-color: var(--teal); color: var(--text); }

.lang-toggle {
  display: flex; border: 1px solid var(--border2); border-radius: 8px; overflow: hidden;
}
.lang-btn {
  padding: 6px 10px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; font-family: inherit;
  font-size: 11px; font-weight: 700; transition: all .15s;
}
.lang-btn.active { background: var(--teal); color: #fff; }

/* Provider badge */
.provider-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border2);
  font-size: 11px; color: var(--text2); font-weight: 600;
}
.provider-badge.free-badge { border-color: rgba(34,197,94,.2); color: #4ade80; }
.provider-badge.streaming { animation: glow-pulse 1.5s ease-in-out infinite; }
@keyframes glow-pulse { 0%,100%{box-shadow:none} 50%{box-shadow:0 0 12px rgba(0,181,165,.3)} }

/* ─── MESSAGES ───────────────────────────────────────────────── */
.messages {
  flex: 1; overflow-y: auto;
  padding: 32px 0 16px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.msg-group { 
  width: 100%; 
  max-width: 800px; 
  margin: 0 auto; 
  padding: 0 20px; 
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Centered welcome layout when empty chat */
.msg-group:has(#welcome-card) {
  justify-content: center;
  align-items: center;
}

.msg { display: flex; gap: 16px; margin-bottom: 24px; animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
.msg.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  align-self: flex-start; margin-top: 2px;
  overflow: hidden;
  color: #fff;
}
.msg.bot  .msg-avatar { background: linear-gradient(135deg, var(--miig), var(--teal)); }
.msg.user .msg-avatar { background: var(--surface3); border: 1px solid var(--border); }
.msg.user .msg-avatar img { width:100%; height:100%; object-fit:cover; }

.msg-body { max-width: 80%; display: flex; flex-direction: column; gap: 4px; }
.msg.user .msg-body { align-items: flex-end; }

.msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.msg-name { font-size: 12px; font-weight: 700; color: var(--text2); }
.msg-time { font-size: 11px; color: var(--muted); }

.bubble {
  padding: 12px 18px;
  border-radius: 18px;
  line-height: 1.65;
  word-break: break-word;
  font-size: 14.5px;
}
.msg.bot .bubble {
  background: var(--bot-bg);
  color: var(--text);
  padding: 4px 0 12px 0;
}
.msg.user .bubble {
  background: var(--user-bg);
  color: var(--user-text);
  border-radius: 18px 18px 4px 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* Markdown styling in bot output */
.bubble p { margin-bottom: 12px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 8px 0 12px 20px; }
.bubble li { margin-bottom: 6px; }
.bubble h1, .bubble h2, .bubble h3 { margin: 18px 0 8px; font-weight: 700; color: var(--text); line-height: 1.3; }
.bubble h1 { font-size: 1.6rem; }
.bubble h2 { font-size: 1.3rem; }
.bubble h3 { font-size: 1.1rem; color: var(--teal-lt); }
[data-theme="light"] .bubble h3 { color: var(--teal-dk); }
.bubble strong { color: var(--text); font-weight: 600; }
.bubble code:not(pre code) {
  background: rgba(0,181,165,0.1); color: var(--teal-lt);
  padding: 2px 6px; border-radius: 6px; font-family: 'DM Mono', monospace; font-size: 12px;
  border: 1px solid rgba(0,181,165,0.15);
}
[data-theme="light"] .bubble code:not(pre code) {
  color: var(--miig); background: rgba(123,63,122,0.06); border-color: rgba(123,63,122,0.1);
}
.bubble a { color: var(--teal-lt); text-decoration: underline; text-underline-offset: 3px; }
[data-theme="light"] .bubble a { color: var(--teal-dk); }

/* Code block */
.code-block {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); margin: 12px 0; font-size: 12.5px;
  box-shadow: var(--shadow);
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid var(--border);
}
.code-lang { font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; text-transform: uppercase; font-weight: 600; }
.copy-code-btn {
  background: transparent; border: 1px solid var(--border2);
  color: var(--text2); cursor: pointer; font-size: 11px;
  padding: 3px 10px; border-radius: 6px; font-family: inherit; transition: .2s;
}
.copy-code-btn:hover { border-color: var(--teal); color: var(--teal); background: rgba(0,181,165,0.06); }
.code-block pre { padding: 14px; overflow-x: auto; background: var(--bg2) !important; }

/* Message actions */
.msg-actions { display: flex; gap: 6px; margin-top: 6px; }
.msg-action-btn {
  background: transparent; border: 1px solid var(--border2);
  color: var(--muted); cursor: pointer; font-size: 11px;
  padding: 3px 8px; border-radius: 6px; font-family: inherit; transition: .2s;
}
.msg-action-btn:hover { border-color: var(--teal); color: var(--teal); background: rgba(0,181,165,0.05); }
.msg.user .msg-actions { justify-content: flex-end; }
.feedback-btn {
  background: transparent; border: none; cursor: pointer;
  font-size: 14px; padding: 2px 4px; border-radius: 4px; transition: .15s; opacity: .5;
}
.feedback-btn:hover, .feedback-btn.active { opacity: 1; }

/* Typing dots */
.typing { display: flex; align-items: center; gap: 5px; padding: 14px 0; }
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal); animation: bounce .8s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.stream-cursor::after {
  content: '▋'; color: var(--teal); animation: blink 1s step-start infinite;
}
@keyframes blink { 50%{ opacity:0 } }

/* Welcome card (Centered Claude-like style) */
.welcome-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px 10px;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.welcome-title { 
  font-size: 2.2rem; 
  font-weight: 500; 
  margin-bottom: 4px; 
  letter-spacing: -1px; 
  color: var(--text);
  line-height: 1.2;
}
.welcome-sub { 
  color: var(--text2); 
  font-size: 15px; 
  line-height: 1.6; 
  margin-bottom: 12px; 
  max-width: 420px;
}
.welcome-chips { 
  display: flex; 
  flex-direction: column;
  gap: 8px; 
  width: 100%;
  margin-top: 10px;
}
.welcome-chip {
  padding: 12px 16px; 
  border-radius: 14px;
  border: 1px solid var(--border); 
  background: var(--surface2);
  color: var(--text); 
  cursor: pointer; 
  font-family: inherit; 
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.welcome-chip::after {
  content: '→';
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s ease;
  color: var(--teal);
  font-weight: 700;
}
.welcome-chip:hover { 
  border-color: var(--teal); 
  background: rgba(0,181,165,.04); 
}
.welcome-chip:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* ─── INPUT AREA (Claude Floating Capsule Style) ───────────────── */
.input-area {
  flex-shrink: 0;
  padding: 16px 20px 24px;
  background: transparent;
}

.input-card {
  max-width: 800px;
  margin: 0 auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 16px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow), 0 12px 40px rgba(0,0,0,0.12);
  transition: all 0.2s ease;
}
.input-card:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal), var(--shadow), 0 12px 40px rgba(0,0,0,0.15);
}

.input-card textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 4px 0;
  min-height: 36px;
  max-height: 180px;
  line-height: 1.5;
}
.input-card textarea::placeholder { color: var(--muted); }

.input-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  gap: 10px;
}

.input-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--border2); 
  background: var(--surface3);
  color: var(--text2); cursor: pointer; font-family: inherit; font-size: 11.5px;
  font-weight: 600;
  transition: all .2s;
}
.toolbar-btn:hover { border-color: var(--teal); color: var(--teal); background: rgba(0,181,165,.05); }

.send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent);
  border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0; transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,181,165,0.2);
}
.send-btn:hover { transform: scale(1.05); box-shadow: 0 6px 14px rgba(0,181,165,0.3); }
.send-btn:disabled { opacity: .25; cursor: not-allowed; transform: none; box-shadow: none; }

.input-hint { font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; }

/* ─── MODALS ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  transform: scale(.95); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.modal-sub { font-size: 13px; color: var(--text2); margin-bottom: 20px; }
.modal label { display: block; font-size: 11px; font-weight: 700; color: var(--text2); margin-bottom: 6px; margin-top: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.modal input, .modal textarea, .modal select {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); font-family: inherit; font-size: 14px;
  outline: none; transition: border-color .2s;
}
.modal input:focus, .modal textarea:focus { border-color: var(--teal); }
.modal textarea { min-height: 80px; resize: vertical; }
.modal-emoji-grid {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.emoji-opt {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border2);
  background: var(--surface3); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.emoji-opt.selected { border-color: var(--teal); background: rgba(0,181,165,.1); }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end; }
.modal-btn {
  padding: 10px 20px; border-radius: 12px; border: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; transition: all .2s;
}
.modal-btn-cancel { background: var(--surface3); color: var(--text2); }
.modal-btn-cancel:hover { background: var(--surface2); color: var(--text); }
.modal-btn-save {
  background: var(--accent);
  color: #fff; box-shadow: 0 4px 12px rgba(0,181,165,.2);
}
.modal-btn-save:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,181,165,.35); }

/* ─── SIDEBAR MOBILE OVERLAY ─────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 40;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ─── TOAST ──────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(60px);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 20px; border-radius: 12px;
  font-size: 13px; z-index: 999; opacity: 0; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
  box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── SYNC STATUS ────────────────────────────────────────────── */
.sync-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal); margin-left: 4px; flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
.sync-dot.syncing { animation: spin-dot .8s linear infinite; background: #eab308; }
.sync-dot.error   { background: #f87171; animation: none; }
@keyframes spin-dot { to { transform: rotate(360deg); } }

/* ─── PREMIUM RATELIMIT CARD (CLAUDE SCREENSHOT STYLE) ─── */
.limit-card {
  max-width: 800px;
  width: 100%;
  margin: -1px auto 0 auto; /* Negative margin to attach cleanly to the bottom of input-card */
  background: #111110; /* Solid deep black matching screenshot */
  border: 1px solid var(--border);
  border-radius: 0 0 24px 24px;
  padding: 12px 24px;
  display: none; /* hidden by default, set to flex when active */
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text2);
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: limitSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes limitSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-theme="light"] .limit-card {
  background: #eae6dd;
  color: var(--text2);
  border-color: var(--border);
}

.limit-card-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.limit-link-underline {
  color: inherit !important;
  text-decoration: underline !important;
  cursor: default;
}

.limit-keep-working {
  color: var(--text) !important;
  font-weight: 600;
  text-decoration: underline !important;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.limit-keep-working:hover {
  opacity: 0.8;
}

/* When limit card is active, flatten bottom corners of input-card */
.input-card.limit-active {
  border-radius: 24px 24px 0 0 !important;
}

/* ─── RESPONSIVE (CLAUDE APP EXACTLY) ────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 280px;
    z-index: 100;
    transform: translateX(-100%);
    box-shadow: 20px 0 40px rgba(0,0,0,0.25);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg2);
  }
  .sidebar.open { transform: translateX(0); }
  
  .sidebar-overlay { 
    display: block; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s ease; 
    z-index: 90;
  }
  .sidebar-overlay.visible { opacity: 1; pointer-events: all; }
  
  .menu-btn { display: flex; }
  .header-right .provider-badge { display: none; }
  
  /* Show new chat icon in header on mobile */
  .header-new-chat-btn { display: flex; }

  .msg-group {
    padding: 0 12px;
  }
  .msg {
    gap: 10px;
    margin-bottom: 20px;
  }
  .msg-body {
    max-width: 90%; /* Wider flow on mobile */
  }
  .bubble {
    padding: 10px 14px;
    font-size: 14px;
  }
  .msg.bot .bubble {
    padding: 4px 0 8px 0;
  }

  .chat-header {
    padding: 0 12px;
  }
  
  .input-area {
    padding: 8px 12px 16px;
  }
  
  .input-card {
    border-radius: 20px;
    padding: 10px 12px 8px 12px;
  }
  
  .input-card textarea {
    font-size: 14px;
    min-height: 32px;
  }
  
  .send-btn {
    width: 32px;
    height: 32px;
  }
  
  .welcome-title {
    font-size: 1.8rem;
  }
  .welcome-sub {
    font-size: 13.5px;
  }
}

/* ─── PROFILE DROPDOWN MENU ─────────────────────────────────── */
.profile-menu {
  position: absolute;
  bottom: 60px;
  left: 16px;
  width: 228px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow), 0 10px 30px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 120;
  animation: menuFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-menu.open {
  display: flex;
}
@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.profile-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 10px 8px;
}
.profile-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--miig), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  overflow: hidden;
}
.profile-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-menu-info {
  flex: 1;
  min-width: 0;
}
.profile-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-menu-email {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-menu-divider {
  height: 1px;
  background: var(--border2);
  margin: 6px 0;
}
.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.profile-menu-item:hover {
  background: var(--surface3);
  color: var(--text);
}
.profile-menu-item.logout-btn {
  color: #f87171 !important;
}
.profile-menu-item.logout-btn:hover {
  background: rgba(239, 68, 68, 0.08) !important;
}

#sidebar-bottom {
  cursor: pointer;
  transition: background 0.15s ease;
}
#sidebar-bottom:hover {
  background: var(--surface2);
}

/* ─── CLAUDE PROJECTS & CUSTOMIZE STYLING ADDITIONS ──────────────── */

.serif-title {
  font-family: 'Lora', Georgia, serif;
  font-weight: 500;
  color: var(--text);
}

.mac-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mac-dots span {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.top-actions { display: flex; gap: 8px; margin-left: auto; }
.top-action-btn {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 14px; padding: 4px; border-radius: 4px; transition: .2s;
}
.top-action-btn:hover { color: var(--text); background: var(--surface); }

.sidebar-pills {
  display: flex;
  margin: 4px 12px 10px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  gap: 2px;
}
.sidebar-pill {
  flex: 1;
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.sidebar-pill.active {
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border: 1px solid var(--border2);
}
[data-theme="light"] .sidebar-pill.active {
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}
.sidebar-pill:hover:not(.active) { color: var(--text2); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
}
.pane-nav-item, .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  width: 100%;
  transition: all 0.2s;
}
.pane-nav-item:hover, .nav-item:hover { background: var(--surface); color: var(--text); }
.pane-nav-item.active, .nav-item.active { background: var(--surface); color: var(--text); font-weight: 700; border: 1px solid var(--border2); }
[data-theme="light"] .pane-nav-item.active, .nav-item.active { border-color: var(--border); }
.nav-icon { font-size: 14px; opacity: 0.8; }

.recents-header {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted);
  padding: 12px 24px 6px;
}

.view-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.view-panel.active {
  display: flex;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.model-select-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--surface3);
  border: 1px solid var(--border2);
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.model-select-badge:hover { border-color: var(--teal); color: var(--text); }
.model-badge-chevron { font-size: 9px; opacity: 0.7; }

.audio-btn {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 14px; padding: 6px; border-radius: 50%;
  transition: .2s; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
}
.audio-btn:hover { background: var(--surface3); color: var(--text); }

.input-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Projects Dashboard */
.projects-dashboard {
  flex: 1;
  overflow-y: auto;
  padding: 40px 48px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .projects-dashboard { padding: 20px 16px; }
}
.projects-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.projects-actions { display: flex; align-items: center; gap: 8px; }
.btn {
  padding: 8px 16px; border-radius: 20px; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-black { background: var(--text); color: var(--bg); }
.btn-black:hover { transform: translateY(-1px); opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { background: var(--surface2); color: var(--text); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  position: relative;
  text-align: left;
}
.project-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.project-card-title { font-family: 'Lora', serif; font-size: 16px; font-weight: 600; color: var(--text); }
.project-card-desc { font-size: 12.5px; color: var(--text2); line-height: 1.5; min-height: 38px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border2); padding-top: 10px; }

.projects-empty-state {
  text-align: center;
  padding: 64px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 24px;
  max-width: 500px;
  margin: 40px auto 0;
}
.projects-empty-icon { font-size: 48px; opacity: 0.8; }
.projects-empty-title { font-size: 18px; font-weight: 600; color: var(--text); }
.projects-empty-sub { color: var(--text2); font-size: 13.5px; max-width: 320px; line-height: 1.6; margin-bottom: 8px; }

/* Create Project */
.create-project-container {
  max-width: 600px;
  width: 100%;
  margin: 40px auto;
  padding: 0 20px;
  overflow-y: auto;
  flex: 1;
}
.info-alert {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 32px;
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.6;
  text-align: left;
}
.info-alert-title { font-family: 'Lora', serif; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.info-alert p { margin-bottom: 8px; }
.info-alert p:last-child { margin-bottom: 0; }

.create-project-form { display: flex; flex-direction: column; gap: 20px; }
.form-field { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.form-field label { font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 14.5px; outline: none; transition: .2s;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--teal); }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 12px; }

/* Project Details Layout */
.project-detail-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px 32px 0;
}
@media (max-width: 768px) {
  .project-detail-container { padding: 16px 12px 0; }
}
.project-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-shrink: 0;
  text-align: left;
}
.project-detail-desc { font-size: 13.5px; color: var(--text2); }
.project-detail-layout {
  flex: 1; display: flex; gap: 24px; overflow: hidden; position: relative;
}
@media (max-width: 768px) {
  .project-detail-layout { flex-direction: column; overflow-y: auto; }
}
.project-main-canvas {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; height: 100%;
}
@media (max-width: 768px) {
  .project-main-canvas { overflow: visible; height: auto; }
}
.project-main-canvas .messages { padding-top: 8px; }

.project-context-sidebar {
  width: 280px; min-width: 280px; border-left: 1px solid var(--border);
  padding-left: 20px; display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0;
}
@media (max-width: 768px) {
  .project-context-sidebar { width: 100%; min-width: 0; border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 20px; overflow-y: visible; }
}
.accordion-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface2); margin-bottom: 12px; overflow: hidden; text-align: left; }
.accordion-header { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 600; font-family: 'Lora', serif; font-size: 13.5px; }
.accordion-header:hover { background: var(--surface3); }
.accordion-toggle { font-size: 16px; color: var(--muted); }
.accordion-content { padding: 12px 16px; border-top: 1px solid var(--border2); display: none; }
.accordion-item.open .accordion-content { display: block; }
.accordion-sub { font-size: 11px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }

textarea#project-instructions-input {
  width: 100%; min-height: 110px; padding: 10px; border-radius: 8px;
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); font-family: inherit; font-size: 13px; outline: none; resize: vertical;
}

.files-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.add-file-trigger { background: transparent; border: 1px solid var(--teal); color: var(--teal); border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; cursor: pointer; transition: .2s; }
.add-file-trigger:hover { background: rgba(0,181,165,.08); }
.files-empty-state { text-align: center; padding: 20px 10px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.files-icon { font-size: 28px; margin-bottom: 6px; opacity: 0.6; }

.files-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.file-attachment-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
  background: var(--surface3); border: 1px solid var(--border2); font-size: 12px;
}
.file-attachment-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); text-align: left; }
.file-attachment-del { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px; }
.file-attachment-del:hover { color: #f87171; }

.project-input-area { padding: 16px 0 24px 0; }

/* Customize View (3-pane Workspace) */
.customize-container {
  flex: 1; overflow: hidden; display: flex; flex-direction: column;
}
.customize-body { display: flex; flex: 1; overflow: hidden; height: 100%; }
@media (max-width: 768px) {
  .customize-body { flex-direction: column; overflow-y: auto; }
}
.customize-pane { display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow-y: auto; height: 100%; }
@media (max-width: 768px) {
  .customize-pane { border-right: none; border-bottom: 1px solid var(--border); overflow-y: visible; height: auto; }
}

/* Left Pane */
.pane-left { width: 220px; min-width: 220px; padding: 16px 12px; gap: 4px; flex-shrink: 0; }
@media (max-width: 768px) {
  .pane-left { width: 100%; min-width: 0; }
}
.pane-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text2); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; text-align: left; width: 100%; transition: all .15s;
}
.pane-nav-item:hover { background: var(--surface); color: var(--text); }
.pane-nav-item.active { background: var(--surface); color: var(--text); font-weight: 700; border: 1px solid var(--border2); }
.pane-nav-icon { font-size: 14px; opacity: 0.8; }
.pane-left-widget {
  margin-top: auto; padding: 12px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text2); line-height: 1.4; display: flex; flex-direction: column; gap: 8px; text-align: left;
}
@media (max-width: 768px) {
  .pane-left-widget { margin-top: 16px; }
}

/* Middle Pane */
.pane-middle { width: 280px; min-width: 280px; flex-shrink: 0; text-align: left; }
@media (max-width: 768px) {
  .pane-middle { width: 100%; min-width: 0; }
}
.pane-middle-header {
  padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
  font-family: 'Lora', serif; font-size: 14.5px; font-weight: 600; color: var(--text);
}
.pane-middle-actions { display: flex; gap: 4px; }
.pane-mini-btn {
  background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px; border-radius: 6px; transition: .2s;
}
.pane-mini-btn:hover { color: var(--text); background: var(--surface); }

.skills-accordion-header {
  padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--border2);
}
.skills-directory-list { display: flex; flex-direction: column; overflow-y: auto; padding: 8px; }
.skills-list-pane { display: flex; flex-direction: column; gap: 2px; }

/* Folder Tree Directory */
.skill-tree-root { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; border-radius: 8px; padding: 4px; }
.skill-tree-root-header {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text2); transition: .15s;
}
.skill-tree-root-header:hover { background: var(--surface); color: var(--text); }
.skill-tree-root.active .skill-tree-root-header { background: var(--surface); color: var(--text); font-weight: 700; }
.skill-tree-children { display: flex; flex-direction: column; gap: 2px; padding-left: 20px; margin-top: 2px; }
.tree-item {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text2); transition: .15s;
}
.tree-item:hover { background: var(--surface); color: var(--text); }
.tree-item.active { background: var(--surface2); color: var(--text); font-weight: 600; border-left: 2px solid var(--teal); }
.tree-icon { font-size: 12px; opacity: 0.7; }
.tree-toggle-arrow { font-size: 10px; color: var(--muted); margin-left: auto; transition: transform 0.2s; }
.tree-toggle-arrow.collapsed { transform: rotate(-90deg); }

/* Right Pane: Editor Card */
.pane-right { flex: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; background: var(--bg); text-align: left; }
@media (max-width: 768px) {
  .pane-right { width: 100%; min-width: 0; min-height: 400px; }
}

.editor-empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; color: var(--muted); padding: 48px;
}
.editor-empty-icon { font-size: 40px; }
.editor-empty-state h3 { color: var(--text2); font-weight: 600; font-size: 15px; }

.skill-editor-details { display: flex; flex-direction: column; gap: 20px; flex: 1; }
.editor-header-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.editor-title { font-family: 'Lora', serif; font-size: 20px; font-weight: 600; color: var(--text); }
.editor-meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.editor-meta-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.editor-meta-val { font-size: 13px; font-weight: 600; color: var(--text); }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--muted); border-radius: 24px; transition: .3s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: .3s; }
input:checked + .slider { background-color: var(--teal); }
input:checked + .slider:before { transform: translateX(20px); }

/* Floating Card for skill preview/edit */
.editor-card { border: 1px solid var(--border); border-radius: 16px; background: var(--surface2); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); flex: 1; min-height: 350px; }
.editor-card-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: rgba(0,0,0,0.1); border-bottom: 1px solid var(--border); }
.editor-card-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.editor-card-actions { display: flex; border: 1px solid var(--border2); border-radius: 6px; overflow: hidden; }
.editor-tab-btn { background: transparent; border: none; color: var(--muted); padding: 5px 10px; font-size: 11px; cursor: pointer; transition: .2s; display: flex; align-items: center; gap: 4px; }
.editor-tab-btn.active { background: var(--surface3); color: var(--text); font-weight: 600; }
.editor-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.editor-card-body textarea { width: 100%; flex: 1; min-height: 250px; border: none; background: transparent; color: var(--text); font-family: 'DM Mono', monospace; font-size: 13px; outline: none; resize: none; line-height: 1.5; }
.editor-preview-content { font-family: 'Lora', serif; line-height: 1.7; color: var(--text2); font-size: 14.5px; }
.editor-preview-content h1, .editor-preview-content h2, .editor-preview-content h3 { color: var(--text); margin-bottom: 12px; margin-top: 20px; font-weight: 500; }
.editor-preview-content h1 { font-size: 22px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.editor-preview-content h2 { font-size: 18px; }
.editor-preview-content h3 { font-size: 15px; }
.editor-preview-content p { margin-bottom: 14px; }
.editor-preview-content ul, .editor-preview-content ol { margin-left: 20px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.editor-preview-content li { list-style-type: disc; }

.connectors-list-mock { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.connector-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); text-align: left; }
