* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0c0c14;
  --surface: #13131f;
  --surface2: #1a1a2e;
  --border: #2a2a3e;
  --accent: #e74c3c;
  --accent2: #3498db;
  --gold: #e8a630;
  --text: #e0e0e0;
  --text-dim: #888;
  --green: #2ecc71;
}
body { font-family: 'Segoe UI', 'DM Sans', sans-serif; background: var(--bg); color: var(--text); height: 100vh; display: flex; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: 260px; background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); }
.sidebar-header h1 { font-size: 18px; color: var(--accent); font-weight: 800; }
.sidebar-header p { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.room-selector { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.room-selector select {
  width: 100%; background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 8px; font-size: 14px; direction: rtl; cursor: pointer;
}
.nav-section { padding: 16px 20px; }
.nav-section h3 { font-size: 11px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 1px; margin-bottom: 10px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; font-size: 14px; margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface2); }
.nav-item.active { background: var(--accent); color: white; }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }

/* Team list */
.team-section { padding: 16px 20px; flex: 1; overflow-y: auto; }
.team-divider { border-top: 1px solid var(--border); margin: 12px 0; }
.team-member {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 8px; cursor: pointer; margin-bottom: 2px; font-size: 13px;
}
.team-member:hover { background: var(--surface2); }
.team-member.selected { background: rgba(231,76,60,0.15); border: 1px solid var(--accent); }
.team-member.dimmed { opacity: 0.5; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 12px;
  font-weight: 700; color: white; flex-shrink: 0;
}
.avatar.small { width: 28px; height: 28px; font-size: 10px; }
.member-info { flex: 1; }
.member-name { font-weight: 600; }
.member-role { font-size: 11px; color: var(--text-dim); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Top bar */
.topbar {
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); flex-shrink: 0;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar h2 { font-size: 16px; font-weight: 600; }
.mode-badge {
  background: var(--accent); color: white; padding: 4px 12px;
  border-radius: 12px; font-size: 12px; font-weight: 600;
}
.superpower-badge {
  background: var(--gold); color: #000; padding: 4px 12px;
  border-radius: 12px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.superpower-badge.off { background: var(--surface2); color: var(--text-dim); }
.participants-bar { display: flex; gap: 4px; }
.participants-bar .avatar { border: 2px solid var(--surface); margin-right: -8px; }

/* Chat area */
.chat-area { flex: 1; overflow-y: auto; padding: 24px; }
.message { display: flex; gap: 12px; margin-bottom: 20px; max-width: 85%; }
.message.system { max-width: 100%; justify-content: center; }
.message.system .msg-content {
  background: transparent; color: var(--text-dim); font-size: 13px;
  text-align: center; border: 1px dashed var(--border); padding: 10px 16px; border-radius: 8px;
}
.msg-content {
  background: var(--surface2); padding: 14px 18px; border-radius: 12px;
  border-top-right-radius: 4px; line-height: 1.6; font-size: 14px; min-width: 200px;
}
.msg-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-name { font-weight: 700; font-size: 14px; }
.msg-role { font-size: 11px; color: var(--text-dim); }
.msg-time { font-size: 11px; color: var(--text-dim); margin-right: auto; }
.msg-content p { margin-bottom: 8px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content.collapsed { max-height: 60px; overflow: hidden; position: relative; }
.msg-content.collapsed::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px;
  background: linear-gradient(transparent, var(--surface2));
}
.show-more-btn {
  background: none; border: none; color: var(--accent2); cursor: pointer;
  font-size: 13px; padding: 4px 0; text-decoration: underline;
}
.msg-content strong { font-weight: 700; }
.msg-content ul, .msg-content ol { padding-right: 1.5em; margin-bottom: 8px; }
.msg-content li { margin-bottom: 4px; }
.msg-content code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; font-size: 13px; direction: ltr; }
.msg-content pre { background: rgba(255,255,255,0.05); padding: 12px; border-radius: 8px; overflow-x: auto; margin: 8px 0; direction: ltr; text-align: left; }

/* TLDR messages */
.tldr-message .msg-content {
  background: var(--surface2); border-left: 3px solid var(--accent2);
}
.tldr-badge { display: inline-block; }
.expand-btn:hover { background: var(--surface) !important; border-color: var(--accent2) !important; color: var(--accent2) !important; }
.expand-btn:disabled { opacity: 0.5; cursor: wait !important; }

/* Refocus button */
#refocus-btn { width: auto; padding: 0 12px; font-size: 13px; white-space: nowrap; }

/* Invite banner */
.invite-banner {
  background: var(--surface2); border: 1px solid var(--gold); border-radius: 8px;
  padding: 10px 16px; margin-bottom: 16px; display: flex; align-items: center;
  gap: 10px; font-size: 13px; max-width: 85%;
}

/* Typing indicator */
.typing { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text-dim); font-size: 13px; }
.typing-dots span {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim); animation: blink 1.4s infinite; margin: 0 2px;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100%{opacity:0.2} 40%{opacity:1} }

/* Input area */
.input-area { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.input-wrapper { display: flex; gap: 12px; align-items: center; }
.input-wrapper textarea {
  flex: 1; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 16px; border-radius: 12px; font-size: 14px; direction: rtl;
  font-family: inherit; resize: none; overflow-y: auto;
  min-height: 44px; max-height: 168px; /* ~7 lines */
  line-height: 1.5;
}
.input-wrapper textarea:focus { outline: none; border-color: var(--accent); }
.send-btn {
  background: var(--accent); color: white; border: none; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer; font-size: 18px;
}
.send-btn:hover { background: #c0392b; }
.control-btn {
  background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.control-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.control-btn.active {
  background: var(--accent); color: white; animation: pulse-stop 1s infinite;
  width: auto; height: 40px; font-size: 14px; padding: 0 16px; border-radius: 8px;
}
@keyframes pulse-stop { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; color: var(--text-dim); gap: 12px; text-align: center; padding: 40px;
}
.empty-state h3 { font-size: 18px; color: var(--text); }

/* Participant picker overlay */
.picker-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); display: flex; align-items: center;
  justify-content: center; z-index: 200;
}
.picker-modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; width: 400px; max-width: 90vw; max-height: 80vh; overflow-y: auto;
}
.picker-modal h3 { margin-bottom: 16px; font-size: 16px; }
.picker-btn {
  display: block; width: 100%; padding: 10px 16px; margin-top: 12px;
  background: var(--accent); color: white; border: none; border-radius: 8px;
  font-size: 14px; cursor: pointer; font-weight: 600;
}
.picker-btn:hover { background: #c0392b; }
.picker-btn.secondary { background: var(--surface2); color: var(--text); }

/* Meeting title bar */
.meeting-bar {
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.meeting-bar-info { display: flex; align-items: center; gap: 12px; }
.meeting-bar-topic { font-weight: 700; font-size: 14px; color: var(--gold); }
.meeting-bar-meta { font-size: 12px; color: var(--text-dim); }

/* Search bar */
.search-bar {
  padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.search-bar input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font-size: 14px; direction: rtl;
}
.search-bar input:focus { outline: none; border-color: var(--accent); }

/* Topbar actions */
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* SVG avatar */
.avatar-svg { border-radius: 50%; flex-shrink: 0; }

/* Nav badge (unread) */
.nav-badge {
  background: var(--accent); color: white; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; margin-right: auto;
}

/* Feedback buttons */
.feedback-btns { display: flex; gap: 4px; margin-top: 6px; }
.feedback-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  padding: 2px 8px; border-radius: 4px; cursor: pointer; font-size: 14px;
}
.feedback-btn:hover { border-color: var(--text); color: var(--text); }
.feedback-btn.selected { border-color: var(--gold); color: var(--gold); }

/* Pin star */
.pin-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; flex-shrink: 0;
}
.pin-btn.pinned { color: var(--gold); }

/* Export button */
#export-btn { font-size: 14px; }

/* Questions panel — floating at bottom of chat */
.questions-panel {
  position: fixed; bottom: 80px; left: 20px; right: 280px;
  background: var(--surface); border: 1px solid var(--gold);
  border-radius: 12px; max-height: 250px; overflow-y: auto;
  z-index: 60; box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
@media (max-width: 768px) {
  .questions-panel { right: 20px; bottom: 140px; }
}
.questions-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--gold); font-weight: 600;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
  border-radius: 12px 12px 0 0;
}
.questions-toggle {
  background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 12px;
}
.questions-list { padding: 8px 16px; }
.question-card {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 6px; cursor: pointer; font-size: 13px; direction: rtl;
}
.question-card:hover { border-color: var(--gold); }
.question-card.answered { opacity: 0.4; border-color: var(--green); }
.question-agent { color: var(--gold); font-weight: 600; white-space: nowrap; min-width: 50px; }
.question-text { flex: 1; line-height: 1.4; }
.question-card.answered-pending { border-color: var(--green); background: rgba(46,204,113,0.05); }
.suggestion-chip {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 4px 12px; border-radius: 16px; cursor: pointer; font-size: 12px;
  white-space: nowrap; transition: all 0.15s;
}
.suggestion-chip:hover { border-color: var(--gold); color: var(--gold); }
.suggestion-chip.selected { background: var(--gold); color: #000; border-color: var(--gold); font-weight: 600; }
.free-text-chip { border-style: dashed; color: var(--text-dim); }

/* File attachment */
.file-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 12px; font-size: 12px; color: var(--text-dim);
  margin-bottom: 8px;
}
.file-badge .remove-file {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 14px; padding: 0 2px;
}
.file-badge .remove-file:hover { color: var(--accent); }

/* Login screen */
.login-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg); display: flex; align-items: center;
  justify-content: center; z-index: 500;
}
.login-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px; text-align: center;
  width: 360px; max-width: 90vw;
}
.login-box h1 { color: var(--accent); font-size: 24px; margin-bottom: 8px; }
.login-box input:focus { outline: none; border-color: var(--accent); }

/* User badge in topbar */
.user-badge {
  font-size: 12px; color: var(--text-dim); background: var(--surface2);
  padding: 4px 10px; border-radius: 12px;
}

/* Hamburger */
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* Mobile */
@media (max-width: 768px) {
  .sidebar { display: none; position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; }
  .sidebar.open { display: flex; }
  .hamburger { display: block; }
  .topbar { padding: 10px 16px; }
  .chat-area { padding: 16px; }
  .message { max-width: 95%; }
  .input-area { padding: 12px 16px; padding-bottom: 70px; }
  .mobile-nav { display: flex !important; }
}

/* Mobile bottom nav */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 8px 0; z-index: 50; justify-content: space-around;
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 10px; color: var(--text-dim); cursor: pointer; padding: 4px 12px;
}
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item .nav-icon { font-size: 20px; }

/* History list */
.history-item {
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 8px; cursor: pointer; background: var(--surface2);
}
.history-item:hover { border-color: var(--accent); }
.history-item h4 { font-size: 14px; margin-bottom: 4px; }
.history-item .meta { font-size: 12px; color: var(--text-dim); }
